Package org.eclipse.ui.console
Class AbstractConsole
- java.lang.Object
-
- org.eclipse.ui.console.AbstractConsole
-
- All Implemented Interfaces:
IConsole
- Direct Known Subclasses:
TextConsole
public abstract class AbstractConsole extends Object implements IConsole
Common function for consoles.Clients implementing consoles should subclass this class.
- Since:
- 3.0
-
-
Constructor Summary
Constructors Constructor Description AbstractConsole(String name, String type, ImageDescriptor imageDescriptor, boolean autoLifecycle)Constructs a new console with the given name, type, image and lifecycle.AbstractConsole(String name, ImageDescriptor imageDescriptor)Constructs a new console with the given name and image.AbstractConsole(String name, ImageDescriptor imageDescriptor, boolean autoLifecycle)Constructs a new console with the given name and image.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivate()Shows this console in all console views.voidaddPropertyChangeListener(IPropertyChangeListener listener)Adds a listener for changes to properties of this console.voiddestroy()Disposes this console.protected voiddispose()Called when this console is removed from the console manager.voidfirePropertyChange(Object source, String property, Object oldValue, Object newValue)Notify all listeners that the given property has changed.StringgetHelpContextId()Returns the help context identifier for this console, ornullif none.ImageDescriptorgetImageDescriptor()Returns an image descriptor for this console, ornullif none.StringgetName()Returns the name of this console.StringgetType()Returns a unique identifier for this console's type, ornullif unspecified.protected voidinit()Called when this console is added to the console manager.voidinitialize()Initializes this console.voidremovePropertyChangeListener(IPropertyChangeListener listener)Removes the given property listener from this console page.protected voidsetImageDescriptor(ImageDescriptor imageDescriptor)Sets the image descriptor for this console to the specified value and notifies property listeners of the change.protected voidsetName(String name)Sets the name of this console to the specified value and notifies property listeners of the change.protected voidsetType(String typeIdentifier)Sets this console's type identifier.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.ui.console.IConsole
createPage
-
-
-
-
Constructor Detail
-
AbstractConsole
public AbstractConsole(String name, ImageDescriptor imageDescriptor, boolean autoLifecycle)
Constructs a new console with the given name and image.- Parameters:
name- console name, cannot benullimageDescriptor- image descriptor, ornullif noneautoLifecycle- whether this console's lifecycle methods should be called automatically when it is added (initialize()) and removed (destroy()) from the console manager. Whenfalse, clients are responsible for calling the lifecycle methods.- Since:
- 3.1
-
AbstractConsole
public AbstractConsole(String name, String type, ImageDescriptor imageDescriptor, boolean autoLifecycle)
Constructs a new console with the given name, type, image and lifecycle.- Parameters:
name- console name, cannot benulltype- console type identifier ornullimageDescriptor- image descriptor, ornullif noneautoLifecycle- whether this console's lifecycle methods should be called automatically when it is added (initialize()) and removed (destroy()) from the console manager. Whenfalse, clients are responsible for calling the lifecycle methods.- Since:
- 3.1
-
AbstractConsole
public AbstractConsole(String name, ImageDescriptor imageDescriptor)
Constructs a new console with the given name and image. The console's lifecycle methodsinit()anddispose()will be called when the console is added and removed from the console manager.- Parameters:
name- console name, cannot benullimageDescriptor- image descriptor, ornullif none
-
-
Method Detail
-
getName
public String getName()
Description copied from interface:IConsoleReturns the name of this console.
-
setName
protected void setName(String name)
Sets the name of this console to the specified value and notifies property listeners of the change.- Parameters:
name- the new name
-
getImageDescriptor
public ImageDescriptor getImageDescriptor()
Description copied from interface:IConsoleReturns an image descriptor for this console, ornullif none.- Specified by:
getImageDescriptorin interfaceIConsole- Returns:
- an image descriptor for this console, or
nullif none
-
setImageDescriptor
protected void setImageDescriptor(ImageDescriptor imageDescriptor)
Sets the image descriptor for this console to the specified value and notifies property listeners of the change.- Parameters:
imageDescriptor- the new image descriptor
-
addPropertyChangeListener
public void addPropertyChangeListener(IPropertyChangeListener listener)
Description copied from interface:IConsoleAdds a listener for changes to properties of this console. Has no effect if an identical listener is already registered.The changes supported by the console view are as follows:
IBasicPropertyConstants.P_TEXT- indicates the name of a console has changedIBasicPropertyConstants.P_IMAGE- indicates the image of a console has changed
Consoles may define additional properties as required.
- Specified by:
addPropertyChangeListenerin interfaceIConsole- Parameters:
listener- a property change listener
-
removePropertyChangeListener
public void removePropertyChangeListener(IPropertyChangeListener listener)
Description copied from interface:IConsoleRemoves the given property listener from this console page. Has no effect if an identical listener is not already registered.- Specified by:
removePropertyChangeListenerin interfaceIConsole- Parameters:
listener- a property listener
-
firePropertyChange
public void firePropertyChange(Object source, String property, Object oldValue, Object newValue)
Notify all listeners that the given property has changed.- Parameters:
source- the object on which a property has changedproperty- identifier of the property that has changedoldValue- the old value of the property, ornullnewValue- the new value of the property, ornull
-
initialize
public final void initialize()
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
-
init
protected void init()
Called when this console is added to the console manager. Default implementation does nothing. Subclasses may override.Since 3.1, this method is only called automatically if this console was created with an automatic lifecycle.
-
destroy
public final void 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
-
dispose
protected void dispose()
Called when this console is removed from the console manager. Default implementation does nothing. Subclasses may override.Since 3.1, this methods is only called automatically if this console was created with an automatic lifecycle.
-
activate
public void activate()
Shows this console in all console views. This console will be become visible if another console is currently pinned.- Since:
- 3.1
-
setType
protected void setType(String typeIdentifier)
Sets this console's type identifier.- Parameters:
typeIdentifier- the type identifier for this console- Since:
- 3.1
-
getType
public String getType()
Description copied from interface:IConsoleReturns a unique identifier for this console's type, ornullif unspecified.
-
getHelpContextId
public String getHelpContextId()
Returns the help context identifier for this console, ornullif none. When a non-nullvalue is returned the associated help will be installed for this console.- Returns:
- help context id or
null - Since:
- 3.2
-
-