Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

javax.ide.view
Class DefaultViewable  view DefaultViewable download DefaultViewable.java

java.lang.Object
  extended byjavax.ide.view.DefaultViewable
All Implemented Interfaces:
Viewable
Direct Known Subclasses:
View

public class DefaultViewable
extends java.lang.Object
implements Viewable

DefaultViewables are objects that map directly to visible GUI elements that users can select such as a menu items, nodes in the project explorer, etc..


Field Summary
private  javax.swing.event.SwingPropertyChangeSupport _propertyChangeSupport
           
private  boolean _visible
           
 
Fields inherited from interface javax.ide.view.Viewable
PROP_ICON_PATH, PROP_LABEL, PROP_VISIBLE
 
Constructor Summary
DefaultViewable()
           
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Add a java.beans.PropertyChangeListener to the listener list.
protected  void firePropertyChange(java.lang.String name, java.lang.Object oldVal, java.lang.Object newVal)
          Fire the property change event.
 javax.ide.util.IconDescription getIcon()
          Gets a relative path to the icon.
 java.lang.String getLabel()
          Get a short descriptive label that can be shown to the user.
 java.lang.String getToolTip()
          Returns the tool tip text to show when the mouse pointer pauses over a UI component that represents this Viewable.
 boolean isVisible()
          Get the object visible state.
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Removes a java.beans.PropertyChangeListener from the listener list.
 void setVisible(boolean visible)
           
 java.lang.String toString()
          Returns the label.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_visible

private boolean _visible

_propertyChangeSupport

private javax.swing.event.SwingPropertyChangeSupport _propertyChangeSupport
Constructor Detail

DefaultViewable

public DefaultViewable()
Method Detail

getLabel

public java.lang.String getLabel()
Get a short descriptive label that can be shown to the user.

Specified by:
getLabel in interface Viewable

getToolTip

public java.lang.String getToolTip()
Description copied from interface: Viewable
Returns the tool tip text to show when the mouse pointer pauses over a UI component that represents this Viewable.

Specified by:
getToolTip in interface Viewable

getIcon

public javax.ide.util.IconDescription getIcon()
Description copied from interface: Viewable
Gets a relative path to the icon. Generally, the is considered translatable, therefore, the path value be placed in an appropriate resource file. The path must be relative the Viewable implementation class file location or the resource file location if one is provided.

Specified by:
getIcon in interface Viewable

isVisible

public boolean isVisible()
Description copied from interface: Viewable
Get the object visible state.

Specified by:
isVisible in interface Viewable

setVisible

public void setVisible(boolean visible)

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Description copied from interface: Viewable
Add a java.beans.PropertyChangeListener to the listener list. A PropertyChangeEvent will be fired in response to setting a bound property.

Specified by:
addPropertyChangeListener in interface Viewable

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Description copied from interface: Viewable
Removes a java.beans.PropertyChangeListener from the listener list.

Specified by:
removePropertyChangeListener in interface Viewable

toString

public java.lang.String toString()
Description copied from interface: Viewable
Returns the label. This overrides the toString method in java.lang.Object.

Implementors of the Viewable interface should override this as appropriate. The default implementation is the same as getLabel()

Specified by:
toString in interface Viewable

firePropertyChange

protected void firePropertyChange(java.lang.String name,
                                  java.lang.Object oldVal,
                                  java.lang.Object newVal)
Fire the property change event. Fires the event for property name only if the oldVal is different from the newVal.