Exemplo n.º 1
0
  public void actionPerformed(ActionEvent e) {
    Pattern selected = getDesignView().getSelectionModel().getSelectedPattern();

    if (selected == null) {
      return;
    }

    Node node = getDesignView().getNodeForPattern(selected);

    if (node == null) {
      return;
    }

    Action[] actions = node.getActions(true);
    if (actions == null) {
      return;
    }

    for (int i = actions.length - 1; i >= 0; i--) {
      Action action = actions[i];
      if (action instanceof GoToAction) {
        org.netbeans.modules.bpel.nodes.actions.GoToSourceAction gotoAction =
            SystemAction.get(org.netbeans.modules.bpel.nodes.actions.GoToSourceAction.class);
        Node[] nodes = new Node[] {node};
        if (gotoAction != null && gotoAction.enable(nodes)) {
          gotoAction.performAction(nodes);
        }
        break;
      }
    }
  }
Exemplo n.º 2
0
 /**
  * DOCUMENT ME!
  *
  * @param libNodes DOCUMENT ME!
  * @return DOCUMENT ME!
  */
 private boolean performDeploy(final List<Node> libNodes) {
   final List<DeployInformation> infos = new LinkedList<DeployInformation>();
   final ModificationStore modStore = ModificationStore.getInstance();
   for (final Node libNode : libNodes) {
     for (final Node node : libNode.getChildren().getNodes(true)) {
       for (final Action a : node.getActions(false)) {
         // if this action is registered it node should be of type
         // LocalManagement or StarterManagement
         if (a instanceof DeployChangedJarsAction) {
           for (final Node ch : node.getChildren().getNodes()) {
             final DeployInformation info = DeployInformation.getDeployInformation(ch);
             final String path = FileUtil.toFile(info.getSourceDir()).getAbsolutePath();
             if (modStore.anyModifiedInContext(path, ModificationStore.MOD_CHANGED)) {
               infos.add(info);
             }
           }
           // continue with outer loop since only one action of
           // this type should be registered
           break;
         }
       }
     }
   }
   try {
     JarHandler.deployAllJars(infos, JarHandler.ANT_TARGET_DEPLOY_CHANGED_JARS);
     for (final DeployInformation info : infos) {
       final String path = FileUtil.toFile(info.getSourceDir()).getAbsolutePath();
       modStore.removeAllModificationsInContext(path, ModificationStore.MOD_CHANGED);
     }
     return true;
   } catch (final IOException ex) {
     LOG.warn("could not deploy changed jars", ex); // NOI18N
     return false;
   }
 }
Exemplo n.º 3
0
 private static void disableActionByName(Node node, String actionName) {
   for (Action action : node.getActions(true)) {
     if (action != null) {
       String name = (String) action.getValue(Action.NAME);
       if (name != null && name.length() > 0) {
         if (name.equals(actionName)) {
           action.setEnabled(false);
         }
       }
     }
   }
 }