X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.modeling.ui%2Fsrc%2Forg%2Fsimantics%2Fmodeling%2Fui%2FdiagramEditor%2FDiagramViewer.java;h=e773a7a639b181cd46c1cce60d2794eae9c9dc52;hp=92d46e160e8f91347dee82da58c2698e5a7ba198;hb=47269fe0acb894f346810417d950a1ab59cdc0ea;hpb=11309f6516278203264b680235cbbe1dc2bde98e diff --git a/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/diagramEditor/DiagramViewer.java b/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/diagramEditor/DiagramViewer.java index 92d46e160..e773a7a63 100644 --- a/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/diagramEditor/DiagramViewer.java +++ b/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/diagramEditor/DiagramViewer.java @@ -184,8 +184,8 @@ public class DiagramViewer 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; @@ -348,7 +348,7 @@ public class DiagramViewer try { 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; } } @@ -358,7 +358,7 @@ public class DiagramViewer } protected String getPopupId() { - return "#ModelingDiagramPopup"; + return "#ModelingDiagramPopup"; //$NON-NLS-1$ } protected void getPreferences() { @@ -422,7 +422,7 @@ public class DiagramViewer 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); @@ -464,7 +464,7 @@ public class DiagramViewer swt = SWTThread.getThreadAccess(display); statusLineManager = getEditorSite().getActionBars().getStatusLineManager(); - Object task = BEGIN("DV.initSession"); + Object task = BEGIN("DV.initSession"); //$NON-NLS-1$ initSession(); END(task); @@ -483,7 +483,7 @@ public class DiagramViewer 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) { @@ -513,9 +513,9 @@ public class DiagramViewer * 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); @@ -532,7 +532,7 @@ public class DiagramViewer 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); @@ -557,7 +557,7 @@ public class DiagramViewer * 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); @@ -573,7 +573,7 @@ public class DiagramViewer */ 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); } @@ -664,7 +664,7 @@ public class DiagramViewer } }); } 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$ } } @@ -691,7 +691,7 @@ public class DiagramViewer // 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); @@ -807,7 +807,7 @@ public class DiagramViewer } }, 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$ }); } @@ -833,7 +833,7 @@ public class DiagramViewer 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; @@ -949,7 +949,7 @@ public class DiagramViewer public void init(DiagramViewerHost _host, IEditorSite site, IEditorInput input, DataContainer 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); @@ -991,7 +991,7 @@ public class DiagramViewer 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; } }