[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
| [ecf-dev] Some thoughts (and code) for ECF UI | 
Hi Folks,
I wanted to let everyone know that I've been adding to 
org.eclipse.ecf.ui plugin to make it easier to build clients.
I've created two new extension points:
Configuration Wizards:  org.eclipse.ecf.ui.configurationWizards
Connect Wizards:  org.eclipse.ecf.ui.connectWizards
These two extension points allow other plugins to register themselves as 
providers of wizards for doing configuration and connection.  So, for 
example, if you are building a new provider, and you want to make 
available a user interface for connecting/authenticating for that 
provider, then you would register itself as an implementer of the 
connectWizards extension point with the following in it's plugin.xml:
  <extension
        point="org.eclipse.ecf.ui.connectWizards">
     <wizard
           class="org.my.client.MyClientConnectWizard"
           containerFactoryName="org.my.client"
           id="my.client.wizard"
           name="My Client Connect Wizard">
     </wizard>
  </extension>
Note that the class "org.my.client.MyClientConnectWizard" must implement 
the org.eclipse.ecf.ui.IConnectWizard interface.  This interface extends 
IWizard.  Also, the containerFactoryName (in this case "org.my.client") 
must match the containerFactory name specified in the containerFactory 
extension for this provider so that there is a 1-1 association between 
the provider implementation and the provider wizard UI.
So, for example, with this provider you would setup a containerFactory 
extension like this:
  <extension
        point="org.eclipse.ecf.containerFactory">
     <containerFactory
           class="org.my.client.ContainerInstantiator"
           description="ECF Generic Client"
           name="org.my.client"
           </containerFactory>
  </extension>
With these extensions in place, clients can call the following code to 
open the MyClientConnectWizard:
new ConnectWizardDialog(shell, workbench, new 
ContainerHolder("org.my.client", container)).open();
And that's it.
To do IContainer creation and configuration via the registered wizard:
ConfigurationWizardDialog cwd = new ConfigurationWizardDialog(shell, 
workbench);
cwd.open();
IContainer newContainer = cwd.getResult().getContainer();
if (newContainer != null) // successful
So here's the whole sequence for creating and connecting an arbitrary 
client, assuming that the provider has setup both configuration and 
connection wizards with the above extension points
ConfigurationWizardDialog cwd = new ConfigurationWizardDialog(shell, 
workbench);
cwd.open();
IContainerHolder configurationResult = cwd.getResult();
IContainer newContainer = configurationResult .getContainer();
// setup newContainer with adapters, listeners, etc
new ConnectWizardDialog(shell, workbench, configurationResult).open();
Any thoughts/comments on any of this are welcome.  Note that we can now 
put libraries of wizard creation support classes (e.g. for providers to 
use) in org.eclipse.ecf.ui.wizards and support actions in 
org.eclipse.ecf.ui.actions.  Then providers will simply pick an existing 
wizard that we've created for doing configuration or connect...or extend 
it, or write their own.   Thanks to Remy Suen for already providing a 
connect wizard (org.eclipse.ui.wizards.GenericClientConnectWizard).
Thanks,
Scott