Class BufferedResourceNode

All Implemented Interfaces:
IContentChangeNotifier, IEditableContent, IEditableContentExtension, IEncodedStreamContentAccessor, IModificationDate, IResourceProvider, IStreamContentAccessor, ITypedElement, IStructureComparator

public class BufferedResourceNode extends ResourceNode
A buffer for a workspace resource.
  • Constructor Details

    • BufferedResourceNode

      public BufferedResourceNode(IResource resource)
      Creates a ResourceNode for the given resource.
      Parameters:
      resource - the resource
  • Method Details

    • isDirty

      public boolean isDirty()
    • createChild

      protected IStructureComparator createChild(IResource child)
      Description copied from class: ResourceNode
      This hook method is called from getChildren once for every member of a container resource. This implementation creates a new ResourceNode for the given child resource. Clients may override this method to create a different type of IStructureComparator or to filter children by returning null.
      Overrides:
      createChild in class ResourceNode
      Parameters:
      child - the child resource for which a IStructureComparator must be returned
      Returns:
      a ResourceNode for the given child or null
    • setContent

      public void setContent(byte[] contents)
      Description copied from class: BufferedContent
      Sets the contents. Registered content change listeners are notified.
      Specified by:
      setContent in interface IEditableContent
      Overrides:
      setContent in class BufferedContent
      Parameters:
      contents - the new contents
    • commit

      public void commit(IProgressMonitor pm) throws CoreException
      Throws:
      CoreException
    • 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
      Overrides:
      replace in class ResourceNode
      Parameters:
      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.
      Returns:
      the argument dest