Class Utility
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
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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
-
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 shelldialogTitle
- the dialog titledialogTitleImage
- the dialog title imagedialogMessage
- the dialog messagedialogImageType
- the dialog image typedialogButtonLabels
- the dialog button labelsdefaultIndex
- the default index
-
-
Method Details
-
popOkCancel
Pops up a warning message with an "OK" and "Cancel" button.- Parameters:
title
- of the warningmessage
- the messagetype
- 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
Pops up a warning message with an "OK" button.- Parameters:
title
- of the warningmessage
- the messagetype
- 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 wtitle
- the titlemessage
- the messagetype
- the type
-
popMessage
Pop message.- Parameters:
title
- the titlemessage
- the messagetype
- the typebuttons
- 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 parenttitle
- the titlemessage
- the messagetype
- the typebuttons
- 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 wtitle
- the titlemessage
- the messagetype
- the typebuttons
- 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 sourceelement
- the elementcomponentClass
- 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 sourceelement
- the elementcomponentClass
- 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 sourceelement
- the elementcomponentClass
- 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 sourceelement
- the elementcomponentClass
- the component classcomp
- the comp- Returns:
- the object[]
-
addElementToArray
Adds the element to array.- Parameters:
source
- the sourceelement
- the elementcomponentClass
- the component class- Returns:
- the object[]
-
arrayContains
Array contains.- Parameters:
array
- the arrayelement
- the element- Returns:
- true, if successful
-