]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.image.ui/src/org/simantics/image/ui/modelBrowser/ImageNode.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.image.ui / src / org / simantics / image / ui / modelBrowser / ImageNode.java
1 /*******************************************************************************\r
2  * Copyright (c) 2007, 2010 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.image.ui.modelBrowser;\r
13 \r
14 import org.simantics.browsing.ui.common.node.AbstractNode;\r
15 import org.simantics.browsing.ui.common.node.IDeletable;\r
16 import org.simantics.browsing.ui.common.node.IModifiable;\r
17 import org.simantics.db.Resource;\r
18 \r
19 /**\r
20  * @author Tuukka Lehtonen\r
21  */\r
22 public class ImageNode extends AbstractNode<Resource> implements IDeletable, IModifiable {\r
23 \r
24     public static class ImageResource {\r
25         Resource r = null;\r
26         public ImageResource(Resource r) {\r
27             this.r = r;\r
28         }\r
29         public Resource getResource() {\r
30             return r;\r
31         }\r
32     }\r
33 \r
34     public ImageNode(Resource resource) {\r
35         super(resource);\r
36     }\r
37 \r
38     @SuppressWarnings("rawtypes")\r
39     @Override\r
40     public Object getAdapter(Class adapter) {\r
41         if(adapter.equals(ImageResource.class))\r
42             return new ImageResource(data);\r
43         return super.getAdapter(adapter);\r
44     }\r
45 \r
46 }\r