Bug 193390 - [Table] Table View needs to be updated when a connection is deleted/disconnected
Summary: [Table] Table View needs to be updated when a connection is deleted/disconnected
Status: NEW
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Kevin Doyle CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-19 16:09 EDT by Kevin Doyle CLA
Modified: 2009-06-17 11:36 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Doyle CLA 2007-06-19 16:09:13 EDT
When disconnecting from a connection the Remote System Details view should return to the connection list if a folder from that connection was being shown.  Since Local doesn't require you to disconnect first before Deleting we also need to do the same thing for Delete.

Currently nothing happens in the Remote System Details view.

-----------Enter bugs above this line-----------
TM 2.0RC3 Testing
installation : eclipse-SDK-3.3RC4
RSE install  : RSE 2.0 RC3
java.runtime : Sun 1.5.0_11-b03
os.name:     : Windows XP, Service Pack 2
------------------------------------------------
Comment 1 Martin Oberhuber CLA 2007-06-28 09:24:41 EDT
See also bug #193381 which is similar for the Scratchpad.

Listening to the events should not be too much of an issue, can you come up with a patch?
Comment 2 Martin Oberhuber CLA 2007-06-28 09:26:03 EDT
*** Bug 193394 has been marked as a duplicate of this bug. ***
Comment 3 Martin Oberhuber CLA 2007-06-28 09:26:58 EDT
Same for folders deleted, see bug #193394.

After deleting the folder that is shown in the Remote System Details view the
contents of the view shows: "Folder PATH_TO_FOLDER is not readable.  Cannot
Expand".  Instead the view should display the parents contents of the deleted
folder or go back to the list of connections.
Comment 4 Kevin Doyle CLA 2007-06-28 09:45:43 EDT
Martin, if I'm not mistaken there is no proper event that is fired when we do a disconnect.  I believe it fires an EVENT_MUST_COLLAPSE.  Thats why I had them separate.  Though is EVENT_MUST_COLLAPSE used for anything else?  Doesn't look like the table or scratchpad handle that event, so I guess it could be used.
Comment 5 Martin Oberhuber CLA 2007-06-28 10:28:46 EDT
SshConnectorService does

   fireCommunicationsEvent(CommunicationsEvent.BEFORE_DISCONNECT);

Dave - would that be a good event to listen to for doing things like removing an item from the details view if it's disconnected?
Comment 6 David McKnight CLA 2007-06-28 10:49:51 EDT
Since it appears that all the services are firing this event, it's probably a good idea.  
Comment 7 David McKnight CLA 2007-06-28 11:06:26 EDT
Actually, it appears FTP is not firing this event.  FTPConnectorService should be firing the communications events as well.
Comment 8 Kevin Doyle CLA 2007-07-04 11:03:57 EDT
Martin, to implement this we will need to make SystemTableViewPart implement ICommunicationsListener which would be an API change, so we should assign this to Future?
Comment 9 Kevin Doyle CLA 2007-07-04 11:19:28 EDT
oops nevermind Martin.  Was thinking SystemTableView, but SystemTableViewPart is internal so we can make API changes to it.
Comment 10 Martin Oberhuber CLA 2007-07-04 11:32:17 EDT
Are you sure that SystemTableViewPart needs to implement ICommunicationsListener itself? I think that in its constructor, it could also create an anonymous nested class that's the communications listener:

bla.addCommunicationsListener(new ICommunicationsListener() {
   public void onCommunicationsEven() {
      doWhatYouNeedToDoInTableViewPart();
   }
});
Comment 11 Kevin Doyle CLA 2007-07-04 11:44:39 EDT
We could do something like that as well.  I was just looking at how the SystemResourceChangeListener and SystemRemoteChangeListener were done.

registry.addSystemResourceChangeListener(this);
registry.addSystemRemoteChangeListener(this);

Just to be consistent shouldn't it be done the same way?
Comment 12 Martin Oberhuber CLA 2007-07-04 12:32:30 EDT
Not necessarily. I'm personally often more in favor of keeping listeners in small anonymous classes -- this makes it more evident what's going on. If your class just implements ISystemCommunicationsListener, finding those methods that actually get called in case of a communications event are much harder to find than if you have a local anonymous class.

Having the TableViewPart implement ISystemCommunicationsListener makes sense if we think that being a communicationsListener is a property of the TableViewPart, and anybody can send it communications events regardless of whether it registered as listener or not. If we think this is the case, it MUST implement the interface; otherwise, it CAN implement the interface and it boils down to a personal matter of preference.

I'll leave it up to you what you prefer -- but don't argue just with "it should look like it is now for consistency". What we have now is not necessarily the best implementation. My personal preference is the local anonymous class, do it according to your personal preference.
Comment 13 Kevin Doyle CLA 2007-07-04 13:10:33 EDT
Thanks Martin.  I wasn't trying to argue for one way over the other.  I was just wondering if we were trying to be consistent in all case's, but I understand the way things are implemented is not always the best.
Comment 14 Kevin Doyle CLA 2007-07-09 15:16:21 EDT
Changed summary as deleting of folder shown in table, displaying an error is fixed in bug #193394.
Comment 15 Martin Oberhuber CLA 2008-07-07 12:10:47 EDT
I just came across this with RSE 3.0

Create a new dstore connection, connect and browse into it.
Activate the Remote Systems Details View -- it shows "Local" and "New_Dstore".
In RSE Tree, disconnect then delete the dstore connection.

--> Deleting is EXTREMELY slow, 
    and when done the tableview still shows the stale "New_DStore" connection.