1 /*******************************************************************************
\r
2 * Copyright (c) 2007, 2012 Association for Decentralized Information Management
\r
3 * in Industry THTH ry.
\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.browsing.ui.swt;
\r
14 import org.eclipse.jface.resource.ImageDescriptor;
\r
15 import org.simantics.db.ReadGraph;
\r
16 import org.simantics.db.Resource;
\r
17 import org.simantics.ui.workbench.editor.AbstractResourceEditorAdapter;
\r
20 * WARNING: this adapter does not currently handle structural selections, i.e.
\r
21 * resource paths but only single resources which will result failure to show
\r
22 * correct data or even worse.
\r
24 * TODO: override {@link #canHandle(ReadGraph, Object)} and
\r
25 * {@link #openEditor(Object)} to do what's described above.
\r
27 public class NewPropertyViewAdapter extends AbstractResourceEditorAdapter {
\r
29 public NewPropertyViewAdapter() {
\r
30 super("New Property View", ImageDescriptor.createFromURL(
\r
31 NewPropertyViewAdapter.class.getResource("../../../../../icons/table_multiple.png")));
\r
35 public boolean canHandle(ReadGraph g, Object r) {
\r
40 public void openEditor(Resource r) throws Exception {
\r
41 openViewWithId("org.simantics.browsing.ui.graph.propertyView", r);
\r