aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Rennie2012-02-23 11:54:21 (EST)
committerEric Moffatt2012-02-28 10:29:52 (EST)
commit207cb1a4b974d17672085f4e9bf590107e5cfb97 (patch)
tree5c9fb896dd9a7982eb8149f1be052b983dd9b205
parentb6abe9cf8a95bf3bec07d0d3c34de8d4b521a3b0 (diff)
downloadeclipse.platform.ui-207cb1a4b974d17672085f4e9bf590107e5cfb97.zip
eclipse.platform.ui-207cb1a4b974d17672085f4e9bf590107e5cfb97.tar.gz
eclipse.platform.ui-207cb1a4b974d17672085f4e9bf590107e5cfb97.tar.bz2
Bug 348537 - Add non-java package table is not selecteable when no javav20120228-1529
packages are available
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/AbstractElementListSelectionDialog.java43
1 files changed, 30 insertions, 13 deletions
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/AbstractElementListSelectionDialog.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/AbstractElementListSelectionDialog.java
index 2dfbb7d..57e5c23 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/AbstractElementListSelectionDialog.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/AbstractElementListSelectionDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -38,8 +38,7 @@ import org.eclipse.ui.PlatformUI;
*
* @since 2.0
*/
-public abstract class AbstractElementListSelectionDialog extends
- SelectionStatusDialog {
+public abstract class AbstractElementListSelectionDialog extends SelectionStatusDialog {
private ILabelProvider fRenderer;
@@ -169,19 +168,37 @@ public abstract class AbstractElementListSelectionDialog extends
}
/**
- * Sets the elements of the list (widget).
- * To be called within open().
- * @param elements the elements of the list.
- */
+ * Sets the elements of the list (widget).
+ *
+ * @param elements
+ * the elements of the list.
+ */
protected void setListElements(Object[] elements) {
Assert.isNotNull(fFilteredList);
fFilteredList.setElements(elements);
+ handleElementsChanged();
}
/**
- * Sets the filter pattern.
- * @param filter the filter pattern.
- */
+ * This method is called when the elements of the backing list are changed to refresh
+ * the standard dialog widgets.
+ *
+ * @since 3.103
+ */
+ protected void handleElementsChanged() {
+ boolean enabled = !fFilteredList.isEmpty();
+ fMessage.setEnabled(enabled);
+ fFilterText.setEnabled(enabled);
+ fFilteredList.setEnabled(enabled);
+ updateOkState();
+ }
+
+ /**
+ * Sets the filter pattern.
+ *
+ * @param filter
+ * the filter pattern.
+ */
public void setFilter(String filter) {
if (fFilterText == null) {
fFilter = filter;
@@ -455,9 +472,9 @@ public abstract class AbstractElementListSelectionDialog extends
* Handles empty list by disabling widgets.
*/
protected void handleEmptyList() {
- fMessage.setEnabled(false);
- fFilterText.setEnabled(false);
- fFilteredList.setEnabled(false);
+ fMessage.setEnabled(false);
+ fFilterText.setEnabled(false);
+ fFilteredList.setEnabled(false);
updateOkState();
}