本文整理匯總了Java中org.eclipse.ui.statushandlers.StatusManager.getManager方法的典型用法代碼示例。如果您正苦於以下問題:Java StatusManager.getManager方法的具體用法?Java StatusManager.getManager怎麽用?Java StatusManager.getManager使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.ui.statushandlers.StatusManager
的用法示例。
在下文中一共展示了StatusManager.getManager方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: handle
import org.eclipse.ui.statushandlers.StatusManager; //導入方法依賴的package包/類
@Override
public void handle(CoreException e) {
if(e.getStatus() != null ){
handle(e.getStatus());
}else{
StatusManager platformStatusMgr = StatusManager.getManager();
platformStatusMgr.handle(e,e.getStatus().getPlugin());
}
}
示例2: handleErrors
import org.eclipse.ui.statushandlers.StatusManager; //導入方法依賴的package包/類
/**
* Handle special error output cases for the compiler.
*
* @return true if no errors are present, false otherwise
*/
private static boolean handleErrors(String line) {
StatusManager manager = StatusManager.getManager();
// special case for missing checkers.jar (or processor class)
Matcher procMatcher = noProcessorPattern.matcher(line);
if (procMatcher.matches()) {
CheckerErrorStatus status;
if (procMatcher.group(1).equals("''")) {
status = new CheckerErrorStatus(
"No checkers configured. Use the plugin preferences to configure checkers to use.");
} else {
status = new CheckerErrorStatus(
"Annotation processor "
+ procMatcher.group(1)
+ " could not be found. Try adding checkers.jar to your project build path.");
}
manager.handle(status, StatusManager.SHOW);
return false;
}
// Misc errors that prevent compiler from running:
Matcher flagMatcher = invalidFlagPattern.matcher(line);
if (flagMatcher.matches()) {
manager.handle(new CheckerErrorStatus("Invalid compiler flag: "
+ flagMatcher.group(1)
+ ". Check your preferences for invalid flags."),
StatusManager.SHOW);
return false;
}
Matcher missingFileMatcher = missingFilePattern.matcher(line);
if (missingFileMatcher.matches()) {
manager.handle(new CheckerErrorStatus("Cannot find file: "
+ missingFileMatcher.group(1)
+ ". You may have malformed input in your preferences."),
StatusManager.SHOW);
return false;
}
return true;
}
示例3: reportError
import org.eclipse.ui.statushandlers.StatusManager; //導入方法依賴的package包/類
public static void reportError(String message, Exception cause) {
IStatus status = new Status(IStatus.ERROR, PLUGIN_ID, message, cause);
StatusManager statusManager = StatusManager.getManager();
statusManager.handle(status, StatusManager.LOG);
statusManager.handle(status, StatusManager.BLOCK);
}