X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.document.linking.ui%2Fsrc%2Forg%2Fsimantics%2Fdocument%2Flinking%2Fviews%2FSourceView.java;h=86dfe67edc3bdb90783ff258200a7b5a9e007ac9;hb=38f8cf1831e50990f7053dfaa20db64a6342015f;hp=68c2b0045cc719b87b8350f3bd72cae864d46bde;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.document.linking.ui/src/org/simantics/document/linking/views/SourceView.java b/bundles/org.simantics.document.linking.ui/src/org/simantics/document/linking/views/SourceView.java index 68c2b0045..86dfe67ed 100644 --- a/bundles/org.simantics.document.linking.ui/src/org/simantics/document/linking/views/SourceView.java +++ b/bundles/org.simantics.document.linking.ui/src/org/simantics/document/linking/views/SourceView.java @@ -65,7 +65,7 @@ public class SourceView extends ViewPart implements ISelectionListener, IPartLis /** * The ID of the view as specified by the extension. */ - public static final String ID = "org.simantics.document.linking.views.SourceView"; + public static final String ID = "org.simantics.document.linking.views.SourceView"; //$NON-NLS-1$ private Composite composite; @@ -110,10 +110,10 @@ public class SourceView extends ViewPart implements ISelectionListener, IPartLis composite.setLayout(new FillLayout()); tabFolder = new TabFolder(composite, SWT.NONE); TabItem link = new TabItem(tabFolder, SWT.NONE); - link.setText("Linking"); + link.setText(Messages.SourceView_Linking); TabItem browse = new TabItem(tabFolder, SWT.NONE); - browse.setText("Browsing"); + browse.setText(Messages.SourceView_Browsing); linkComposite = new Composite(tabFolder, SWT.NONE); link.setControl(linkComposite); @@ -147,11 +147,11 @@ public class SourceView extends ViewPart implements ISelectionListener, IPartLis browseComposite.setLayout(new GridLayout(2,false)); modelCombo = new CCombo(browseComposite, SWT.BORDER|SWT.READ_ONLY); final WidgetSupport support = new WidgetSupportImpl(); - SimanticsUI.getSession().asyncRequest(new ReadRequest() { + Simantics.getSession().asyncRequest(new ReadRequest() { @Override public void run(ReadGraph graph) throws DatabaseException { - Resource project = SimanticsUI.getProject().get(); + Resource project = Simantics.getProject().get(); modelToComboListener = new ModelToComboListener(modelCombo) { @Override public Resource getCurrentModel() { @@ -163,7 +163,7 @@ public class SourceView extends ViewPart implements ISelectionListener, IPartLis } }); Button checkingButton = new Button(browseComposite, SWT.TOGGLE); - checkingButton.setText("All"); + checkingButton.setText(Messages.SourceView_All); checkingButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { @@ -171,7 +171,7 @@ public class SourceView extends ViewPart implements ISelectionListener, IPartLis boolean checked = button.getSelection(); browseExplorer.dispose(); createModelExplorer(checked,support,browseComposite); - button.setText(checked ? "Old/Removed" : "All"); + button.setText(checked ? Messages.SourceView_OldRemoved : Messages.SourceView_All); if (currentModel != null) setModel(currentModel, true); browseComposite.getParent().layout(true, true); @@ -198,7 +198,7 @@ public class SourceView extends ViewPart implements ISelectionListener, IPartLis } private void createModelExplorer(boolean onlyCheckable,WidgetSupport support,Composite browseComposite) { - browseExplorer = new SourceLinkExplorerComposite(ArrayMap.keys("displaySelectors", "displayFilter","treeView").values(false, false, true), selectionProvider,getSite(), browseComposite, support,false, SWT.BORDER | SWT.SINGLE | SWT.FULL_SELECTION); + browseExplorer = new SourceLinkExplorerComposite(ArrayMap.keys("displaySelectors", "displayFilter","treeView").values(false, false, true), selectionProvider,getSite(), browseComposite, support,false, SWT.BORDER | SWT.SINGLE | SWT.FULL_SELECTION); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ if(!onlyCheckable) browseExplorer.setBrowseContexts(DocumentLink.URIs.ModelViewpointBrowseContext, DocumentLink.URIs.ModelViewpointActionContext); else @@ -207,7 +207,7 @@ public class SourceView extends ViewPart implements ISelectionListener, IPartLis browseExplorer.setInputSource(new SingleSelectionInputSource(Resource.class)); browseExplorer.getExplorer().setAutoExpandLevel(2); // Expand everything in the beginning browseExplorer.setColumnsVisible(true); - browseExplorer.setContextMenuId("#SourceModelViewPopup"); + browseExplorer.setContextMenuId("#SourceModelViewPopup"); //$NON-NLS-1$ browseExplorer.finish(); ((Tree)browseExplorer.getExplorer().getControl()).setLinesVisible(true); @@ -215,25 +215,25 @@ public class SourceView extends ViewPart implements ISelectionListener, IPartLis } private void createLinkTab(final Composite linkComposite) { - objectExplorer = new SourceLinkExplorerComposite(ArrayMap.keys("displaySelectors", "displayFilter","treeView").values(false, false,true), selectionProvider,getSite(), linkComposite, support, SWT.BORDER | SWT.SINGLE | SWT.FULL_SELECTION); + objectExplorer = new SourceLinkExplorerComposite(ArrayMap.keys("displaySelectors", "displayFilter","treeView").values(false, false,true), selectionProvider,getSite(), linkComposite, support, SWT.BORDER | SWT.SINGLE | SWT.FULL_SELECTION); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ objectExplorer.setBrowseContexts(DocumentLink.URIs.SourceObjectViewpointBrowseContext, DocumentLink.URIs.SourceObjectViewpointActionContext); objectExplorer.setColumns(Constants.SOURCE_OBJECT_COLUMNS); objectExplorer.setInputSource(new SingleSelectionInputSource(Resource.class)); objectExplorer.getExplorer().setAutoExpandLevel(2); // Expand everything in the beginning objectExplorer.setColumnsVisible(true); - objectExplorer.setContextMenuId("#SourceObjectViewPopup"); + objectExplorer.setContextMenuId("#SourceObjectViewPopup"); //$NON-NLS-1$ objectExplorer.finish(); ((Tree)objectExplorer.getExplorer().getControl()).setLinesVisible(true); final Sash sash = new Sash (linkComposite, SWT.HORIZONTAL); - propertyExplorer = new SourceLinkExplorerComposite(ArrayMap.keys("displaySelectors", "displayFilter","treeView").values(false, false,true), selectionProvider,getSite(), linkComposite, support, SWT.BORDER | SWT.SINGLE | SWT.FULL_SELECTION); + propertyExplorer = new SourceLinkExplorerComposite(ArrayMap.keys("displaySelectors", "displayFilter","treeView").values(false, false,true), selectionProvider,getSite(), linkComposite, support, SWT.BORDER | SWT.SINGLE | SWT.FULL_SELECTION); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ propertyExplorer.setBrowseContexts(DocumentLink.URIs.SourcePropertyViewpointBrowseContext, DocumentLink.URIs.SourcePropertyViewpointActionContext); propertyExplorer.setColumns(Constants.SOURCE_COLUMNS); propertyExplorer.setInputSource(new SingleSelectionInputSource(Resource.class)); propertyExplorer.getExplorer().setAutoExpandLevel(2); // Expand everything in the beginning propertyExplorer.setColumnsVisible(true); - propertyExplorer.setContextMenuId("#SourcePropertyViewPopup"); + propertyExplorer.setContextMenuId("#SourcePropertyViewPopup"); //$NON-NLS-1$ propertyExplorer.finish(); ((Tree)propertyExplorer.getExplorer().getControl()).setLinesVisible(true); @@ -317,7 +317,7 @@ public class SourceView extends ViewPart implements ISelectionListener, IPartLis if (res == null) return; try { - final Resource selected = SimanticsUI.getSession().syncRequest(new Read() { + final Resource selected = Simantics.getSession().syncRequest(new Read() { @Override public Resource perform(ReadGraph graph) throws DatabaseException { try { @@ -335,8 +335,8 @@ public class SourceView extends ViewPart implements ISelectionListener, IPartLis return; } ISelection realSelection = new StructuredSelection(selected); - objectExplorer.setInput(SimanticsUI.getSessionContext(), realSelection); - propertyExplorer.setInput(SimanticsUI.getSessionContext(), realSelection); + objectExplorer.setInput(Simantics.getSessionContext(), realSelection); + propertyExplorer.setInput(Simantics.getSessionContext(), realSelection); Simantics.getSession().asyncRequest(new ReadRequest() { @Override @@ -390,16 +390,16 @@ public class SourceView extends ViewPart implements ISelectionListener, IPartLis } private void makeActions() { - pinSelectionAction = new Action("Pin selection", Action.AS_CHECK_BOX) { + pinSelectionAction = new Action(Messages.SourceView_PinSelection, Action.AS_CHECK_BOX) { public void run() { pinSelection = isChecked(); } }; // action1.setToolTipText("Action 1 tooltip"); - pinSelectionAction.setImageDescriptor(Activator.imageDescriptorFromPlugin("com.famfamfam.silk", "icons/lock.png")); + pinSelectionAction.setImageDescriptor(Activator.imageDescriptorFromPlugin("com.famfamfam.silk", "icons/lock.png")); //$NON-NLS-1$ //$NON-NLS-2$ - linkAllAction = new Action("Link All", Action.AS_RADIO_BUTTON) { + linkAllAction = new Action(Messages.SourceView_LinkAll, Action.AS_RADIO_BUTTON) { @Override public void run() { setAcceptedObject(AcceptedObject.ALL); @@ -407,7 +407,7 @@ public class SourceView extends ViewPart implements ISelectionListener, IPartLis } }; - linkDocumentsAction = new Action("Link Documents", Action.AS_RADIO_BUTTON) { + linkDocumentsAction = new Action(Messages.SourceView_LinkDocuments, Action.AS_RADIO_BUTTON) { @Override public void run() { setAcceptedObject(AcceptedObject.DOCUMENT); @@ -453,13 +453,13 @@ public class SourceView extends ViewPart implements ISelectionListener, IPartLis if (model.equals(r)) { modelCombo.select(i); ISelection realSelection = new StructuredSelection(currentModel); - browseExplorer.setInput(SimanticsUI.getSessionContext(), realSelection); + browseExplorer.setInput(Simantics.getSessionContext(), realSelection); return; } } modelCombo.select(-1); ISelection realSelection = new StructuredSelection(); - browseExplorer.setInput(SimanticsUI.getSessionContext(), realSelection); + browseExplorer.setInput(Simantics.getSessionContext(), realSelection); } @SuppressWarnings("rawtypes")