Oxygen XML Editor 12.2 Author API

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

java.lang.Object
  extended by ro.sync.ecss.extensions.api.component.AuthorComponentProvider

public class AuthorComponentProvider
extends java.lang.Object

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
 
Method Summary
 void addAuthorComponentListener(AuthorComponentListener listener)
          Add an author component listener
 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()
          Get the author access used to perform various operations on the Author Page.
 java.util.Map<java.lang.String,javax.swing.AbstractAction> getAuthorCommonActions()
          Get the map of author common actions (undo, redo, cut, copy, paste, etc)
 java.util.Map<java.lang.String,javax.swing.AbstractAction> getAuthorExtensionActions()
          Get the map of author extension actions.
 java.awt.Component getEditorComponent()
           
 java.awt.Component getStatusComponent()
           
 boolean isModified()
           
 void load(java.net.URL url, java.io.Reader reader)
          Set the content to edit.
 void print(boolean preview)
          Print the author component content.
 void removeAuthorComponentListener(AuthorComponentListener listener)
          Remove 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)
          The Pop-up customizer can be used to add/remove actions from the pop-up menu in the Author bread crumb before showing it.
 void setEditorPopUpCustomizer(PopupMenuCustomizer 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.
 void setOutlinerPopUpCustomizer(PopupMenuCustomizer popUpCustomizer)
          The Pop-up customizer can be used to add/remove actions from the pop-up menu in the Author Outliner view before showing it.
 
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
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
Set 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.

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).

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)
Add an author component listener

Parameters:
listener - The listener.

removeAuthorComponentListener

public void removeAuthorComponentListener(AuthorComponentListener listener)
Remove an author component listener

Parameters:
listener - The listener.

getEditorComponent

public java.awt.Component getEditorComponent()
Returns:
the editor panel

getStatusComponent

public java.awt.Component getStatusComponent()
Returns:
the status panel

getAuthorExtensionActions

public java.util.Map<java.lang.String,javax.swing.AbstractAction> getAuthorExtensionActions()
Get 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

public java.util.Map<java.lang.String,javax.swing.AbstractAction> 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()
Returns:
true if the component is modified

getAuthorAccess

public AuthorAccess getAuthorAccess()
Get the author access used to perform various operations on the Author Page.

Returns:
the author access.

setEditorPopUpCustomizer

public void setEditorPopUpCustomizer(PopupMenuCustomizer 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

public void setOutlinerPopUpCustomizer(PopupMenuCustomizer popUpCustomizer)
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.

setBreadCrumbPopUpCustomizer

public void setBreadCrumbPopUpCustomizer(PopupMenuCustomizer popUpCustomizer)
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 outline, attributes, entities, elements or model helper component, depending on the ID.

Parameters:
helperID - One of the AuthorComponentProvider.ATTRIBUTES_PANEL_ID, AuthorComponentProvider.ELEMENTS_PANEL_ID, AuthorComponentProvider.ENTITIES_PANEL_ID, AuthorComponentProvider.MODEL_PANEL_ID, AuthorComponentProvider.OUTLINER_PANEL_ID constants.
Returns:
The additional component.

print

public void print(boolean preview)
Print the author component content. Shows the Print dialog.

Parameters:
preview - true to show the Print Preview dialog, false to show the Print dialog.

Oxygen XML Editor 12.2 Author API

© Copyright SyncRO Soft SRL 2002 - 2010.