public final class MasterDocumentManager extends AppPartBase implements OpenedDocumentHook2, AppDocumentTypeDetector.Listener
app, id
Constructor and Description |
---|
MasterDocumentManager() |
Modifier and Type | Method and Description |
---|---|
static DocumentSet |
addDocumentSet(App app,
OpenedDocument openedDoc) |
boolean |
checkingDocument(OpenedDocument openedDoc)
Invoked before specified OpenedDocument is checked for validity.
|
boolean |
closingDocument(OpenedDocument openedDoc)
Invoked before specified OpenedDocument is being closed.
|
boolean |
creatingDocument(OpenedDocument openedDoc,
URL templateURL)
Invoked before a specified OpenedDocument is ``created''.
|
void |
detectedDocumentType(Element rootElement,
DTDSpec dtdSpec,
Configuration configuration,
DocumentTypeSpec documentTypeSpec) |
Diagnostic[] |
documentChecked(OpenedDocument openedDoc,
HookStatus status,
Diagnostic[] diagnostics)
Invoked after specified OpenedDocument has been checked for validity.
|
void |
documentClosed(OpenedDocument openedDoc,
HookStatus status)
Invoked after specified OpenedDocument has been closed.
|
void |
documentCreated(OpenedDocument openedDoc,
HookStatus status)
Invoked after specified OpenedDocument has been ``created''.
|
void |
documentDisposed(OpenedDocument openedDoc)
Invoked after specified OpenedDocument has been disposed.
|
void |
documentEvent(OpenedDocument openedDoc,
DocumentEvent event)
A DocumentEvent has been received by openedDoc which then
forwards it to this hook.
|
void |
documentOpened(OpenedDocument openedDoc,
HookStatus status)
Invoked after specified OpenedDocument has been ``opened''.
|
void |
documentSaved(OpenedDocument openedDoc,
HookStatus status)
Invoked after specified OpenedDocument has been saved.
|
void |
documentSavedAs(OpenedDocument openedDoc,
HookStatus status)
Invoked after specified OpenedDocument has been saved to a different
location.
|
static DocumentSet |
getDocumentSet(OpenedDocument openedDoc) |
static DocumentSetFactory |
getDocumentSetFactory(OpenedDocument openedDoc) |
void |
initApp(App app,
String id)
Specifies the App containing this part and the unique ID of this part
within the App.
|
static Boolean |
isAutoCreateDocumentSetFactory(App app,
OpenedDocument openedDoc) |
boolean |
openingDocument(OpenedDocument openedDoc,
URL openURL,
boolean readOnly)
Invoked before a specified OpenedDocument is ``opened''.
|
static void |
reloadDocumentSet(App app,
DocumentSet docSet,
OpenedDocument masterDoc) |
static void |
removeDocumentSet(App app,
DocumentSet docSet,
OpenedDocument masterDoc) |
boolean |
savingDocument(OpenedDocument openedDoc)
Invoked before specified OpenedDocument is being saved.
|
boolean |
savingDocumentAs(OpenedDocument openedDoc,
URL saveURL)
Invoked before specified OpenedDocument is being saved to a different
location.
|
static void |
updateDocumentSet(App app,
DocumentSet docSet,
OpenedDocument masterDoc) |
activeEditorChanged, applyPreferences, destroyApp, editingContextChanged, flushPreferences, getApp, getId, isEditingContextSensitive, namespacePrefixesChanged, saveStateChanged, undoStateChanged, validityStateChanged
public void initApp(App app, String id)
AppPartBase
Default implementation simply stores its arguments in
AppPartBase.app
and AppPartBase.id
.
initApp
in interface AppPart
initApp
in class AppPartBase
AppPart.getApp()
,
AppPart.getId()
,
App.getPart(java.lang.String)
public void detectedDocumentType(Element rootElement, DTDSpec dtdSpec, Configuration configuration, DocumentTypeSpec documentTypeSpec)
detectedDocumentType
in interface AppDocumentTypeDetector.Listener
public boolean openingDocument(OpenedDocument openedDoc, URL openURL, boolean readOnly)
OpenedDocumentHook
Receiving this notification guarantees that OpenedDocumentHook.documentOpened(com.xmlmind.xmleditapp.desktop.OpenedDocument, com.xmlmind.xmleditapp.desktop.HookStatus)
will also being invoked, even if the status passed to this method may
be different from HookStatus.SUCCESS
.
openingDocument
in interface OpenedDocumentHook
openedDoc
- OpenedDocument which is the subject of this eventopenURL
- URL of the document to be openedreadOnly
- if true
, the document is to be opened in
read-only modefalse
if this operation is vetoed by this hook;
true
otherwiseOpenedDocument.open(java.net.URL, boolean)
public void documentOpened(OpenedDocument openedDoc, HookStatus status)
OpenedDocumentHook
This method is invoked before an
UndoManager
is added to
the newly opened Document
. Therefore it's
possible to modify the document in this method.
documentOpened
in interface OpenedDocumentHook
openedDoc
- OpenedDocument which is the subject of this eventstatus
- status of this operationOpenedDocument.open(java.net.URL, boolean)
public boolean savingDocument(OpenedDocument openedDoc)
OpenedDocumentHook
Receiving this notification guarantees that OpenedDocumentHook.documentSaved(com.xmlmind.xmleditapp.desktop.OpenedDocument, com.xmlmind.xmleditapp.desktop.HookStatus)
will also being invoked, even if the status passed to this method may
be different from HookStatus.SUCCESS
.
savingDocument
in interface OpenedDocumentHook
openedDoc
- OpenedDocument which is the subject of this eventfalse
if this operation is vetoed by this hook;
true
otherwiseOpenedDocument.save()
public void documentSaved(OpenedDocument openedDoc, HookStatus status)
OpenedDocumentHook
documentSaved
in interface OpenedDocumentHook
openedDoc
- OpenedDocument which is the subject of this eventstatus
- status of this operationOpenedDocument.save()
public boolean savingDocumentAs(OpenedDocument openedDoc, URL saveURL)
OpenedDocumentHook
Receiving this notification guarantees that OpenedDocumentHook.documentSavedAs(com.xmlmind.xmleditapp.desktop.OpenedDocument, com.xmlmind.xmleditapp.desktop.HookStatus)
will also being invoked, even if the status passed to this method may
be different from HookStatus.SUCCESS
.
savingDocumentAs
in interface OpenedDocumentHook
openedDoc
- OpenedDocument which is the subject of this eventsaveURL
- URL where the document is to be savedfalse
if this operation is vetoed by this hook;
true
otherwiseOpenedDocument.saveAs(java.net.URL)
public void documentSavedAs(OpenedDocument openedDoc, HookStatus status)
OpenedDocumentHook
documentSavedAs
in interface OpenedDocumentHook
openedDoc
- OpenedDocument which is the subject of this eventstatus
- status of this operationOpenedDocument.saveAs(java.net.URL)
public boolean closingDocument(OpenedDocument openedDoc)
OpenedDocumentHook
Receiving this notification guarantees that OpenedDocumentHook.documentClosed(com.xmlmind.xmleditapp.desktop.OpenedDocument, com.xmlmind.xmleditapp.desktop.HookStatus)
will also being invoked, even if the status passed to this method may
be different from HookStatus.SUCCESS
.
closingDocument
in interface OpenedDocumentHook
openedDoc
- OpenedDocument which is the subject of this eventfalse
if this operation is vetoed by this hook;
true
otherwiseOpenedDocument.close()
public void documentClosed(OpenedDocument openedDoc, HookStatus status)
OpenedDocumentHook
documentClosed
in interface OpenedDocumentHook
openedDoc
- OpenedDocument which is the subject of this eventstatus
- status of this operationOpenedDocument.close()
public void documentEvent(OpenedDocument openedDoc, DocumentEvent event)
OpenedDocumentHook2
documentEvent
in interface OpenedDocumentHook2
openedDoc
- the OpenedDocument forwarding the DocumentEventevent
- contains the ``message'' sent by the invokerpublic boolean creatingDocument(OpenedDocument openedDoc, URL templateURL)
OpenedDocumentHook
Receiving this notification guarantees that OpenedDocumentHook.documentCreated(com.xmlmind.xmleditapp.desktop.OpenedDocument, com.xmlmind.xmleditapp.desktop.HookStatus)
will also being invoked, even if the status passed to this method may
be different from HookStatus.SUCCESS
.
creatingDocument
in interface OpenedDocumentHook
openedDoc
- OpenedDocument which is the subject of this eventtemplateURL
- URL of the document templatefalse
if this operation is vetoed by this hook;
true
otherwiseOpenedDocument.newFromTemplate(java.net.URL)
public void documentCreated(OpenedDocument openedDoc, HookStatus status)
OpenedDocumentHook
This method is invoked before an
UndoManager
is added to
the newly created Document
. Therefore it's
possible to modify the document in this method.
documentCreated
in interface OpenedDocumentHook
openedDoc
- OpenedDocument which is the subject of this eventstatus
- status of this operationOpenedDocument.newFromTemplate(java.net.URL)
public boolean checkingDocument(OpenedDocument openedDoc)
OpenedDocumentHook
Receiving this notification guarantees that OpenedDocumentHook.documentChecked(com.xmlmind.xmleditapp.desktop.OpenedDocument, com.xmlmind.xmleditapp.desktop.HookStatus, com.xmlmind.xml.validate.Diagnostic[])
will also being invoked, even if the status passed to this method may
be different from HookStatus.SUCCESS
.
checkingDocument
in interface OpenedDocumentHook
openedDoc
- OpenedDocument which is the subject of this eventfalse
if this operation is vetoed by this hook;
true
otherwiseOpenedDocument.checkValidity(com.xmlmind.xmleditapp.validatehook.Reason, java.net.URL)
public Diagnostic[] documentChecked(OpenedDocument openedDoc, HookStatus status, Diagnostic[] diagnostics)
OpenedDocumentHook
This method can be used to implement semantic validation. Such
validation method must append semantic
warnings (Diagnostic.Severity#SEMANTIC_WARNING
)
and errors (Diagnostic.Severity#SEMANTIC_ERROR
) to the
list of validity warnings and errors passed as third argument.
documentChecked
in interface OpenedDocumentHook
openedDoc
- OpenedDocument which is the subject of this eventstatus
- status of this operationdiagnostics
- (possibly empty) list of warnings and errors found
during validationOpenedDocument.checkValidity(com.xmlmind.xmleditapp.validatehook.Reason, java.net.URL)
public void documentDisposed(OpenedDocument openedDoc)
OpenedDocumentHook
documentDisposed
in interface OpenedDocumentHook
openedDoc
- OpenedDocument which is the subject of this event.
The state of openedDoc has already been cleared.
For example, openedDoc.getDocument()
returns null
.
OpenedDocument.dispose()
public static DocumentSet addDocumentSet(App app, OpenedDocument openedDoc)
public static DocumentSetFactory getDocumentSetFactory(OpenedDocument openedDoc)
public static Boolean isAutoCreateDocumentSetFactory(App app, OpenedDocument openedDoc)
public static void updateDocumentSet(App app, DocumentSet docSet, OpenedDocument masterDoc)
public static void reloadDocumentSet(App app, DocumentSet docSet, OpenedDocument masterDoc)
public static void removeDocumentSet(App app, DocumentSet docSet, OpenedDocument masterDoc)
public static DocumentSet getDocumentSet(OpenedDocument openedDoc)