Package org.eclipse.ui.console
Class AbstractConsole
java.lang.Object
org.eclipse.ui.console.AbstractConsole
- All Implemented Interfaces:
IConsole
- Direct Known Subclasses:
TextConsole
Common function for consoles.
Clients implementing consoles should subclass this class.
- Since:
- 3.0
-
Constructor Summary
ConstructorDescriptionAbstractConsole
(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
Modifier and TypeMethodDescriptionvoid
activate()
Shows this console in all console views.void
Adds a listener for changes to properties of this console.final void
destroy()
Disposes this console.protected void
dispose()
Called when this console is removed from the console manager.void
firePropertyChange
(Object source, String property, Object oldValue, Object newValue) Notify all listeners that the given property has changed.Returns the help context identifier for this console, ornull
if none.Returns an image descriptor for this console, ornull
if none.getName()
Returns the name of this console.getType()
Returns a unique identifier for this console's type, ornull
if unspecified.protected void
init()
Called when this console is added to the console manager.final void
Initializes this console.void
Removes the given property listener from this console page.protected void
setImageDescriptor
(ImageDescriptor imageDescriptor) Sets the image descriptor for this console to the specified value and notifies property listeners of the change.protected void
Sets the name of this console to the specified value and notifies property listeners of the change.protected void
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 Details
-
AbstractConsole
Constructs a new console with the given name and image.- Parameters:
name
- console name, cannot benull
imageDescriptor
- image descriptor, ornull
if 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 benull
type
- console type identifier ornull
imageDescriptor
- image descriptor, ornull
if 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
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 benull
imageDescriptor
- image descriptor, ornull
if none
-
-
Method Details
-
getName
Description copied from interface:IConsole
Returns the name of this console. -
setName
Sets the name of this console to the specified value and notifies property listeners of the change.- Parameters:
name
- the new name
-
getImageDescriptor
Description copied from interface:IConsole
Returns an image descriptor for this console, ornull
if none.- Specified by:
getImageDescriptor
in interfaceIConsole
- Returns:
- an image descriptor for this console, or
null
if none
-
setImageDescriptor
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
Description copied from interface:IConsole
Adds 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:
addPropertyChangeListener
in interfaceIConsole
- Parameters:
listener
- a property change listener
-
removePropertyChangeListener
Description copied from interface:IConsole
Removes the given property listener from this console page. Has no effect if an identical listener is not already registered.- Specified by:
removePropertyChangeListener
in interfaceIConsole
- Parameters:
listener
- a property listener
-
firePropertyChange
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, ornull
newValue
- 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
Sets this console's type identifier.- Parameters:
typeIdentifier
- the type identifier for this console- Since:
- 3.1
-
getType
Description copied from interface:IConsole
Returns a unique identifier for this console's type, ornull
if unspecified. -
getHelpContextId
Returns the help context identifier for this console, ornull
if none. When a non-null
value is returned the associated help will be installed for this console.- Returns:
- help context id or
null
- Since:
- 3.2
-