Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2007-06-14 23:09:39 +0000
committerslewis2007-06-14 23:09:39 +0000
commitb60508f045bcbf6e6d2cd5cccea7693e39cccd66 (patch)
tree2eb1da01e7f899f894dcd626e0fe400b0d7a0daf
parent14011e5402c55f1c2689160d4959e036d304072d (diff)
downloadorg.eclipse.ecf-b60508f045bcbf6e6d2cd5cccea7693e39cccd66.tar.gz
org.eclipse.ecf-b60508f045bcbf6e6d2cd5cccea7693e39cccd66.tar.xz
org.eclipse.ecf-b60508f045bcbf6e6d2cd5cccea7693e39cccd66.zip
Added error checking to SelectProviderAction line 73 for bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=192751v20070614-1610
-rw-r--r--framework/bundles/org.eclipse.ecf.ui/src/org/eclipse/ecf/internal/ui/Messages.java2
-rw-r--r--framework/bundles/org.eclipse.ecf.ui/src/org/eclipse/ecf/internal/ui/actions/SelectProviderAction.java59
-rw-r--r--framework/bundles/org.eclipse.ecf.ui/src/org/eclipse/ecf/internal/ui/messages.properties1
3 files changed, 43 insertions, 19 deletions
diff --git a/framework/bundles/org.eclipse.ecf.ui/src/org/eclipse/ecf/internal/ui/Messages.java b/framework/bundles/org.eclipse.ecf.ui/src/org/eclipse/ecf/internal/ui/Messages.java
index cf4ce3f61..857d32c0c 100644
--- a/framework/bundles/org.eclipse.ecf.ui/src/org/eclipse/ecf/internal/ui/Messages.java
+++ b/framework/bundles/org.eclipse.ecf.ui/src/org/eclipse/ecf/internal/ui/Messages.java
@@ -89,6 +89,8 @@ public class Messages extends NLS {
public static String AbstractURIHyperlink_EXCEPTION_HYPERLINK;
+ public static String SelectProviderAction_WARNING_CONTAINER_TYPE_DESCRIPTION_NOT_FOUND;
+
static {
// load message values from bundle file
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
diff --git a/framework/bundles/org.eclipse.ecf.ui/src/org/eclipse/ecf/internal/ui/actions/SelectProviderAction.java b/framework/bundles/org.eclipse.ecf.ui/src/org/eclipse/ecf/internal/ui/actions/SelectProviderAction.java
index 488f27898..a42d453ea 100644
--- a/framework/bundles/org.eclipse.ecf.ui/src/org/eclipse/ecf/internal/ui/actions/SelectProviderAction.java
+++ b/framework/bundles/org.eclipse.ecf.ui/src/org/eclipse/ecf/internal/ui/actions/SelectProviderAction.java
@@ -7,6 +7,7 @@
*
* Contributors:
* Remy Suen <remy.suen@gmail.com> - initial API and implementation
+ * Scott Lewis <slewis@composent.com> - error checking
******************************************************************************/
package org.eclipse.ecf.internal.ui.actions;
@@ -16,16 +17,20 @@ import java.util.Iterator;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtension;
import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
import org.eclipse.ecf.core.ContainerFactory;
import org.eclipse.ecf.core.ContainerTypeDescription;
import org.eclipse.ecf.core.IContainer;
import org.eclipse.ecf.internal.ui.Activator;
+import org.eclipse.ecf.internal.ui.Messages;
import org.eclipse.ecf.internal.ui.wizards.IWizardRegistryConstants;
import org.eclipse.ecf.ui.IConfigurationWizard;
import org.eclipse.ecf.ui.IConnectWizard;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
@@ -70,26 +75,42 @@ public class SelectProviderAction implements IWizardRegistryConstants,
final IConfigurationElement ice = ices[j];
ContainerTypeDescription typeDescription = ContainerFactory
.getDefault().getDescriptionByName(factoryName);
- if (!typeDescription.isHidden()) {
- if (wizard == null) {
- map.put(ice.getAttribute(ATT_NAME),
- new SelectionAdapter() {
- public void widgetSelected(
- SelectionEvent e) {
- openConnectWizard(ice,
- factoryName);
- }
- });
- } else {
- map.put(ice.getAttribute(ATT_NAME),
- new SelectionAdapter() {
- public void widgetSelected(
- SelectionEvent e) {
- openConnectWizard(wizard, ice,
- factoryName);
- }
- });
+ if (typeDescription != null) {
+ if (!typeDescription.isHidden()) {
+ if (wizard == null) {
+ map.put(ice.getAttribute(ATT_NAME),
+ new SelectionAdapter() {
+ public void widgetSelected(
+ SelectionEvent e) {
+ openConnectWizard(ice,
+ factoryName);
+ }
+ });
+ } else {
+ map.put(ice.getAttribute(ATT_NAME),
+ new SelectionAdapter() {
+ public void widgetSelected(
+ SelectionEvent e) {
+ openConnectWizard(wizard,
+ ice, factoryName);
+ }
+ });
+ }
}
+ } else {
+ Activator
+ .getDefault()
+ .getLog()
+ .log(
+ new Status(
+ IStatus.WARNING,
+ Activator.PLUGIN_ID,
+ IStatus.WARNING,
+ NLS
+ .bind(
+ Messages.SelectProviderAction_WARNING_CONTAINER_TYPE_DESCRIPTION_NOT_FOUND,
+ factoryName),
+ null));
}
}
}
diff --git a/framework/bundles/org.eclipse.ecf.ui/src/org/eclipse/ecf/internal/ui/messages.properties b/framework/bundles/org.eclipse.ecf.ui/src/org/eclipse/ecf/internal/ui/messages.properties
index 400df4d53..ab96c31a5 100644
--- a/framework/bundles/org.eclipse.ecf.ui/src/org/eclipse/ecf/internal/ui/messages.properties
+++ b/framework/bundles/org.eclipse.ecf.ui/src/org/eclipse/ecf/internal/ui/messages.properties
@@ -63,3 +63,4 @@ ConfigurationWizardSelectionPage_CONFIGURATION_ERROR_MESSAGE=The wizard could no
AbstractConnectWizardPage_LOGIN_AUTOMATICALLY_LABEL=Login &automatically at startup
AbstractConnectWizardPage_CONNECTID_ERROR_STATUS=A connect ID must be specified.
ContainerCreateErrorDialog_CREATE_CONTAINER_ERROR_TITLE=Create Container Error
+SelectProviderAction_WARNING_CONTAINER_TYPE_DESCRIPTION_NOT_FOUND=ContainerTypeDescription {0} not found

Back to the top