Oxygen XML Editor 16.1 Author API

ro.sync.ecss.extensions.api.component
Class AuthorComponentProvider

java.lang.Object
  extended by ro.sync.ecss.extensions.api.component.InternalComponentProvider
      extended by ro.sync.ecss.extensions.api.component.AuthorComponentProvider
All Implemented Interfaces:
ComponentProvider, EditorComponentProvider, ro.sync.ecss.layout.DisplayModeConstants

@API(type=NOT_EXTENDABLE,
     src=PRIVATE)
public class AuthorComponentProvider
extends ro.sync.ecss.extensions.api.component.InternalComponentProvider
implements ro.sync.ecss.layout.DisplayModeConstants, EditorComponentProvider

A component encapsulating all the visual editing part. Developers can set the XML and CSS files, and access the document through the AuthorAccess API.


Field Summary
static int ATTRIBUTES_PANEL_ID
          Attributes Panel
protected  boolean detectionFinished
          True if the detection finished
static int ELEMENTS_PANEL_ID
          Elements Panel
static int ENTITIES_PANEL_ID
          Entities Panel
static int MODEL_PANEL_ID
          Model Panel
static int OUTLINER_PANEL_ID
          Outliner Panel
static int REVIEWS_PANEL_ID
          Reviews Panel
 
Fields inherited from interface ro.sync.ecss.layout.DisplayModeConstants
ACTIVE_DISPLAY_MODE, DISPLAY_MODE_BLOCK_TAGS, DISPLAY_MODE_FULL_TAGS, DISPLAY_MODE_FULL_TAGS_WITH_ATTRS, DISPLAY_MODE_INLINE_TAGS, DISPLAY_MODE_NO_TAGS, DISPLAY_MODE_PARTIAL_TAGS
 
Method Summary
 void addAuthorComponentListener(AuthorComponentListener listener)
          Adds an author component listener.
 java.util.List<javax.swing.JToolBar> createExtensionActionsToolbars()
          Deprecated. Please use instead the method ((WSAuthorComponentEditorPage)getWSEditorAccess().getCurrentPage()).createExtensionActionsToolbars();
 java.io.Reader createReader()
          Create a reader over the editor's current page content
 javax.swing.JComponent getAdditionalEditHelper(int helperID)
          Get an additional edit helper panel.
 AuthorAccess getAuthorAccess()
          Deprecated. Please use instead the method ((WSAuthorEditorPage)getWSEditorAccess().getCurrentPage()).getAuthorAccess().
 java.util.Map<java.lang.String,javax.swing.AbstractAction> getAuthorCommonActions()
          Deprecated. Please use instead the method ((WSAuthorEditorPage)getWSEditorAccess().getCurrentPage()).getActionsProvider().getAuthorCommonActions().
 java.util.Map<java.lang.String,javax.swing.AbstractAction> getAuthorExtensionActions()
          Deprecated. Please use instead the method ((WSAuthorEditorPage)getWSEditorAccess().getCurrentPage()).getActionsProvider().getAuthorExtensionActions().
 java.awt.Component getEditorComponent()
          Get the main editor panel.
protected  java.lang.Object getEditorKey()
           
 java.awt.Component getStatusComponent()
          Get the status panel which shows the status of the edited document.
 WSEditor getWSEditorAccess()
          Get the access to the WS Editor.
 boolean isModified()
          Check if the component is modified
 void load(java.net.URL url, java.io.Reader reader)
          Sets the content to edit.
 void print(boolean preview)
          Print the author component content.
 void removeAuthorComponentListener(AuthorComponentListener listener)
          Removes an author component listener.
 void save()
          Save the content back to the original URL from where it was loaded using the internal support.
 void setBreadCrumbPopUpCustomizer(PopupMenuCustomizer popUpCustomizer)
          Deprecated. Please use instead the method ((WSAuthorComponentEditorPage)getWSEditorAccess().getCurrentPage()).setBreadCrumbPopUpCustomizer();
 void setEditorPopUpCustomizer(PopupMenuCustomizer popUpCustomizer)
          Deprecated. Please use instead the method ((WSAuthorEditorPage)getWSEditorAccess().getCurrentPage())addPopUpMenuCustomizer(AuthorPopupMenuCustomizer popUpCustomizer)
 void setModified(boolean modified)
          Sets the modified status.
 void setOutlinerPopUpCustomizer(PopupMenuCustomizer popUpCustomizer)
          Deprecated. Please use instead the method ((WSAuthorComponentEditorPage)getWSEditorAccess().getCurrentPage()).setOutlinerPopUpCustomizer();
 void showBreadCrumb(boolean showBreadCrumb)
          Deprecated. Please use instead the method ((WSAuthorComponentEditorPage)getWSEditorAccess().getCurrentPage()).showBreadCrumbPanel();
 void showLocation(java.net.URL url)
          Show the location referenced by a given URL in the editor.
 void showLocation(java.net.URL url, java.io.Reader reader)
          Show the location referenced by a given URL in the editor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

