Extension SDK

oracle.jdeveloper.library
Class LibraryListHelper

java.lang.Object
  |
  +--oracle.ide.model.DefaultSubDirtyable
        |
        +--oracle.jdeveloper.library.LibraryListHelper
All Implemented Interfaces:
Copyable, Dirtyable, Observer, SubDirtyable

public class LibraryListHelper
extends DefaultSubDirtyable
implements Copyable, Observer


Constructor Summary
LibraryListHelper()
           
 
Method Summary
 boolean add(Element child)
           
 boolean canAdd(Element element)
           
 boolean canRemove(Element element)
           
 boolean containsChild(Element child)
           
 java.lang.Object copyTo(java.lang.Object target)
          Copies the internal state of this object to the specified copy.
protected  void copyToImpl(LibraryListHelper copy)
           
 boolean equals(java.lang.Object obj)
           
protected  boolean equalsImpl(LibraryListHelper other)
           
 JDK findJDK(java.lang.String JDKName)
           
 JDK findJDK(VersionNumber num)
           
static JDK findJDK(VersionNumber num, JDK[] jdks)
           
 JLibrary findLibrary(java.lang.String libName)
           
 java.lang.String findUniqueJDKName()
           
 java.lang.String findUniqueLibraryName()
           
 java.util.Iterator getChildren()
           
 java.util.List getJdkList()
           
 java.util.List getLibraryList()
           
 boolean isChildJDK(JDK jdk)
           
 boolean isChildLibrary(JLibrary lib)
           
 boolean remove(Element child)
           
 void removeAll()
           
 void setJdkList(java.util.List jdks)
           
 void setLibraryList(java.util.List libs)
           
 void setOwner(Dirtyable owner)
          This method should be called to set the document in which a SubDirtyable implementation will be persisted.
 int size()
           
 void update(java.lang.Object observed, UpdateMessage change)
          Notification message.
 
Methods inherited from class oracle.ide.model.DefaultSubDirtyable
getOwner, isDirty, markDirty
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LibraryListHelper

public LibraryListHelper()
Method Detail

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
Following copied from interface: oracle.ide.util.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.
Throws:
java.lang.ClassCastException - if target is non-null and cannot be downcast to the type of this object.

copyToImpl

protected void copyToImpl(LibraryListHelper copy)

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

equalsImpl

protected boolean equalsImpl(LibraryListHelper other)

setOwner

public void setOwner(Dirtyable owner)
Description copied from interface: SubDirtyable
This method should be called to set the document in which a SubDirtyable implementation will be persisted.
Overrides:
setOwner in class DefaultSubDirtyable
Following copied from interface: oracle.ide.model.SubDirtyable
Parameters:
owner - The Dirtyable object in which this SubDirtyable will be saved.

setLibraryList

public void setLibraryList(java.util.List libs)

getLibraryList

public java.util.List getLibraryList()

setJdkList

public void setJdkList(java.util.List jdks)

getJdkList

public java.util.List getJdkList()

findUniqueJDKName

public java.lang.String findUniqueJDKName()

findJDK

public JDK findJDK(java.lang.String JDKName)

findJDK

public JDK findJDK(VersionNumber num)

findJDK

public static JDK findJDK(VersionNumber num,
                          JDK[] jdks)

findUniqueLibraryName

public java.lang.String findUniqueLibraryName()

findLibrary

public JLibrary findLibrary(java.lang.String libName)

isChildLibrary

public boolean isChildLibrary(JLibrary lib)

isChildJDK

public boolean isChildJDK(JDK jdk)

canAdd

public boolean canAdd(Element element)

add

public boolean add(Element child)

canRemove

public boolean canRemove(Element element)

remove

public boolean remove(Element child)

removeAll

public void removeAll()

size

public int size()

getChildren

public java.util.Iterator getChildren()

containsChild

public boolean containsChild(Element child)

update

public void update(java.lang.Object observed,
                   UpdateMessage change)
Description copied from interface: Observer
Notification message. Subjects call this method when they notify their observers that the subjects state has changed.
Specified by:
update in interface Observer
Following copied from interface: oracle.ide.addin.Observer
Parameters:
observed - the subject whose state has changed.
change - what has changed.

Extension SDK