1 /*******************************************************************************
2 * Copyright (c) 2012 Association for Decentralized Information Management in
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * VTT Technical Research Centre of Finland - initial API and implementation
11 *******************************************************************************/
12 package org.simantics.browsing.ui.swt;
14 import java.util.Collections;
15 import java.util.List;
17 import org.simantics.browsing.ui.model.nodetypes.EntityNodeType;
18 import org.simantics.browsing.ui.model.nodetypes.SpecialNodeType;
19 import org.simantics.databoard.util.Bean;
20 import org.simantics.db.Resource;
22 public class NodeContextValueBean extends Bean {
25 public Resource resource;
26 public List<Resource> resources;
27 public String className = "";
29 public NodeContextValueBean(EntityNodeType ent) {
30 name = EntityNodeType.class.getName();
31 resource = ent.entityTypes.get(0);
32 resources = ent.entityTypes;
35 public NodeContextValueBean(SpecialNodeType ent) {
36 assert(ent.resource != null);
37 name = SpecialNodeType.class.getName();
38 resource = ent.resource;
39 resources = Collections.singletonList(ent.resource);
40 className = ent.getContentType().getName();
43 public NodeContextValueBean(Resource resource) {
44 assert(resource != null);
45 name = Resource.class.getName();
46 this.resource = resource;
47 this.resources = Collections.singletonList(resource);