diff options
author | slewis | 2007-03-26 06:08:21 +0000 |
---|---|---|
committer | slewis | 2007-03-26 06:08:21 +0000 |
commit | f0fa6bc90af40a2a97233bc5f434c31ee822a296 (patch) | |
tree | 3379d4fa08eb7f4abda6b6e16050a7c761885210 /examples | |
parent | b27016f06da65a8a3af516d402cb3487a2f37ca1 (diff) | |
download | org.eclipse.ecf-f0fa6bc90af40a2a97233bc5f434c31ee822a296.tar.gz org.eclipse.ecf-f0fa6bc90af40a2a97233bc5f434c31ee822a296.tar.xz org.eclipse.ecf-f0fa6bc90af40a2a97233bc5f434c31ee822a296.zip |
Simplified containerFactory extension point. Modified ContainerTypeDescription to match new schema. Removed JoinGroupWizard/JoinGroupWizardPage from org.eclipse.ecf.ui. Removed property and defaultargument elements from containerFactory extensions.
Diffstat (limited to 'examples')
4 files changed, 25 insertions, 118 deletions
diff --git a/examples/bundles/org.eclipse.ecf.example.collab/plugin.xml b/examples/bundles/org.eclipse.ecf.example.collab/plugin.xml index 5c567a84b..a5320f16d 100644 --- a/examples/bundles/org.eclipse.ecf.example.collab/plugin.xml +++ b/examples/bundles/org.eclipse.ecf.example.collab/plugin.xml @@ -24,23 +24,6 @@ name="ECF Collab Roster"/> </extension> <extension - point="org.eclipse.ui.actionSets"> - <actionSet - label="ECF" - visible="true" - id="org.eclipse.ecf.example.collab.actionSet"> - <action - toolbarPath="org.eclipse.ecf.example.collab.topseparator" - label="Connect to ECF Provider..." - class="org.eclipse.ecf.example.collab.actions.NewWorkbenchAction" - tooltip="Connect to ECF Provider" - icon="icons/group.gif" - style="push" - menubarPath="file/#additions" - id="org.eclipse.ecf.example.collab.joingroupaction"/> - </actionSet> - </extension> - <extension point="org.eclipse.ui.popupMenus"> <objectContribution adaptable="true" diff --git a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/ui/ConnectionDialog.java b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/ui/ConnectionDialog.java index 03da99588..0f5ebc5c5 100644 --- a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/ui/ConnectionDialog.java +++ b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/ui/ConnectionDialog.java @@ -217,11 +217,7 @@ public class ConnectionDialog extends TitleAreaDialog { for (Iterator i = rawDescriptions.iterator(); i.hasNext();) { final ContainerTypeDescription desc = (ContainerTypeDescription) i .next(); - Map props = desc.getProperties(); - String isServer = (String) props.get(ISSERVER_PROP_NAME); - if (isServer == null || !isServer.equalsIgnoreCase("true")) { - elements.add(desc); - } + if (!desc.isServer() && !desc.isHidden()) elements.add(desc); } return elements.toArray(); @@ -389,7 +385,9 @@ public class ConnectionDialog extends TitleAreaDialog { .getFirstElement(); if (desc != null) { containerType = desc.getName(); - createPropertyComposite(paramComp, desc.getProperties()); + // XXX replace with access to desc.getParameters() + createPropertyComposite(paramComp, null); + //createPropertyComposite(paramComp, desc.getProperties()); } } diff --git a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/ui/JoinGroupWizard.java b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/ui/JoinGroupWizard.java index d1cb06449..cc6a11c29 100644 --- a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/ui/JoinGroupWizard.java +++ b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/ui/JoinGroupWizard.java @@ -13,6 +13,7 @@ package org.eclipse.ecf.example.collab.ui; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.ISchedulingRule; @@ -70,14 +71,13 @@ public class JoinGroupWizard extends Wizard { String groupName = mainPage.getJoinGroupText(); String nickName = mainPage.getNicknameText(); String containerType = mainPage.getContainerType(); - String password = mainPage.getPasswordText(); boolean autoLogin = mainPage.getAutoLoginFlag(); try { - client = new URIClientConnectAction(containerType,groupName,nickName,password,project,autoLogin); + client = new URIClientConnectAction(containerType,groupName,nickName,"",project,autoLogin); client.run(null); } catch (Exception e) { String id = ClientPlugin.getDefault().getBundle().getSymbolicName(); - throw new CoreException(new Status(Status.ERROR, id, 100, "Could not connect to "+groupName, e)); + throw new CoreException(new Status(Status.ERROR, id, IStatus.ERROR, "Could not connect to "+groupName, e)); } } } diff --git a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/ui/JoinGroupWizardPage.java b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/ui/JoinGroupWizardPage.java index b4516aad2..ff8423d45 100644 --- a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/ui/JoinGroupWizardPage.java +++ b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/ui/JoinGroupWizardPage.java @@ -13,10 +13,9 @@ package org.eclipse.ecf.example.collab.ui; import java.util.ArrayList; import java.util.Iterator; import java.util.List; -import java.util.Map; -import org.eclipse.ecf.core.ContainerTypeDescription; import org.eclipse.ecf.core.ContainerFactory; +import org.eclipse.ecf.core.ContainerTypeDescription; import org.eclipse.jface.dialogs.IDialogSettings; import org.eclipse.jface.wizard.WizardPage; import org.eclipse.swt.SWT; @@ -39,21 +38,12 @@ public class JoinGroupWizardPage extends WizardPage { protected static final String USER_NAME_SYSTEM_PROPERTY = "user.name"; - protected static final String ISSERVER_PROP_NAME = CLASSNAME+".isServer"; - protected static final String DEFAULTGROUPID_PROP_NAME = CLASSNAME+".defaultgroupid"; - protected static final String EXAMPLEGROUPID_PROP_NAME = CLASSNAME+".examplegroupid"; - protected static final String USEPASSWORD_PROP_NAME = CLASSNAME+".usepassword"; - protected static final String USENICKNAME_PROP_NAME = CLASSNAME+".usenickname"; - protected static final String URLPREFIX_NAME = CLASSNAME+".urlprefix"; - protected static final String GROUPIDLABEL_PROP_NAME = CLASSNAME+".groupIDLabel"; - protected static final String NAMESPACE_PROP_NAME = CLASSNAME+".namespace"; - - protected static final String PAGE_DESCRIPTION = "Select protocol provider, complete account info and login"; - protected static final String JOINGROUP_FIELDNAME = "Group ID:"; + protected static final String PAGE_DESCRIPTION = "Complete account info and choose 'Finish' to login"; + protected static final String JOINGROUP_FIELDNAME = "Connect ID:"; protected static final String NICKNAME_FIELDNAME = "Nickname:"; - protected static final String ECF_DEFAULT_URL = "ecftcp://localhost:3282/server"; - protected static final String ECF_TEMPLATE_URL = "<protocol>://<machinename>:<port>/<servicename>"; - protected static final String PAGE_TITLE = "Connect with ECF"; + protected static final String ECF_DEFAULT_URL = "ecftcp://ecf.eclipse.org:3282/server"; + protected static final String ECF_TEMPLATE_URL = "ecftcp://<server>:<port>/<groupname>"; + protected static final String PAGE_TITLE = "Connect with ECF Generic Client"; protected static final String DEFAULT_CLIENT = "ecf.generic.client"; @@ -67,16 +57,13 @@ public class JoinGroupWizardPage extends WizardPage { protected String template_url = ECF_TEMPLATE_URL; protected String default_url = ECF_DEFAULT_URL; - protected boolean showPassword = true; protected boolean showNickname = true; - protected Label password_label; protected Text nickname_text; protected Label nickname_label; protected Text joingroup_text; protected Label example_label; protected Combo combo; - protected Text password_text; protected List containerDescriptions = new ArrayList(); protected String urlPrefix = ""; protected Label groupIDLabel; @@ -90,58 +77,18 @@ public class JoinGroupWizardPage extends WizardPage { public boolean getAutoLoginFlag() { return autoLoginFlag; } - protected void modifyUI(Map props) { - if (props != null) { - String usePassword = (String) props.get(USEPASSWORD_PROP_NAME); - String examplegroupid = (String) props.get(EXAMPLEGROUPID_PROP_NAME); - String defaultgroupid = (String) props.get(DEFAULTGROUPID_PROP_NAME); - String useNickname = (String) props.get(USENICKNAME_PROP_NAME); - urlPrefix = (String) props.get(URLPREFIX_NAME); - namespace = (String) props.get(NAMESPACE_PROP_NAME); - if (urlPrefix == null) urlPrefix = ""; - String groupLabel = (String) props.get(GROUPIDLABEL_PROP_NAME); - if (groupLabel != null) { - groupIDLabel.setText(groupLabel); - } else { - groupIDLabel.setText(JOINGROUP_FIELDNAME); - } - // turn off password unless used - if (usePassword != null){ - password_label.setVisible(true); - password_text.setVisible(true); - } else { - password_label.setVisible(false); - password_text.setVisible(false); - } - // turn off nickname unless used - if (useNickname != null){ - nickname_label.setVisible(true); - nickname_text.setVisible(true); - } else { - nickname_label.setVisible(false); - nickname_text.setVisible(false); - } - // set examplegroupid text - example_label.setText((examplegroupid != null)?examplegroupid:""); - joingroup_text.setText((defaultgroupid != null)?defaultgroupid:""); - } - } - protected void fillCombo() { + + protected void fillCombo() { List rawDescriptions = ContainerFactory.getDefault().getDescriptions(); int index = 0; int def = 0; - Map defProps = null; for(Iterator i=rawDescriptions.iterator(); i.hasNext(); ) { final ContainerTypeDescription desc = (ContainerTypeDescription) i.next(); String name = desc.getName(); String description = desc.getDescription(); - Map props = desc.getProperties(); - String isServer = (String) props.get(ISSERVER_PROP_NAME); - if (isServer == null || !isServer.equalsIgnoreCase("true")) { - if (DEFAULT_CLIENT.equals(name)) { - def = index; - defProps = props; - } + // Only add default client to combo + if (DEFAULT_CLIENT.equals(name)) { + def = index; combo.add(description+" - "+name,index); combo.setData(""+index,desc); containerDescriptions.add(desc); @@ -150,9 +97,6 @@ public class JoinGroupWizardPage extends WizardPage { } combo.addSelectionListener(new SelectionListener() { public void widgetSelected(SelectionEvent e) { - ContainerTypeDescription desc = (ContainerTypeDescription) combo.getData(combo.getSelectionIndex()+""); - Map props = desc.getProperties(); - modifyUI(props); } public void widgetDefaultSelected(SelectionEvent e) { @@ -161,7 +105,6 @@ public class JoinGroupWizardPage extends WizardPage { }); // Set to default if (combo.getItemCount() > 0) combo.select(def); - if (defProps != null) modifyUI(defProps); } public void createControl(Composite parent) { @@ -173,7 +116,7 @@ public class JoinGroupWizardPage extends WizardPage { setControl(container); final Label label_4 = new Label(container, SWT.NONE); - label_4.setText("Provider:"); + label_4.setText("Protocol:"); final GridData gridData_0 = new GridData(GridData.HORIZONTAL_ALIGN_FILL); label_4.setLayoutData(gridData_0); @@ -181,16 +124,17 @@ public class JoinGroupWizardPage extends WizardPage { final GridData gridData_1 = new GridData(GridData.HORIZONTAL_ALIGN_FILL); combo.setLayoutData(gridData_1); - Label l5 = new Label(container, SWT.NONE); - l5.setText(""); - example_label = new Label(container, SWT.NONE); - example_label.setText(template_url); - groupIDLabel = new Label(container, SWT.NONE); groupIDLabel.setText(JOINGROUP_FIELDNAME); joingroup_text = new Text(container, SWT.BORDER); joingroup_text.setText(default_url); + + Label l5 = new Label(container, SWT.NONE); + l5.setText(""); + example_label = new Label(container, SWT.NONE); + example_label.setText(template_url); + final GridData gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL); gridData.widthHint = 140; joingroup_text.setLayoutData(gridData); @@ -225,16 +169,6 @@ public class JoinGroupWizardPage extends WizardPage { nickname_label.setVisible(false); } - password_label = new Label(container, SWT.NONE); - password_label.setText("Password:"); - - password_text = new Text(container, SWT.BORDER); - password_text.setEchoChar('*'); - password_text.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL)); - if (!showPassword) { - password_text.setVisible(false); - password_label.setVisible(false); - } autoLogin = new Button(container,SWT.CHECK); autoLogin.setText("Login &automatically at startup"); autoLogin.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END)); @@ -258,10 +192,6 @@ public class JoinGroupWizardPage extends WizardPage { String[] items = combo.getItems(); for (int i = 0; i < items.length; ++i) if (strVal.equals(items[i])) { - combo.select(i); - ContainerTypeDescription desc = (ContainerTypeDescription) combo - .getData(String.valueOf(i)); - modifyUI(desc.getProperties()); break; } } @@ -310,10 +240,6 @@ public class JoinGroupWizardPage extends WizardPage { return nickname_text.getText().trim(); } - public String getPasswordText() { - return password_text.getText(); - } - public String getContainerType() { int index = combo.getSelectionIndex(); if (index == -1) return null; |