Extension SDK 10.1.2

oracle.ide.layout
Class IdeLayout

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

public class IdeLayout
extends BaseLayout
implements Folder, Subject

IdeLayout class. IdeLayout instances are layouts that can contain other layouts. For example, the design and debug layouts can contain other user created SimpleLayouts as their children.


Field Summary
 
Fields inherited from class oracle.ide.layout.BaseLayout
_attributes, _lastModified, _url
 
Fields inherited from interface oracle.ide.addin.Subject
OBJECT_MODIFIED
 
Fields inherited from interface oracle.ide.layout.Layout
LAYOUT_ACTIVE_PROPERTY, LAYOUT_NAME_PROPERTY
 
Constructor Summary
protected IdeLayout()
           
  IdeLayout(java.net.URL fileURL, java.lang.String shortLabel, ArrayResourceBundle iconBundle, int iconKey)
           
  IdeLayout(java.net.URL fileURL, java.lang.String shortLabel, javax.swing.Icon icon)
           
 
Method Summary
 boolean add(Element element)
          Appends a child Element to the end of the Folder.
 void attach(Observer observer)
          Registers an observer interested in being notified when the internal state of the class implementing the Subject interface changes.
 boolean canAdd(Element element)
          Other classes can call this method to determine whether the given Element can be added to the Folder.
 boolean canRemove(Element element)
          Other classes can call this method to determine whether the specified Element can be removed from this Folder.
 void close()
          Release the data associated with this item
 boolean containsChild(Element child)
          Returns true if the folder contains the specified child Element; returns false otherwise.
 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.
 boolean equals(java.lang.Object o)
           
protected  boolean equalsImpl(IdeLayout other)
           
 Layout findLayout(java.net.URL url)
          Find the layout associated with the specified url.
 Layout getActiveLayout()
           
 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.
 Layout getDefaults()
           
 javax.swing.Icon getIcon()
          Returns an Icon that can be shown in association with this Displayable.
 java.io.InputStream getInputStream()
          Gets a InputStream that can be used to read the contents of this object.
protected  java.util.Map getLayoutMap()
           
 java.lang.String getLongLabel()
          Returns a long label that can be displayed to the user.
 java.lang.String getProperty(java.lang.String key, java.lang.String defaultValue)
          Retrieves the value associated with a property.
 java.lang.String getShortLabel()
          Returns a short label that can be displayed to the user.
 java.lang.String getToolTipText()
          Returns the tool tip text to show when the mouse pointer pauses over a UI component that represents this Displayable.
 boolean isOpen()
          True if the data item has been loaded already.
 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 open()
          Open (load) the data associated with this item.
 boolean remove(Element element)
          Removes the specified child Element.
 void removeAll()
          Removes all children from the folder.
 java.lang.Object removeProperty(java.lang.String key)
          Removes the property.
 void save(boolean shallow)
          Force the node to be re-loaded from file.
protected  void setActiveLayout(Layout layout)
           
 java.lang.Object setProperty(java.lang.String key, java.lang.String value)
          Sets the value for a property.
 int size()
          Returns the current number of children in the folder.
 
Methods inherited from class oracle.ide.layout.BaseLayout
copyToImpl, equalsImpl, findLayout, getAttributes, getData, getFilename, getName, getOwner, getTimestamp, getURL, isActive, isDirty, isNew, isReadOnly, markDirty, setActive, setInherited, setOwner, setURL, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface oracle.ide.model.Element
getAttributes
 
Methods inherited from interface oracle.ide.model.Data
getData
 
Methods inherited from interface oracle.ide.model.Displayable
toString
 

Constructor Detail

IdeLayout

public IdeLayout(java.net.URL fileURL,
                 java.lang.String shortLabel,
                 javax.swing.Icon icon)

IdeLayout

public IdeLayout(java.net.URL fileURL,
                 java.lang.String shortLabel,
                 ArrayResourceBundle iconBundle,
                 int iconKey)

IdeLayout

protected IdeLayout()
Method Detail

getProperty

public java.lang.String getProperty(java.lang.String key,
                                    java.lang.String defaultValue)
Description copied from interface: PropertyAccess
Retrieves the value associated with a property. If no value exists for the requested property, the specified default value is returned.

Specified by:
getProperty in interface PropertyAccess
Parameters:
key - the property key for which a value is desired.
defaultValue - the value to return if no value currently exists.
Returns:
the value of the requested property, or the default value if the property does not exist.

setProperty

public java.lang.Object setProperty(java.lang.String key,
                                    java.lang.String value)
Description copied from interface: PropertyAccess
Sets the value for a property.

Specified by:
setProperty in interface PropertyAccess
Parameters:
key - the property key to set
value - the string value to set
Returns:
the previous value

removeProperty

