Index: frontend/client/src/autotest/common/ui/MultiListSelectPresenter.java |
diff --git a/frontend/client/src/autotest/common/ui/MultiListSelectPresenter.java b/frontend/client/src/autotest/common/ui/MultiListSelectPresenter.java |
index 4b9d9235dff8bf67813e225042c76db9a5be489d..0d9efaa63ef8e8c807fd71606ac841a3205cb630 100644 |
--- a/frontend/client/src/autotest/common/ui/MultiListSelectPresenter.java |
+++ b/frontend/client/src/autotest/common/ui/MultiListSelectPresenter.java |
@@ -32,8 +32,8 @@ public class MultiListSelectPresenter implements ClickHandler, DoubleClickHandle |
public HandlerRegistration addDoubleClickHandler(DoubleClickHandler handler); |
} |
- /* Optional additional display allowing toggle between a simple ListBox and a |
- * DoubleListSelector |
+ /* Optional additional display allowing toggle between a simple ListBox and a |
+ * DoubleListSelector |
*/ |
public interface ToggleDisplay { |
public SimplifiedList getSingleSelector(); |
@@ -93,14 +93,14 @@ public class MultiListSelectPresenter implements ClickHandler, DoubleClickHandle |
public String toString() { |
return "Item<" + name + ", " + value + ">"; |
} |
- |
+ |
private boolean isSelected() { |
if (isGeneratedItem) { |
return true; |
} |
return selected; |
} |
- |
+ |
private void setSelected(boolean selected) { |
assert !isGeneratedItem; |
this.selected = selected; |
@@ -138,11 +138,6 @@ public class MultiListSelectPresenter implements ClickHandler, DoubleClickHandle |
public HandlerRegistration addChangeHandler(ChangeHandler handler) { |
throw new UnsupportedOperationException(); |
} |
- |
- @Override |
- public void setEnabled(boolean enabled) { |
- throw new UnsupportedOperationException(); |
- } |
}; |
} |
@@ -210,7 +205,7 @@ public class MultiListSelectPresenter implements ClickHandler, DoubleClickHandle |
// check consistency of selectedItems |
for (Item item : items) { |
if (item.isSelected() && !selectedItems.contains(item)) { |
- throw new RuntimeException("selectedItems is inconsistent, missing: " |
+ throw new RuntimeException("selectedItems is inconsistent, missing: " |
+ item.toString()); |
} |
} |
@@ -233,7 +228,7 @@ public class MultiListSelectPresenter implements ClickHandler, DoubleClickHandle |
private boolean isItemPresent(Item item) { |
return Collections.binarySearch(items, item) >= 0; |
} |
- |
+ |
private void removeItem(Item item) { |
items.remove(item); |
if (item.isSelected()) { |
@@ -299,7 +294,7 @@ public class MultiListSelectPresenter implements ClickHandler, DoubleClickHandle |
selectedItems.add(item); |
assert verifyConsistency(); |
} |
- |
+ |
public void selectItemByName(String name) { |
selectItem(getItemByName(name)); |
refresh(); |
@@ -331,7 +326,7 @@ public class MultiListSelectPresenter implements ClickHandler, DoubleClickHandle |
} |
/** |
- * Set the set of selected items, silently dropping any that don't exist in the header field |
+ * Set the set of selected items, silently dropping any that don't exist in the header field |
* list. |
*/ |
public void restoreSelectedItems(List<Item> items) { |
@@ -394,15 +389,15 @@ public class MultiListSelectPresenter implements ClickHandler, DoubleClickHandle |
} |
return null; |
} |
- |
+ |
public boolean hasItemName(String name) { |
return findItem(name) != null; |
} |
@Override |
public void onClick(ClickEvent event) { |
- boolean isItemSelectedOnLeft = display.getAvailableList().getSelectedName() != null; |
- boolean isItemSelectedOnRight = display.getSelectedList().getSelectedName() != null; |
+ boolean isItemSelectedOnLeft = (display.getAvailableList().getSelectedName() != null); |
+ boolean isItemSelectedOnRight = (display.getSelectedList().getSelectedName() != null); |
Object source = event.getSource(); |
if (source == display.getAddAllButton()) { |
addAll(); |
@@ -425,7 +420,7 @@ public class MultiListSelectPresenter implements ClickHandler, DoubleClickHandle |
} else { |
throw new RuntimeException("Unexpected ClickEvent from " + event.getSource()); |
} |
- |
+ |
refresh(); |
} |
@@ -440,7 +435,7 @@ public class MultiListSelectPresenter implements ClickHandler, DoubleClickHandle |
// ignore double-clicks on other widgets |
return; |
} |
- |
+ |
refresh(); |
} |
@@ -459,7 +454,7 @@ public class MultiListSelectPresenter implements ClickHandler, DoubleClickHandle |
selectItem(item); |
} |
} |
- |
+ |
refresh(); |
} |