/** Go to the next panel, or finish if this is the last panel */
 public void next() {
   if (!nextButton.isEnabled()) return;
   currentPanel.canAdvance = true;
   currentPanel.wizardNext();
   if (!currentPanel.canAdvance) return;
   for (WizardListener listener : listeners) listener.wizardNext(currentPanel);
 }
Exemple #2
0
 /**
  * ************************************************
  *
  * <pre>
  * Summary: Catch any key pressed.
  *
  * </pre>
  *
  * *************************************************
  */
 public void keyPressed(KeyEvent e) {
   // Have an escape do the same as clicking cancel.
   if (e.getKeyCode() == KeyEvent.VK_ESCAPE) abandonButton.doClick();
   // Return
   else if (e.getKeyCode() == KeyEvent.VK_ENTER) {
     if (closeButton.isEnabled()) {
       closeButton.doClick();
     }
   }
 }
 /** Cancel the dialog */
 public void cancel() {
   if (!cancelButton.isEnabled()) return;
   currentPanel.wizardCancel();
   for (WizardListener listener : listeners) returnCode = listener.wizardCancel(currentPanel);
   setVisible(false);
 }
Exemple #4
0
 public boolean isLastButtonEnabled() {
   return lastButton.isEnabled();
 }
 /** Go to the previous panel */
 public void back() {
   if (!backButton.isEnabled()) return;
   currentPanel.wizardBack();
   for (WizardListener listener : listeners) listener.wizardBack(currentPanel);
 }
Exemple #6
0
 public boolean isPrevButtonEnabled() {
   return prevButton.isEnabled();
 }
Exemple #7
0
 public boolean isNextButtonEnabled() {
   return nextButton.isEnabled();
 }
Exemple #8
0
 public boolean isFirstButtonEnabled() {
   return firstButton.isEnabled();
 }
Exemple #9
0
 public void jButtonExit_actionPerformed(ActionEvent e) {
   if (jButtonStop.isEnabled()) {
     jButtonStop_actionPerformed(e);
   }
   System.exit(0);
 }
 /** Update buttons on the form */
 private void updateButtons() {
   String error = null;
   boolean wasCheckedNode = false;
   boolean reorderMerges = false;
   for (int i = 0; i < myTreeRoot.getChildCount(); i++) {
     CheckedTreeNode node = (CheckedTreeNode) myTreeRoot.getChildAt(i);
     boolean seenCheckedNode = false;
     boolean reorderNeeded = false;
     boolean seenMerges = false;
     boolean seenUnchecked = false;
     for (int j = 0; j < node.getChildCount(); j++) {
       if (node.getChildAt(j) instanceof CheckedTreeNode) {
         CheckedTreeNode commitNode = (CheckedTreeNode) node.getChildAt(j);
         Commit commit = (Commit) commitNode.getUserObject();
         seenMerges |= commit.isMerge;
         if (commitNode.isChecked()) {
           seenCheckedNode = true;
         } else {
           seenUnchecked = true;
           if (seenCheckedNode) {
             reorderNeeded = true;
           }
         }
       }
     }
     if (!seenCheckedNode) {
       continue;
     }
     Root r = (Root) node.getUserObject();
     if (seenMerges && seenUnchecked) {
       error = GitBundle.getString("push.active.error.merges.unchecked");
     }
     if (seenMerges && reorderNeeded) {
       reorderMerges = true;
       error = GitBundle.getString("push.active.error.reorder.merges");
     }
     if (reorderNeeded) {
       if (error == null) {
         error = GitBundle.getString("push.active.error.reorder.needed");
       }
     }
     if (r.currentBranch == null) {
       if (error == null) {
         error = GitBundle.getString("push.active.error.no.branch");
       }
       break;
     }
     wasCheckedNode |= r.remoteBranch != null;
     if (r.remoteCommits != 0 && r.commits.size() != 0) {
       if (error == null) {
         error = GitBundle.getString("push.active.error.behind");
       }
       break;
     }
   }
   boolean rebaseNeeded = isRebaseNeeded();
   myPushButton.setEnabled(wasCheckedNode && error == null && !rebaseNeeded);
   setErrorText(error);
   myRebaseButton.setEnabled(rebaseNeeded && !reorderMerges);
   setOKActionEnabled(myPushButton.isEnabled() || myRebaseButton.isEnabled());
 }
    /** Background thread used to receive data from the server. */
    public void run() {
      Long id;
      Integer message_type;
      String target;
      String soap;
      SOAPMonitorData data;
      int selected;
      int row;
      boolean update_needed;
      while (socket != null) {
        try {
          // Get the data from the server
          message_type = (Integer) in.readObject();
          // Process the data depending on its type
          switch (message_type.intValue()) {
            case SOAPMonitorConstants.SOAP_MONITOR_REQUEST:
              // Get the id, target and soap info
              id = (Long) in.readObject();
              target = (String) in.readObject();
              soap = (String) in.readObject();
              // Add new request data to the table
              data = new SOAPMonitorData(id, target, soap);
              model.addData(data);
              // If "most recent" selected then update
              // the details area if needed
              selected = table.getSelectedRow();
              if ((selected == 0) && model.filterMatch(data)) {
                valueChanged(null);
              }
              break;
            case SOAPMonitorConstants.SOAP_MONITOR_RESPONSE:
              // Get the id and soap info
              id = (Long) in.readObject();
              soap = (String) in.readObject();
              data = model.findData(id);
              if (data != null) {
                update_needed = false;
                // Get the selected row
                selected = table.getSelectedRow();
                // If "most recent", then always
                // update details area
                if (selected == 0) {
                  update_needed = true;
                }
                // If the data being updated is
                // selected then update details
                row = model.findRow(data);
                if ((row != -1) && (row == selected)) {
                  update_needed = true;
                }
                // Set the response and update table
                data.setSOAPResponse(soap);
                model.updateData(data);
                // Refresh details area (if needed)
                if (update_needed) {
                  valueChanged(null);
                }
              }
              break;
          }

        } catch (Exception e) {
          // Exceptions are expected here when the
          // server communication has been terminated.
          if (stop_button.isEnabled()) {
            stop();
            setErrorStatus(STATUS_CLOSED);
          }
        }
      }
    }
 public boolean getSelected() {
   return !_button.isEnabled();
 }