예제 #1
0
  /**
   * Applies the status to the status line of a dialog page.
   *
   * @param page the dialog page
   * @param status the status to apply
   */
  public static void applyToStatusLine(DialogPage page, IStatus status) {
    if (status == null) {
      page.setMessage(null, IMessageProvider.NONE);
      page.setErrorMessage(null);
      return;
    }

    String message = status.getMessage();

    if (message != null && message.length() == 0) {
      message = null;
    }

    switch (status.getSeverity()) {
      case IStatus.OK:
        page.setMessage(message, IMessageProvider.NONE);
        page.setErrorMessage(null);
        break;
      case IStatus.WARNING:
        page.setMessage(message, IMessageProvider.WARNING);
        page.setErrorMessage(null);
        break;
      case IStatus.INFO:
        page.setMessage(message, IMessageProvider.INFORMATION);
        page.setErrorMessage(null);
        break;
      default:
        page.setMessage(null);
        page.setErrorMessage(message);
        break;
    }
  }
예제 #2
0
 @Override
 public void setVisible(boolean visible) {
   super.setVisible(visible);
   if (visible) {
     updateEnablement();
   }
 }
예제 #3
0
  /*
   * Implements method from IDialogPage
   */
  @Override
  public void setVisible(boolean visible) {
    if (visible && fPattern != null) {
      if (fFirstTime) {
        fFirstTime = false;
        // Set item and text here to prevent page from resizing
        fPattern.setItems(getPreviousSearchPatterns());
        fExtensions.setItems(fPreviousExtensions);
        //				if (fExtensions.getItemCount() == 0) {
        //					loadFilePatternDefaults();
        //				}
        if (!initializePatternControl()) {
          fPattern.select(0);
          fExtensions.setText("*"); // $NON-NLS-1$
          handleWidgetSelected();
        }
      }
      fPattern.setFocus();
    }
    updateOKStatus();

    IEditorInput editorInput = getContainer().getActiveEditorInput();
    getContainer()
        .setActiveEditorCanProvideScopeSelection(
            editorInput != null && editorInput.getAdapter(IFile.class) != null);

    super.setVisible(visible);
  }
예제 #4
0
 /*
  * Implements method from IDialogPage
  */
 @Override
 public void setVisible(final boolean visible) {
   if (visible && fPattern != null) {
     if (fFirstTime) {
       fFirstTime = false;
       // Set item and text here to prevent page from resizing
       fPattern.setItems(getPreviousSearchPatterns());
       try {
         initSelections();
       } catch (final ErlModelException e) {
       }
     }
     fPattern.setFocus();
   }
   updateOKStatus();
   super.setVisible(visible);
 }
예제 #5
0
 @Override
 public void dispose() {
   writeConfiguration();
   super.dispose();
 }
예제 #6
0
 /**
  * Shows the given message in the page for this field editor if it has one.
  *
  * @param msg the message
  */
 protected void showMessage(String msg) {
   if (page != null) {
     page.setErrorMessage(msg);
   }
 }
예제 #7
0
 /** Clears the normal message from the message line. */
 protected void clearMessage() {
   if (page != null) {
     page.setMessage(null);
   }
 }