X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.modeling.ui%2Fsrc%2Forg%2Fsimantics%2Fmodeling%2Fui%2FmodelBrowser%2Fmodel%2FStatementPredicateNode.java;fp=bundles%2Forg.simantics.modeling.ui%2Fsrc%2Forg%2Fsimantics%2Fmodeling%2Fui%2FmodelBrowser%2Fmodel%2FStatementPredicateNode.java;h=08a5788063c281ce7b5615368f8417122c881b05;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hp=7e07d0eea0c6f82d1942e7fc1fc2a9f49ee7b062;hpb=24e2b34260f219f0d1644ca7a138894980e25b14;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/modelBrowser/model/StatementPredicateNode.java b/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/modelBrowser/model/StatementPredicateNode.java index 7e07d0eea..08a578806 100644 --- a/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/modelBrowser/model/StatementPredicateNode.java +++ b/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/modelBrowser/model/StatementPredicateNode.java @@ -1,80 +1,80 @@ -/******************************************************************************* - * 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.modeling.ui.modelBrowser.model; - -import org.eclipse.jface.viewers.ISelection; -import org.simantics.browsing.ui.content.Labeler.Modifier; -import org.simantics.browsing.ui.graph.impl.LabelerUtil; -import org.simantics.db.ReadGraph; -import org.simantics.db.Resource; -import org.simantics.db.Session; -import org.simantics.db.Statement; -import org.simantics.db.exception.DatabaseException; - -@Deprecated -public abstract class StatementPredicateNode implements INode { - - protected Statement statement; - - public StatementPredicateNode(Statement resource) { - assert resource != null; - this.statement = resource; - } - - @Override - public String getLabel(ReadGraph g) throws DatabaseException { - return LabelerUtil.safeStringRepresentation(g, statement.getPredicate()); - } - - @Override - public int getCategory(ReadGraph graph) throws DatabaseException { - return 0; - } - - @Override - public Modifier getModifier(Session session, String columnId) { - return null; - } - - @Override - public boolean hasChildren(ReadGraph g) throws DatabaseException { - return !getChildren(g).isEmpty(); - } - - @Override - public Object getAdapter(Class adapter) { - if (adapter == Resource.class) - return statement.getPredicate(); - if (adapter == Statement.class) - return statement; - return null; - } - - @Override - public boolean equals(Object obj) { - if(this == obj) - return true; - if(obj == null) - return false; - return getClass().equals(obj.getClass()) && statement.equals(((StatementPredicateNode)obj).statement); - } - - @Override - public int hashCode() { - return getClass().hashCode()*31 + statement.hashCode(); - } - - @Override - public void handleDrop(Session session, ISelection data) { - } - -} +/******************************************************************************* + * 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.modeling.ui.modelBrowser.model; + +import org.eclipse.jface.viewers.ISelection; +import org.simantics.browsing.ui.content.Labeler.Modifier; +import org.simantics.browsing.ui.graph.impl.LabelerUtil; +import org.simantics.db.ReadGraph; +import org.simantics.db.Resource; +import org.simantics.db.Session; +import org.simantics.db.Statement; +import org.simantics.db.exception.DatabaseException; + +@Deprecated +public abstract class StatementPredicateNode implements INode { + + protected Statement statement; + + public StatementPredicateNode(Statement resource) { + assert resource != null; + this.statement = resource; + } + + @Override + public String getLabel(ReadGraph g) throws DatabaseException { + return LabelerUtil.safeStringRepresentation(g, statement.getPredicate()); + } + + @Override + public int getCategory(ReadGraph graph) throws DatabaseException { + return 0; + } + + @Override + public Modifier getModifier(Session session, String columnId) { + return null; + } + + @Override + public boolean hasChildren(ReadGraph g) throws DatabaseException { + return !getChildren(g).isEmpty(); + } + + @Override + public Object getAdapter(Class adapter) { + if (adapter == Resource.class) + return statement.getPredicate(); + if (adapter == Statement.class) + return statement; + return null; + } + + @Override + public boolean equals(Object obj) { + if(this == obj) + return true; + if(obj == null) + return false; + return getClass().equals(obj.getClass()) && statement.equals(((StatementPredicateNode)obj).statement); + } + + @Override + public int hashCode() { + return getClass().hashCode()*31 + statement.hashCode(); + } + + @Override + public void handleDrop(Session session, ISelection data) { + } + +}