Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 284086

Summary: [plug-in registry] give user information, that he is now connected
Product: [Eclipse Project] PDE Reporter: Jacek Pospychala <jacek.pospychala>
Component: IncubatorsAssignee: Wojciech Galanciak <wojciech.galanciak>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: 3.5   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 243439    
Attachments:
Description Flags
adds inforamtion about connection status
none
simpler version of previous patch
none
updated
none
Previous patch after small update. none

Description Jacek Pospychala CLA 2009-07-21 02:36:14 EDT
Once user connects to some remote Eclipse or Equinox instance, it should be clearly indicated in the view where did he connected and that the contents represented are no longer the local state.

To implement this you could use setContentDescription(String) method in RegistryBrowser.

When the connection drops, the content description should be updated as well.
Comment 1 Wojciech Galanciak CLA 2009-07-30 08:47:11 EDT
Created attachment 142997 [details]
adds inforamtion about connection status

This is the first version of the patch. Plugin registry view informs user about connection status during connecting with remote application. There are two scenario:
- it has connected with remote application
- it hasn't connected with remote application
These situation are handled. We need to add information when the client loses connection with a server.
Comment 2 Jacek Pospychala CLA 2009-07-30 09:10:16 EDT
I don't think Backend needs to remember if it has connected or not. Let's just invoke updateTitle() when connecting and make something simple, like:

public void updateTitle() {
  URI uri = model.getURI();
  String uriString = "";
  if (! "local".equals(uri.getScheme())) // we're connected remotely
    uriString = "[" + uri.toString() + "] ";
  }

  setContentDescription(uriString + getTitleSummary());
}

Comment 3 Wojciech Galanciak CLA 2009-07-30 10:22:03 EDT
Created attachment 143015 [details]
simpler version of previous patch

Yes, it's simpler but in that situation we don't remember that connection was established correctly or not. We can check it because model.connect(monitor, boolean) returns true when it connected, so if we check the returned value we can prepare correct statement:
- [connected with r-osgi://host:port] when it connected
- [cannot connect with r-osgi://host:port] when it not connected
Unfortunately, we must remember that statement somewhere (e. g. in RegistryBackend).
Comment 4 Jacek Pospychala CLA 2009-07-30 10:36:24 EDT
so maybe if unable to connect, we should better tell this to user.
For example: view should fall back to the local ("local:///") and show an error message. What you think?
Comment 5 Wojciech Galanciak CLA 2009-07-31 05:59:34 EDT
Created attachment 143119 [details]
updated

Ok, I've added MessageDialog which shows when it can't establish connection.
Comment 6 Wojciech Galanciak CLA 2009-08-06 12:03:49 EDT
Created attachment 143683 [details]
Previous patch after small update.
Comment 7 Wojciech Galanciak CLA 2009-08-07 10:12:13 EDT

*** This bug has been marked as a duplicate of bug 283387 ***