Issue #2419 - fixed issue with DualList and how it was being used.
Former-commit-id: 7020ca52e6e22a68013de74bc9891ad44942c48a
This commit is contained in:
parent
2ebc09493a
commit
9c02d45802
4 changed files with 28 additions and 24 deletions
|
@ -60,6 +60,8 @@ import com.raytheon.viz.ui.widgets.duallist.DualListConfig;
|
|||
* Mar 20, 2012 240 jpiatt Updates to filter notification table data.
|
||||
* Jun 1, 2012 645 jpiatt Added tooltips.
|
||||
* Sep 25, 2013 2408 mpduff Added sort to subscription lists.
|
||||
* Sep 27, 2013 #2419 lvenable Update code to reflect changes made in
|
||||
* the dual list.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -172,8 +174,8 @@ public class NotificationFilterDlg extends CaveSWTDialogBase {
|
|||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
if (alwaysIncludeMeBtn.getSelection()) {
|
||||
userDualList.getConfig().getIncludeList().clear();
|
||||
userDualList.getConfig().getIncludeList().add(currentUser);
|
||||
userDualList.clearIncludeList();
|
||||
userDualList.addToIncludeList(currentUser);
|
||||
|
||||
// Available and Selected Filter Lists
|
||||
String[] available = userDualList.getAvailableListItems();
|
||||
|
@ -210,7 +212,7 @@ public class NotificationFilterDlg extends CaveSWTDialogBase {
|
|||
userDualList.setAvailableItems(arr2);
|
||||
|
||||
} else {
|
||||
userDualList.getConfig().getIncludeList().clear();
|
||||
userDualList.clearIncludeList();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -261,11 +263,11 @@ public class NotificationFilterDlg extends CaveSWTDialogBase {
|
|||
|
||||
}
|
||||
|
||||
HashSet<String> h = new HashSet<String>();
|
||||
HashSet<String> includeItems = new HashSet<String>();
|
||||
|
||||
if (selfInclude) {
|
||||
|
||||
h.add(currentUser);
|
||||
includeItems.add(currentUser);
|
||||
}
|
||||
|
||||
// Create the user dual list
|
||||
|
@ -273,7 +275,7 @@ public class NotificationFilterDlg extends CaveSWTDialogBase {
|
|||
dualConfig.setListHeight(120);
|
||||
dualConfig.setListWidth(125);
|
||||
dualConfig.setShowUpDownBtns(false);
|
||||
dualConfig.setIncludeList(h);
|
||||
dualConfig.setIncludeList(includeItems);
|
||||
dualConfig.setAvailableListLabel("Available Users:");
|
||||
dualConfig.setSelectedListLabel("Selected Users:");
|
||||
|
||||
|
|
|
@ -74,6 +74,8 @@ import com.raytheon.viz.ui.widgets.duallist.IUpdate;
|
|||
* Sep 25, 2012 1357 mpduff Initial creation.
|
||||
* Jan 17, 2013 1357 mpduff Added timestep settings.
|
||||
* Feb 26, 2013 1667 mpduff Sort categories.
|
||||
* Sep 27, 2013 #2419 lvenable Changed code so the dual list will
|
||||
* function correctly on start up.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -518,9 +520,7 @@ public class StatsControlDlg extends CaveSWTDialog implements IStatsControl,
|
|||
List<String> groupList = data.getGroupList();
|
||||
Collections.sort(groupList);
|
||||
groupFilterDualList.clearAvailableList(true);
|
||||
groupFilterDualList.clearSelection();
|
||||
groupFilterDualList.setAvailableItems(groupList);
|
||||
groupFilterDualList.getConfig().setFullList(groupList);
|
||||
groupFilterDualList.setFullList(groupList);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -544,9 +544,7 @@ public class StatsControlDlg extends CaveSWTDialog implements IStatsControl,
|
|||
List<String> groupList = data.getGroupList();
|
||||
Collections.sort(groupList);
|
||||
groupFilterDualList.clearAvailableList(true);
|
||||
groupFilterDualList.clearSelection();
|
||||
groupFilterDualList.setAvailableItems(groupList);
|
||||
groupFilterDualList.getConfig().setFullList(groupList);
|
||||
groupFilterDualList.setFullList(groupList);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -57,6 +57,9 @@ import com.raytheon.viz.ui.widgets.duallist.ButtonImages.ButtonImage;
|
|||
* Dec 17, 2012 1431 mpduff Fix filter problem when deselecting items.
|
||||
* Jan 07, 2013 1456 bgonzale Added setSelectedList(ArrayList<String>).
|
||||
* Aug 20, 2013 1733 mpduff Search now uses SearchUtils.
|
||||
* Sep 27, 2013 #2419 lvenable Removed the ability to get the dual config list
|
||||
* and added some convenience methods to clear and add
|
||||
* to the include list.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -447,7 +450,7 @@ public class DualList extends Composite {
|
|||
* @param fullList
|
||||
* all users listed in notification table
|
||||
*/
|
||||
public void setFullList(ArrayList<String> fullList) {
|
||||
public void setFullList(java.util.List<String> fullList) {
|
||||
config.setFullList(fullList);
|
||||
populateLists();
|
||||
}
|
||||
|
@ -911,22 +914,21 @@ public class DualList extends Composite {
|
|||
}
|
||||
|
||||
/**
|
||||
* Get the configuration.
|
||||
*
|
||||
* @return the configuration.
|
||||
* Clear the include list. The include list is the list of items that will
|
||||
* always be present in the selected list control.
|
||||
*/
|
||||
public DualListConfig getConfig() {
|
||||
return config;
|
||||
public void clearIncludeList() {
|
||||
config.getIncludeList().clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the configuration.
|
||||
* Add an item to the include list.
|
||||
*
|
||||
* @param config
|
||||
* the configuration.
|
||||
* @param item
|
||||
* Item to add to the include list.
|
||||
*/
|
||||
public void setConfig(DualListConfig config) {
|
||||
this.config = config;
|
||||
public void addToIncludeList(String item) {
|
||||
config.getIncludeList().add(item);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -36,6 +36,7 @@ import java.util.List;
|
|||
* Aug 10, 2012 1002 mpduff Added numeric flag for sorting.
|
||||
* Jan 07, 2013 1431 mpduff Add case sensitive and exclude flags.
|
||||
* Aug 20, 2013 1733 mpduff Add match flag.
|
||||
* Sep 27, 2013 #2419 lvenable Updated include description.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -81,7 +82,8 @@ public class DualListConfig {
|
|||
private List<String> fullList = new ArrayList<String>();
|
||||
|
||||
/**
|
||||
* The list to include.
|
||||
* The include list is a set of items that will always be present the
|
||||
* selected list and cannot be removed from the selected list.
|
||||
*/
|
||||
private HashSet<String> includeList = new HashSet<String>();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue