예제 #1
0
  @Override
  protected void buttonPressed(int buttonId) {
    if (buttonId == IDialogConstants.CLOSE_ID
        || buttonId == IDialogConstants.CANCEL_ID
        || buttonId == IDialogConstants.BACK_ID) {
      this.setReturnCode(buttonId);
      this.close();

    } else if (buttonId == IDialogConstants.OK_ID) {
      try {
        if (!validate()) {
          return;
        }

        this.perfomeOK();
        setReturnCode(buttonId);
        close();

      } catch (InputException e) {
        if (e.getMessage() != null) {
          this.setMessage(ResourceString.getResourceString(e.getMessage(), e.getArgs()));
        }
        return;

      } catch (Exception e) {
        Activator.showExceptionDialog(e);
      }
    }

    super.buttonPressed(buttonId);
  }
  /** {@inheritDoc} */
  @Override
  protected void buttonPressed(int buttonId) {
    setReturnCode(buttonId);
    close();

    super.buttonPressed(buttonId);
  }
예제 #3
0
  protected void buttonPressed(int buttonId) {
    if (buttonId == RESET_ID) {
      usernameField.setText(""); // $NON-NLS-1$
      passwordField.setText(""); // $NON-NLS-1$
    } else {
      if (buttonId == Window.OK) {
        if (!workspaceCombo.getEnabled()) {
          portalStatus.setText(Messages.TAUPortalUploadDialog_ErrorNoWorkspace);
          return;
        }
        if (workspaceCombo.getSelectionIndex() == -1) {
          portalStatus.setText(Messages.TAUPortalUploadDialog_ErrorNoWorkspace);
          return;
        }

        try {
          String success =
              uploadPPK(
                  url, uname, pwd, workspaceCombo.getItem(workspaceCombo.getSelectionIndex()), ppk);
          if (success.indexOf(Messages.TAUPortalUploadDialog_Error) >= 0) {
            portalStatus.setText(success);
            return;
          }
        } catch (Exception e) {
          e.printStackTrace();
          portalStatus.setText(Messages.TAUPortalUploadDialog_UploadError);
          return;
        }
      }
      super.buttonPressed(buttonId);
    }
  }
예제 #4
0
 /*
  * (non-Javadoc) Method declared on Dialog.
  */
 protected void buttonPressed(int buttonId) {
   if (buttonId == IDialogConstants.OK_ID) {
     value = text.getText();
   } else {
     value = null;
   }
   super.buttonPressed(buttonId);
 }
 /* (non-Javadoc)
  * @see org.eclipse.jface.dialogs.Dialog#buttonPressed(int)
  */
 protected void buttonPressed(int buttonId) {
   super.buttonPressed(buttonId);
   if (DELETE_BUTTON_ID == buttonId) {
     deletePressed();
   }
   if (BROWSE_BUTTON_ID == buttonId) {
     browsePressed();
   }
 }
예제 #6
0
 /*
  * (non-Javadoc) Method declared on Dialog.
  */
 @Override
 protected void buttonPressed(final int buttonId) {
   if (buttonId == IDialogConstants.OK_ID) {
     this.value = this.text.getText();
   } else {
     this.value = null;
   }
   super.buttonPressed(buttonId);
 }
 protected void buttonPressed(int buttonId) {
   if (buttonId == IDialogConstants.OK_ID) {
     StructuredSelection sel = (StructuredSelection) listViewer.getSelection();
     Object[] objs = sel.toArray();
     selectedSkills = new int[objs.length];
     for (int i = 0; i < objs.length; i++) {
       selectedSkills[i] = ((SkillConfig) objs[i]).id;
     }
   }
   super.buttonPressed(buttonId);
 }
