]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/NewPropertyViewAdapter.java
Merge remote-tracking branch 'origin/svn' commit 'ccc1271c9d6657fb9dcf4cf3cb115fa0c8c...
[simantics/platform.git] / bundles / org.simantics.browsing.ui.swt / src / org / simantics / browsing / ui / swt / NewPropertyViewAdapter.java
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
8  *\r
9  * Contributors:\r
10  *     VTT Technical Research Centre of Finland - initial API and implementation\r
11  *******************************************************************************/\r
12 package org.simantics.browsing.ui.swt;\r
13 \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
18 \r
19 /**\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
23  * \r
24  * TODO: override {@link #canHandle(ReadGraph, Object)} and\r
25  * {@link #openEditor(Object)} to do what's described above.\r
26  */\r
27 public class NewPropertyViewAdapter extends AbstractResourceEditorAdapter {\r
28 \r
29     public NewPropertyViewAdapter() {\r
30         super("New Property View", ImageDescriptor.createFromURL(\r
31                 NewPropertyViewAdapter.class.getResource("../../../../../icons/table_multiple.png")));\r
32     }\r
33 \r
34     @Override\r
35     public boolean canHandle(ReadGraph g, Object r) {\r
36         return true;\r
37     }\r
38 \r
39     @Override\r
40     public void openEditor(Resource r) throws Exception {\r
41         openViewWithId("org.simantics.browsing.ui.graph.propertyView", r);\r
42     }\r
43 \r
44 }\r