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


Java StatusManager.BLOCK屬性代碼示例

本文整理匯總了Java中org.eclipse.ui.statushandlers.StatusManager.BLOCK屬性的典型用法代碼示例。如果您正苦於以下問題:Java StatusManager.BLOCK屬性的具體用法?Java StatusManager.BLOCK怎麽用?Java StatusManager.BLOCK使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.eclipse.ui.statushandlers.StatusManager的用法示例。


在下文中一共展示了StatusManager.BLOCK屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getWorkbenchErrorHandler

@Override
public synchronized AbstractStatusHandler getWorkbenchErrorHandler() {
	return new WorkbenchErrorHandler() {
		@Override
		public void handle(StatusAdapter statusAdapter, int style) {
			if (isClosing) {
				// we are shutting down, so just log
				WorkbenchPlugin.log(statusAdapter.getStatus());
				return;
			}
			if ((style & StatusManager.SHOW) != 0) {
				style = style | StatusManager.BLOCK;
			}
			super.handle(statusAdapter, style);
		}
	};
}
 
開發者ID:nasa,項目名稱:OpenSPIFe,代碼行數:17,代碼來源:EnsembleWorkbenchAdvisor.java

示例2: print

/**
 * Prints an exception.
 * 
 * @param message
 *            The exception message.
 * @param e
 *            The exception or error.
 */
public static void print(int severity, @NonNull String message, @Nullable Throwable e) {

	IStatus status = (e == null) ?
		new Status(severity, MMINTActivator.PLUGIN_ID, message) :
		new Status(severity, MMINTActivator.PLUGIN_ID, message, e);
	int style;
	switch (severity) {
		case IStatus.WARNING:
			style = StatusManager.LOG;
			break;
		case IStatus.ERROR:
			style = StatusManager.BLOCK | StatusManager.LOG;
			break;
		default:
			style = StatusManager.LOG;
	}
	StatusManager.getManager().handle(status, style);
}
 
開發者ID:adisandro,項目名稱:MMINT,代碼行數:26,代碼來源:MMINTException.java

示例3: reportError

public static void reportError(Throwable t) {
    Throwable cause = t.getCause();
    if (cause != null && cause != t) {
        reportError(cause);
        return;
    }

    boolean showCustomErrorMessageDialog = false;
    int style = StatusManager.LOG;
    String title = "Error";
    String message = t.getLocalizedMessage();
    if (t instanceof KeeperException) {

        KeeperException ke = (KeeperException) t;

        title = "ZooKeeper Error";
        showCustomErrorMessageDialog = true;

        if (ke instanceof InvalidACLException) {
            title = "Invalid ACL";
            message = "ACL is invalid for '" + ke.getPath() + "'.";
        }
        else if (ke instanceof NodeExistsException) {
            title = "Znode Exists";
            message = "Znode '" + ke.getPath() + "' already exists.";
        }
        else if (ke instanceof NoAuthException) {
            title = "Not Authorized";
            message = "Not authorized to perform this action on '" + ke.getPath() + "'.";
        }
        else if (ke instanceof NoNodeException) {
            title = "No Znode";
            message = "Znode '" + ke.getPath() + "' does not exist.";
        }
        else if (ke instanceof NotEmptyException) {
            title = "Not Empty";
            message = "Znode '" + ke.getPath() + "' has children.";
        }

    }

    if (showCustomErrorMessageDialog) {
        MessageDialog.openError(Display.getCurrent().getActiveShell(), title, message);
    }
    else {
        style = style | StatusManager.BLOCK;
    }

    Status status = new Status(IStatus.ERROR, PLUGIN_ID, message, t);
    StatusManager.getManager().handle(status, style);
}
 
開發者ID:baloise,項目名稱:eZooKeeper,代碼行數:51,代碼來源:ZooKeeperActivator.java


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