Extension SDK 10.1.2

oracle.ide.layout
Class BaseLayout

java.lang.Object
  extended byoracle.ide.layout.BaseLayout
All Implemented Interfaces:
Data, Dirtyable, Displayable, Document, Element, Layout, LazyLoadable, Locatable, PropertyAccess, Subject
Direct Known Subclasses:
IdeLayout, SimpleLayout

public abstract class BaseLayout
extends java.lang.Object
implements Layout

BaseLayout class. Base implementation of the Layout interface.


Field Summary
protected  Attributes _attributes
           
protected  long _lastModified
          Timestamp prop to record the last time this Document was updated.
protected  java.net.URL _url
          Stores the node's url.
 
Fields inherited from interface oracle.ide.layout.Layout
LAYOUT_ACTIVE_PROPERTY, LAYOUT_NAME_PROPERTY
 
Fields inherited from interface oracle.ide.addin.Subject
OBJECT_MODIFIED
 
Constructor Summary
protected BaseLayout(java.net.URL url)
          Constructor
 
Method Summary
 void attach(Observer observer)
          Registers an observer interested in being notified when the internal state of the class implementing the Subject interface changes.
 void close()
          Close the node.
protected  void copyToImpl(BaseLayout copy)
          Design pattern for supporting strongly typed copying.
 void detach(Observer observer)
          Unregisters an observer that is not interested anymore in being notified when the internal state of the class implementing the Subject interface changes.
protected  boolean equalsImpl(BaseLayout other)
          This is a helper method for Object.equals(Object) that can also be used by subclasses that implement Object.equals(Object).
protected static Layout findLayout(java.net.URL url, Element layout)
           
 Attributes getAttributes()
          Get the layout's attributes.
 java.util.Iterator getChildren()
          This method is part of the Element interface to provide a convenient way of getting an Iterator over any contained child Elements without having to test the object's type with the instanceof operator or having to downcast to a more specific type.
 java.lang.Object getData()
          Gets the data element that implements this interface.
 java.lang.String getFilename()
          Retrieves the filename associated with this Document.
 java.lang.String getLongLabel()
          Gets a fully qualified label for display purpose.
 java.lang.String getName()
          Get this layout name.
 IdeLayout getOwner()
          Get the IdeLayout that owns this layout.
 java.lang.String getShortLabel()
          Gets a short label for display purpose.
 long getTimestamp()
          Gets the Document's time stamp.
 java.lang.String getToolTipText()
          Returns the tool tip text to show when the mouse pointer pauses over a UI component that represents this Displayable.
 java.net.URL getURL()
          Gets the url that uniquely identifies this Element.
 boolean isActive()
          Returns true if this layout is currently active.
 boolean isDirty()
          True if the data in the Document has been modified.
 boolean isNew()
          Returns true if the document's data has never been saved.
 boolean isReadOnly()
          is this node read-only?
 void markDirty(boolean dirty)
          Marks the data with the specified dirty state.
 boolean mayHaveChildren()
          This method is part of the Element interface to provide a convenient way of determining whether an object may have children without having to test the object's type with the instanceof operator or having to downcast to a more specific type.
 void notifyObservers(java.lang.Object object, UpdateMessage change)
          Notifies all observers that the state of the subject has changed.
 void setActive(boolean active)
          Mark this layout as the currently active layout.
 void setInherited(Layout layout)
          Set a layout from which this layout inherits settings.
 void setOwner(IdeLayout owner)
          Set the owner of this layout.
 void setURL(java.net.URL url)
          Sets the url
 java.lang.String toString()
          Returns the Short Label displayed to a user.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface oracle.ide.model.Document
getInputStream, open, save
 
Methods inherited from interface oracle.ide.model.Displayable
getIcon
 
Methods inherited from interface oracle.ide.model.LazyLoadable
isOpen
 
Methods inherited from interface oracle.ide.util.PropertyAccess
getProperty, removeProperty, setProperty
 

Field Detail

_lastModified

protected long _lastModified
Timestamp prop to record the last time this Document was updated.


_url

protected java.net.URL _url
Stores the node's url.


_attributes

protected Attributes _attributes
Constructor Detail

BaseLayout

protected BaseLayout(java.net.URL url)
Constructor

Method Detail

isActive

public boolean isActive()
                 throws TransientMarker
Description copied from interface: Layout
Returns true if this layout is currently active.

Specified by:
isActive in interface Layout
Throws:
TransientMarker

setActive

public void setActive(boolean active)
               throws TransientMarker
Description copied from interface: Layout
Mark this layout as the currently active layout.

Specified by:
setActive in interface Layout
Throws:
TransientMarker

setInherited

public void setInherited(Layout layout)
Description copied from interface: Layout
Set a layout from which this layout inherits settings.

Specified by:
setInherited in interface Layout

getName

public java.lang.String getName()
Description copied from interface: Layout
Get this layout name.

Specified by:
getName in interface Layout

getOwner

public IdeLayout getOwner()
                   throws TransientMarker
Description copied from interface: Layout
Get the IdeLayout that owns this layout.

Specified by:
getOwner in interface Layout
Throws:
TransientMarker

setOwner

public void setOwner(IdeLayout owner)
              throws TransientMarker
Description copied from interface: Layout
Set the owner of this layout.

Specified by:
setOwner in interface Layout
Throws:
TransientMarker

getFilename

public java.lang.String getFilename()
Retrieves the filename associated with this Document.

Returns:
the filename of the Document.

getTimestamp

public long getTimestamp()
Gets the Document's time stamp.

