X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.modeling.ui%2Fsrc%2Forg%2Fsimantics%2Fmodeling%2Fui%2FcomponentTypeEditor%2FComponentTypeEditor.java;h=56b5d895b3b02d04e9ecb01ab7e1aea7bfd66d25;hb=fd2a6ff5d708baed2bdbaf94e6cd7bcc7b288069;hp=56f295b475a5c1de088ce951d01882fa019b068e;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git 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..56b5d895b 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 = Messages.ComponentTypeEditor_UserComponentInterface; + + @Override + public void setInitializationData(IConfigurationElement cfig, String propertyName, Object data) { + if (data instanceof String) { + String[] params = ((String) data).split(";"); //$NON-NLS-1$ + for (String param : params) { + String[] keyValue = param.split("="); //$NON-NLS-1$ + if (keyValue.length == 2) { + if ("formTitle".equals(keyValue[0])) { //$NON-NLS-1$ + 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(); + } + +}