public abstract class AbstractConsole extends Object implements IConsole
Clients implementing consoles should subclass this class.
Constructor and Description |
---|
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.
|
AbstractConsole(String name,
String type,
ImageDescriptor imageDescriptor,
boolean autoLifecycle)
Constructs a new console with the given name, type, image and lifecycle.
|
Modifier and Type | Method and Description |
---|---|
void |
activate()
Shows this console in all console views.
|
void |
addPropertyChangeListener(IPropertyChangeListener listener)
Adds a listener for changes to properties of this console.
|
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.
|
String |
getHelpContextId()
Returns the help context identifier for this console, or
null
if none. |
ImageDescriptor |
getImageDescriptor()
Returns an image descriptor for this console, or
null
if none. |
String |
getName()
Returns the name of this console.
|
String |
getType()
Returns a unique identifier for this console's type, or
null
if unspecified. |
protected void |
init()
Called when this console is added to the console manager.
|
void |
initialize()
Initializes this console.
|
void |
removePropertyChangeListener(IPropertyChangeListener listener)
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 |
setName(String name)
Sets the name of this console to the specified value and notifies
property listeners of the change.
|
protected void |
setType(String typeIdentifier)
Sets this console's type identifier.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createPage
public AbstractConsole(String name, ImageDescriptor imageDescriptor, boolean autoLifecycle)
name
- console name, cannot be null
imageDescriptor
- image descriptor, or null
if noneautoLifecycle
- whether this console's lifecycle methods should be called
automatically when it is added (initialize()
) and removed
(destroy()
) from the console manager. When false
,
clients are responsible for calling the lifecycle methods.public AbstractConsole(String name, String type, ImageDescriptor imageDescriptor, boolean autoLifecycle)
name
- console name, cannot be null
type
- console type identifier or null
imageDescriptor
- image descriptor, or null
if noneautoLifecycle
- whether this console's lifecycle methods should be called
automatically when it is added (initialize()
) and removed
(destroy()
) from the console manager. When false
,
clients are responsible for calling the lifecycle methods.public AbstractConsole(String name, ImageDescriptor imageDescriptor)
init()
and dispose()
will be called when the
console is added and removed from the console manager.name
- console name, cannot be null
imageDescriptor
- image descriptor, or null
if nonepublic String getName()
IConsole
protected void setName(String name)
name
- the new namepublic ImageDescriptor getImageDescriptor()
IConsole
null
if none.getImageDescriptor
in interface IConsole
null
if noneprotected void setImageDescriptor(ImageDescriptor imageDescriptor)
imageDescriptor
- the new image descriptorpublic void addPropertyChangeListener(IPropertyChangeListener listener)
IConsole
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 changedConsoles may define additional properties as required.
addPropertyChangeListener
in interface IConsole
listener
- a property change listenerpublic void removePropertyChangeListener(IPropertyChangeListener listener)
IConsole
removePropertyChangeListener
in interface IConsole
listener
- a property listenerpublic void firePropertyChange(Object source, String property, Object oldValue, Object newValue)
source
- the object on which a property has changedproperty
- identifier of the property that has changedoldValue
- the old value of the property, or null
newValue
- the new value of the property, or null
public final void initialize()
protected void init()
Since 3.1, this method is only called automatically if this console was created with an automatic lifecycle.
public final void destroy()
protected void dispose()
Since 3.1, this methods is only called automatically if this console was created with an automatic lifecycle.
public void activate()
protected void setType(String typeIdentifier)
typeIdentifier
- the type identifier for this consolepublic String getType()
IConsole
null
if unspecified.public String getHelpContextId()
null
if none. When a non-null
value is returned the associated help
will be installed for this console.null
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.