All the documents and components register here so that they become available
to the processing that crosses different components and documents such as
cross document position stack or word matching.
author: Miloslav Metelka version: 1.00
Method Summary
public static synchronized void
activate(JTextComponent c) Put the component to the first position in the array of last accessed
components.
public static synchronized void
activate(BaseDocument doc) Put the document to the first position in the array of last accessed
documents.
Put the document to the first position in the array of last accessed
documents. The document must be registered otherwise nothing is done.
Parameters: doc - document to be activated
Add weak listener to listen to change of activity of documents or
components. The caller must hold the listener object in some instance
variable to prevent it from being garbage collected.
Parameters: l - listener to add
Add component to registry. If the component is already registered it
returns the existing} ID. The document that is currently assigned to the
component is _not_ registered automatically.
ID of the component
Get component when its ID is known. It's rather cheap operation.
Parameters: compID - component ID. It can be retrieved from the component bygetID(c). component instance or null when document no longer exists
getComponentIterator
public static synchronized Iterator getComponentIterator()(Code)
Get the iterator over the active components. It starts with the most
active component till the least active component.
Get document when its ID is known. It's rather cheap operation.
Parameters: docID - document ID. It can be retrieved from the document bygetID(doc). document instance or null when document no longer exists
getDocumentIterator
public static synchronized Iterator getDocumentIterator()(Code)
Get the iterator over the active documents. It starts with the most
active document till the least active document. It's just the current
snapshot so the iterator will not reflect future changes.
Remove listener for changes in activity. It's optional to remove the
listener. It would be done automatically if the object holding the
listener would be garbage collected.
Parameters: l - listener to remove
Remove component from registry. It's usually done when the UI of the
component is being deinstalled.
ID that the component had in the registry. The possible new IDwill be different from this one. -1 will be returned if thecomponent was not yet added to the registry.