java.lang.Object
org.eclipse.jface.window.Window
org.eclipse.jface.dialogs.Dialog
org.eclipse.jface.dialogs.IconAndMessageDialog
org.eclipse.jface.dialogs.MessageDialog
org.apache.uima.taeconfigurator.editors.ui.Utility
All Implemented Interfaces:
org.eclipse.jface.window.IShellProvider

public class Utility extends org.eclipse.jface.dialogs.MessageDialog
The Class Utility.
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.eclipse.jface.window.Window

    org.eclipse.jface.window.Window.IExceptionHandler
  • Field Summary

    Fields inherited from class org.eclipse.jface.dialogs.MessageDialog

    AUTOMATED_MODE, CONFIRM, ERROR, INFORMATION, NONE, QUESTION, QUESTION_WITH_CANCEL, WARNING

    Fields inherited from class org.eclipse.jface.dialogs.IconAndMessageDialog

    imageLabel, message, messageLabel

    Fields inherited from class org.eclipse.jface.dialogs.Dialog

    blockedHandler, buttonBar, DIALOG_DEFAULT_BOUNDS, DIALOG_PERSISTLOCATION, DIALOG_PERSISTSIZE, dialogArea, DLG_IMG_ERROR, DLG_IMG_HELP, DLG_IMG_INFO, DLG_IMG_MESSAGE_ERROR, DLG_IMG_MESSAGE_INFO, DLG_IMG_MESSAGE_WARNING, DLG_IMG_QUESTION, DLG_IMG_WARNING, ELLIPSIS

    Fields inherited from class org.eclipse.jface.window.Window

    CANCEL, OK, resizeHasOccurred
  • Constructor Summary

    Constructors
    Constructor
    Description
    Utility(org.eclipse.swt.widgets.Shell parentShell, String dialogTitle, org.eclipse.swt.graphics.Image dialogTitleImage, String dialogMessage, int dialogImageType, String[] dialogButtonLabels, int defaultIndex)
    Instantiates a new utility.
  • Method Summary

    Modifier and Type
    Method
    Description
    static Object[]
    addElementToArray(Object[] source, Object element, Class componentClass)
    Adds the element to array.
    static boolean
    arrayContains(Object[] array, Object element)
    Array contains.
    static void
    popMessage(String title, String message, int type)
    Pops up a warning message with an "OK" button.
    static int
    popMessage(String title, String message, int type, String[] buttons)
    Pop message.
    static int
    popMessage(org.eclipse.swt.widgets.Shell parent, String title, String message, int type, String[] buttons)
    Pop message.
    static void
    popMessage(org.eclipse.swt.widgets.Widget w, String title, String message, int type)
    Pop message.
    static int
    popMessage(org.eclipse.swt.widgets.Widget w, String title, String message, int type, String[] buttons)
    Pop message.
    static int
    popOkCancel(String title, String message, int type)
    Pops up a warning message with an "OK" and "Cancel" button.
    static Object[]
    removeElementFromArray(Object[] source, Object element, Class componentClass)
    remove element(s) (must be present) using == test.
    static Object[]
    removeElementsFromArray(Object[] source, Object element, Class componentClass)
    Removes the elements from array.
    static Object[]
    removeElementsFromArray(Object[] source, Object element, Class componentClass, Comparator comp)
    Removes the elements from array.
    static Object[]
    removeEqualElementFromArray(Object[] source, Object element, Class componentClass)
    remove element(s) (must be present) using equals test.

    Methods inherited from class org.eclipse.jface.dialogs.MessageDialog

    buttonPressed, configureShell, createButton, createButtonsForButtonBar, createCustomArea, createDialogArea, customShouldTakeFocus, getButton, getButtonLabels, getDefaultButtonIndex, getImage, getMinimumMessageWidth, handleShellCloseEvent, open, open, open, openConfirm, openError, openInformation, openQuestion, openWarning, setButtonLabels, setButtons

    Methods inherited from class org.eclipse.jface.dialogs.IconAndMessageDialog

    createButtonBar, createContents, createDialogAndButtonArea, createMessageArea, getColumnCount, getErrorImage, getInfoImage, getMessageLabelStyle, getQuestionImage, getWarningImage

    Methods inherited from class org.eclipse.jface.dialogs.Dialog

    applyDialogFont, cancelPressed, close, convertHeightInCharsToPixels, convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, convertWidthInCharsToPixels, create, dialogFontIsDefault, getBlockedHandler, getButtonBar, getCancelButton, getDialogArea, getDialogBoundsSettings, getDialogBoundsStrategy, getImage, getInitialLocation, getInitialSize, getOKButton, initializeBounds, initializeDialogUnits, isResizable, okPressed, setBlockedHandler, setButtonLayoutData, setButtonLayoutFormData, shortenText

    Methods inherited from class org.eclipse.jface.window.Window

    canHandleShellCloseEvent, constrainShellSize, createShell, getConstrainedShellBounds, getContents, getDefaultImage, getDefaultImages, getDefaultOrientation, getLayout, getParentShell, getReturnCode, getShell, getShellListener, getShellStyle, getWindowManager, handleFontChange, setBlockOnOpen, setDefaultImage, setDefaultImages, setDefaultModalParent, setDefaultOrientation, setExceptionHandler, setParentShell, setReturnCode, setShellStyle, setWindowManager

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Utility

      public Utility(org.eclipse.swt.widgets.Shell parentShell, String dialogTitle, org.eclipse.swt.graphics.Image dialogTitleImage, String dialogMessage, int dialogImageType, String[] dialogButtonLabels, int defaultIndex)
      Instantiates a new utility.
      Parameters:
      parentShell - the parent shell
      dialogTitle - the dialog title
      dialogTitleImage - the dialog title image
      dialogMessage - the dialog message
      dialogImageType - the dialog image type
      dialogButtonLabels - the dialog button labels
      defaultIndex - the default index
  • Method Details

    • popOkCancel

      public static int popOkCancel(String title, String message, int type)
      Pops up a warning message with an "OK" and "Cancel" button.
      Parameters:
      title - of the warning
      message - the message
      type - one of MessageDialog.NONE for a dialog with no image MessageDialog.ERROR for a dialog with an error image MessageDialog.INFORMATION for a dialog with an information image MessageDialog.QUESTION for a dialog with a question image MessageDialog.WARNING for a dialog with a warning image
      Returns:
      the int
    • popMessage

      public static void popMessage(String title, String message, int type)
      Pops up a warning message with an "OK" button.
      Parameters:
      title - of the warning
      message - the message
      type - one of MessageDialog.NONE for a dialog with no image MessageDialog.ERROR for a dialog with an error image MessageDialog.INFORMATION for a dialog with an information image MessageDialog.QUESTION for a dialog with a question image MessageDialog.WARNING for a dialog with a warning image
    • popMessage

      public static void popMessage(org.eclipse.swt.widgets.Widget w, String title, String message, int type)
      Pop message.
      Parameters:
      w - the w
      title - the title
      message - the message
      type - the type
    • popMessage

      public static int popMessage(String title, String message, int type, String[] buttons)
      Pop message.
      Parameters:
      title - the title
      message - the message
      type - the type
      buttons - the buttons
      Returns:
      the int
    • popMessage

      public static int popMessage(org.eclipse.swt.widgets.Shell parent, String title, String message, int type, String[] buttons)
      Pop message.
      Parameters:
      parent - the parent
      title - the title
      message - the message
      type - the type
      buttons - the buttons
      Returns:
      the int
    • popMessage

      public static int popMessage(org.eclipse.swt.widgets.Widget w, String title, String message, int type, String[] buttons)
      Pop message.
      Parameters:
      w - the w
      title - the title
      message - the message
      type - the type
      buttons - the buttons
      Returns:
      the int
    • removeElementFromArray

      public static Object[] removeElementFromArray(Object[] source, Object element, Class componentClass)
      remove element(s) (must be present) using == test.
      Parameters:
      source - the source
      element - the element
      componentClass - the component class
      Returns:
      a copy of the array with == element(s) removed
    • removeEqualElementFromArray

      public static Object[] removeEqualElementFromArray(Object[] source, Object element, Class componentClass)
      remove element(s) (must be present) using equals test.
      Parameters:
      source - the source
      element - the element
      componentClass - the component class
      Returns:
      a copy of the array with equal element(s) removed
    • removeElementsFromArray

      public static Object[] removeElementsFromArray(Object[] source, Object element, Class componentClass)
      Removes the elements from array.
      Parameters:
      source - the source
      element - the element
      componentClass - the component class
      Returns:
      the object[]
    • removeElementsFromArray

      public static Object[] removeElementsFromArray(Object[] source, Object element, Class componentClass, Comparator comp)
      Removes the elements from array.
      Parameters:
      source - the source
      element - the element
      componentClass - the component class
      comp - the comp
      Returns:
      the object[]
    • addElementToArray

      public static Object[] addElementToArray(Object[] source, Object element, Class componentClass)
      Adds the element to array.
      Parameters:
      source - the source
      element - the element
      componentClass - the component class
      Returns:
      the object[]
    • arrayContains

      public static boolean arrayContains(Object[] array, Object element)
      Array contains.
      Parameters:
      array - the array
      element - the element
      Returns:
      true, if successful