Class ShowTablePropertiesBaseOperation

    • Constructor Detail

      • ShowTablePropertiesBaseOperation

        public ShowTablePropertiesBaseOperation​(TablePropertiesHelper tableHelper)
        Constructor.
        Parameters:
        tableHelper - The table properties helper.
    • Method Detail

      • showTableProperties

        public void showTableProperties​(ArgumentsMap args)
                                 throws AuthorOperationException
        Shows the table properties and process all the modifications.
        Parameters:
        args - the arguments the operation was invoked with.
        Throws:
        AuthorOperationException - When the action cannot be performed.
      • getElementsWithModifiedAttributes

        protected java.util.List<TabInfo> getElementsWithModifiedAttributes​(EditedTablePropertiesInfo tableInfo)
        Obtain all the elements with all the modified attributes.
        Parameters:
        tableInfo - The obtained table information from the table properties dialog.
        Returns:
        A map containing all the elements whose attributes will be modified and the corresponding attributes.
      • checkRowSpans

        protected boolean checkRowSpans​(java.util.List<AuthorElement> collectedRows,
                                        int parentType)
        Check if the selected rows can be moved (row spans don't exceed collected rows range).
        Parameters:
        collectedRows - The rows to be checked.
        parentType - The type of the parent element.
        Returns:
        true if the rows can be moved.
      • getFragmentsAndOffsetsToInsert

        protected java.util.List<TabInfo> getFragmentsAndOffsetsToInsert​(EditedTablePropertiesInfo tableInfo)
                                                                  throws AuthorOperationException
        Obtain a map with all the fragments which will be modified and the corresponding offsets (the offsets where the fragments will be inserted).
        Parameters:
        tableInfo - The obtained table information from the table properties dialog.
        Returns:
        a list tab info objects which contains all the fragments which will be modified and the corresponding offsets (the offsets where the fragments will be inserted).
        Throws:
        AuthorOperationException
      • getTableInformation

        protected TabInfo getTableInformation​(java.util.List<java.lang.Integer[]> selections)
        Obtain the information for table tab. This information will contain the properties which will be edited, the table elements on which those properties applies and some context information.
        Parameters:
        selections - The list with the selection intervals.
        Returns:
        The tab info object or null is there are no properties to edit for table.
      • getAttrProperty

        protected TableProperty getAttrProperty​(java.util.List<AuthorElement> collectedElements,
                                                java.lang.String detectedAttributeValue,
                                                TableProperty currentAttribute)
        Obtain the table property object for the given attribute.
        Parameters:
        collectedElements - The list of all rows which will be edited.
        detectedAttributeValue - Current value of the attribute. It is the value set on the element(s).
        currentAttribute - The current attribute.
        Returns:
        a TableProperty object for the given attribute.
      • getCommonValue

        protected java.lang.String getCommonValue​(AuthorElement currentElem,
                                                  java.lang.String attrQname,
                                                  java.lang.String currentValue)
        Obtain the common value for the given attribute set on the given element.
        Parameters:
        currentElem - The element to check for given attribute.
        attrQname - The attribute qualified name.
        currentValue - The currently computed common value for the given attribute.
        Returns:
        The common value between the given value and the attribute values set on the given element.
      • getSelectedTab

        protected EditedTablePropertiesInfo.TAB_TYPE getSelectedTab​(java.util.List<java.lang.Integer[]> selections)
        Obtain the tab that will be selected in the "Table Properties" dialog.
        Parameters:
        selections - The currently selected nodes or the node at caret position.
        Returns:
        the tab that will be selected in the "Table Properties" dialog.
      • getCategoriesAndProperties

        protected abstract java.util.List<TabInfo> getCategoriesAndProperties​(java.util.List<java.lang.Integer[]> selections)
        Obtain the categories from the table properties dialog. The categories maps the tab name to the list of properties that will be modified in the corresponding tab panel. Every property will be modified using a combobox/radios which will contain the possible values for that property. The label string for the combobox/radios group will be the provided render string of the property or the property name, if a render string is not provided.
        Parameters:
        selections - The currently selected nodes or the node at caret position.
        Returns:
        A list of tab info objects containing the tab names and the corresponding properties list.
      • getTableAttribute

        protected abstract java.util.List<TableProperty> getTableAttribute()
        Obtain the table attributes.
        Returns:
        A list with TableProperty objects containing the table attributes qualified name, render string and possible values.
      • computeFragmentsToMoveInsideFooter

        protected abstract boolean computeFragmentsToMoveInsideFooter​(java.util.List<AuthorDocumentFragment> fragments,
                                                                      java.util.List<javax.swing.text.Position> offsets,
                                                                      TabInfo tabInfo,
                                                                      java.util.List<AuthorElement> nodesToModify,
                                                                      AuthorElement currentNode)
                                                               throws AuthorOperationException
        Computes the fragment and position, inside footer element, for the given node.
        Parameters:
        fragments - A list with already computed fragments. The new fragment will be added to this list.
        offsets - A list with positions where the given fragments will be inserted.
        tabInfo - The current edited tab info.
        nodesToModify - A list containing all the nodes that will be deleted.
        currentNode - The node to be checked if it should be moved.
        Returns:
        true if the parent of the given node parent should be also deleted.
        Throws:
        AuthorOperationException - If the new parent fragment could not be inserted.
      • computeFragmentMoveInsideHeader

        protected abstract boolean computeFragmentMoveInsideHeader​(java.util.List<AuthorDocumentFragment> fragments,
                                                                   java.util.List<javax.swing.text.Position> offsets,
                                                                   TabInfo tabInfo,
                                                                   java.util.List<AuthorElement> nodesToModify,
                                                                   AuthorElement currentNode)
                                                            throws AuthorOperationException
        Computes the fragment and position, inside header element, for the given node.
        Parameters:
        fragments - A list with already computed fragments. The new fragment will be added to this list.
        offsets - A list with positions where the given fragments will be inserted.
        tabInfo - The current edited tab info.
        nodesToModify - A list containing all the nodes that will be deleted.
        currentNode - The node to be checked if it should be moved.
        Returns:
        true if the parent of the given node parent should be also deleted.
        Throws:
        AuthorOperationException - If the new parent fragment could not be inserted.
      • computeFragmentsToMoveInsideBody

        protected abstract boolean computeFragmentsToMoveInsideBody​(java.util.List<AuthorDocumentFragment> fragments,
                                                                    java.util.List<javax.swing.text.Position> offsets,
                                                                    TabInfo tabInfo,
                                                                    java.util.List<AuthorElement> nodesToModify,
                                                                    AuthorElement currentNode)
                                                             throws AuthorOperationException
        Computes the fragment and position, inside body element, for the given node.
        Parameters:
        fragments - A list with already computed fragments. The new fragment will be added to this list.
        offsets - A list with positions where the given fragments will be inserted.
        tabInfo - The current edited tab info.
        nodesToModify - A list containing all the nodes that will be deleted.
        currentNode - The node to be checked if it should be moved.
        Returns:
        true if the parent of the given node parent should be also deleted.
        Throws:
        AuthorOperationException - If the new parent fragment could not be inserted.
      • getHelpPageID

        protected java.lang.String getHelpPageID()
        Get the ID of the help page which will be called by the end user.
        Returns:
        the ID of the help page which will be called by the end user or null.