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; }
@Override public void stop(BundleContext context) throws Exception { if (fConsoleManager != null) { IConsole[] consoles = fConsoleManager.getConsoles(); if (consoles != null) { fConsoleManager.removeConsoles(consoles); } } super.stop(context); }
/** * Initialize for existing consoles */ private void updateForExistingConsoles() { IConsoleManager manager = getConsoleManager(); // create pages for consoles IConsole[] consoles = manager.getConsoles(); consolesAdded(consoles); // add as a listener manager.addConsoleListener(this); }
@Override public void openConsole() { IOConsole console = getConsole(); IConsole[] existing = fConsoleManager.getConsoles(); boolean exists = false; for (IConsole existingConsole : existing) { if (console == existingConsole) exists = true; } if (!exists) fConsoleManager.addConsoles(new IConsole[] {console}); fConsoleManager.showConsoleView(console); }
public void openConsole() { if (fConsole == null) { fConsole = new JavaStackTraceConsole(); fConsole.initializeDocument(); fConsoleManager.addConsoles(new IConsole[]{fConsole}); } fConsoleManager.showConsoleView(fConsole); } }
@Override public Object[] getPages() { return getConsoleManager().getConsoles(); }
private ConsoleContext createOrGetConsole () { if ( this.parentController != null && this.parentController.getConsole () != null ) { return this.parentController.getConsole (); } final IConsoleManager manager = ConsolePlugin.getDefault ().getConsoleManager (); final MessageConsole messageConsole = new MessageConsole ( String.format ( "Symbol Debug Console: %s", this.symbolInfoName ), null, null, true ); manager.addConsoles ( new IConsole[] { messageConsole } ); this.createdConsole = messageConsole; return new ConsoleContext ( messageConsole ); }
public void closeConsole() { IConsoleManager manager = ConsolePlugin.getDefault().getConsoleManager(); manager.removeConsoles(new IConsole[] {this}); ConsolePlugin.getDefault().getConsoleManager().addConsoleListener(this.newLifecycle()); }
void closeConsole(OSGiConsole console) { synchronized (this) { if (console != fConsole) throw new IllegalArgumentException("Wrong console instance!"); //$NON-NLS-1$ fConsole = null; } fConsoleManager.removeConsoles(new IConsole[] {console}); } }
public BuildConsoleManager() { consoleByBuild = new HashMap<IBuild, BuildConsole>(); consoleManager = ConsolePlugin.getDefault().getConsoleManager(); consoleManager.addConsoleListener(listener); }
public void stop() { consoleManager.removeConsoleListener(listener); }
/** * 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); }
/** * Adds a hyperlink to this console. * * @param hyperlink the hyperlink to add * @param offset the offset in the console document at which the hyperlink should be added * @param length the length of the text which should be hyperlinked * @throws BadLocationException if the specified location is not valid. */ public void addHyperlink(IHyperlink hyperlink, int offset, int length) throws BadLocationException { IDocument document = getDocument(); ConsoleHyperlinkPosition hyperlinkPosition = new ConsoleHyperlinkPosition(hyperlink, offset, length); try { document.addPosition(ConsoleHyperlinkPosition.HYPER_LINK_CATEGORY, hyperlinkPosition); fConsoleManager.refresh(this); } catch (BadPositionCategoryException e) { ConsolePlugin.log(e); } }
public void showConsole() { boolean exists = false; IConsoleManager manager = ConsolePlugin.getDefault().getConsoleManager(); for(IConsole element : manager.getConsoles()) { if(this == element) { exists = true; } } if(!exists) { manager.addConsoles(new IConsole[] {this}); } manager.showConsoleView(this); }
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]; }
private void bringConsoleToFront() { if(PlatformUI.isWorkbenchRunning()) { IConsoleManager manager = ConsolePlugin.getDefault().getConsoleManager(); if(!isVisible()) { manager.addConsoles(new IConsole[] {this}); } manager.showConsoleView(this); } }
private ConsoleContext createOrGetConsole () { if ( this.parentController != null && this.parentController.getConsole () != null ) { return this.parentController.getConsole (); } final IConsoleManager manager = ConsolePlugin.getDefault ().getConsoleManager (); final MessageConsole messageConsole = new MessageConsole ( String.format ( "Symbol Debug Console: %s", this.symbolInfoName ), null, null, true ); manager.addConsoles ( new IConsole[] { messageConsole } ); this.createdConsole = messageConsole; return new ConsoleContext ( messageConsole ); }
public void run() { ConsolePlugin.getDefault().getConsoleManager().removeConsoles(new IConsole[]{fConsole}); } }
public JavaStackTraceConsoleFactory() { fConsoleManager = ConsolePlugin.getDefault().getConsoleManager(); fConsoleManager.addConsoleListener(new IConsoleListener() { public void consolesAdded(IConsole[] consoles) { } public void consolesRemoved(IConsole[] consoles) { for (int i = 0; i < consoles.length; i++) { if(consoles[i] == fConsole) { fConsole.saveDocument(); fConsole = null; } } } }); } /* (non-Javadoc)
public void consolesRemoved(IConsole[] consoles) { for (int i = 0; i < consoles.length; i++) { IConsole console = consoles[i]; if (console == AbstractConsole.this) { ConsolePlugin.getDefault().getConsoleManager().removeConsoleListener(this); destroy(); } } } }