Class AbstractComponentProvider

    • Field Detail

      • logger

        protected static final org.slf4j.Logger logger
        Logger for logging.
      • messages

        protected static final ro.sync.i18n.MessageBundle messages
        The messages resource bundle.
      • detectionFinished

        protected boolean detectionFinished
        True if the detection finished
    • 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)
      • createEditor

        protected abstract ro.sync.exml.editor.AbstractEditor createEditor​(ro.sync.exml.workspace.impl.component.BaseComponentEditorManager parentEditorManager,
                                                                           java.awt.Frame parentFrame,
                                                                           java.lang.String[] allowedPages,
                                                                           java.lang.String initialPage,
                                                                           java.lang.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 be null
        contentType - The content type of the editor.
        Returns:
        The new created editor.
        Throws:
        AuthorComponentException
      • 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
      • 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.
      • 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
      • getEditorKey

        public java.lang.Object getEditorKey()
        Specified by:
        getEditorKey in class ro.sync.ecss.extensions.api.component.InternalComponentProvider
        Returns:
        The editor.
      • 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
      • 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