detectionFinished

protected boolean detectionFinished
True if the detection finished


OUTLINER_PANEL_ID

public static final int OUTLINER_PANEL_ID
Outliner Panel

See Also:
Constant Field Values

ATTRIBUTES_PANEL_ID

public static final int ATTRIBUTES_PANEL_ID
Attributes Panel

See Also:
Constant Field Values

MODEL_PANEL_ID

public static final int MODEL_PANEL_ID
Model Panel

See Also:
Constant Field Values

ELEMENTS_PANEL_ID

public static final int ELEMENTS_PANEL_ID
Elements Panel

See Also:
Constant Field Values

ENTITIES_PANEL_ID

public static final int ENTITIES_PANEL_ID
Entities Panel

See Also:
Constant Field Values

REVIEWS_PANEL_ID

public static final int REVIEWS_PANEL_ID
Reviews Panel

See Also:
Constant Field Values
Method Detail

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

public void load(java.net.URL url,
                 java.io.Reader reader)
          throws AuthorComponentException
Sets the content to edit.

This does not guarantee that the set content has been interpreted, you should set an AuthorComponentListener and listen for documentTypeChanged() before using the author extension actions.

Specified by:
load in interface ComponentProvider
Parameters:
url - URL to load, can be null if 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

public void showLocation(java.net.URL url,
                         java.io.Reader reader)
                  throws AuthorComponentException
Description copied from interface: EditorComponentProvider
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.

Specified by:
showLocation in interface EditorComponentProvider
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:
EditorComponentProvider.showLocation(java.net.URL, java.io.Reader)

createReader

public java.io.Reader createReader()
Create a reader over the editor's current page content

Returns:
The reader over the current page's content

addAuthorComponentListener

public void addAuthorComponentListener(AuthorComponentListener listener)
Adds an author component listener.

Specified by:
addAuthorComponentListener in interface EditorComponentProvider
Parameters:
listener - The listener.

removeAuthorComponentListener

public void removeAuthorComponentListener(AuthorComponentListener listener)
Removes an author component listener.

Specified by:
removeAuthorComponentListener in interface EditorComponentProvider
Parameters:
listener - The listener.

getEditorComponent

public java.awt.Component getEditorComponent()
Description copied from interface: ComponentProvider
Get the main editor panel.

Specified by:
getEditorComponent in interface ComponentProvider
Returns:
The editor panel.

getStatusComponent

public java.awt.Component getStatusComponent()
Description copied from interface: ComponentProvider
Get the status panel which shows the status of the edited document.

Specified by:
getStatusComponent in interface ComponentProvider
Returns:
The status panel.

getAuthorExtensionActions

@Deprecated
public java.util.Map<java.lang.String,javax.swing.AbstractAction> getAuthorExtensionActions()
Deprecated. Please use instead the method ((WSAuthorEditorPage)getWSEditorAccess().getCurrentPage()).getActionsProvider().getAuthorExtensionActions().

Gets the map of author extension actions.

This should get called after each load as the extension actions depend on the loaded document type.

Returns:
The map with (action id, AbstractAction) pairs with the actions defined in the Author framework. Can be null if no actions available.

getAuthorCommonActions

@Deprecated
public java.util.Map<java.lang.String,javax.swing.AbstractAction> getAuthorCommonActions()
Deprecated. Please use instead the method ((WSAuthorEditorPage)getWSEditorAccess().getCurrentPage()).getActionsProvider().getAuthorCommonActions().

