Class AbstractComponentProvider
java.lang.Object
ro.sync.ecss.extensions.api.component.InternalComponentProvider
ro.sync.ecss.extensions.api.component.AbstractComponentProvider
- All Implemented Interfaces:
ComponentProvider,EditorComponentProvider,DisplayModeConstants
- Direct Known Subclasses:
AuthorComponentProvider,GenericEditorComponentProvider
@API(type=NOT_EXTENDABLE,
src=PRIVATE)
public abstract class AbstractComponentProvider
extends ro.sync.ecss.extensions.api.component.InternalComponentProvider
implements DisplayModeConstants, EditorComponentProvider
A component encapsulating all the editing part.
Developers can create an editor, and access the document through the
WSEditor API.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanTrue if the detection finishedprotected static final org.slf4j.LoggerLogger for logging.protected static final ro.sync.i18n.MessageBundleThe messages resource bundle.Fields inherited from interface ro.sync.exml.workspace.api.editor.page.author.DisplayModeConstants
DISPLAY_MODE_BLOCK_TAGS, DISPLAY_MODE_BLOCK_TAGS_WITHOUT_TEXT, DISPLAY_MODE_FULL_TAGS, DISPLAY_MODE_FULL_TAGS_WITH_ATTRS, DISPLAY_MODE_INLINE_TAGS, DISPLAY_MODE_NO_TAGS, DISPLAY_MODE_PARTIAL_TAGSFields inherited from interface ro.sync.ecss.extensions.api.component.EditorComponentProvider
ATTRIBUTES_PANEL_ID, ELEMENTS_PANEL_ID, ENTITIES_PANEL_ID, MODEL_PANEL_ID, OUTLINER_PANEL_ID, REVIEWS_PANEL_ID -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds an author component listener.protected abstract ro.sync.exml.editor.AbstractEditorcreateEditor(ro.sync.exml.workspace.impl.component.BaseComponentEditorManager parentEditorManager, Frame parentFrame, String[] allowedPages, String initialPage, String contentType) Create an editorCreate a reader over the editor's current page contentgetAdditionalEditHelper(int helperID) Get an additional edit helper panel.Get the main editor panel.Get the status panel which shows the status of the edited document.Get the access to the WS Editor.booleanCheck if the component is modifiedvoidSets the content to edit.voidprint(boolean preview) Print the author component content.voidRemoves an author component listener.voidsave()Save the content back to the original URL from where it was loaded using the internal support.voidsetModified(boolean modified) Sets the modified status.voidshowLocation(URL url) Show the location referenced by a given URL in the editor.voidshowLocation(URL url, Reader reader) Show the location referenced by a given URL in the editor.
-
Field Details
-
logger
protected static final org.slf4j.Logger loggerLogger for logging. -
messages
protected static final ro.sync.i18n.MessageBundle messagesThe messages resource bundle. -
detectionFinished
protected boolean detectionFinishedTrue if the detection finished
-
-
Method Details
-
save
public void save()Save the content back to the original URL from where it was loaded using the internal support. Useful only when you provide an initial URL from which the component is loaded. -
load
Sets the content to edit.This does not guarantee that the set content has been interpreted, you should set an
AuthorComponentListenerand listen fordocumentTypeChanged()before using the author extension actions.- Specified by:
loadin interfaceComponentProvider- Parameters:
url- URL to load, can benullif the reader is specified If no XML content reader is given, the URL will be used both to obtain the content and to solve relative references (eg: images). If the XML content reader is also given, the URL will only be used to solve relative references from the file.reader- The reader.- Throws:
AuthorComponentException- When there was a load problem (eg: IOException).
-
showLocation
Description copied from interface:EditorComponentProviderShow the location referenced by a given URL in the editor.
If the document pointed by this URL is different than the document currently loaded in the editor page, this URL will be used to set the content to edit, to solve relative references (eg: images) and to show the location pointed by the URL reference part.
If the document pointed by this URL is currently loaded in the editor page, only the reference part of the given URL will be used to show the corresponding location in the editor.- Specified by:
showLocationin interfaceEditorComponentProvider- Parameters:
url- The URL to show location for.reader- The reader over the URL, can be null.- Throws:
AuthorComponentException- When there was a load problem (eg: IOException).- See Also:
-
createEditor
protected abstract ro.sync.exml.editor.AbstractEditor createEditor(ro.sync.exml.workspace.impl.component.BaseComponentEditorManager parentEditorManager, Frame parentFrame, String[] allowedPages, String initialPage, String contentType) throws AuthorComponentException Create an editor- Parameters:
parentEditorManager- The view manager.parentFrame- View's parent frame.allowedPages- The enumeration of allowed pages.initialPage- The initial page. Can benullcontentType- The content type of the editor.- Returns:
- The new created editor.
- Throws:
AuthorComponentException
-
createReader
Create a reader over the editor's current page content- Returns:
- The reader over the current page's content
-
addAuthorComponentListener
Adds an author component listener.- Specified by:
addAuthorComponentListenerin interfaceEditorComponentProvider- Parameters:
listener- The listener.
-
removeAuthorComponentListener
Removes an author component listener.- Specified by:
removeAuthorComponentListenerin interfaceEditorComponentProvider- Parameters:
listener- The listener.
-
getEditorComponent
Description copied from interface:ComponentProviderGet the main editor panel.- Specified by:
getEditorComponentin interfaceComponentProvider- Returns:
- The editor panel.
-
getStatusComponent
Description copied from interface:ComponentProviderGet the status panel which shows the status of the edited document.- Specified by:
getStatusComponentin interfaceComponentProvider- Returns:
- The status panel.
-
isModified
public boolean isModified()Check if the component is modified- Returns:
trueif the component is modified.
-
setModified
public void setModified(boolean modified) Sets the modified status.- Parameters:
modified-trueto flag as modified.- Since:
- 13
-
getWSEditorAccess
Get the access to the WS Editor.- Specified by:
getWSEditorAccessin interfaceComponentProvider- Returns:
- The author access.
-
getEditorKey
- Specified by:
getEditorKeyin classro.sync.ecss.extensions.api.component.InternalComponentProvider- Returns:
- The editor.
-
getAdditionalEditHelper
Get an additional edit helper panel. It can be the Attributes, Reviews, Outliner, Elements, Entities, Model component, depending on the ID. Note that the Elements, Entities and Model views are not available in the Author Reviewer edition.- Specified by:
getAdditionalEditHelperin interfaceEditorComponentProvider- Parameters:
helperID- One of:- Returns:
- The additional component.
-
print
public void print(boolean preview) Print the author component content. Shows the Print dialog.- Specified by:
printin interfaceComponentProvider- Parameters:
preview-trueto show the Print Preview dialog,falseto show the Print dialog.- Since:
- 13
-
showLocation
Show the location referenced by a given URL in the editor.
If the document pointed by this URL is different than the document currently loaded in the editor page, this URL will be used to set the content to edit, to solve relative references (eg: images) and to show the location pointed by the URL reference part.
If the document pointed by this URL is currently loaded in the editor page, only the reference part of the given URL will be used to show the corresponding location in the editor.- Parameters:
url- The URL to show location for.- Throws:
AuthorComponentException- When there was a load problem (eg: IOException).- Since:
- 14.1
-