本文整理汇总了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;
}