X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.spreadsheet.graph%2Fsrc%2Forg%2Fsimantics%2Fspreadsheet%2Fgraph%2Fadapter%2FCellVariable.java;fp=bundles%2Forg.simantics.spreadsheet.graph%2Fsrc%2Forg%2Fsimantics%2Fspreadsheet%2Fgraph%2Fadapter%2FCellVariable.java;h=b965a65ba3dcabce79179b247af94ff9da52d2fa;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hp=151f6683d76040b4d42d40dbdf296ae6801ce28d;hpb=24e2b34260f219f0d1644ca7a138894980e25b14;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.spreadsheet.graph/src/org/simantics/spreadsheet/graph/adapter/CellVariable.java b/bundles/org.simantics.spreadsheet.graph/src/org/simantics/spreadsheet/graph/adapter/CellVariable.java index 151f6683d..b965a65ba 100644 --- a/bundles/org.simantics.spreadsheet.graph/src/org/simantics/spreadsheet/graph/adapter/CellVariable.java +++ b/bundles/org.simantics.spreadsheet.graph/src/org/simantics/spreadsheet/graph/adapter/CellVariable.java @@ -1,52 +1,52 @@ -package org.simantics.spreadsheet.graph.adapter; - -import org.simantics.db.ReadGraph; -import org.simantics.db.Resource; -import org.simantics.db.WriteGraph; -import org.simantics.db.exception.DatabaseException; -import org.simantics.db.layer0.variable.StandardGraphChildVariable; -import org.simantics.db.layer0.variable.Variable; -import org.simantics.spreadsheet.common.cell.VariableCellEditor; - -public class CellVariable extends StandardGraphChildVariable { - - public CellVariable(Variable parent, Resource resource) throws DatabaseException { - super(parent, null, resource); - } - - @Override - public String getLabel(ReadGraph graph) throws DatabaseException { - return null; - } - - @SuppressWarnings("unchecked") - protected T tryAdapt(ReadGraph graph, Class clazz) throws DatabaseException { - if(VariableCellEditor.class == clazz) { - return (T)new VariableCellEditor() { - - @Override - public void edit(WriteGraph graph, Variable cell, String text) throws DatabaseException { - } - - @Override - public void copy(WriteGraph graph, Variable cell, String location) throws DatabaseException { - } - - }; - } - return null; - } - - @Override - public T adapt(ReadGraph graph, Class clazz) throws DatabaseException { - T t = tryAdapt(graph, clazz); - return t != null ? t : super.adapt(graph, clazz); - } - - @Override - public T adaptPossible(ReadGraph graph, Class clazz) throws DatabaseException { - T t = tryAdapt(graph, clazz); - return t != null ? t : super.adaptPossible(graph, clazz); - } - -} +package org.simantics.spreadsheet.graph.adapter; + +import org.simantics.db.ReadGraph; +import org.simantics.db.Resource; +import org.simantics.db.WriteGraph; +import org.simantics.db.exception.DatabaseException; +import org.simantics.db.layer0.variable.StandardGraphChildVariable; +import org.simantics.db.layer0.variable.Variable; +import org.simantics.spreadsheet.common.cell.VariableCellEditor; + +public class CellVariable extends StandardGraphChildVariable { + + public CellVariable(Variable parent, Resource resource) throws DatabaseException { + super(parent, null, resource); + } + + @Override + public String getLabel(ReadGraph graph) throws DatabaseException { + return null; + } + + @SuppressWarnings("unchecked") + protected T tryAdapt(ReadGraph graph, Class clazz) throws DatabaseException { + if(VariableCellEditor.class == clazz) { + return (T)new VariableCellEditor() { + + @Override + public void edit(WriteGraph graph, Variable cell, String text) throws DatabaseException { + } + + @Override + public void copy(WriteGraph graph, Variable cell, String location) throws DatabaseException { + } + + }; + } + return null; + } + + @Override + public T adapt(ReadGraph graph, Class clazz) throws DatabaseException { + T t = tryAdapt(graph, clazz); + return t != null ? t : super.adapt(graph, clazz); + } + + @Override + public T adaptPossible(ReadGraph graph, Class clazz) throws DatabaseException { + T t = tryAdapt(graph, clazz); + return t != null ? t : super.adaptPossible(graph, clazz); + } + +}