1 /*******************************************************************************
2 * Copyright (c) 2012 Association for Decentralized Information Management in
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
10 * VTT Technical Research Centre of Finland - initial API and implementation
11 *******************************************************************************/
12 package org.simantics.modeling.template2d.ui.diagram.handlers;
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;
24 public class BindFlagToFlagTable extends AbstractHandler implements IElementUpdater {
27 public Object execute(ExecutionEvent event) throws ExecutionException {
28 BindToIOTableDialog dialog = new BindToIOTableDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
29 if (dialog.init(event) == false)
35 @SuppressWarnings("rawtypes")
37 public void updateElement(UIElement element, Map parameters) {
39 // Boolean enabled = Simantics.getSession().syncRequest(ToggleSynchronizedEditing.inSynchronizedEditingMode());
40 // element.setChecked(enabled);
41 // } catch (DatabaseException e) {
42 // ErrorLogger.defaultLogError(e);