public java.lang.Object removeProperty(java.lang.String key)
Description copied from interface: PropertyAccess
Removes the property.

Specified by:
removeProperty in interface PropertyAccess
Parameters:
key - the property key to remove
Returns:
the previous value

getActiveLayout

public Layout getActiveLayout()

findLayout

public Layout findLayout(java.net.URL url)
Find the layout associated with the specified url. If the url matches the default layout url return it, otherwise, look in the list of children.


getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Gets a InputStream that can be used to read the contents of this object.

Specified by:
getInputStream in interface Document
Returns:
an input stream, or null if the node has no contents.
Throws:
java.io.IOException - if a security manager exists and its checkRead method denies read access.

open

public void open()
Open (load) the data associated with this item.

Specified by:
open in interface Document

close

public void close()
Release the data associated with this item

Specified by:
close in interface Document
Overrides:
close in class BaseLayout

save

public void save(boolean shallow)
          throws java.io.IOException
Force the node to be re-loaded from file.

Specified by:
save in interface Document
Parameters:
shallow - do not save children if container. TBD
Throws:
java.io.IOException - Signals that an I/O exception of some sort occurred.

isOpen

public boolean isOpen()
True if the data item has been loaded already.

Specified by:
isOpen in interface LazyLoadable
Returns:
true if the data item has already been opened.

getDefaults

public Layout getDefaults()

getShortLabel

public java.lang.String getShortLabel()
Description copied from interface: Displayable
Returns a short label that can be displayed to the user. Generally, the value of the returned String is considered translatable and should therefore be placed in an appropriate resource file. When possible, the returned label should be reasonably short enough to show in the navigator or explorer windows but long enough to clearly identify and distinguish the Displayable.

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

getIcon

public javax.swing.Icon getIcon()
Description copied from interface: Displayable
Returns an Icon that can be shown in association with this Displayable. Typically the icon will be used in a tree control or list control. Therefore the icon must fit naturally within the space normally given to items within those controls. Such icons are usually 16x16 in size or, if there is a one-pixel transparent padding around the edge, 18x18 in size. It is strongly recommended that icons returned by this method be either 16x16 or 18x18 in size. If null is returned, the control may show a default icon, or it may show no icon, whichever is appropriate.

Specified by:
getIcon in interface Displayable
Returns:
the Icon to be displayed for the Displayable.

getLongLabel

public java.lang.String getLongLabel()
Description copied from interface: Displayable
Returns a long label that can be displayed to the user. Generally, the value of the returned String is considered translatable and should therefore be placed in an appropriate resource file. The long label differs from the short label essentially on length. Usually the long label will only be shown on-demand and in places where horizontal space is more available. Examples are the status bar and tooltips.

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

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
Overrides:
getToolTipText in class BaseLayout
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
Overrides:
mayHaveChildren in class BaseLayout
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
Overrides:
getChildren in class BaseLayout
Returns:
an Iterator of any children held by this Element, else null.

add

public boolean add(Element element)
Description copied from interface: Folder
Appends a child Element to the end of the Folder.

Specified by:
add in interface Folder

remove

public boolean remove(Element element)
Description copied from interface: Folder
Removes the specified child Element. If the child object appears more than once, only the first instance is removed.

Specified by:
remove in interface Folder
Parameters:
element - The child object to remove.

canRemove

public boolean canRemove(Element element)
Description copied from interface: Folder
Other classes can call this method to determine whether the specified Element can be removed from this Folder.

Specified by:
canRemove in interface Folder
Parameters:
element - the Element that is about to be removed from this Folder.
Returns:
true if the specified Element can be removed from this Folder; false if the Element cannot be removed.

canAdd

public boolean canAdd(Element element)
Description copied from interface: Folder
Other classes can call this method to determine whether the given Element can be added to the Folder.

Specified by:
canAdd in interface Folder
Parameters:
element - the Element that is about to be added to this Folder.
Returns:
true if the specified Element can be added to this Folder; false if the Element cannot be added.

containsChild

public boolean containsChild(Element child)
Description copied from interface: Folder
Returns true if the folder contains the specified child Element; returns false otherwise.

Specified by:
containsChild in interface Folder

size

public int size()
Description copied from interface: Folder
Returns the current number of children in the folder.

Specified by:
size in interface Folder

removeAll

public void removeAll()
Description copied from interface: Folder
Removes all children from the folder.

Specified by:
removeAll in interface Folder

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
Overrides:
attach in class BaseLayout

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
Overrides:
detach in class BaseLayout

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
Overrides:
notifyObservers in class BaseLayout

equals

public boolean equals(java.lang.Object o)

equalsImpl

protected final boolean equalsImpl(IdeLayout other)

setActiveLayout

protected void setActiveLayout(Layout layout)

getLayoutMap

protected java.util.Map getLayoutMap()

Extension SDK

 

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