Exemplo n.º 1
0
 private long getSelectedModuleId() {
   long moduleId = -1;
   TreePath path = this.moduleTree.getSelectionPath();
   if (path != null) { // returns null if nothing is selected
     AbstractDefineComponent selectedComponent =
         (AbstractDefineComponent) path.getLastPathComponent();
     moduleId = selectedComponent.getModuleId();
   }
   return moduleId;
 }
Exemplo n.º 2
0
 @Override
 public void valueChanged(TreeSelectionEvent event) {
   TreePath path = event.getPath();
   AbstractDefineComponent selectedComponent =
       (AbstractDefineComponent) path.getLastPathComponent();
   if (selectedComponent.getModuleId()
       != DefinitionController.getInstance().getSelectedModuleId()) {
     this.updateSelectedModule(selectedComponent.getModuleId());
   }
   this.checkLayerComponentIsSelected();
 }