當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。