Community
Participate
Working Groups
Part of the GSoC 2009 project "OSGi Remote Management Tool"
let's keep it simple for start. try extend this class org.eclipse.jface.dialogs.InputDialog
Created attachment 137504 [details] simple connection dialog I added first version of connection dialog. It extends simple ImputDialog. There is also partly implemented address validation.
Created attachment 141361 [details] updated version of connection dialog It's updated version of the connection dialog. It's a patch for pde-incubator/osgimonitoring/plugins/org.eclipse.pde.runtime. Main change is a simpler validation which only checks that url is not null and it's correct URI constructor argument syntax.
Thanks Wojciech. Change looks simple. 1. Do we really need a separate class for ConnectionDialog? Why not just create anonymous IInputValidator class, like: InputValidator validator = new IInputValidator() { public String isValid(String url) { ... } }; InputDialog dialog = new InputDialog(Display.getCurrent().getActiveShell(), PDERuntimeMessages.RegistryView_connectAction_label, PDERuntimeMessages.RegistryView_enterURL, validator); 2. I wonder what would happen if a RegistryModel got disconnected. Would Plug-in registry automatically turn back to local connection? (We might solve this in separate bug, please open one for that.) 3. Second, it'd be good to show the "Connect" option only when connectors other than "local" are available, to keep User interface simple. To do that we could check how much extensions are registered with our extension point. (This is minor)
Created attachment 141491 [details] updated connection dialog This is updated version of connection dialog. I've added anonymous IInputValidator definition as argument for InputDialog constructor instead of additional ConnectionDialog class. Additionaly, it checks a number of extensions registered with our extension point and shows "Connect" option only if there is at least one available.
I have simplified the validation a bit. We might think about improving the dialog to give a hint or use some default URL to the user. Thanks Wojtek, good job! FIXED.