void doSetTitleToolTip(String name);
}
- public static final String DIAGRAMMING_CONTEXT = "org.simantics.modeling.ui.diagramming";
- private static final String PREFERENCE_VIRTUAL_GRAPH = "preferences";
+ public static final String DIAGRAMMING_CONTEXT = "org.simantics.modeling.ui.diagramming"; //$NON-NLS-1$
+ private static final String PREFERENCE_VIRTUAL_GRAPH = "preferences"; //$NON-NLS-1$
private static final boolean PROFILE = false;
protected Set<String> getPropertyPageContexts() {
try {
- return BrowseContext.getBrowseContextClosure(SimanticsUI.getSession(), defaultPropertyBrowseContexts);
+ return BrowseContext.getBrowseContextClosure(Simantics.getSession(), defaultPropertyBrowseContexts);
} catch (DatabaseException e) {
- ExceptionUtils.logAndShowError("Failed to load modeled browse contexts for property page, see exception for details.", e);
+ ExceptionUtils.logAndShowError(Messages.DiagramViewer_FailedtoLoadModeled, e);
return defaultPropertyBrowseContexts;
}
}
}
protected String getPopupId() {
- return "#ModelingDiagramPopup";
+ return "#ModelingDiagramPopup"; //$NON-NLS-1$
}
protected void getPreferences() {
}
protected void initSession() {
- sessionContextProvider = SimanticsUI.getSessionContextProvider();
+ sessionContextProvider = Simantics.getSessionContextProvider();
sessionContext = sessionContextProvider.getSessionContext();
}
resourceManager = new LocalResourceManager(JFaceResources.getResources(), parent);
c = new SWTChassis(parent, 0);
- Object task = BEGIN("DV.precreateParticipants");
+ Object task = BEGIN("DV.precreateParticipants"); //$NON-NLS-1$
createCustomParticipants();
END(task);
swt = SWTThread.getThreadAccess(display);
statusLineManager = getEditorSite().getActionBars().getStatusLineManager();
- Object task = BEGIN("DV.initSession");
+ Object task = BEGIN("DV.initSession"); //$NON-NLS-1$
initSession();
END(task);
this.canvasContext = new CanvasContext(thread);
this.canvasContext.setLocked(true);
- task = BEGIN("DV.createChassis");
+ task = BEGIN("DV.createChassis"); //$NON-NLS-1$
createChassis(parent);
END(task);
} catch (DatabaseException e) {
* Invoke this only from the AWT thread.
*/
protected void initializeCanvas() {
- Object canvasInit = BEGIN("DV.canvasInitialization");
+ Object canvasInit = BEGIN("DV.canvasInitialization"); //$NON-NLS-1$
- Object task = BEGIN("DV.createViewerCanvas");
+ Object task = BEGIN("DV.createViewerCanvas"); //$NON-NLS-1$
initializeCanvasContext(canvasContext);
END(task);
canvasContext.getHintStack().addKeyHintListener(GridPainter.KEY_GRID_ENABLED, canvasHintListener);
canvasContext.getHintStack().addKeyHintListener(RulerPainter.KEY_RULER_ENABLED, canvasHintListener);
- task = BEGIN("DV.setCanvasContext");
+ task = BEGIN("DV.setCanvasContext"); //$NON-NLS-1$
setCanvasContext(canvasContext);
END(task);
* cancelled.
*/
protected void performActivation(IProgressMonitor monitor) {
- SubMonitor progress = SubMonitor.convert(monitor, "Activate Mapping", 100);
+ SubMonitor progress = SubMonitor.convert(monitor, Messages.DiagramViewer_MonitorActivateMapping, 100);
IActivationManager activationManager = sessionContext.getSession().peekService(IActivationManager.class);
if (activationManager != null) {
activation = activationManager.activate(diagramResource);
*/
protected void scheduleZoomToFit(IDiagram diagram) {
if (diagram == null)
- throw new IllegalStateException("diagram is null");
+ throw new IllegalStateException("diagram is null"); //$NON-NLS-1$
CanvasUtils.scheduleZoomToFit(swt, () -> disposed, canvasContext, diagram);
}
}
});
} catch (DatabaseException e) {
- throw new UnsupportedOperationException("Failed to initialize data model synchronizer", e);
+ throw new UnsupportedOperationException("Failed to initialize data model synchronizer", e); //$NON-NLS-1$
}
}
// unnecessary visual glitches.
h.setHint(Hints.KEY_DISABLE_PAINTING, Boolean.TRUE);
- Object task = BEGIN("createSynchronizer");
+ Object task = BEGIN("createSynchronizer"); //$NON-NLS-1$
this.synchronizer = createSynchronizer(ctx, sessionContext);
END(task);
}
}, parameter -> {
if (parameter != null)
- ErrorLogger.defaultLogError("Failed to write default diagram page description to database, see exception for details", parameter);
+ ErrorLogger.defaultLogError("Failed to write default diagram page description to database, see exception for details", parameter); //$NON-NLS-1$
});
}
protected void setDiagramDesc(ICanvasContext ctx, DiagramDesc diagramDesc) {
if (diagramDesc == null)
- throw new NullPointerException("null diagram desc");
+ throw new NullPointerException("null diagram desc"); //$NON-NLS-1$
if (diagramDesc.equals(this.diagramDesc))
return;
public void init(DiagramViewerHost _host, IEditorSite site, IEditorInput input, DataContainer<IDiagram> diagramContainer, WorkbenchSelectionProvider selectionProvider) {
if (!(input instanceof IResourceEditorInput))
- throw new RuntimeException("Invalid input: must be IResourceEditorInput");
+ throw new RuntimeException("Invalid input: must be IResourceEditorInput"); //$NON-NLS-1$
setHost(_host);
setSite(site);
// Set initial part name according to the name given by IEditorInput
host.doSetPartName(getEditorInput().getName());
- Session session = SimanticsUI.peekSession();
+ Session session = Simantics.peekSession();
if (session != null) {
Supplier<Boolean> disposedCallback = () -> disposed;
session.asyncRequest(
try {
return (T) DiagramTypeUtils.readSymbolProviderFactory(sessionContext.getSession(), diagramResource);
} catch (DatabaseException e) {
- ErrorLogger.defaultLogError(getClass() + " failed to adapt to SymbolProviderFactory, see exception for details.", e);
+ ErrorLogger.defaultLogError(getClass() + " failed to adapt to SymbolProviderFactory, see exception for details.", e); //$NON-NLS-1$
return null;
}
}