コード例 #1
0
 /** @generated */
 public final void selectionChanged(IStructuredSelection selection) {
   myDiagram = null;
   if (selection.size() == 1) {
     Object selectedElement = selection.getFirstElement();
     if (selectedElement instanceof TOENavigatorItem) {
       selectedElement = ((TOENavigatorItem) selectedElement).getView();
     } else if (selectedElement instanceof IAdaptable) {
       selectedElement = ((IAdaptable) selectedElement).getAdapter(View.class);
     }
     if (selectedElement instanceof Diagram) {
       Diagram diagram = (Diagram) selectedElement;
       if (AllHolderEditPart.MODEL_ID.equals(TOEVisualIDRegistry.getModelID(diagram))) {
         myDiagram = diagram;
       }
     }
   }
   setEnabled(myDiagram != null);
 }
コード例 #2
0
 /** @generated */
 private boolean isOwnView(View view) {
   return AllHolderEditPart.MODEL_ID.equals(TOEVisualIDRegistry.getModelID(view));
 }