import org.simantics.ui.colors.Colors;
import org.simantics.ui.fonts.FontDescriptor;
import org.simantics.ui.fonts.Fonts;
-import org.simantics.utils.datastructures.Callback;
import org.simantics.utils.datastructures.hints.IHintContext.Key;
import org.simantics.utils.datastructures.hints.IHintContext.KeyOf;
public class MonitorClassFactory2 extends SyncElementFactory {
private static final Key KEY_VARIABLE_LISTENER = new KeyOf(MonitorListener.class,
- "MONITOR_VARIABLE_LISTENER");
+ "MONITOR_VARIABLE_LISTENER"); //$NON-NLS-1$
- private static final String CLASS_ID = "Monitor";
+ private static final String CLASS_ID = "Monitor"; //$NON-NLS-1$
private static final IHintSynchronizer HINT_SYNCHRONIZER = new CompositeHintSynchronizer(
MonitorSynchronizer.INSTANCE,
loadParentRelationships(graph, element, e);
final Map<String, String> substitutions = new HashMap<String, String>();
- substitutions.put("#v1", "");
+ substitutions.put("#v1", ""); //$NON-NLS-1$ //$NON-NLS-2$
final Resource diagramRuntime = diagram.getHint(DiagramModelHints.KEY_DIAGRAM_RUNTIME_RESOURCE);
if (diagramRuntime != null) {
}) {
@Override
public void accepted(MonitorVariable var) {
- session.asyncRequest(new MonitorVariableWrite(var.getVariable(), text), new Callback<DatabaseException>() {
- @Override
- public void run(DatabaseException e) {
- if (e != null)
- ErrorLogger.defaultLogError(e);
- }
+ session.asyncRequest(new MonitorVariableWrite(var.getVariable(), text), e -> {
+ if (e != null)
+ ErrorLogger.defaultLogError(e);
});
}
@Override
});
}
- IElement mappedElement = diagram.getDiagramClass().getSingleItem(DataElementMap.class).getElement(diagram, element);
+ IElement mappedElement = e;//diagram.getDiagramClass().getSingleItem(DataElementMap.class).getElement(diagram, element);
MonitorListener monitorListener = new MonitorListener(element, canvas, diagram, substitutions);
if (mappedElement != null) {
MonitorListener oldListener = mappedElement.getHint(KEY_VARIABLE_LISTENER);
}
if(monitorVariable != null)
- graph.asyncRequest(new MonitorVariableValueRequest(diagramRuntime, element), monitorListener);
+ graph.syncRequest(new MonitorVariableValueRequest(diagramRuntime, element), monitorListener);
}
}