X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.spreadsheet.graph%2Fsrc%2Forg%2Fsimantics%2Fspreadsheet%2Fgraph%2FGraphUI.java;h=b2fc404f23f200b1ff3477ce24e45c8bd22652e0;hp=9a3e8732679d284b4a30abfdbcfc274da9a708e7;hb=86adc86522decdf79259743cde5ec3688af3d908;hpb=ad811ef47b6daa8aaa5b1011f2438bd55c29ae2a diff --git a/bundles/org.simantics.spreadsheet.graph/src/org/simantics/spreadsheet/graph/GraphUI.java b/bundles/org.simantics.spreadsheet.graph/src/org/simantics/spreadsheet/graph/GraphUI.java index 9a3e87326..b2fc404f2 100644 --- a/bundles/org.simantics.spreadsheet.graph/src/org/simantics/spreadsheet/graph/GraphUI.java +++ b/bundles/org.simantics.spreadsheet.graph/src/org/simantics/spreadsheet/graph/GraphUI.java @@ -61,7 +61,6 @@ import org.simantics.spreadsheet.CellEditor; import org.simantics.spreadsheet.ClientModel; import org.simantics.spreadsheet.ClientModel.OperationMode; import org.simantics.spreadsheet.SheetCommands; -import org.simantics.spreadsheet.common.logging.Logger; import org.simantics.spreadsheet.event.model.RemoveCellHandler; import org.simantics.spreadsheet.resource.SpreadsheetResource; import org.simantics.ui.selection.WorkbenchSelectionUtils; @@ -69,6 +68,8 @@ import org.simantics.utils.datastructures.Pair; import org.simantics.utils.strings.AlphanumComparator; import org.simantics.utils.threads.logger.ITask; import org.simantics.utils.threads.logger.ThreadLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import gnu.trove.map.hash.THashMap; import gnu.trove.map.hash.TObjectIntHashMap; @@ -102,6 +103,8 @@ class FilteredVariableProperties extends UnaryRead(variable) { + this.cellEditor = processor.sync(new VariableRead>(variable) { @Override - public CellEditor perform(ReadGraph graph) throws DatabaseException { + public CellEditor perform(ReadGraph graph) throws DatabaseException { SpreadsheetResource SHEET = SpreadsheetResource.getInstance(graph); return variable.getPropertyValue(graph, SHEET.cellEditor); } @@ -338,6 +341,8 @@ public class GraphUI implements Adaptable, ListenerSupport, AsyncListenerSupport private static class PropertyListener extends SingleSetSyncListenerDelegate> { + private static final Logger LOGGER = LoggerFactory.getLogger(PropertyListener.class); + private ClientModel client; private String childName; private boolean listenerDisposed; @@ -370,7 +375,7 @@ public class GraphUI implements Adaptable, ListenerSupport, AsyncListenerSupport @Override public void exception(ReadGraph graph, Throwable throwable) throws DatabaseException { - Logger.defaultLogError(throwable); + LOGGER.error("PropertyListener.exception", throwable); String propertyName = property.first; if("content".equals(propertyName)) { @@ -492,7 +497,7 @@ public class GraphUI implements Adaptable, ListenerSupport, AsyncListenerSupport return (T)new CellEditor() { @Override - public void edit(Transaction transaction, String location, String property, T value, Binding binding, Consumer callback) { + public void edit(Transaction transaction, String location, String property, E value, Binding binding, Consumer callback) { if (ClientModel.ITERATION_ENABLED.equals(location)) { Simantics.getSession().asyncRequest(new ReadRequest() { @@ -539,7 +544,7 @@ public class GraphUI implements Adaptable, ListenerSupport, AsyncListenerSupport load(newContext, client); return; } catch (DatabaseException e) { - Logger.defaultLogError(e); + LOGGER.error("edit failed for model key '" + ClientModel.CONTEXT_CURRENT + "'", e); } } } @@ -564,7 +569,7 @@ public class GraphUI implements Adaptable, ListenerSupport, AsyncListenerSupport load(newInput, client); return; } catch (DatabaseException e) { - Logger.defaultLogError(e); + LOGGER.error("edit failed for model key '" + ClientModel.SHEETS_CURRENT + "'", e); } } } @@ -610,7 +615,7 @@ public class GraphUI implements Adaptable, ListenerSupport, AsyncListenerSupport // fullSynchronize(); return; } catch (DatabaseException e) { - Logger.defaultLogError(e); + LOGGER.error("edit failed for model key '" + ClientModel.STATES_CURRENT + "'", e); } } } @@ -664,7 +669,7 @@ public class GraphUI implements Adaptable, ListenerSupport, AsyncListenerSupport } } catch (DatabaseException e) { - Logger.defaultLogError(e); + LOGGER.error("edit failed for model key '" + ClientModel.SOURCES_CURRENT + "'", e); } } return; @@ -796,12 +801,12 @@ public class GraphUI implements Adaptable, ListenerSupport, AsyncListenerSupport @Override public void exception(AsyncReadGraph graph, Throwable t) { - Logger.defaultLogError("Failed to read properties.", t); + LOGGER.error("Failed to read properties.", t); } @Override public void exception(ReadGraph graph, Throwable t) { - Logger.defaultLogError("Failed to read properties.", t); + LOGGER.error("Failed to read properties.", t); } public void dispose() {