本文整理汇总了Java中org.eclipse.core.runtime.IStatus.INFO属性的典型用法代码示例。如果您正苦于以下问题:Java IStatus.INFO属性的具体用法?Java IStatus.INFO怎么用?Java IStatus.INFO使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.core.runtime.IStatus
的用法示例。
在下文中一共展示了IStatus.INFO属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: mapLevel
private int mapLevel(Level level) {
switch (level.toInt()) {
case Priority.DEBUG_INT:
case Priority.INFO_INT:
return IStatus.INFO;
case Priority.WARN_INT:
return IStatus.WARNING;
case Priority.ERROR_INT:
case Priority.FATAL_INT:
return IStatus.ERROR;
default:
return IStatus.INFO;
}
}
示例2: applyToStatusLine
/** copied from PropertyAndPreferencePage */
private static void applyToStatusLine(DialogPage page, IStatus status) {
String message = status.getMessage();
if (message != null && message.length() == 0) {
message = null;
}
switch (status.getSeverity()) {
case IStatus.OK:
page.setMessage(message, IMessageProvider.NONE);
page.setErrorMessage(null);
break;
case IStatus.WARNING:
page.setMessage(message, IMessageProvider.WARNING);
page.setErrorMessage(null);
break;
case IStatus.INFO:
page.setMessage(message, IMessageProvider.INFORMATION);
page.setErrorMessage(null);
break;
default:
page.setMessage(null);
page.setErrorMessage(message);
break;
}
}
示例3: makeStatus
private IStatus makeStatus ( final Connection connection, final ConnectionState state, final Throwable error )
{
int severity;
String message;
if ( error != null )
{
message = ExceptionHelper.getMessage ( error );
severity = IStatus.ERROR;
}
else if ( state == ConnectionState.CLOSED )
{
message = "Connection closed";
severity = IStatus.WARNING;
}
else
{
message = String.format ( "State changed: %s", state );
severity = IStatus.INFO;
}
return new Status ( severity, Activator.PLUGIN_ID, message, error );
}
示例4: publish
@Override
public void publish(LogRecord record) {
if (!isLoggable(record)) {
return;
}
int severity = IStatus.INFO;
if (record.getLevel() == Level.SEVERE) {
severity = IStatus.ERROR;
} else if (record.getLevel() == Level.WARNING) {
severity = IStatus.WARNING;
}
IStatus status = new Status(severity, record.getLoggerName(), record.getMessage(), record.getThrown());
Platform.getLog(JavaDebuggerServerPlugin.context.getBundle()).log(status);
}
示例5: validateScript
protected IStatus validateScript ( final Object value )
{
this.script = null;
try
{
this.script = makeScript ( value );
}
catch ( final Exception e )
{
return new Status ( IStatus.ERROR, Activator.PLUGIN_ID, ExceptionHelper.getMessage ( e ) );
}
return new Status ( IStatus.INFO, Activator.PLUGIN_ID, "Enter a Java script fragment which returns the new name of each item" );
}
示例6: testLogInfo
@Test
public void testLogInfo() throws Exception {
ILog log = Activator.getDefault().getLog();
String [] msg = new String [] {"",""};
ILogListener listener = new ILogListener() {
@Override
public void logging(IStatus status, String plugin) {
msg [0] = status.getMessage();
if (status.getSeverity()==IStatus.INFO) {
msg [1] = "info";
}
}
};
log.addLogListener(listener);
IJavaProject jp = null;
try {
jp = ProjectHelper.getOrCreateSimpleGW4EProject(PROJECT_NAME, false, false);
PreferenceManager.setLogInfoEnabled (jp.getProject().getName(),true);
ResourceManager.logInfo(jp.getProject().getName(), "infomessage");
assertEquals("infomessage",msg [0]);
assertEquals("info",msg [1]);
} finally {
PreferenceManager.setLogInfoEnabled (jp.getProject().getName(),false);
log.removeLogListener(listener);
}
}