Class StructureRootNode

    • Constructor Detail

      • StructureRootNode

        public StructureRootNode​(IDocument document,
                                 Object input,
                                 StructureCreator creator,
                                 ISharedDocumentAdapter adapter)
        Create the structure root node.
        document - the document
        input - the input associated with the document
        creator - the structure creator that is creating the node
        adapter - the shared document adapter from which the document was obtained or null if the document was not obtained from an ISharedDocumentAdapter
    • Method Detail

      • dispose

        public void dispose()
        Description copied from interface: IDisposable
        Disposes of this service. All resources must be freed. All listeners must be detached. Dispose will only be called once during the life cycle of a service.
        Specified by:
        dispose in interface IDisposable
      • replace

        public ITypedElement replace​(ITypedElement child,
                                     ITypedElement other)
        Description copied from interface: IEditableContent
        This method is called on a parent to add or remove a child, or to copy the contents of a child. What to do is encoded in the two arguments as follows:
        add: dest == null src != null
        remove: dest != null src == null
        copy: dest != null src != null
        Specified by:
        replace in interface IEditableContent
        replace in class DocumentRangeNode
        child - the existing child of this object to be replaced; if null a new child can be added.
        other - the new child to be added or replaced; if null an existing child can be removed.
        the argument dest
      • getImage

        public Image getImage()
        Description copied from interface: ITypedElement
        Returns an image for this object. This image is used when displaying this object in the UI.
        Specified by:
        getImage in interface ITypedElement
        the image of this object or null if this type of input has no image
      • getName

        public String getName()
        Description copied from interface: ITypedElement
        Returns the name of this object. The name is used when displaying this object in the UI.
        Specified by:
        getName in interface ITypedElement
        the name of this object
      • getType

        public String getType()
        Description copied from interface: ITypedElement
        Returns the type of this object. For objects with a file name this is typically the file extension. For folders its the constant FOLDER_TYPE. The type is used for determining a suitable viewer for this object.
        Specified by:
        getType in interface ITypedElement
        the type of this object
      • validateEdit

        public IStatus validateEdit​(Shell shell)
        Description copied from interface: IEditableContentExtension
        If the element is read-only, this method should be called to attempt to make it writable.
        Specified by:
        validateEdit in interface IEditableContentExtension
        validateEdit in class DocumentRangeNode
        shell - a shell used to prompt the user if required.
        a status object that is OK if things are fine, otherwise a status describing reasons why modifying the given files is not reasonable. A status with a severity of CANCEL is returned if the validation was canceled, indicating the edit should not proceed.