Get the map of author common actions (undo, redo, cut, copy, paste, etc).

Returns:
The map with (action id, AbstractAction) pairs with the actions defined for working in the Author.

isModified

public boolean isModified()
Check if the component is modified

Returns:
true if the component is modified.

setModified

public void setModified(boolean modified)
Sets the modified status.

Parameters:
modified - true to flag as modified.
Since:
13

getAuthorAccess

@Deprecated
public AuthorAccess getAuthorAccess()
Deprecated. Please use instead the method ((WSAuthorEditorPage)getWSEditorAccess().getCurrentPage()).getAuthorAccess().

Get the author access used to perform various operations on the Author Page.

Returns:
The author access.

getWSEditorAccess

public WSEditor getWSEditorAccess()
Get the access to the WS Editor.

Specified by:
getWSEditorAccess in interface ComponentProvider
Returns:
The author access.

getEditorKey

protected java.lang.Object getEditorKey()
Specified by:
getEditorKey in class ro.sync.ecss.extensions.api.component.InternalComponentProvider
Returns:
The editor.

setEditorPopUpCustomizer

@Deprecated
public void setEditorPopUpCustomizer(PopupMenuCustomizer popUpCustomizer)
Deprecated. Please use instead the method ((WSAuthorEditorPage)getWSEditorAccess().getCurrentPage())addPopUpMenuCustomizer(AuthorPopupMenuCustomizer popUpCustomizer)

The Pop-up customizer can be used to add/remove actions from the pop-up menu in the Author page editor before showing it. If everything is removed then the menu will not be shown.

Parameters:
popUpCustomizer - The pop Up Customizer.

setOutlinerPopUpCustomizer

@Deprecated
public void setOutlinerPopUpCustomizer(PopupMenuCustomizer popUpCustomizer)
Deprecated. Please use instead the method ((WSAuthorComponentEditorPage)getWSEditorAccess().getCurrentPage()).setOutlinerPopUpCustomizer();

The Pop-up customizer can be used to add/remove actions from the pop-up menu in the Author Outliner view before showing it. If everything is removed then the menu will not be shown.

Parameters:
popUpCustomizer - The pop Up Customizer.

showBreadCrumb

@Deprecated
public void showBreadCrumb(boolean showBreadCrumb)
Deprecated. Please use instead the method ((WSAuthorComponentEditorPage)getWSEditorAccess().getCurrentPage()).showBreadCrumbPanel();

Show or hide the Bread Crumb panel in Author component.

Parameters:
showBreadCrumb - true to show the Bread Crumb.
Since:
14.1

setBreadCrumbPopUpCustomizer

@Deprecated
public void setBreadCrumbPopUpCustomizer(PopupMenuCustomizer popUpCustomizer)
Deprecated. Please use instead the method ((WSAuthorComponentEditorPage)getWSEditorAccess().getCurrentPage()).setBreadCrumbPopUpCustomizer();

The Pop-up customizer can be used to add/remove actions from the pop-up menu in the Author bread crumb before showing it. If everything is removed then the menu will not be shown.

Parameters:
popUpCustomizer - The pop Up Customizer.

getAdditionalEditHelper

public javax.swing.JComponent getAdditionalEditHelper(int helperID)
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:
getAdditionalEditHelper in interface EditorComponentProvider
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:
print in interface ComponentProvider
Parameters:
preview - true to show the Print Preview dialog, false to show the Print dialog.
Since:
13

createExtensionActionsToolbars

@Deprecated
public java.util.List<javax.swing.JToolBar> createExtensionActionsToolbars()
Deprecated. Please use instead the method ((WSAuthorComponentEditorPage)getWSEditorAccess().getCurrentPage()).createExtensionActionsToolbars();

Create toolbars with all the actions defined at the framework level in exactly the same order in which they have been added to the toolbars from the Document Type Edit dialog. The toolbars will look almost identical with the ones which appear when the XML is opened in an Oxygen standalone version.

Returns:
toolbars with all the actions defined at the framework level.
Since:
14.1

showLocation

public void showLocation(java.net.URL url)
                  throws AuthorComponentException
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

Oxygen XML Editor 16.1 Author API

© Copyright SyncRO Soft SRL 2002 - 2014. All rights reserved.