1 /*******************************************************************************
\r
2 * Copyright (c) 2012 Association for Decentralized Information Management in
\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 java.util.Collections;
\r
15 import java.util.List;
\r
17 import org.simantics.browsing.ui.model.nodetypes.EntityNodeType;
\r
18 import org.simantics.browsing.ui.model.nodetypes.SpecialNodeType;
\r
19 import org.simantics.databoard.util.Bean;
\r
20 import org.simantics.db.Resource;
\r
22 public class NodeContextValueBean extends Bean {
\r
25 public Resource resource;
\r
26 public List<Resource> resources;
\r
27 public String className = "";
\r
29 public NodeContextValueBean(EntityNodeType ent) {
\r
30 name = EntityNodeType.class.getName();
\r
31 resource = ent.entityTypes.get(0);
\r
32 resources = ent.entityTypes;
\r
35 public NodeContextValueBean(SpecialNodeType ent) {
\r
36 assert(ent.resource != null);
\r
37 name = SpecialNodeType.class.getName();
\r
38 resource = ent.resource;
\r
39 resources = Collections.singletonList(ent.resource);
\r
40 className = ent.getContentType().getName();
\r
43 public NodeContextValueBean(Resource resource) {
\r
44 assert(resource != null);
\r
45 name = Resource.class.getName();
\r
46 this.resource = resource;
\r
47 this.resources = Collections.singletonList(resource);
\r