Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjonas2014-09-22 07:56:44 -0400
committerjonas2014-09-22 07:56:44 -0400
commit5ac75d78fc4831539656905acbfe15d16d300015 (patch)
treefc1b29991a9b0c3a3390e5a03c0e9ff4d5439e64
parentf8316a957038c31c47a6d19c4cb7adec5b09715e (diff)
downloadorg.eclipse.e4.tools-5ac75d78fc4831539656905acbfe15d16d300015.tar.gz
org.eclipse.e4.tools-5ac75d78fc4831539656905acbfe15d16d300015.tar.xz
org.eclipse.e4.tools-5ac75d78fc4831539656905acbfe15d16d300015.zip
Bug 444692 - Remove Warnings - Adapted TitleAreaFilterDialog
-rw-r--r--bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/FilteredContributionDialog.java12
-rw-r--r--bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/tabs/empty/TitleAreaFilterDialog.java13
2 files changed, 13 insertions, 12 deletions
diff --git a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/FilteredContributionDialog.java b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/FilteredContributionDialog.java
index eebcc4ce..e3ad7d08 100644
--- a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/FilteredContributionDialog.java
+++ b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/FilteredContributionDialog.java
@@ -722,7 +722,9 @@ public abstract class FilteredContributionDialog extends SaveDialogBoundsSetting
}
};
if (dlg.open() == Dialog.OK) {
- setFilterBundles((List<String>) dlg.asList());
+ ArrayList<String> result = new ArrayList<String>();
+ result.add(dlg.getFirstSelection());
+ setFilterBundles(result);
refreshSearch();
}
updateUiState();
@@ -756,7 +758,9 @@ public abstract class FilteredContributionDialog extends SaveDialogBoundsSetting
}
};
if (dlg.open() == Dialog.OK) {
- setFilterPackages((List<String>) dlg.asList());
+ ArrayList<String> result = new ArrayList<String>();
+ result.add(dlg.getFirstSelection());
+ setFilterBundles(result);
refreshSearch();
}
updateUiState();
@@ -816,7 +820,9 @@ public abstract class FilteredContributionDialog extends SaveDialogBoundsSetting
}
};
if (dlg.open() == Dialog.OK) {
- setFilterLocations((List<String>) dlg.asList());
+ ArrayList<String> result = new ArrayList<String>();
+ result.add(dlg.getFirstSelection());
+ setFilterBundles(result);
refreshSearch();
}
updateUiState();
diff --git a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/tabs/empty/TitleAreaFilterDialog.java b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/tabs/empty/TitleAreaFilterDialog.java
index df02c420..4be36335 100644
--- a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/tabs/empty/TitleAreaFilterDialog.java
+++ b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/tabs/empty/TitleAreaFilterDialog.java
@@ -12,10 +12,6 @@
package org.eclipse.e4.tools.emf.ui.internal.common.component.tabs.empty;
import org.eclipse.e4.tools.emf.ui.internal.common.component.tabs.Messages;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
import org.eclipse.jface.dialogs.TitleAreaDialog;
import org.eclipse.jface.viewers.ArrayContentProvider;
import org.eclipse.jface.viewers.DoubleClickEvent;
@@ -151,13 +147,12 @@ public class TitleAreaFilterDialog extends TitleAreaDialog {
return text;
}
- public List<?> asList() {
+ public String getFirstSelection() {
Object firstElement = getFirstElement();
- if (firstElement == null) {
- return Collections.EMPTY_LIST;
- } else {
- return Arrays.asList(firstElement);
+ if (firstElement instanceof String) {
+ return (String) firstElement;
}
+ return firstElement.toString();
}
}

Back to the top