當前位置: 首頁>>代碼示例>>Java>>正文


Java JFaceResources.format方法代碼示例

本文整理匯總了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);
}
 
開發者ID:Transkribus,項目名稱:TranskribusSwtGui,代碼行數:41,代碼來源:ExceptionDetailsErrorDialog.java

示例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;
}
 
開發者ID:OpenSoftwareSolutions,項目名稱:PDFReporter-Studio,代碼行數:41,代碼來源:DataAdapterErrorDialog.java


注:本文中的org.eclipse.jface.resource.JFaceResources.format方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。