X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.browsing.ui.swt%2Fsrc%2Forg%2Fsimantics%2Fbrowsing%2Fui%2Fswt%2FNodeContextValueBean.java;h=42e2c94eb7ee44c91a4933b48b501968ccfaf6bd;hp=cc0bb47accd1ba70c1199782bc7aa38ce8ba2b5e;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hpb=24e2b34260f219f0d1644ca7a138894980e25b14 diff --git a/bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/NodeContextValueBean.java b/bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/NodeContextValueBean.java index cc0bb47ac..42e2c94eb 100644 --- a/bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/NodeContextValueBean.java +++ b/bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/NodeContextValueBean.java @@ -1,50 +1,50 @@ -/******************************************************************************* - * Copyright (c) 2012 Association for Decentralized Information Management in - * Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.browsing.ui.swt; - -import java.util.Collections; -import java.util.List; - -import org.simantics.browsing.ui.model.nodetypes.EntityNodeType; -import org.simantics.browsing.ui.model.nodetypes.SpecialNodeType; -import org.simantics.databoard.util.Bean; -import org.simantics.db.Resource; - -public class NodeContextValueBean extends Bean { - - public String name; - public Resource resource; - public List resources; - public String className = ""; - - public NodeContextValueBean(EntityNodeType ent) { - name = EntityNodeType.class.getName(); - resource = ent.entityTypes.get(0); - resources = ent.entityTypes; - } - - public NodeContextValueBean(SpecialNodeType ent) { - assert(ent.resource != null); - name = SpecialNodeType.class.getName(); - resource = ent.resource; - resources = Collections.singletonList(ent.resource); - className = ent.getContentType().getName(); - } - - public NodeContextValueBean(Resource resource) { - assert(resource != null); - name = Resource.class.getName(); - this.resource = resource; - this.resources = Collections.singletonList(resource); - } - -} +/******************************************************************************* + * Copyright (c) 2012 Association for Decentralized Information Management in + * Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.browsing.ui.swt; + +import java.util.Collections; +import java.util.List; + +import org.simantics.browsing.ui.model.nodetypes.EntityNodeType; +import org.simantics.browsing.ui.model.nodetypes.SpecialNodeType; +import org.simantics.databoard.util.Bean; +import org.simantics.db.Resource; + +public class NodeContextValueBean extends Bean { + + public String name; + public Resource resource; + public List resources; + public String className = ""; + + public NodeContextValueBean(EntityNodeType ent) { + name = EntityNodeType.class.getName(); + resource = ent.entityTypes.get(0); + resources = ent.entityTypes; + } + + public NodeContextValueBean(SpecialNodeType ent) { + assert(ent.resource != null); + name = SpecialNodeType.class.getName(); + resource = ent.resource; + resources = Collections.singletonList(ent.resource); + className = ent.getContentType().getName(); + } + + public NodeContextValueBean(Resource resource) { + assert(resource != null); + name = Resource.class.getName(); + this.resource = resource; + this.resources = Collections.singletonList(resource); + } + +}