--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2012 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.browsing.ui.swt;\r
+\r
+import java.util.Collections;\r
+import java.util.List;\r
+\r
+import org.simantics.browsing.ui.model.nodetypes.EntityNodeType;\r
+import org.simantics.browsing.ui.model.nodetypes.SpecialNodeType;\r
+import org.simantics.databoard.util.Bean;\r
+import org.simantics.db.Resource;\r
+\r
+public class NodeContextValueBean extends Bean {\r
+\r
+ public String name;\r
+ public Resource resource;\r
+ public List<Resource> resources;\r
+ public String className = "";\r
+ \r
+ public NodeContextValueBean(EntityNodeType ent) {\r
+ name = EntityNodeType.class.getName();\r
+ resource = ent.entityTypes.get(0);\r
+ resources = ent.entityTypes;\r
+ }\r
+\r
+ public NodeContextValueBean(SpecialNodeType ent) {\r
+ assert(ent.resource != null);\r
+ name = SpecialNodeType.class.getName();\r
+ resource = ent.resource;\r
+ resources = Collections.singletonList(ent.resource);\r
+ className = ent.getContentType().getName();\r
+ }\r
+\r
+ public NodeContextValueBean(Resource resource) {\r
+ assert(resource != null);\r
+ name = Resource.class.getName();\r
+ this.resource = resource;\r
+ this.resources = Collections.singletonList(resource);\r
+ }\r
+ \r
+}\r