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