Extension SDK

oracle.ide.layout
Class SimpleLayout

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

public class SimpleLayout
extends BaseLayout
implements Copyable

Simple layout information. This is an extension of the BaseLayout class. SimpleLayouts are generally user created layouts that are owned by the IdeLayouts.


Field Summary
 
Fields inherited from class oracle.ide.layout.BaseLayout
_attributes, _lastModified, _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
SimpleLayout(java.net.URL url)
          Constructor
 
Method Summary
 void close()
          Release the data associated with this item
 java.lang.Object copyTo(java.lang.Object target)
          Copies the internal state of this object to the specified copy.
protected  void copyToImpl(SimpleLayout copy)
           
 boolean equals(java.lang.Object o)
           
protected  boolean equalsImpl(SimpleLayout other)
           
 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.
 java.io.OutputStream getOutputStream()
          Gets a OutputStream that can be used to save the contents of this object.
 IdeLayout getOwner()
          Get the IdeLayout that owns this layout.
protected  OrderedProperties getProperties()
           
 java.lang.String getProperty(java.lang.String key, java.lang.String defaultValue)
          Retrieves the value associated with a property.
 boolean isOpen()
          True if the data item has been loaded already.
 boolean isPropertySet(java.lang.String key, java.lang.String value, java.lang.String defaultValue)
          Returns true if the property identified by the given key is equals the given value.
 void open()
          Open (load) the data associated with this item.
 java.util.Enumeration propertyNames()
          Returns an enumeration of all the keys in this property list, including the keys in the default property list.
 java.lang.Object removeProperty(java.lang.String key)
          Removes the property.
 void reopen()
           
 void save(boolean shallow)
          Force the node to be re-loaded from file.
 void setInherited(Layout layout)
          Set a layout from which this layout inherits settings.
 void setName(java.lang.String name)
           
 void setOwner(IdeLayout owner)
          Set the owner of this layout.
protected  void setProperties(OrderedProperties properties)
           
 java.lang.Object setProperty(java.lang.String key, java.lang.String value)
          Sets the value for a property.
 
Methods inherited from class oracle.ide.layout.BaseLayout
attach, copyToImpl, detach, equalsImpl, findLayout, getAttributes, getChildren, getData, getFilename, getLongLabel, getName, getShortLabel, getTimestamp, getToolTipText, getURL, isActive, isDirty, isNew, isReadOnly, markDirty, mayHaveChildren, notifyObservers, setActive, setURL, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimpleLayout

public SimpleLayout(java.net.URL url)
Constructor

Method Detail

getProperty

public java.lang.String getProperty(java.lang.String key,
                                    java.lang.String defaultValue)
                             throws TransientMarker
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.
Throws:
TransientMarker

setProperty

public java.lang.Object setProperty(java.lang.String key,
                                    java.lang.String value)
                             throws TransientMarker
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
Throws:
TransientMarker

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

isPropertySet

public boolean isPropertySet(java.lang.String key,
                             java.lang.String value,
                             java.lang.String defaultValue)
Returns true if the property identified by the given key is equals the given value. If a defaultValue is specified, that value is used in the comparison. The strings are compared without regards to case.


propertyNames

public java.util.Enumeration propertyNames()
Returns an enumeration of all the keys in this property list, including the keys in the default property list.

Returns:
an enumeration of all the keys in this property list, including the keys in the default property list.
See Also:
Enumeration, Properties.defaults

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

getOwner

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

Specified by:
getOwner in interface Layout
Overrides:
getOwner in class BaseLayout
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
Overrides:
setOwner in class BaseLayout
Throws:
TransientMarker

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 for this node instance

setName

public void setName(java.lang.String name)
             throws java.beans.PropertyVetoException
Throws:
java.beans.PropertyVetoException

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.

getOutputStream

public java.io.OutputStream getOutputStream()
                                     throws java.io.IOException
Gets a OutputStream that can be used to save the contents of this object.

Returns:
an output stream.
Throws:
java.io.IOException - if a security manager exists and its checkRead method denies read access.

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.

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

reopen

public void reopen()

save

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

Specified by:
save in interface Document
Parameters:
shallow - do not save children if container. TBD

copyTo

public java.lang.Object copyTo(java.lang.Object target)
Description copied from interface: Copyable
Copies the internal state of this object to the specified copy. If copy is null, then this method should create a new instance of this class and proceed to copy the internal state to the newly created object. Generally, only the persistent state of the object should be copied, but whether or not it is appropriate to copy transient properties is at the discretion of the individual implementor.

Regardless of whether the copy occurs to an existing object or to a newly created object, the return value is object to which this object's state was copied.

There is a standard implementation pattern for the copyTo method that helps avoid problems that arise when a Copyable object is subclassed. The pattern is:

public Object copyTo( Object target )
{
final <this_class> copy =
target != null ? (<this_class>) target : new <this_class>();
copyToImpl( copy );
return copy;
} protected final void copyToImpl( <this_class> copy ) { super.copyToImpl( copy ); // if necessary // put code here for copying the properties of <this_class> }
The parameter passed into the copyToImpl method is the same type of this class. The responsibility of copyToImpl is to copy the state of this class through direct access of the fields. The copyToImpl method should not use getters and setters since these may be overridden, causing the state of this class to be incompletely copied.

Specified by:
copyTo in interface Copyable
Parameters:
target - The target object to which the state of this object should be copied. If target is null, then the copyTo method will return a new instance of this class.
Returns:
The object to which the state of this object was copied. If the target was non-null, then the return value is the same as the target object that was passed in; otherwise, the return value is a new instance of this class.

equals

public boolean equals(java.lang.Object o)

equalsImpl

protected final boolean equalsImpl(SimpleLayout other)

copyToImpl

protected final void copyToImpl(SimpleLayout copy)

getProperties

protected final OrderedProperties getProperties()

setProperties

protected final void setProperties(OrderedProperties properties)

Extension SDK

 

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