- Timestamp:
- 11/22/11 21:36:06 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/modelicaml/org.openmodelica.modelicaml.common/src/org/openmodelica/modelicaml/common/services/PapyrusServices.java
r1060 r1130 16 16 public class PapyrusServices { 17 17 18 public static CommonViewer getModelExplorerView(){ 19 IViewPart view = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView("org.eclipse.papyrus.modelexplorer.modelexplorer"); 20 21 ModelExplorerPageBookView modelExplorerPageBookView = null; 22 if (view instanceof ModelExplorerPageBookView) { 23 modelExplorerPageBookView = (ModelExplorerPageBookView)view; 24 } 25 CommonViewer modelExplorerView = ((ModelExplorerView) modelExplorerPageBookView.getAdapter(ModelExplorerView.class)).getCommonViewer(); 26 27 return modelExplorerView; 28 } 29 30 31 public static boolean isVisiblePapyrusModelExplorerView(){ 32 IViewPart view = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView("org.eclipse.papyrus.modelexplorer.modelexplorer"); 33 34 ModelExplorerPageBookView modelExplorerPageBookView = null; 35 if (view instanceof ModelExplorerPageBookView) { 36 modelExplorerPageBookView = (ModelExplorerPageBookView)view; 37 } 38 CommonViewer modelExplorerView = ((ModelExplorerView) modelExplorerPageBookView.getAdapter(ModelExplorerView.class)).getCommonViewer(); 39 if (modelExplorerView != null) { 40 return modelExplorerView.getControl().isVisible(); 41 } 42 43 return false; 44 } 45 18 46 public static void locate(Object object){ 19 47 if (object instanceof EObject) { … … 29 57 items.add(modelExplorerPageBookView.findElementForEObject( modelExplorerView, (EObject)object)); 30 58 59 // set focus 60 modelExplorerView.getControl().setFocus(); 61 31 62 // set new selection 32 63 modelExplorerView.setSelection(new StructuredSelection(items), true); 33 } 64 65 } 34 66 } 35 67 … … 46 78 List<Object> items = new ArrayList<Object>(); 47 79 items.add(modelExplorerPageBookView.findElementForEObject( modelExplorerView, (EObject)object)); 80 81 // set focus 82 modelExplorerView.getControl().setFocus(); 48 83 49 84 // reset the selection so that the components tree can instantiate the selected class again
Note: See TracChangeset
for help on using the changeset viewer.