import org.simantics.spreadsheet.ClientModel;\r
import org.simantics.spreadsheet.ClientModel.OperationMode;\r
import org.simantics.spreadsheet.SheetCommands;\r
-import org.simantics.spreadsheet.common.logging.Logger;\r
import org.simantics.spreadsheet.event.model.RemoveCellHandler;\r
import org.simantics.spreadsheet.resource.SpreadsheetResource;\r
import org.simantics.ui.selection.WorkbenchSelectionUtils;\r
import org.simantics.utils.strings.AlphanumComparator;\r
import org.simantics.utils.threads.logger.ITask;\r
import org.simantics.utils.threads.logger.ThreadLogger;\r
+import org.slf4j.Logger;\r
+import org.slf4j.LoggerFactory;\r
\r
import gnu.trove.map.hash.THashMap;\r
import gnu.trove.map.hash.TObjectIntHashMap;\r
\r
public class GraphUI implements Adaptable, ListenerSupport, AsyncListenerSupport, SyncListenerSupport {\r
\r
+ private static final Logger LOGGER = LoggerFactory.getLogger(GraphUI.class);\r
+\r
final public static boolean DEBUG = false;\r
\r
final private RequestProcessor processor;\r
\r
support.addListener(listener);\r
\r
- this.cellEditor = processor.sync(new VariableRead<CellEditor>(variable) {\r
+ this.cellEditor = processor.sync(new VariableRead<CellEditor<Write>>(variable) {\r
\r
@Override\r
- public CellEditor perform(ReadGraph graph) throws DatabaseException {\r
+ public CellEditor<Write> perform(ReadGraph graph) throws DatabaseException {\r
SpreadsheetResource SHEET = SpreadsheetResource.getInstance(graph);\r
return variable.getPropertyValue(graph, SHEET.cellEditor);\r
}\r
\r
private static class PropertyListener extends SingleSetSyncListenerDelegate<Pair<String,Variable>> {\r
\r
+ private static final Logger LOGGER = LoggerFactory.getLogger(PropertyListener.class);\r
+\r
private ClientModel client;\r
private String childName;\r
private boolean listenerDisposed;\r
@Override\r
public void exception(ReadGraph graph, Throwable throwable) throws DatabaseException {\r
\r
- Logger.defaultLogError(throwable);\r
+ LOGGER.error("PropertyListener.exception", throwable);\r
\r
String propertyName = property.first;\r
if("content".equals(propertyName)) {\r
return (T)new CellEditor<Write>() {\r
\r
@Override\r
- public <T> void edit(Transaction<Write> transaction, String location, String property, T value, Binding binding, Consumer<?> callback) {\r
+ public <E> void edit(Transaction<Write> transaction, String location, String property, E value, Binding binding, Consumer<?> callback) {\r
\r
if (ClientModel.ITERATION_ENABLED.equals(location)) {\r
Simantics.getSession().asyncRequest(new ReadRequest() {\r
load(newContext, client);\r
return;\r
} catch (DatabaseException e) {\r
- Logger.defaultLogError(e);\r
+ LOGGER.error("edit failed for model key '" + ClientModel.CONTEXT_CURRENT + "'", e);\r
}\r
}\r
}\r
load(newInput, client);\r
return;\r
} catch (DatabaseException e) {\r
- Logger.defaultLogError(e);\r
+ LOGGER.error("edit failed for model key '" + ClientModel.SHEETS_CURRENT + "'", e);\r
}\r
}\r
}\r
// fullSynchronize();\r
return;\r
} catch (DatabaseException e) {\r
- Logger.defaultLogError(e);\r
+ LOGGER.error("edit failed for model key '" + ClientModel.STATES_CURRENT + "'", e);\r
}\r
}\r
}\r
}\r
\r
} catch (DatabaseException e) {\r
- Logger.defaultLogError(e);\r
+ LOGGER.error("edit failed for model key '" + ClientModel.SOURCES_CURRENT + "'", e);\r
}\r
}\r
return;\r
\r
@Override\r
public void exception(AsyncReadGraph graph, Throwable t) {\r
- Logger.defaultLogError("Failed to read properties.", t);\r
+ LOGGER.error("Failed to read properties.", t);\r
}\r
\r
@Override\r
public void exception(ReadGraph graph, Throwable t) {\r
- Logger.defaultLogError("Failed to read properties.", t);\r
+ LOGGER.error("Failed to read properties.", t);\r
}\r
\r
public void dispose() {\r