Community
Participate
Working Groups
The core shall provide a getVisibleEditors() method returning a list of actually visible editors. An editor is visible if its diagram area is visible. There could be several visible editors, but only one of them is active at a time. In Papyrus, there could only have one active editor at a time (accesible with getActiveEditor() ).
methods are added to org.eclipse.papyrus.sasheditor.editor.ISashWindowsContainer: - List<IEditorPart> getVisibleIEditorParts(); - public List<IPage> getVisiblePages(); You can get the ISashWindowsContainer and access them by one of the following method (see doc) : - org.eclipse.papyrus.core.utils.ServiceUtils.getISashWindowsContainer(serviceRegistry). - org.eclipse.papyrus.diagram.common.util.ServiceUtilsForGMF.getISashWindowsContainer(domain) - org.eclipse.papyrus.core.utils.ServiceUtilsForActionHandlers.getISashWindowsContainer() // check doc !!!
It seems that the service registry has not been initialized for the value ISashWindowsContainer see log: org.eclipse.papyrus.core.services.ServiceNotFoundException: No service registered under 'interface org.eclipse.papyrus.sasheditor.editor.ISashWindowsContainer' at org.eclipse.papyrus.core.services.ServicesRegistry.getService(ServicesRegistry.java:334) at org.eclipse.papyrus.core.utils.AbstractServiceUtils.getISashWindowsContainer(AbstractServiceUtils.java:105) at org.eclipse.papyrus.modelexplorer.LinkHelper.activateEditor(LinkHelper.java:69) at org.eclipse.ui.internal.navigator.actions.LinkEditorAction$2.run(LinkEditorAction.java:78) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.ui.internal.navigator.actions.LinkEditorAction$1.runInUIThread(LinkEditorAction.java:76) at org.eclipse.ui.progress.UIJob$1.run(UIJob.java:95) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4059) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3678) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438) at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577) at org.eclipse.equinox.launcher.Main.run(Main.java:1410) at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
there was a bug in SashWindowsContainer at public boolean accept(TabFolderPart part) { IPage page = part.getVisiblePagePart(); if( part != null && part instanceof IEditorPage ) { <--- here this is page not part IEditorPage editorPage = (IEditorPage) page; visiblePages.add(editorPage.getIEditorPart()); } // continue searching return true; } Done in the revision 3966
I close this task