aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Rennie2012-02-23 11:54:21 (EST)
committerEric Moffatt2012-02-28 10:52:06 (EST)
commit1db6582c0f432727871148ea19642c8920e5b97a (patch)
treee805f27b1d5965caf254e2ccba6da6bf5509edfd
parentb5a86796d1056b47aed85f873c26841908a62e94 (diff)
downloadeclipse.platform.ui-1db6582c0f432727871148ea19642c8920e5b97a.zip
eclipse.platform.ui-1db6582c0f432727871148ea19642c8920e5b97a.tar.gz
eclipse.platform.ui-1db6582c0f432727871148ea19642c8920e5b97a.tar.bz2
Bug 348537 - Add non-java package table is not selecteable when no java
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();
}