| |
|
| java.lang.Object org.openide.util.Task org.openide.loaders.FolderInstance
All known Subclasses: org.openide.loaders.DataLdrActions, org.openide.loaders.FolderLookup,
folder | protected DataFolder folder(Code) | | Folder to work with. Non null only if a constructor with DataFolder
is used to construct this object.
|
FolderInstance | public FolderInstance(DataFolder df)(Code) | | Create new folder instance.
Parameters: df - data folder to create instances from |
FolderInstance | public FolderInstance(DataObject.Container container)(Code) | | A new object that listens on changes in a container.
Parameters: container - the object to associate with since: 1.11 |
acceptContainer | protected InstanceCookie acceptContainer(DataObject.Container container)(Code) | | Allows subclasses to decide how they want to work with an object
that implements a DataObject.Container.
By default this returns null to indicated that subfolders
(as well as
DataShadow s, etc.) should be ignored.
A common override of this method is to return a new
FolderInstance based on the subfolder, permitting
recursion.
Compare
FolderInstance.acceptDataObject(DataObject) to learn when this method
is called.
Parameters: container - the container to accept or not cookie for this container or null if this object shouldbe ignored since: 1.11 |
acceptDataObject | protected InstanceCookie acceptDataObject(DataObject dob)(Code) | | Allows subclasses to decide whether they want to work with the specified
DataObject or not.
The default implementation roughly performs the following steps:
- if
dob has an InstanceCookie
FolderInstance.acceptCookie(InstanceCookie) is called on that cookie
- if
dob has a DataFolder cookie,
FolderInstance.acceptFolder(DataFolder) is called on that folder
- if
dob has a DataObject.Container cookie,
FolderInstance.acceptContainer(DataObject.Container) is called on that
container
The first of the aforementioned steps which returns a non-null
cookie and does not throw an exception determines the return value. If
none of the steps succeeds, null is returned.
Parameters: dob - a DataObject to test the cookie for the DataObject or null if it should not be used |
checkRecreate | final void checkRecreate()(Code) | | Checks whether recreation of this instance is running already
and in that case does nothing, otherwise calls
FolderInstance.recreate() recreate method.
This prevents from redundant recreation tasks of this instance caused by
first creation of underlying items which are also of
org.openide.util.Task Task type (e.g. sub-FolderInstances, sub-FolderLookups etc.).
|
createInstance | abstract protected Object createInstance(InstanceCookie[] cookies) throws java.io.IOException, ClassNotFoundException(Code) | | Notifies subclasses that the set of cookies for this folder
has changed.
A new object representing the folder should
be created (or the old one updated).
Called both upon initialization of the class, and change of its cookies.
It may be poor style for this method to have side-effects. A
common way to use FolderInstance is to have this
method set some global state which is then used as the resulting
instance. Better is to treat the FolderInstance as
pure SPI and assign it to a variable of type
InstanceCookie . Then use the
FolderInstance.instanceCreate method to get the final result. However in some
cases there is a singleton live object which must be updated
in-place, and it only makes sense to do so here (in which case
the InstanceCookie methods are unused).
Parameters: cookies - updated array of instance cookies for the folder object to represent these cookies exception: IOException - an I/O error occured exception: ClassNotFoundException - a class has not been found |
err | final Logger err()(Code) | | Access to error manager for FolderLookup.
|
instanceFinished | final public void instanceFinished()(Code) | | Wait for instance initialization to finish.
|
instanceName | public String instanceName()(Code) | | The name of the class that we create.
the name |
postCreationTask | protected Task postCreationTask(Runnable run)(Code) | | Invokes the creation of objects in a "safe" thread. This method is
for expert subclasses that want to control the thread that the
instance is created in.
The default implementation invokes the creation logic in the
request processor in non-blocking mode (no other tasks will
block on this).
Parameters: run - runnable to run task to control the execution of the runnable or null if the runnable is run immediatelly since: 1.5 |
recreate | public synchronized void recreate()(Code) | | Starts recreation of the instance in special thread.
|
run | public void run()(Code) | | Synchronously starts the creation of the instance.
|
waitFinished | public void waitFinished()(Code) | | Overrides the instance finished to deal with
internal state correctly.
|
|
|
|