-/*******************************************************************************\r
- * Copyright (c) 2013 Association for Decentralized Information Management in\r
- * Industry THTH ry.\r
- * All rights reserved. This program and the accompanying materials\r
- * are made available under the terms of the Eclipse Public License v1.0\r
- * which accompanies this distribution, and is available at\r
- * http://www.eclipse.org/legal/epl-v10.html\r
- *\r
- * Contributors:\r
- * Semantum Oy - initial API and implementation\r
- *******************************************************************************/\r
-package org.simantics.modeling.ui.componentTypeEditor;\r
-\r
-import java.util.Map;\r
-\r
-import org.eclipse.jface.dialogs.IDialogSettings;\r
-import org.eclipse.jface.layout.GridDataFactory;\r
-import org.eclipse.jface.layout.GridLayoutFactory;\r
-import org.eclipse.jface.resource.ImageDescriptor;\r
-import org.eclipse.swt.SWT;\r
-import org.eclipse.swt.events.SelectionEvent;\r
-import org.eclipse.swt.events.SelectionListener;\r
-import org.eclipse.swt.widgets.Button;\r
-import org.eclipse.swt.widgets.Composite;\r
-import org.eclipse.swt.widgets.Control;\r
-import org.eclipse.swt.widgets.Shell;\r
-import org.simantics.db.Resource;\r
-import org.simantics.modeling.ui.componentTypeEditor.LiftPropertiesDialog.LiftedProperty;\r
-import org.simantics.scl.runtime.tuple.Tuple3;\r
-import org.simantics.ui.workbench.dialogs.ResourceSelectionDialog3;\r
-import org.simantics.utils.datastructures.Pair;\r
-\r
-public class LiftPropertiesDialog extends ResourceSelectionDialog3<LiftedProperty> {\r
-\r
- private boolean mapProperties = false;\r
- private Button checkbox;\r
-\r
- public static class LiftedProperty extends Tuple3 {\r
-\r
- public LiftedProperty(Resource component, Resource componentType, Resource predicate) {\r
- super(component, componentType, predicate);\r
- }\r
- \r
- public Resource getComponent() {\r
- return (Resource)get(0);\r
- }\r
-\r
- public Resource getComponentType() {\r
- return (Resource)get(1);\r
- }\r
-\r
- public Resource getPredicate() {\r
- return (Resource)get(2);\r
- }\r
-\r
- }\r
- \r
- public LiftPropertiesDialog(Shell shell,\r
- Map<LiftedProperty, Pair<String, ImageDescriptor>> parameter, String title) {\r
- super(shell, parameter, title);\r
- }\r
-\r
- @Override\r
- protected IDialogSettings getBaseDialogSettings() {\r
- return null;\r
- }\r
-\r
- @Override\r
- protected Control createExtendedContentArea(Composite parent) {\r
- Composite c = new Composite(parent, SWT.NONE);\r
- GridDataFactory.fillDefaults().grab(true, false).applyTo(c);\r
- GridLayoutFactory.swtDefaults().numColumns(2).applyTo(c);\r
-// Label l = new Label(c, SWT.NONE); \r
-// l.setText("Map lifted properties into interface");\r
-// GridDataFactory.fillDefaults().grab(false, false).applyTo(l);\r
- checkbox = new Button(c, SWT.CHECK);\r
- checkbox.setText("Map lifted properties into interface");\r
- checkbox.addSelectionListener(new SelectionListener() {\r
- \r
- @Override\r
- public void widgetSelected(SelectionEvent e) {\r
- widgetDefaultSelected(e);\r
- }\r
- \r
- @Override\r
- public void widgetDefaultSelected(SelectionEvent e) {\r
- mapProperties = checkbox.getSelection();\r
- }\r
- });\r
- GridDataFactory.fillDefaults().grab(true, false).applyTo(checkbox);\r
- return super.createExtendedContentArea(parent);\r
- }\r
-\r
- @Override\r
- public void create() {\r
- super.create();\r
- checkbox.setFocus();\r
- }\r
-\r
- public boolean getMapProperties() {\r
- return mapProperties;\r
- }\r
-\r
+/*******************************************************************************
+ * Copyright (c) 2013 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:
+ * Semantum Oy - initial API and implementation
+ *******************************************************************************/
+package org.simantics.modeling.ui.componentTypeEditor;
+
+import java.util.Map;
+
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.jface.layout.GridLayoutFactory;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Shell;
+import org.simantics.db.Resource;
+import org.simantics.modeling.ui.componentTypeEditor.LiftPropertiesDialog.LiftedProperty;
+import org.simantics.scl.runtime.tuple.Tuple3;
+import org.simantics.ui.workbench.dialogs.ResourceSelectionDialog3;
+import org.simantics.utils.datastructures.Pair;
+
+public class LiftPropertiesDialog extends ResourceSelectionDialog3<LiftedProperty> {
+
+ private boolean mapProperties = false;
+ private Button checkbox;
+
+ public static class LiftedProperty extends Tuple3 {
+
+ public LiftedProperty(Resource component, Resource componentType, Resource predicate) {
+ super(component, componentType, predicate);
+ }
+
+ public Resource getComponent() {
+ return (Resource)get(0);
+ }
+
+ public Resource getComponentType() {
+ return (Resource)get(1);
+ }
+
+ public Resource getPredicate() {
+ return (Resource)get(2);
+ }
+
+ }
+
+ public LiftPropertiesDialog(Shell shell,
+ Map<LiftedProperty, Pair<String, ImageDescriptor>> parameter, String title) {
+ super(shell, parameter, title);
+ }
+
+ @Override
+ protected IDialogSettings getBaseDialogSettings() {
+ return null;
+ }
+
+ @Override
+ protected Control createExtendedContentArea(Composite parent) {
+ Composite c = new Composite(parent, SWT.NONE);
+ GridDataFactory.fillDefaults().grab(true, false).applyTo(c);
+ GridLayoutFactory.swtDefaults().numColumns(2).applyTo(c);
+// Label l = new Label(c, SWT.NONE);
+// l.setText("Map lifted properties into interface");
+// GridDataFactory.fillDefaults().grab(false, false).applyTo(l);
+ checkbox = new Button(c, SWT.CHECK);
+ checkbox.setText(Messages.LiftPropertiesDialog_MapLiftedPropertiesIntoInterface);
+ checkbox.addSelectionListener(new SelectionListener() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ widgetDefaultSelected(e);
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ mapProperties = checkbox.getSelection();
+ }
+ });
+ GridDataFactory.fillDefaults().grab(true, false).applyTo(checkbox);
+ return super.createExtendedContentArea(parent);
+ }
+
+ @Override
+ public void create() {
+ super.create();
+ checkbox.setFocus();
+ }
+
+ public boolean getMapProperties() {
+ return mapProperties;
+ }
+