Home » Eclipse Projects » Eclipse Platform » Hiding filesystem resources from clients of the resources API even after refresh?
Hiding filesystem resources from clients of the resources API even after refresh? [message #98559] |
Wed, 23 July 2003 12:17  |
Eclipse User |
|
|
|
Originally posted by: lefh.decisionsoft.com
I'm helping to write a team provider for eclipse; because of the way that
the underlying versioning system works, when a versioned folder is deleted
or removed, it is not possible to delete the actual filesystem folder until
the folder is committed. On the other hand, from the point of view of an
eclipse user, these folders should not be visible, since modifying them
will cause all manner of woes...In my IMoveDeleteHook implementation, I'm
doing the necessary version control operations, and then calling
tree.deletedFolder, which does remove the folder from all the views... but
only until the next time the user refreshes the workspace!
My initial thought was to make these directories team private without
actually deleting them, but this raises another issue - once I make them
team private there seems to be no way to get views on the resource tree
(such as the Navigator) to refresh themselves and not display the item. As
far as I can make out, the only time that the WorkbenchContentProvider will
ever remove something from its tree is when it receives an explicit REMOVED
delta. I imagine that I could remove the file and then refresh it, making
it team private when it was re-added, but currently this doesn't seem to
work for me, presumably as I'm doing the whole lot inside a
WorkspaceModifyOperation, precisely in order to avoid generating multiple
resource deltas!
Is there a reasonably neat way of achieving this kind of behaviour? I'm not
completely sure, but I think I'm having a similar problem with marking more
normal types of team private resource as team private "after the fact"; by
the time I process the resource delta to make the files team private, the
resource tree has already added them, and I can't then get rid of them!
Thanks in advance,
Lucian
--
Lucian Holland
DecisionSoft Limited http://www.decisionsoft.com
XML Development and Services
|
|
|
Re: Hiding filesystem resources from clients of the resources API even after refresh? [message #101661 is a reply to message #98559] |
Mon, 28 July 2003 13:29  |
Eclipse User |
|
|
|
Originally posted by: John_Arthorne.oti.com_
This is usually achieved by converting outgoing deletions into
"phantoms". Phantom resources are not shown anywhere in the UI, but can
be accessed programatically in a similar manner to team private members
(IContainer.members(IContainer.INCLUDE_PHANTOMS)). When a resource
becomes a phantom, resource change listeners receive a REMOVED delta, so
views will remove those resources.
The only trick is that phantoms are tied to the ISynchronizer API. You
create phantoms by attaching sync info to a resource. You delete
phantoms by removing their sync info. If you're writing a team
provider, you should generally be using the ISynchronizer API to store
sync information about the resourceds. Read the javadoc of
ISynchronizer for more details...
--
Lucian Holland wrote:
> I'm helping to write a team provider for eclipse; because of the way
> that the underlying versioning system works, when a versioned folder is
> deleted or removed, it is not possible to delete the actual filesystem
> folder until the folder is committed. On the other hand, from the point
> of view of an eclipse user, these folders should not be visible, since
> modifying them will cause all manner of woes...In my IMoveDeleteHook
> implementation, I'm doing the necessary version control operations, and
> then calling tree.deletedFolder, which does remove the folder from all
> the views... but only until the next time the user refreshes the workspace!
>
> My initial thought was to make these directories team private without
> actually deleting them, but this raises another issue - once I make them
> team private there seems to be no way to get views on the resource tree
> (such as the Navigator) to refresh themselves and not display the item.
> As far as I can make out, the only time that the
> WorkbenchContentProvider will ever remove something from its tree is
> when it receives an explicit REMOVED delta. I imagine that I could
> remove the file and then refresh it, making it team private when it was
> re-added, but currently this doesn't seem to work for me, presumably as
> I'm doing the whole lot inside a WorkspaceModifyOperation, precisely in
> order to avoid generating multiple resource deltas!
>
> Is there a reasonably neat way of achieving this kind of behaviour? I'm
> not completely sure, but I think I'm having a similar problem with
> marking more normal types of team private resource as team private
> "after the fact"; by the time I process the resource delta to make the
> files team private, the resource tree has already added them, and I
> can't then get rid of them!
>
> Thanks in advance,
> Lucian
>
|
|
|
Goto Forum:
Current Time: Sat Jul 26 20:53:07 EDT 2025
Powered by FUDForum. Page generated in 0.07346 seconds
|