本文整理匯總了Java中org.eclipse.ui.console.MessageConsoleStream.setActivateOnWrite方法的典型用法代碼示例。如果您正苦於以下問題:Java MessageConsoleStream.setActivateOnWrite方法的具體用法?Java MessageConsoleStream.setActivateOnWrite怎麽用?Java MessageConsoleStream.setActivateOnWrite使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.ui.console.MessageConsoleStream
的用法示例。
在下文中一共展示了MessageConsoleStream.setActivateOnWrite方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getConsoleOutputStream
import org.eclipse.ui.console.MessageConsoleStream; //導入方法依賴的package包/類
public OutputStream getConsoleOutputStream(boolean isError) {
final MessageConsoleStream output = messageConsole.newMessageStream();
output.setActivateOnWrite(false);
final int colorId;
if (!isError) {
colorId = SWT.COLOR_BLACK;
} else {
colorId = SWT.COLOR_RED;
}
/* we must set the color in the UI thread */
Runnable runnable = new Runnable() {
public void run() {
org.eclipse.swt.graphics.Color color = Display.getCurrent()
.getSystemColor(colorId);
output.setColor(color);
}
};
Display.getDefault().syncExec(runnable);
return output;
}
示例2: get
import org.eclipse.ui.console.MessageConsoleStream; //導入方法依賴的package包/類
@Override
public CommandConsole get(String name, String title) throws IOException {
MessageConsole console = findConsole(name);
MessageConsoleStream stream = console.newMessageStream();
stream.setActivateOnWrite(true);
stream.write("*** " + title + " ***\n");
return new CommandConsoleImpl(console);
}
示例3: launchDeployJob
import org.eclipse.ui.console.MessageConsoleStream; //導入方法依賴的package包/類
private void launchDeployJob(IProject project, Credential credential)
throws IOException, CoreException {
AnalyticsPingManager.getInstance().sendPing(AnalyticsEvents.APP_ENGINE_DEPLOY,
analyticsDeployEventMetadataKey);
IPath workDirectory = createWorkDirectory();
DeployPreferences deployPreferences = getDeployPreferences(project);
DeployConsole messageConsole =
MessageConsoleUtilities.createConsole(getConsoleName(deployPreferences.getProjectId()),
new DeployConsole.Factory());
IConsoleManager consoleManager = ConsolePlugin.getDefault().getConsoleManager();
consoleManager.showConsoleView(messageConsole);
ConsoleColorProvider colorProvider = new ConsoleColorProvider();
MessageConsoleStream outputStream = messageConsole.newMessageStream();
MessageConsoleStream errorStream = messageConsole.newMessageStream();
outputStream.setActivateOnWrite(true);
errorStream.setActivateOnWrite(true);
outputStream.setColor(colorProvider.getColor(IDebugUIConstants.ID_STANDARD_OUTPUT_STREAM));
errorStream.setColor(colorProvider.getColor(IDebugUIConstants.ID_STANDARD_ERROR_STREAM));
StagingDelegate stagingDelegate = getStagingDelegate(project);
DeployJob deploy = new DeployJob(deployPreferences, credential, workDirectory,
outputStream, errorStream, stagingDelegate);
messageConsole.setJob(deploy);
deploy.addJobChangeListener(new JobChangeAdapter() {
@Override
public void done(IJobChangeEvent event) {
if (event.getResult().isOK()) {
AnalyticsPingManager.getInstance().sendPing(AnalyticsEvents.APP_ENGINE_DEPLOY_SUCCESS,
analyticsDeployEventMetadataKey);
}
launchCleanupJob();
}
});
deploy.schedule();
}
示例4: showConsole
import org.eclipse.ui.console.MessageConsoleStream; //導入方法依賴的package包/類
public static void showConsole(String consoleName, String content) throws IOException, PartInitException{
IWorkbenchPage page = PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getActivePage();
MessageConsole console = ConsoleHelper
.findConsole(consoleName);
MessageConsoleStream out = console.newMessageStream();
out.println(content);
out.setActivateOnWrite(true);
out.setColor(Display.getDefault().getSystemColor(SWT.COLOR_BLUE));
out.close();
IConsoleView view = (IConsoleView) page.showView(IConsoleConstants.ID_CONSOLE_VIEW);
view.display(console);
}
示例5: printToConsole
import org.eclipse.ui.console.MessageConsoleStream; //導入方法依賴的package包/類
/**
* 向控製台打印一條信息,並激活控製台
* @param message
* @param activate 是否激活控製台
*/
public static void printToConsole(String message,boolean activate){
MessageConsoleStream printer = ConsoleFactory.getConsole().newMessageStream();
printer.setActivateOnWrite(activate);
printer.println(message);
}