public boolean checkClangFormat(String clangformat) { if (clangformat == null) { err.println("clang-format is not specified."); return false; } File file = new File(clangformat); if (!file.exists()) { err.println("clang-format (" + clangformat + ") does not exist."); return false; } if (!file.canExecute()) { err.println("clang-format (" + clangformat + ") is not executable."); return false; } return true; }
/** * Returns a new message stream connected to this console. * <p> * Clients should avoid writing large amounts of output to this stream in the UI * thread. The console needs to process the output in the UI thread and if the client * hogs the UI thread writing output to the console, the console will not be able * to process the output. * </p> * @return a new message stream connected to this console */ public MessageConsoleStream newMessageStream() { return new MessageConsoleStream(this); }
public ConsoleContext ( final MessageConsole messageConsole ) { this.writerStream = messageConsole.newMessageStream (); final MessageConsoleStream errorStream = messageConsole.newMessageStream (); errorStream.setColor ( Display.getDefault ().getSystemColor ( SWT.COLOR_RED ) ); this.errorPrintWriter = new PrintWriter ( new OutputStreamWriter ( errorStream ) ); this.logStream = messageConsole.newMessageStream (); this.logStream.setColor ( Display.getDefault ().getSystemColor ( SWT.COLOR_GRAY ) ); }
/** * Appends the specified message to this stream, followed by a line * separator string. * * @param message message to print */ public void println(String message) { print(message + "\n"); //$NON-NLS-1$ }
/** * Appends the specified message to this stream. * * @param message message to append */ public void print(String message) { try { write(message); } catch (IOException e) { ConsolePlugin.log(e); } }
@Override public void handle(BuildOutputEvent event, IOperationMonitor monitor) throws IOException, CoreException { BufferedReader reader = event.getInput(); String line; while ((line = reader.readLine()) != null) { if (stream.isClosed()) { throw new OperationCanceledException(); } stream.println(line); } }
public ConsoleContext ( final MessageConsole messageConsole ) { this.writerStream = messageConsole.newMessageStream (); final MessageConsoleStream errorStream = messageConsole.newMessageStream (); errorStream.setColor ( Display.getDefault ().getSystemColor ( SWT.COLOR_RED ) ); this.errorPrintWriter = new PrintWriter ( new OutputStreamWriter ( errorStream ) ); this.logStream = messageConsole.newMessageStream (); this.logStream.setColor ( Display.getDefault ().getSystemColor ( SWT.COLOR_GRAY ) ); }
/** * Appends the specified message to this stream, followed by a line * separator string. * * @param message message to print */ public void println(String message) { print(message + "\n"); //$NON-NLS-1$ }
/** * Appends a line separator string to this stream. */ public void println() { try { write("\n"); //$NON-NLS-1$ } catch (IOException e) { ConsolePlugin.log(e); } }
@Override public void run() { err.setColor(new Color(getStandardDisplay(), new RGB(255, 0, 0))); }; });
/** * Appends the specified message to this stream. * * @param message message to append */ public void print(String message) { try { write(message); } catch (IOException e) { ConsolePlugin.log(e); } }
/** * Returns a new message stream connected to this console. * <p> * Clients should avoid writing large amounts of output to this stream in the UI * thread. The console needs to process the output in the UI thread and if the client * hogs the UI thread writing output to the console, the console will not be able * to process the output. * </p> * @return a new message stream connected to this console */ public MessageConsoleStream newMessageStream() { return new MessageConsoleStream(this); }
public void debugLog ( final String string ) { this.console.getLogStream ().println ( string ); }
/** * Appends a line separator string to this stream. */ public void println() { try { write("\n"); //$NON-NLS-1$ } catch (IOException e) { ConsolePlugin.log(e); } }
public void debugLog ( final String string ) { this.console.getLogStream ().println ( string ); }