/** * Disposes this console. This method should only be called by clients managing a * console's lifecycle, otherwise this method will be called automatically when this * console is removed from the console manager. The method is called once to dispose * this console, after which this console will no longer be used. * * @since 3.1 */ public final void destroy() { dispose(); }
/** * Sets the image descriptor for this console to the specified value and notifies * property listeners of the change. * * @param imageDescriptor the new image descriptor */ protected void setImageDescriptor(ImageDescriptor imageDescriptor) { ImageDescriptor old = fImageDescriptor; fImageDescriptor =imageDescriptor; firePropertyChange(this, IBasicPropertyConstants.P_IMAGE, old, imageDescriptor); }
/** * Initializes this console. This method should only be called by clients managing a * console's lifecycle, otherwise this method will be called automatically when this console * is added to the console manager. The method is called once to initialize this console, * marking the beginning of its lifecycle. * * @since 3.1 */ public final void initialize() { init(); }
/** * Constructs a new console with the given name, type, image and lifecycle. * * @param name console name, cannot be <code>null</code> * @param type console type identifier or <code>null</code> * @param imageDescriptor image descriptor, or <code>null</code> if none * @param autoLifecycle whether this console's lifecycle methods should be called * automatically when it is added (<code>initialize()</code>) and removed * (<code>destroy()</code>) from the console manager. When <code>false</code>, * clients are responsible for calling the lifecycle methods. * @since 3.1 */ public AbstractConsole(String name, String type, ImageDescriptor imageDescriptor, boolean autoLifecycle) { setName(name); setType(type); setImageDescriptor(imageDescriptor); if (autoLifecycle) { ConsolePlugin.getDefault().getConsoleManager().addConsoleListener(new Lifecycle()); } }
protected void updateHelp() { IConsole console = getConsole(); String helpContextId = null; if (console instanceof AbstractConsole) { AbstractConsole abs = (AbstractConsole) console; helpContextId = abs.getHelpContextId(); } if (helpContextId == null) { helpContextId = IConsoleHelpContextIds.CONSOLE_VIEW; } PlatformUI.getWorkbench().getHelpSystem().setHelp(getPageBook().getParent(), helpContextId); }
@Override public void consolesAdded(IConsole[] consoles) { for (int i = 0; i < consoles.length; i++) { IConsole console = consoles[i]; if (console == AbstractConsole.this) { initialize(); } } }
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(); } } } }
/** * Constructs a new console with the given name, type, image and lifecycle. * * @param name console name, cannot be <code>null</code> * @param type console type identifier or <code>null</code> * @param imageDescriptor image descriptor, or <code>null</code> if none * @param autoLifecycle whether this console's lifecycle methods should be called * automatically when it is added (<code>initialize()</code>) and removed * (<code>destroy()</code>) from the console manager. When <code>false</code>, * clients are responsible for calling the lifecycle methods. * @since 3.1 */ public AbstractConsole(String name, String type, ImageDescriptor imageDescriptor, boolean autoLifecycle) { setName(name); setType(type); setImageDescriptor(imageDescriptor); if (autoLifecycle) { ConsolePlugin.getDefault().getConsoleManager().addConsoleListener(new Lifecycle()); } }
protected void updateHelp() { IConsole console = getConsole(); String helpContextId = null; if (console instanceof AbstractConsole) { AbstractConsole abs = (AbstractConsole) console; helpContextId = abs.getHelpContextId(); } if (helpContextId == null) { helpContextId = IConsoleHelpContextIds.CONSOLE_VIEW; } PlatformUI.getWorkbench().getHelpSystem().setHelp(getPageBook().getParent(), helpContextId); }
public void consolesAdded(IConsole[] consoles) { for (int i = 0; i < consoles.length; i++) { IConsole console = consoles[i]; if (console == AbstractConsole.this) { initialize(); } } }
@Override 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(); } } } }
/** * Disposes this console. This method should only be called by clients managing a * console's lifecycle, otherwise this method will be called automatically when this * console is removed from the console manager. The method is called once to dispose * this console, after which this console will no longer be used. * * @since 3.1 */ public final void destroy() { dispose(); }
/** * Sets the image descriptor for this console to the specified value and notifies * property listeners of the change. * * @param imageDescriptor the new image descriptor */ protected void setImageDescriptor(ImageDescriptor imageDescriptor) { ImageDescriptor old = fImageDescriptor; fImageDescriptor =imageDescriptor; firePropertyChange(this, IBasicPropertyConstants.P_IMAGE, old, imageDescriptor); }
/** * Initializes this console. This method should only be called by clients managing a * console's lifecycle, otherwise this method will be called automatically when this console * is added to the console manager. The method is called once to initialize this console, * marking the beginning of its lifecycle. * * @since 3.1 */ public final void initialize() { init(); }
protected void dispose() { super.dispose(); fFont = null; synchronized(fAttributes) { fAttributes.clear(); } } /**
/** * Sets the name of this console to the specified value and notifies * property listeners of the change. * * @param name the new name */ protected void setName(String name) { if (!name.equals(fName)) { String old = fName; fName = name; firePropertyChange(this, IBasicPropertyConstants.P_TEXT, old, name); } }
@Override protected void dispose() { super.dispose(); fFont = null; synchronized(fAttributes) { fAttributes.clear(); } } /**
/** * Sets the name of this console to the specified value and notifies * property listeners of the change. * * @param name the new name */ protected void setName(String name) { if (!name.equals(fName)) { String old = fName; fName = name; firePropertyChange(this, IBasicPropertyConstants.P_TEXT, old, name); } }