本文整理匯總了Java中org.eclipse.jface.resource.JFaceResources.format方法的典型用法代碼示例。如果您正苦於以下問題:Java JFaceResources.format方法的具體用法?Java JFaceResources.format怎麽用?Java JFaceResources.format使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.jface.resource.JFaceResources
的用法示例。
在下文中一共展示了JFaceResources.format方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: ExceptionDetailsErrorDialog
import org.eclipse.jface.resource.JFaceResources; //導入方法依賴的package包/類
/**
* Creates an error dialog. Note that the dialog will have no visual
* representation (no widgets) until it is told to open.
* <p>
* Normally one should use <code>openError</code> to create and open one
* of these. This constructor is useful only if the error object being
* displayed contains child items <it>and </it> you need to specify a mask
* which will be used to filter the displaying of these children.
* </p>
*
* @param parentShell
* the shell under which to create this dialog
* @param dialogTitle
* the title to use for this dialog, or <code>null</code> to
* indicate that the default title should be used
* @param message
* the message to show in this dialog, or <code>null</code> to
* indicate that the error's message should be shown as the
* primary message
* @param status
* the error to show to the user
* @param displayMask
* the mask to use to filter the displaying of child items, as
* per <code>IStatus.matches</code>
* @see org.eclipse.core.runtime.IStatus#matches(int)
*/
public ExceptionDetailsErrorDialog(Shell parentShell, String dialogTitle, String message,
IStatus status, int displayMask) {
super(parentShell);
this.title = dialogTitle == null ? JFaceResources
.getString("Problem_Occurred") : //$NON-NLS-1$
dialogTitle;
this.message = message == null ? status.getMessage()
: JFaceResources
.format(
"Reason", new Object[] { message, status.getMessage() }); //$NON-NLS-1$
this.status = status;
this.displayMask = displayMask;
setShellStyle(getShellStyle() | SWT.RESIZE);
}
示例2: DataAdapterErrorDialog
import org.eclipse.jface.resource.JFaceResources; //導入方法依賴的package包/類
/**
* Creates an error dialog. Note that the dialog will have no visual
* representation (no widgets) until it is told to open.
* <p>
* Normally one should use <code>openError</code> to create and open one
* of these. This constructor is useful only if the error object being
* displayed contains child items <it>and </it> you need to specify a mask
* which will be used to filter the displaying of these children. The error
* dialog will only be displayed if there is at least one child status
* matching the mask.
* </p>
*
* @param parentShell
* the shell under which to create this dialog
* @param dialogTitle
* the title to use for this dialog, or <code>null</code> to
* indicate that the default title should be used
* @param message
* the message to show in this dialog, or <code>null</code> to
* indicate that the error's message should be shown as the
* primary message
* @param status
* the error to show to the user
* @param displayMask
* the mask to use to filter the displaying of child items, as
* per <code>IStatus.matches</code>
* @see org.eclipse.core.runtime.IStatus#matches(int)
*/
public DataAdapterErrorDialog(Shell parentShell, String dialogTitle, String message,
IStatus status) {
super(parentShell);
this.title = dialogTitle == null ? JFaceResources
.getString("Problem_Occurred") : //$NON-NLS-1$
dialogTitle;
this.message = message == null ? status.getMessage()
: JFaceResources
.format(
"Reason", new Object[] { message, status.getMessage() }); //$NON-NLS-1$
this.status = status;
}