]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.modeling.template2d.ui/src/org/simantics/modeling/template2d/ui/diagram/handlers/BindFlagToFlagTable.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.modeling.template2d.ui / src / org / simantics / modeling / template2d / ui / diagram / handlers / BindFlagToFlagTable.java
1 /*******************************************************************************
2  * Copyright (c) 2012 Association for Decentralized Information Management in
3  * Industry THTH ry.
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
8  *
9  * Contributors:
10  *     VTT Technical Research Centre of Finland - initial API and implementation
11  *******************************************************************************/
12 package org.simantics.modeling.template2d.ui.diagram.handlers;
13
14 import java.util.Map;
15
16 import org.eclipse.core.commands.AbstractHandler;
17 import org.eclipse.core.commands.ExecutionEvent;
18 import org.eclipse.core.commands.ExecutionException;
19 import org.eclipse.ui.PlatformUI;
20 import org.eclipse.ui.commands.IElementUpdater;
21 import org.eclipse.ui.menus.UIElement;
22 import org.simantics.modeling.template2d.ui.diagram.dialogs.BindToIOTableDialog;
23
24 public class BindFlagToFlagTable extends AbstractHandler implements IElementUpdater {
25
26         @Override
27     public Object execute(ExecutionEvent event) throws ExecutionException {
28         BindToIOTableDialog dialog = new BindToIOTableDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
29                 if (dialog.init(event) == false)
30                         return null;
31                 dialog.open();
32         return null;
33     }
34
35     @SuppressWarnings("rawtypes")
36     @Override
37     public void updateElement(UIElement element, Map parameters) {
38 //        try {
39 //            Boolean enabled = Simantics.getSession().syncRequest(ToggleSynchronizedEditing.inSynchronizedEditingMode());
40 //            element.setChecked(enabled);
41 //        } catch (DatabaseException e) {
42 //            ErrorLogger.defaultLogError(e);
43 //        }
44     }
45
46 }