This document lists changes made to the Loaders
API. Please ask on the dev@openide.netbeans.org
mailing list
if you have any questions about the details of a
change, or are wondering how to convert existing code to be compatible.
Most module authors should start by reading the Upgrade Guide for the current release.
Fuller descriptions of all changes can be found below (follow links).
Not all deprecations are listed here, assuming that the deprecated APIs continue to essentially work. For a full deprecation list, please consult the Javadoc.
DataEditorSupport
DataLoaderPool.getDefault()
DataLoader
can be specified in a layer
ChangeableDataFilter
interface
DataShadow
uses URL for storage
DataNode.getHtmlDisplayName
was implemented
These API specification versions may be used to indicate that a module requires a certain API feature in order to function. For example, if you see here a feature you need which is labelled 1.20, your manifest should contain in its main attributes the line:
OpenIDE-Module-Module-Dependencies: org.openide.loaders > 1.20
DataEditorSupport
DataLoaderPool.getDefault()
DataLoader
can be specified in a layer
ChangeableDataFilter
interface
DataShadow
uses URL for storage
DataNode.getHtmlDisplayName
was implemented
org.openide.loaders.ChangeableDataFilter
ChangeableDataFilter
interface
org.openide.text.DataEditorSupport
org.openide.loaders.DataFolder
org.openide.loaders.DataLoader
DataLoader
can be specified in a layer
org.openide.loaders.DataLoaderPool
DataLoaderPool.getDefault()
org.openide.loaders.DataNode
DataNode.getHtmlDisplayName
was implemented
org.openide.loaders.DataObject
org.openide.awt.Toolbar
org.openide.awt.ToolbarPool
DataEditorSupport
DataEditorSupport
; made by: jtulach; issues:
#17081
Many people subclass DataEditorSupport
to provide editing ability for data
objects. The great majority of them wish to provide an editor cookie
and with standard semantics for open, modify, save, undo,
close, reload, etc. By using the
DataEditorSupport.create
factory
method this task is simplified to two lines of code.
DataLoaderPool.getDefault()
DataLoaderPool
; made by: jtulach; issues:
#41650
DataLoaderPool
now has a new method getDefault()
to allow simple access to the default system loader pool.
DataLoader
can be specified in a layer
DataLoader
; made by: jtulach; issues:
#45137
DataLoader
now has a new method protected String actionsContext()
which by default returns null
but can be overriden to identify name
of a place on default file system where layers can store instances of javax.swing.Action
that will then be used as a return value of DataNode.getActions(boolean)
.
This allows smooth extensibility of one data object's node with actions
from other modules.
The change is compatible, as if one does not override this method,
the behaviour remains the same as it used to be. If the method is overridden
and returns non-null value,
the DataLoader.setActions
uses the given context to
store the actions into it.
The standard loader for folder use Loaders/folder/any/Actions
as its context, so any module who wishes to add anything to its
popup menu, may register actions layer file like
any regular actions just into the folder Loaders/folder/any/Actions
.
ChangeableDataFilter
interface
ChangeableDataFilter
; made by: phrebejk; issues:
#44368
The class FolderChildren
was able to filter the children
using DataFilter
. But the data filter was constant for the
entire life of the FolderChildren
instance. ChangeableDataFilter
class adds the ability to change the filtering strategy, where
the change is reflected immediatley in the folder children.
Toolbar
ToolbarPool
; made by: mslama; issues:
#34574
Toolbar.getBasicHeight()
was added to replace Toolbar.BASIC_HEIGHT
.
ToolbarPool.getPreferredIconSize()
and ToolbarPool.setPreferredIconSize(int)
were added.
DataShadow
uses URL for storage
DataNode.getHtmlDisplayName
was implemented
DataNode
; made by: tboudreau; issues:
#29466
DataNode
now implements getHtmlDisplayName()
as follows: If the
underlying filesystem implements the new FileSystem.HtmlStatus
, it will
call FileSystem.HtmlStatus.annotateNameHtml()
and return the result.
This enables, for example, CVS annotations to be shown with a different
font color.
DataFolder
; made by: jglick; issues:
#26667
LAST_MODIFIED
and
SIZE
, were added.
DataObject
; made by: jtulach; issues:
#33750
DataObjects
and DataLoaders
.
This change has been introduced to make the behaviour
safer and more predicatable. Its goal is not to introduce
new deadlocks, but everybody writing its own loaders has
to keep in mind that it is dangerous to perform a long
running operation in the handleCopy, handleMove,
handleRename, handleCreateFromTemplate methods.
DataObject
; made by: jtulach; issues:
#33469
org.openide.loaders
package
the possibility to invoke DataObject
's constructor has been
restricted.
There is an OperationListener
class in the org.openide.loaders
package that shall be notified about every created DataObject. It is easy
to be notified when the DataObject is being created, but the notification
shall be done when its constructor finishes otherwise magic race
conditions can happen, see for example
issue 20022.
The previous solution was to wait 500ms after the start of DataObject's
constructor and notifying the creation than, but of course it means
that if the constructor takes longer time, we were in the same problem again.
Because DataObjects shall be created only by DataLoaders in method
DataLoader.handleFindDataObject
, we can notify each data
object when the execution is returning from DataLoader.handleFindDataObject,
but in order for the system to work correctly we shall prevent creation
of DataObjects outside of this place.
DataObject constructor will throw an exception if invoked outside of
DataLoader.handleFindDataObject
or MultiFileLoader.createDataObject
methods. This is incompatible change, but nobody should really be affected,
as creating data objects outside of DataLoader has no real
meaning.
org.openide.loaders
package were separated
out from the whole openide.jar into their own openide-loaders.jar.
Built on May 4 2005. | Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.