当前位置: 首页>>代码示例>>Java>>正文


Java IStatus.INFO属性代码示例

本文整理汇总了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;
	}
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:17,代码来源:EclipseLogAppender.java

示例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;
	}
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:25,代码来源:AbstractN4JSPreferencePage.java

示例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 );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:22,代码来源:ConnectionManager.java

示例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);
}
 
开发者ID:Microsoft,项目名称:java-debug,代码行数:16,代码来源:JdtLogHandler.java

示例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" );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:15,代码来源:ScriptPage.java

示例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);
	}
	
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:27,代码来源:ResourceManagerTest.java


注:本文中的org.eclipse.core.runtime.IStatus.INFO属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。