X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.modeling.ui%2Fsrc%2Forg%2Fsimantics%2Fmodeling%2Fui%2FcomponentTypeEditor%2FComponentTypeEditor.java;h=74e5e7c676cfb5bb69340e54ae25813ff20008cb;hp=56f295b475a5c1de088ce951d01882fa019b068e;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hpb=24e2b34260f219f0d1644ca7a138894980e25b14 diff --git a/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/ComponentTypeEditor.java b/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/ComponentTypeEditor.java index 56f295b47..74e5e7c67 100644 --- a/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/ComponentTypeEditor.java +++ b/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/ComponentTypeEditor.java @@ -1,58 +1,58 @@ -/******************************************************************************* - * Copyright (c) 2012 Association for Decentralized Information Management in - * Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.modeling.ui.componentTypeEditor; - -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IExecutableExtension; -import org.eclipse.swt.widgets.Composite; -import org.simantics.ui.workbench.ResourceEditorPart; - -/** - * @author Hannu Niemistö - * @author Tuukka Lehtonen (IExecutableExtension) - */ -public class ComponentTypeEditor extends ResourceEditorPart implements IExecutableExtension { - - protected ComponentTypeViewer viewer; - protected String formTitle = "User Component Interface"; - - @Override - public void setInitializationData(IConfigurationElement cfig, String propertyName, Object data) { - if (data instanceof String) { - String[] params = ((String) data).split(";"); - for (String param : params) { - String[] keyValue = param.split("="); - if (keyValue.length == 2) { - if ("formTitle".equals(keyValue[0])) { - formTitle = keyValue[1]; - } - } - } - } - } - - @Override - public void createPartControl(Composite parent) { - viewer = new ComponentTypeViewer(parent, getInputResource(), getEditorTitle()); - activateValidation(); - } - - protected String getEditorTitle() { - return formTitle; - } - - @Override - public void setFocus() { - viewer.setFocus(); - } - -} +/******************************************************************************* + * Copyright (c) 2012 Association for Decentralized Information Management in + * Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.modeling.ui.componentTypeEditor; + +import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.core.runtime.IExecutableExtension; +import org.eclipse.swt.widgets.Composite; +import org.simantics.ui.workbench.ResourceEditorPart; + +/** + * @author Hannu Niemistö + * @author Tuukka Lehtonen (IExecutableExtension) + */ +public class ComponentTypeEditor extends ResourceEditorPart implements IExecutableExtension { + + protected ComponentTypeViewer viewer; + protected String formTitle = "User Component Interface"; + + @Override + public void setInitializationData(IConfigurationElement cfig, String propertyName, Object data) { + if (data instanceof String) { + String[] params = ((String) data).split(";"); + for (String param : params) { + String[] keyValue = param.split("="); + if (keyValue.length == 2) { + if ("formTitle".equals(keyValue[0])) { + formTitle = keyValue[1]; + } + } + } + } + } + + @Override + public void createPartControl(Composite parent) { + viewer = new ComponentTypeViewer(parent, getInputResource(), getEditorTitle()); + activateValidation(); + } + + protected String getEditorTitle() { + return formTitle; + } + + @Override + public void setFocus() { + viewer.setFocus(); + } + +}