예제 #8
0
  protected void buttonPressed(int buttonId) {
    int id = buttonId;
    if (buttonId == ID_PROJECT) {
      ignoreIt = true;
      id = Window.OK;
    } else {
      ignoreIt = false;
    }

    if (id == Window.OK) {
      stopAnnoying = dontShow.getSelection();
    }
    LispPlugin.getStore()
        .setValue(PreferenceConstants.SHOW_ECLIPSE_COMPILE_WARNING_DIALOG, !stopAnnoying);
    super.buttonPressed(id);
  }
 @Override
 protected void buttonPressed(int buttonId) {
   ConfigurationItem configItem = null;
   if (buttonId == IDialogConstants.OK_ID) {
     // make each editor save its value
     for (FieldEditor editor : editors) {
       editor.store();
     }
     // copy updated values into configuration map
     configItem = constructConfigurationOptions();
     Method validateMethod = null;
     try {
       validateMethod = translator.getClass().getMethod("ValidateConfigurationOptions", null);
       if (validateMethod != null) {
         logger.debug("Translator method ValidateConfigurationOptions found");
         translator.configure(configItem);
         String errorMessage = (String) validateMethod.invoke(translator, null);
         if (errorMessage.length() > 0) {
           messageArea.updateText(errorMessage, IMessageProvider.ERROR);
           return;
         }
       }
     } catch (SecurityException e) {
       // TODO Auto-generated catch block
       e.printStackTrace();
       return;
     } catch (NoSuchMethodException e) {
       logger.debug("No Translator method ValidateConfigurationOptions found");
     } catch (IllegalArgumentException e) {
       // TODO Auto-generated catch block
       e.printStackTrace();
       return;
     } catch (IllegalAccessException e) {
       // TODO Auto-generated catch block
       e.printStackTrace();
       return;
     } catch (InvocationTargetException e) {
       // TODO Auto-generated catch block
       e.printStackTrace();
       return;
     }
   }
   updateConfigurationOptions(configItem);
   super.buttonPressed(buttonId);
 }
  protected void buttonPressed(int buttonId) {
    if (buttonId == IDialogConstants.CANCEL_ID) {
      this.cancelPressed();

      ImageStackRoiSelectionTransferJob.cancelJob = true;
      return;
    }
    if (buttonId == IDialogConstants.OK_ID) {
      ImageStackRoiSelectionTransferJob.cancelJob = false;
      ImageStackRoiSelectionTransferJob.doSetSignature(sel);
      ImageStackRoiSelectionTransferJob.setSignatureNumber(spinner.getSelection());
      ImageStackRoiSelectionTransferJob.setMinStackSlice(spinner_1.getSelection());
      ImageStackRoiSelectionTransferJob.setMaxStackSlice(spinner_2.getSelection());

      this.okPressed();
      return;
    }
    super.buttonPressed(buttonId);
  }
 protected void buttonPressed(int buttonId) {
   if (buttonId == IDialogConstants.OK_ID) {
     editObject.format = formats[comboTextureType.getSelectionIndex()];
     editObject.sizeWidth = sizes[comboTextureSize.getSelectionIndex()];
     editObject.sizeHeight = editObject.sizeWidth;
     try {
       editObject.borderWidth = Integer.parseInt(textBorderWidth.getText());
       if (editObject.borderWidth < 0 || editObject.borderWidth > 10) {
         throw new Exception();
       }
     } catch (Exception e) {
       MessageDialog.openError(this.getShell(), "错误", "描边宽度:请输入0-10之间的整数。");
       return;
     }
     if (CompressTextureOption.ETC1.equals(editObject.format)) {
       String msg = "ETC1格式不支持透明色,你确定你要使用这个格式吗?";
       if (!MessageDialog.openConfirm(getShell(), "确认", msg)) {
         return;
       }
     }
   }
   super.buttonPressed(buttonId);
 }
예제 #12
0
  @Override
  protected void buttonPressed(int buttonId) {
    if (buttonId == IDialogConstants.OK_ID) {
      handleConverterSelection();
      IConvertManagedBuildObject convertBuildObject = null;
      try {
        convertBuildObject =
            (IConvertManagedBuildObject)
                getSelectedConversionElement().createExecutableExtension("class"); // $NON-NLS-1$
      } catch (CoreException e) {
        ManagedBuilderUIPlugin.log(e);
      }
      if (convertBuildObject != null) {
        String fromId = getSelectedConversionElement().getAttribute("fromId"); // $NON-NLS-1$
        String toId = getSelectedConversionElement().getAttribute("toId"); // $NON-NLS-1$

        IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(getProject());
        if (info != null) {
          IManagedProject managedProject = info.getManagedProject();
          if (managedProject != null) {
            if (convertBuildObject.convert(managedProject, fromId, toId, true) == null) {
              setConversionSuccessful(false);
            } else {
              setConversionSuccessful(true);
            }
          } else {
            setConversionSuccessful(false);
          }
        } else {
          setConversionSuccessful(false);
        }
      } else {
        setConversionSuccessful(false);
      }
    }
    super.buttonPressed(buttonId);
  }
 protected void buttonPressed(int buttonId) {
   target = getModelValue(targetField.getText());
   data = getModelValue(dataField.getText());
   super.buttonPressed(buttonId);
 }
 protected void buttonPressed(int buttonId) {
   key = keyText.getText();
   value = valueText.getText();
   super.buttonPressed(buttonId);
 }
 protected void buttonPressed(int buttonId) {
   if (buttonId == IDialogConstants.OK_ID) {
     this.offset = editArea.getOffset();
   }
   super.buttonPressed(buttonId);
 }
예제 #16
0
 /** This method is called if a button has been pressed. */
 protected void buttonPressed(int buttonId) {
   if (buttonId == IDialogConstants.OK_ID) saveWidgetValues();
   super.buttonPressed(buttonId);
 }