/** * Returns the console manager. * * @return the console manager */ private IConsoleManager getConsoleManager() { return ConsolePlugin.getDefault().getConsoleManager(); }
public void consolesAdded(IConsole[] consoles) { Display display = ConsolePlugin.getStandardDisplay(); display.asyncExec(new Runnable() { public void run() { update(); } }); }
/** * Logs the specified status with this plug-in's log. * * @param status status to log */ public static void log(IStatus status) { getDefault().getLog().log(status); }
/** * Because the autoscroll value is in another plugin we must update the preference store manually */ protected void updateAutoScrollLockEditor() { autoScrollLockEditor.setPreferenceStore(ConsolePlugin.getDefault().getPreferenceStore()); autoScrollLockEditor.load(); }
private static MessageConsole findConsole(String name) { ConsolePlugin plugin = ConsolePlugin.getDefault(); IConsoleManager conMan = plugin.getConsoleManager(); IConsole[] existing = conMan.getConsoles(); for (int i = 0; i < existing.length; i++) if (name.equals(existing[i].getName())) return (MessageConsole) existing[i]; }
@Override public void run() { try { Point selection= fTextViewer.getTextWidget().getSelection(); IDocument document= fTextViewer.getDocument(); fLastLine= document.getLineOfOffset(document.getLength()) + 1; int startLine= selection == null ? 1 : fTextViewer.getTextWidget().getLineAtOffset(selection.x) + 1; String title= ConsoleMessages.TextViewerGotoLineAction_Go_To_Line_1; String message= MessageFormat.format(ConsoleMessages.TextViewerGotoLineAction_Enter_line_number__8, new Object[] {Integer.valueOf(fLastLine)}); String value= Integer.toString(startLine); Shell activeShell= fTextViewer.getTextWidget().getShell(); InputDialog d= new InputDialog(activeShell, title, message, value, new NumberValidator()); if (d.open() == Window.OK) { try { int line= Integer.parseInt(d.getValue()); gotoLine(line - 1); } catch (NumberFormatException x) { ConsolePlugin.errorDialog(activeShell, ConsoleMessages.TextViewerGotoLineAction_Go_To_Line_1, ConsoleMessages.TextViewerGotoLineAction_Exceptions_occurred_attempt_to_go_to_line_2, x); // } } } catch (BadLocationException x) { ConsolePlugin.errorDialog(fTextViewer.getTextWidget().getShell(), ConsoleMessages.TextViewerGotoLineAction_Go_To_Line_1, ConsoleMessages.TextViewerGotoLineAction_Exceptions_occurred_attempt_to_go_to_line_2, x); // return; } } }
private MessageConsole findConsole(String name) { ConsolePlugin plugin = ConsolePlugin.getDefault(); IConsoleManager conMan = plugin.getConsoleManager(); IConsole[] existing = conMan.getConsoles(); //if console exists, clear it for (int i = 0; i < existing.length; i++) if (name.equals(existing[i].getName())){ ((MessageConsole) existing[i]).clearConsole(); //this is the important part return myConsole; } myConsole = new MessageConsole(name, null); conMan.addConsoles(new IConsole[]{myConsole}); return myConsole; }
public void run() { try { Point selection= fTextViewer.getTextWidget().getSelection(); IDocument document= fTextViewer.getDocument(); fLastLine= document.getLineOfOffset(document.getLength()) + 1; int startLine= selection == null ? 1 : fTextViewer.getTextWidget().getLineAtOffset(selection.x) + 1; String title= ConsoleMessages.TextViewerGotoLineAction_Go_To_Line_1; String message= MessageFormat.format(ConsoleMessages.TextViewerGotoLineAction_Enter_line_number__8, new Object[] {new Integer(fLastLine)}); String value= Integer.toString(startLine); Shell activeShell= fTextViewer.getTextWidget().getShell(); InputDialog d= new InputDialog(activeShell, title, message, value, new NumberValidator()); if (d.open() == Window.OK) { try { int line= Integer.parseInt(d.getValue()); gotoLine(line - 1); } catch (NumberFormatException x) { ConsolePlugin.errorDialog(activeShell, ConsoleMessages.TextViewerGotoLineAction_Go_To_Line_1, ConsoleMessages.TextViewerGotoLineAction_Exceptions_occurred_attempt_to_go_to_line_2, x); // } } } catch (BadLocationException x) { ConsolePlugin.errorDialog(fTextViewer.getTextWidget().getShell(), ConsoleMessages.TextViewerGotoLineAction_Go_To_Line_1, ConsoleMessages.TextViewerGotoLineAction_Exceptions_occurred_attempt_to_go_to_line_2, x); // return; } } }
/** * Returns the console manager. * * @return the console manager */ private IConsoleManager getConsoleManager() { return ConsolePlugin.getDefault().getConsoleManager(); }
/** * Logs the specified status with this plug-in's log. * * @param status status to log */ public static void log(IStatus status) { getDefault().getLog().log(status); }
public void consolesRemoved(IConsole[] consoles) { Display display = ConsolePlugin.getStandardDisplay(); display.asyncExec(new Runnable() { public void run() { if (fMenu != null) { fMenu.dispose(); } update(); } }); } }
/** * Jumps to the line. */ protected void gotoLine(int line) { IDocument document= fTextViewer.getDocument(); try { int start= document.getLineOffset(line); int length= document.getLineLength(line); fTextViewer.getTextWidget().setSelection(start, start + length); fTextViewer.revealRange(start, length); } catch (BadLocationException x) { ConsolePlugin.errorDialog(fTextViewer.getTextWidget().getShell(), ConsoleMessages.TextViewerGotoLineAction_Go_To_Line_1, ConsoleMessages.TextViewerGotoLineAction_Exceptions_occurred_attempt_to_go_to_line_2, x); // } }
public OSGiConsoleFactory() { fConsoleManager = ConsolePlugin.getDefault().getConsoleManager(); }
public void setWaterMarks(int low, int high) { lowWaterMark = low; highWaterMark = high; ConsolePlugin.getStandardDisplay().asyncExec(new Runnable() { public void run() { checkBufferSize(); } }); }
/** * Jumps to the line. */ protected void gotoLine(int line) { IDocument document= fTextViewer.getDocument(); try { int start= document.getLineOffset(line); int length= document.getLineLength(line); fTextViewer.getTextWidget().setSelection(start, start + length); fTextViewer.revealRange(start, length); } catch (BadLocationException x) { ConsolePlugin.errorDialog(fTextViewer.getTextWidget().getShell(), ConsoleMessages.TextViewerGotoLineAction_Go_To_Line_1, ConsoleMessages.TextViewerGotoLineAction_Exceptions_occurred_attempt_to_go_to_line_2, x); // } }
/** * Shows this console in all console views. This console will be become visible * if another console is currently pinned. * * @since 3.1 */ public void activate() { ConsolePlugin.getDefault().getConsoleManager().showConsoleView(this); }
public void setWaterMarks(int low, int high) { lowWaterMark = low; highWaterMark = high; ConsolePlugin.getStandardDisplay().asyncExec(new Runnable() { @Override public void run() { checkBufferSize(); } }); }
/** * Shows this console in all console views. This console will be become visible * if another console is currently pinned. * * @since 3.1 */ public void activate() { ConsolePlugin.getDefault().getConsoleManager().showConsoleView(this); }
/** * makes the associated text widget uneditable. */ public void setReadOnly() { ConsolePlugin.getStandardDisplay().asyncExec(new Runnable() { public void run() { StyledText text = getTextWidget(); if (text != null && !text.isDisposed()) { text.setEditable(false); } } }); }
@Override public void run() { ConsolePlugin.getDefault().getConsoleManager().removeConsoles(new IConsole[]{fConsole}); } }