Specified by:
getTimestamp in interface Document
Returns:
the Document's time stamp.

isReadOnly

public boolean isReadOnly()
is this node read-only?

Specified by:
isReadOnly in interface Document
Returns:
true if the document is a read-only document.

isDirty

public boolean isDirty()
True if the data in the Document has been modified.

Specified by:
isDirty in interface Dirtyable
Returns:
true if the data item has been modified.

markDirty

public void markDirty(boolean dirty)
Description copied from interface: Dirtyable
Marks the data with the specified dirty state. This method is called markDirty(...) instead of setDirty(...) so that the JavaBeans Introspector will not mistakenly identify "dirty" as a JavaBean property.

Specified by:
markDirty in interface Dirtyable
Parameters:
dirty - If true, sets the object as being dirty; if false, sets the object as being up-to-date.

close

public void close()
Close the node. Node should go to un-opened state. TBD

Specified by:
close in interface Document

isNew

public boolean isNew()
Description copied from interface: Document
Returns true if the document's data has never been saved.

Specified by:
isNew in interface Document
Returns:
true if the document's data has never been saved.

getData

public java.lang.Object getData()
Gets the data element that implements this interface.

Specified by:
getData in interface Data
Returns:
object implementing this interface.

getShortLabel

public java.lang.String getShortLabel()
Gets a short label for display purpose.

Specified by:
getShortLabel in interface Displayable
Returns:
a short descriptive label. For example; an unqualified file name.

getLongLabel

public java.lang.String getLongLabel()
Gets a fully qualified label for display purpose.

Specified by:
getLongLabel in interface Displayable
Returns:
a long descriptive label. For example; a fully qualified file name.

getURL

public java.net.URL getURL()
Gets the url that uniquely identifies this Element. An url is a sequence of protocols with their corresponding matching values. The url pattern is as follows: ::<...>:///<...>/ For example the following url: latte:context:java//c:\jdev\p1.jpr/c:\jdev\test\myclass.java has three protocols: latte, context, and java. Their correspoding values are: no value, c:\jdev\p1.jpr, and c:\jdev\test\myclass.java, respectively.

Specified by:
getURL in interface Locatable
Returns:
url identifying this Element.

setURL

public void setURL(java.net.URL url)
Sets the url

Specified by:
setURL in interface Locatable
Parameters:
url - the url to set.

getToolTipText

public java.lang.String getToolTipText()
Description copied from interface: Displayable
Returns the tool tip text to show when the mouse pointer pauses over a UI component that represents this Displayable. In many cases it may be appropriate for this method to return the same value as Displayable.getLongLabel().

Specified by:
getToolTipText in interface Displayable
Returns:
the ToolTip for this node instance

mayHaveChildren

public boolean mayHaveChildren()
Description copied from interface: Element
This method is part of the Element interface to provide a convenient way of determining whether an object may have children without having to test the object's type with the instanceof operator or having to downcast to a more specific type.

An implementation of Element that represents a leaf in a tree structure should return false from this method. An implementation of Element that could represent a non-leaf in a tree structure should return true from this method, even if it does not currently contain any children.

Specified by:
mayHaveChildren in interface Element
Returns:
true if this Element may contain children.

getChildren

public java.util.Iterator getChildren()
Description copied from interface: Element
This method is part of the Element interface to provide a convenient way of getting an Iterator over any contained child Elements without having to test the object's type with the instanceof operator or having to downcast to a more specific type.

An implementation of Element that represents a leaf in a tree structure should return null from this method. An implementation of Element that could represent a non-leaf in a tree structure should return either an Iterator over the child Elements or null if there are no children.

Specified by:
getChildren in interface Element
Returns:
an Iterator of any children held by this Element, else null.

getAttributes

public Attributes getAttributes()
Get the layout's attributes. This class does not define any attributes.

Specified by:
getAttributes in interface Element

attach

public void attach(Observer observer)
Description copied from interface: Subject
Registers an observer interested in being notified when the internal state of the class implementing the Subject interface changes. Implementors should do nothing when the same observer is added more than once.

Specified by:
attach in interface Subject
Parameters:
observer - the Observer interested in change notification messages.

detach

public void detach(Observer observer)
Description copied from interface: Subject
Unregisters an observer that is not interested anymore in being notified when the internal state of the class implementing the Subject interface changes. Implementors should do nothing when the same observer is removed more than once.

Specified by:
detach in interface Subject
Parameters:
observer - the Observer disinterested in change notification messages.

notifyObservers

public void notifyObservers(java.lang.Object object,
                            UpdateMessage change)
Description copied from interface: Subject
Notifies all observers that the state of the subject has changed.

Specified by:
notifyObservers in interface Subject
Parameters:
object - the subject whose state has changed.
change - what changed.

copyToImpl

protected final void copyToImpl(BaseLayout copy)
Design pattern for supporting strongly typed copying.

This method is intended to be helper method that subclasses can use, if they implement the Copyable interface.


equalsImpl

protected final boolean equalsImpl(BaseLayout other)
This is a helper method for Object.equals(Object) that can also be used by subclasses that implement Object.equals(Object). It assumes that the argument is not null.


findLayout

protected static Layout findLayout(java.net.URL url,
                                   Element layout)

toString

public java.lang.String toString()
Description copied from interface: Displayable
Returns the Short Label displayed to a user. This overrides the toString method in java.lang.Object.

Implementors of the Displayable interface should override this as appropriate. The default implementation is the same as getShortLabel

Specified by:
toString in interface Displayable

Extension SDK

 

Copyright © 1997, 2004, Oracle. All rights reserved.