X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.image.ui%2Fsrc%2Forg%2Fsimantics%2Fimage%2Fui%2FmodelBrowser%2FImageLabeler.java;h=900857339638c8a90ae51f7bcc252919cf96d70a;hb=refs%2Fchanges%2F26%2F2526%2F3;hp=e83c078629175b2d12c15583fa513d4734baeb6b;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.image.ui/src/org/simantics/image/ui/modelBrowser/ImageLabeler.java b/bundles/org.simantics.image.ui/src/org/simantics/image/ui/modelBrowser/ImageLabeler.java index e83c07862..900857339 100644 --- a/bundles/org.simantics.image.ui/src/org/simantics/image/ui/modelBrowser/ImageLabeler.java +++ b/bundles/org.simantics.image.ui/src/org/simantics/image/ui/modelBrowser/ImageLabeler.java @@ -1,31 +1,31 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 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.image.ui.modelBrowser; - -import org.simantics.browsing.ui.graph.contributor.labeler.LabelerContributor; -import org.simantics.databoard.Bindings; -import org.simantics.db.ReadGraph; -import org.simantics.db.exception.DatabaseException; -import org.simantics.layer0.Layer0; - -public class ImageLabeler extends LabelerContributor { - - @Override - public String getLabel(ReadGraph graph, ImageNode node) throws DatabaseException { - Layer0 L0 = Layer0.getInstance(graph); - String name = graph.getPossibleRelatedValue(node.data, L0.HasName, Bindings.STRING); - if(name == null) - name = "No name"; - return name; - } - -} +/******************************************************************************* + * Copyright (c) 2007, 2010 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.image.ui.modelBrowser; + +import org.simantics.browsing.ui.graph.contributor.labeler.LabelerContributor; +import org.simantics.databoard.Bindings; +import org.simantics.db.ReadGraph; +import org.simantics.db.exception.DatabaseException; +import org.simantics.layer0.Layer0; + +public class ImageLabeler extends LabelerContributor { + + @Override + public String getLabel(ReadGraph graph, ImageNode node) throws DatabaseException { + Layer0 L0 = Layer0.getInstance(graph); + String name = graph.getPossibleRelatedValue(node.data, L0.HasName, Bindings.STRING); + if(name == null) + name = "No name"; //$NON-NLS-1$ + return name; + } + +}