Example #1
0
 /**
  * Returns the filters set by the user.
  *
  * @return a {@code SearchFilter} object
  */
 SearchFilter selectedFilters() {
   SearchFilter filter = null;
   if (txtCount.getInputVerifier().verify(txtCount)) {
     Status status = null;
     if (btnGroupStatus.getSelection() != null) {
       status = Status.valueOf(btnGroupStatus.getSelection().getActionCommand());
     }
     final String countStr = txtCount.getText().trim();
     final Integer count = countStr.isEmpty() ? null : Integer.parseInt(countStr);
     final List<Type> types = selectedTypes();
     if (tileFilter) {
       filter = new TileFilter(status, types, count);
     } else {
       filter = new ClusterFilter(status, types, count);
     }
   }
   return filter;
 }
Example #2
0
 private void selectStatus(final Status status) {
   if (status != null) {
     switch (status) {
       case OPEN:
         rbStatusOpen.setSelected(true);
         break;
       case SOLVED:
         rbStatusSolved.setSelected(true);
         break;
       default:
         rbStatusInvalid.setSelected(true);
         break;
     }
   } else {
     btnGroupStatus.clearSelection();
   }
 }