1 /*******************************************************************************
\r
2 * Copyright (c) 2007, 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.sysdyn.ui.properties;
\r
14 import org.eclipse.jface.layout.GridDataFactory;
\r
15 import org.eclipse.jface.layout.GridLayoutFactory;
\r
16 import org.eclipse.swt.SWT;
\r
17 import org.eclipse.swt.widgets.Composite;
\r
18 import org.eclipse.swt.widgets.Control;
\r
19 import org.eclipse.swt.widgets.Tree;
\r
20 import org.eclipse.ui.IWorkbenchSite;
\r
21 import org.simantics.browsing.ui.swt.SingleSelectionInputSource;
\r
22 import org.simantics.browsing.ui.swt.widgets.GraphExplorerComposite;
\r
23 import org.simantics.browsing.ui.swt.widgets.impl.WidgetSupport;
\r
24 import org.simantics.db.Resource;
\r
25 import org.simantics.db.management.ISessionContext;
\r
26 import org.simantics.sysdyn.SysdynResource;
\r
27 import org.simantics.sysdyn.ui.properties.widgets.ColumnKeys;
\r
28 import org.simantics.utils.datastructures.ArrayMap;
\r
30 public class ModuleParameterTab extends LabelPropertyTabContributor {
\r
32 GraphExplorerComposite explorer;
\r
35 public void createControls(Composite body, IWorkbenchSite site, ISessionContext context, WidgetSupport support) {
\r
36 Composite composite = new Composite(body, SWT.NONE);
\r
37 GridDataFactory.fillDefaults().grab(true, true).applyTo(composite);
\r
38 GridLayoutFactory.fillDefaults().margins(3, 3).applyTo(composite);
\r
40 explorer = new GraphExplorerComposite(ArrayMap.keys(
\r
41 "displaySelectors", "displayFilter").values(false, false), site, composite, support, SWT.FULL_SELECTION | SWT.BORDER);
\r
43 explorer.setBrowseContexts(SysdynResource.URIs.Module_ParameterOverrideBrowseContext);
\r
44 explorer.setColumns(ColumnKeys.MODULE_PARAMETER_COLUMNS);
\r
45 explorer.setInputSource(new SingleSelectionInputSource(
\r
50 GridDataFactory.fillDefaults().grab(true, true).applyTo(
\r
53 Control c = explorer.getExplorerControl();
\r
54 if (c instanceof Tree)
\r
55 ((Tree) c).setLinesVisible(true);
\r