com.aspose.words

Class EditableRange

  • java.lang.Object
    • com.aspose.words.EditableRange
public class EditableRange 
extends java.lang.Object

Represents a single editable range.

EditableRange is a "facade" object that encapsulates two nodes EditableRangeStart and EditableRangeEnd in a document tree and allows to work with an editable range as a single object.

Property Getters/Setters Summary
EditableRangeEndgetEditableRangeEnd()
Gets the node that represents the end of the editable range.
EditableRangeStartgetEditableRangeStart()
Gets the node that represents the start of the editable range.
intgetEditorGroup()
void
setEditorGroup(intvalue)
           Returns or sets an alias (or editing group) which shall be used to determine if the current user shall be allowed to edit this editable range. The value of the property is EditorType integer constant.
intgetId()
Gets the editable range identifier.
java.lang.StringgetSingleUser()
void
setSingleUser(java.lang.Stringvalue)
           Returns or sets the single user for editable range.
 
Method Summary
voidremove()
Removes the editable range from the document. Does not remove content inside the editable range.
 

    • Property Getters/Setters Detail

      • getEditableRangeEnd

        public EditableRangeEnd getEditableRangeEnd()
        
        Gets the node that represents the end of the editable range.
      • getEditableRangeStart

        public EditableRangeStart getEditableRangeStart()
        
        Gets the node that represents the start of the editable range.
      • getEditorGroup/setEditorGroup

        public int getEditorGroup() / public void setEditorGroup(int value)
        
        Returns or sets an alias (or editing group) which shall be used to determine if the current user shall be allowed to edit this editable range. The value of the property is EditorType integer constant.

        Single user and editor group cannot be set simultaneously for the specific editable range, if the one is set, the other will be clear.

        Example:

        Shows how to add editing group for editable ranges
        //Add EditableRangeStart
        EditableRangeStart startRange1 = builder.startEditableRange();
        
        builder.writeln("EditableRange_1_1");
        builder.writeln("EditableRange_1_2");
        
        // Sets the editor for editable range region
        startRange1.getEditableRange().setEditorGroup(EditorType.EVERYONE);
      • getId

        public int getId()
        
        Gets the editable range identifier.

        The region must be demarcated using the EditableRangeStart and EditableRangeEnd

        Editable range identifiers are supposed to be unique across a document and Aspose.Words automatically maintains editable range identifiers when loading, saving and combining documents.

      • getSingleUser/setSingleUser

        public java.lang.String getSingleUser() / public void setSingleUser(java.lang.String value)
        
        Returns or sets the single user for editable range.

        This editor can be stored in one of the following forms:

        DOMAIN\Username - for users whose access shall be authenticated using the current user's domain credentials.

        user@domain.com - for users whose access shall be authenticated using the user's e-mail address as credentials.

        user - for users whose access shall be authenticated using the current user's machine credentials.

        Single user and editor group cannot be set simultaneously for the specific editable range, if the one is set, the other will be clear.

    • Method Detail

      • remove

        public void remove()
                   throws java.lang.Exception
        Removes the editable range from the document. Does not remove content inside the editable range.

        Example:

        Shows how to remove an editable range from a document.
        Document doc = new Document(getMyDir() + "Document.doc");
        DocumentBuilder builder = new DocumentBuilder(doc);
        
        // Create an EditableRange so we can remove it. Does not have to be well-formed.
        EditableRangeStart edRange1Start = builder.startEditableRange();
        EditableRange editableRange1 = edRange1Start.getEditableRange();
        builder.writeln("Paragraph inside editable range");
        EditableRangeEnd edRange1End = builder.endEditableRange();
        
        // Remove the range that was just made.
        editableRange1.remove();