/** * Connects the given stream monitor to a new output stream with the given identifier. * * @param streamMonitor stream monitor * @param streamIdentifier stream identifier * @param activateOnWrite whether the stream should displayed when written to */ @SuppressWarnings("resource") private void connect(IStreamMonitor streamMonitor, String streamIdentifier, boolean activateOnWrite) { IOConsoleOutputStream stream = null; if (fAllocateConsole) { stream = newOutputStream(); Color color = fColorProvider.getColor(streamIdentifier); stream.setColor(color); stream.setActivateOnWrite(activateOnWrite); } synchronized (streamMonitor) { StreamListener listener = new StreamListener(streamIdentifier, streamMonitor, stream); fStreamListeners.add(listener); } }
@Override public void propertyChange(PropertyChangeEvent event) { final String streamId = getStreamId(event.getProperty()); if (streamId != null) { AntUIPlugin.getStandardDisplay().asyncExec(() -> { IOConsoleOutputStream stream = getConsole().getStream(streamId); if (stream != null) { stream.setColor(getColor(streamId)); } }); } }
IOConsoleOutputStream stream = getStream(IDebugUIConstants.ID_STANDARD_OUTPUT_STREAM); if (stream != null) { stream.setColor(fColorProvider.getColor(IDebugUIConstants.ID_STANDARD_OUTPUT_STREAM)); IOConsoleOutputStream stream = getStream(IDebugUIConstants.ID_STANDARD_ERROR_STREAM); if (stream != null) { stream.setColor(fColorProvider.getColor(IDebugUIConstants.ID_STANDARD_ERROR_STREAM));
protected void initializeConsoleStreams(Display display) { if(!initialized) { setCommandStream(newOutputStream()); setErrorStream(newOutputStream()); setMessageStream(newOutputStream()); // TODO convert this to use themes // install colors commandColor = new Color(display, new RGB(0, 0, 0)); messageColor = new Color(display, new RGB(0, 0, 255)); errorColor = new Color(display, new RGB(255, 0, 0)); getCommandStream().setColor(commandColor); getMessageStream().setColor(messageColor); getErrorStream().setColor(errorColor); // install font setFont(JFaceResources.getFontRegistry().get("pref_console_font")); //$NON-NLS-1$ initialized = true; } }