1 /*******************************************************************************
\r
2 * Copyright (c) 2012 Association for Decentralized Information Management in
\r
4 * All rights reserved. This program and the accompanying materials
\r
5 * are made available under the terms of the Eclipse Public License v1.0
\r
6 * which accompanies this distribution, and is available at
\r
7 * http://www.eclipse.org/legal/epl-v10.html
\r
10 * VTT Technical Research Centre of Finland - initial API and implementation
\r
11 *******************************************************************************/
\r
12 package org.simantics.modeling.ui.componentTypeEditor;
\r
14 import org.eclipse.core.runtime.IConfigurationElement;
\r
15 import org.eclipse.core.runtime.IExecutableExtension;
\r
16 import org.eclipse.swt.widgets.Composite;
\r
17 import org.simantics.ui.workbench.ResourceEditorPart;
\r
20 * @author Hannu Niemistö
\r
21 * @author Tuukka Lehtonen (IExecutableExtension)
\r
23 public class ComponentTypeEditor extends ResourceEditorPart implements IExecutableExtension {
\r
25 protected ComponentTypeViewer viewer;
\r
26 protected String formTitle = "User Component Interface";
\r
29 public void setInitializationData(IConfigurationElement cfig, String propertyName, Object data) {
\r
30 if (data instanceof String) {
\r
31 String[] params = ((String) data).split(";");
\r
32 for (String param : params) {
\r
33 String[] keyValue = param.split("=");
\r
34 if (keyValue.length == 2) {
\r
35 if ("formTitle".equals(keyValue[0])) {
\r
36 formTitle = keyValue[1];
\r
44 public void createPartControl(Composite parent) {
\r
45 viewer = new ComponentTypeViewer(parent, getInputResource(), getEditorTitle());
\r
46 activateValidation();
\r
49 protected String getEditorTitle() {
\r
54 public void setFocus() {
\r