|
Extension SDK | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectoracle.ide.layout.BaseLayout
oracle.ide.layout.IdeLayout
IdeLayout class. IdeLayout instances are layouts that can contain other
layouts. For example, the design and debug layouts can contain other
user created SimpleLayout
s 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. |
java.lang.Object |
copyTo(java.lang.Object target)
Copies the internal state of this object to the
specified copy . |
protected void |
copyToImpl(IdeLayout copy)
|
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 Element s 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 |
reopen()
|
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 |
public IdeLayout(java.net.URL fileURL, java.lang.String shortLabel, javax.swing.Icon icon)
public IdeLayout(java.net.URL fileURL, java.lang.String shortLabel, ArrayResourceBundle iconBundle, int iconKey)
protected IdeLayout()
Method Detail |
public java.lang.String getProperty(java.lang.String key, java.lang.String defaultValue) throws TransientMarker
PropertyAccess
getProperty
in interface PropertyAccess
key
- the property key for which a value is desired.defaultValue
- the value to return if no value currently
exists.
TransientMarker
public java.lang.Object setProperty(java.lang.String key, java.lang.String value) throws TransientMarker
PropertyAccess
setProperty
in interface PropertyAccess
key
- the property key to setvalue
- the string value to set
TransientMarker
public java.lang.Object removeProperty(java.lang.String key)
PropertyAccess
removeProperty
in interface PropertyAccess
key
- the property key to remove
public Layout getActiveLayout() throws TransientMarker
TransientMarker
public Layout findLayout(java.net.URL url)
url
. If
the url
matches the default layout url return it,
otherwise, look in the list of children.
public java.io.InputStream getInputStream() throws java.io.IOException
InputStream
that can be used to read the contents
of this object.
getInputStream
in interface Document
java.io.IOException
- if a security manager exists and its
checkRead
method denies read access.public void open()
open
in interface Document
public void close()
close
in interface Document
close
in class BaseLayout
public void reopen()
public void save(boolean shallow) throws java.io.IOException
save
in interface Document
shallow
- do not save children if container.
TBD
java.io.IOException
public boolean isOpen()
isOpen
in interface LazyLoadable
true
if the data item has already been opened.public Layout getDefaults()
public java.lang.String getShortLabel()
Displayable
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
.
getShortLabel
in interface Displayable
getShortLabel
in class BaseLayout
public javax.swing.Icon getIcon()
Displayable
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.
getIcon
in interface Displayable
Icon
to be displayed for the
Displayable
.public java.lang.String getLongLabel()
Displayable
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.
getLongLabel
in interface Displayable
getLongLabel
in class BaseLayout
public java.lang.String getToolTipText()
Displayable
Displayable
.
In many cases it may be appropriate for this method to return the
same value as Displayable.getLongLabel()
.
getToolTipText
in interface Displayable
getToolTipText
in class BaseLayout
public boolean mayHaveChildren()
Element
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.
mayHaveChildren
in interface Element
mayHaveChildren
in class BaseLayout
public java.util.Iterator getChildren()
Element
Element
interface to
provide a convenient way of getting an Iterator
over any
contained child Element
s 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 Element
s or
null
if there are no children.
getChildren
in interface Element
getChildren
in class BaseLayout
public boolean add(Element element)
Folder
Element
to the end of the
Folder
.
add
in interface Folder
public boolean remove(Element element)
Folder
Element
. If the child object
appears more than once, only the first instance is removed.
remove
in interface Folder
element
- The child object to remove.public boolean canRemove(Element element)
Folder
Element
can be removed from this
Folder
.
canRemove
in interface Folder
element
- the Element
that is about to be removed
from this Folder
.
true
if the specified Element
can be
removed from this Folder
; false
if the
Element
cannot be removed.public boolean canAdd(Element element)
Folder
Element
can be added to the Folder
.
canAdd
in interface Folder
element
- the Element
that is about to be added
to this Folder
.
true
if the specified Element
can be
added to this Folder
; false
if the
Element
cannot be added.public boolean containsChild(Element child)
Folder
true
if the folder contains the
specified child Element
; returns false
otherwise.
containsChild
in interface Folder
public int size()
Folder
size
in interface Folder
public void removeAll()
Folder
removeAll
in interface Folder
public void attach(Observer observer)
Subject
Subject
interface
changes.
Implementors should do nothing when the same observer is added more
than once.
attach
in interface Subject
attach
in class BaseLayout
public void detach(Observer observer)
Subject
Subject
interface changes.
Implementors should do nothing when the same observer is removed more
than once.
detach
in interface Subject
detach
in class BaseLayout
public void notifyObservers(java.lang.Object object, UpdateMessage change)
Subject
notifyObservers
in interface Subject
notifyObservers
in class BaseLayout
public java.lang.Object copyTo(java.lang.Object target)
Copyable
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.
copyTo
in interface Copyable
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.
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.public boolean equals(java.lang.Object o)
protected final boolean equalsImpl(IdeLayout other)
protected final void copyToImpl(IdeLayout copy)
protected void setActiveLayout(Layout layout)
protected java.util.Map getLayoutMap()
|
Extension SDK | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright ©1997, 2003, Oracle. All rights reserved.