本文整理匯總了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);
}
};
}
示例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);
}
示例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);
}