|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfable.framework.toolbox.SWTUtils
public class SWTUtils
Field Summary | |
---|---|
static java.lang.String |
LS
|
Constructor Summary | |
---|---|
SWTUtils()
|
Method Summary | |
---|---|
static java.lang.String |
convertText(java.lang.String string)
If the SWT Text DELIMITER is CRLF, then it converts LF not preceeded by CR to DELIMITER. |
static java.awt.image.BufferedImage |
convertToAWT(org.eclipse.swt.graphics.ImageData data)
Converts an SWT ImageData to an AWT BufferedImage. |
static org.eclipse.swt.graphics.ImageData |
convertToSWT(java.awt.image.BufferedImage bufferedImage)
Converts an AWT BufferedImage to an SWT ImageData. |
static org.eclipse.ui.IEditorInput |
createEditorInput(java.io.File file)
Creates a new IEditorInput from a File. |
static void |
createFileFromIFile(org.eclipse.core.resources.IFile fileHandle,
java.io.InputStream contents,
org.eclipse.core.runtime.IProgressMonitor monitor)
Creates a file resource given the file handle and contents. |
static void |
enableControlTree(org.eclipse.swt.widgets.Control control,
boolean enabled)
Recursively enables or disables this control and all its children. |
static void |
errMsg(org.eclipse.swt.widgets.Shell shell,
java.lang.String msg)
Displays an error MessageDialog. |
static void |
errMsg(java.lang.String msg)
Displays an error MessageDialog. |
static void |
errMsgAsync(org.eclipse.swt.widgets.Shell shell,
java.lang.String msg)
Displays an error MessageDialog using asyncExec. |
static void |
errMsgAsync(java.lang.String msg)
Same as errMsgAsync(null, msg). |
static void |
excMsg(org.eclipse.swt.widgets.Shell shell,
java.lang.String msg,
java.lang.Exception ex)
Displays an exception MessageDialog. |
static void |
excMsg(java.lang.String msg,
java.lang.Exception ex)
Displays an exception MessageDialog. |
static void |
excMsgAsync(org.eclipse.swt.widgets.Shell shell,
java.lang.String msg,
java.lang.Exception ex)
Displays an exception MessageDialog using asyncExec. |
static void |
excMsgAsync(java.lang.String msg,
java.lang.Exception ex)
Displays an exception MessageDialog using asyncExec. |
static void |
excTraceMsg(org.eclipse.swt.widgets.Shell shell,
java.lang.String msg,
java.lang.Exception ex)
Displays an exception ExceptionMessageDialog. |
static void |
excTraceMsg(java.lang.String msg,
java.lang.Exception ex)
Displays an ExceptionMessageDialog. |
static void |
excTraceMsgAsync(org.eclipse.swt.widgets.Shell shell,
java.lang.String msg,
java.lang.Exception ex)
Displays an ExceptionMessageDialog using asyncExec. |
static void |
excTraceMsgAsync(java.lang.String msg,
java.lang.Exception ex)
Displays an ExceptionMessageDialog using asyncExec. |
static org.eclipse.core.resources.IFile |
getFile(org.eclipse.ui.IEditorInput editorInput)
From the IMP project. |
static java.lang.String |
getNameExtension(org.eclipse.ui.IEditorInput editorInput)
|
static org.eclipse.core.runtime.IPath |
getPath(org.eclipse.ui.IEditorInput editorInput)
Returns the IPath for a variety of IEditorInput's. |
static int |
getTextWidth(org.eclipse.swt.widgets.Text text,
int cols)
Finds the width for a Text control given the number of columns desired. |
static void |
infoMsg(org.eclipse.swt.widgets.Shell shell,
java.lang.String msg)
Displays an information MessageDialog. |
static void |
infoMsg(java.lang.String msg)
Displays an information MessageDialog. |
static void |
infoMsgAsync(org.eclipse.swt.widgets.Shell shell,
java.lang.String msg)
Displays an information MessageDialog using asyncExec. |
static void |
infoMsgAsync(java.lang.String msg)
Same as infoMsgAsync(null, msg). |
static java.lang.String |
timeStamp()
Generates a timestamp. |
static java.lang.String |
timeStamp(java.lang.String pattern)
Generates a timestamp given a pattern |
static boolean |
tryToOpenExternalFileEditor(java.lang.String fileName)
Tries to open an editor on the given external file. |
static boolean |
tryToOpenWorkspaceFileEditor(java.lang.String fileName,
java.lang.String editorID)
Checks if the file is in the workspace. |
static boolean |
tryToRefreshProject(java.lang.String fileName)
Checks if the file is in the workspace. |
static void |
warnMsg(org.eclipse.swt.widgets.Shell shell,
java.lang.String msg)
Displays a warning MessageDialog. |
static void |
warnMsg(java.lang.String msg)
Displays a warning MessageDialog. |
static void |
warnMsgAsync(org.eclipse.swt.widgets.Shell shell,
java.lang.String msg)
Displays a warning MessageDialog using asyncExec. |
static void |
warnMsgAsync(java.lang.String msg)
Displays a warning MessageDialog using asyncExec. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String LS
Constructor Detail |
---|
public SWTUtils()
Method Detail |
---|
public static java.lang.String timeStamp()
public static java.lang.String timeStamp(java.lang.String pattern)
pattern
- appropriate for SimpleDateFormat
public static void errMsg(java.lang.String msg)
msg
- public static void errMsg(org.eclipse.swt.widgets.Shell shell, java.lang.String msg)
shell
- Can be null.msg
- public static void errMsgAsync(java.lang.String msg)
msg
- public static void errMsgAsync(org.eclipse.swt.widgets.Shell shell, java.lang.String msg)
shell
- Can be null.msg
- public static void warnMsg(java.lang.String msg)
msg
- public static void warnMsg(org.eclipse.swt.widgets.Shell shell, java.lang.String msg)
shell
- Can be null.msg
- public static void warnMsgAsync(java.lang.String msg)
msg
- public static void warnMsgAsync(org.eclipse.swt.widgets.Shell shell, java.lang.String msg)
shell
- Can be null.msg
- public static void infoMsg(java.lang.String msg)
msg
- public static void infoMsg(org.eclipse.swt.widgets.Shell shell, java.lang.String msg)
shell
- Can be null.msg
- public static void infoMsgAsync(java.lang.String msg)
msg
- public static void infoMsgAsync(org.eclipse.swt.widgets.Shell shell, java.lang.String msg)
shell
- Can be null.msg
- public static void excMsg(java.lang.String msg, java.lang.Exception ex)
msg
- The first part of the message, to which exception information
is added.ex
- public static void excMsg(org.eclipse.swt.widgets.Shell shell, java.lang.String msg, java.lang.Exception ex)
shell
- Can be null.msg
- The first part of the message, to which exception information
is added.ex
- public static void excMsgAsync(java.lang.String msg, java.lang.Exception ex)
msg
- The first part of the message, to which exception information
is added.ex
- public static void excMsgAsync(org.eclipse.swt.widgets.Shell shell, java.lang.String msg, java.lang.Exception ex)
shell
- Can be null.msg
- The first part of the message, to which exception information
is added.ex
- public static void excTraceMsg(java.lang.String msg, java.lang.Exception ex)
msg
- The first part of the message, to which exception information
is added.ex
- public static void excTraceMsg(org.eclipse.swt.widgets.Shell shell, java.lang.String msg, java.lang.Exception ex)
shell
- Can be null.msg
- The first part of the message, to which exception information
is added.ex
- public static void excTraceMsgAsync(java.lang.String msg, java.lang.Exception ex)
msg
- The first part of the message, to which exception information
is added.ex
- public static void excTraceMsgAsync(org.eclipse.swt.widgets.Shell shell, java.lang.String msg, java.lang.Exception ex)
shell
- Can be null.msg
- The first part of the message, to which exception information
is added.ex
- public static java.lang.String convertText(java.lang.String string)
string
- The string to convert.
public static void createFileFromIFile(org.eclipse.core.resources.IFile fileHandle, java.io.InputStream contents, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
fileHandle
- the file handle to create a file resource withcontents
- the initial contents of the new file resource, or
null
if none (equivalent to an empty stream)monitor
- the progress monitor to show visual progress with
org.eclipse.core.runtime.CoreException
- if the operation fails
org.eclipse.core.runtime.OperationCanceledException
- if the operation is canceledpublic static org.eclipse.core.runtime.IPath getPath(org.eclipse.ui.IEditorInput editorInput)
public static org.eclipse.core.resources.IFile getFile(org.eclipse.ui.IEditorInput editorInput)
public static java.lang.String getNameExtension(org.eclipse.ui.IEditorInput editorInput)
public static void enableControlTree(org.eclipse.swt.widgets.Control control, boolean enabled)
control
- Control to be enabled or disabled.enabled
- Whether to enable or disable.public static java.awt.image.BufferedImage convertToAWT(org.eclipse.swt.graphics.ImageData data)
bufferedImage
-
public static org.eclipse.swt.graphics.ImageData convertToSWT(java.awt.image.BufferedImage bufferedImage)
bufferedImage
-
public static int getTextWidth(org.eclipse.swt.widgets.Text text, int cols)
text
- cols
-
public static org.eclipse.ui.IEditorInput createEditorInput(java.io.File file)
file
-
public static boolean tryToRefreshProject(java.lang.String fileName)
fileName
- The name of the file.
public static boolean tryToOpenWorkspaceFileEditor(java.lang.String fileName, java.lang.String editorID)
fileName
- The name of the file.editorID
- The ID of the editor to open; e.g.,
"org.eclipse.ui.DefaultTextEditor"
public static boolean tryToOpenExternalFileEditor(java.lang.String fileName)
fileName
- External file name.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |