Exemplo n.º 1
1
  @Override
  public void filterTable(String filter) {

    // store list only for first time
    if (fullBackup.isEmpty() || fullBackup == null) {
      fullBackup.addAll(getList());
    }

    // always clear selected items
    selectionModel.clear();
    list.clear();

    if (filter.equalsIgnoreCase("")) {
      list.addAll(fullBackup);
    } else {
      for (ExtSource src : fullBackup) {
        // store ext source if name or type matches
        if ((src.getName().toLowerCase().startsWith(filter.toLowerCase()))
            || renameContent(src.getType()).toLowerCase().startsWith(filter.toLowerCase())) {
          list.add(src);
        }
      }
    }

    if (list.isEmpty() && !filter.isEmpty()) {
      loaderImage.setEmptyResultMessage("No external source matching '" + filter + "' found.");
    } else {
      loaderImage.setEmptyResultMessage("No external sources found in Perun.");
    }

    dataProvider.flush();
    dataProvider.refresh();
    loaderImage.loadingFinished();
  }
Exemplo n.º 2
0
 public void insertToTable(int index, ExtSource object) {
   list.add(index, object);
   oracle.add(object.getName());
   oracle.add(renameContent(object.getType()));
   dataProvider.flush();
   dataProvider.refresh();
 }
Exemplo n.º 3
0
 /**
  * Add object as new row to table
  *
  * @param object ExtSource to be added as new row
  */
 public void addToTable(ExtSource object) {
   list.add(object);
   oracle.add(object.getName());
   oracle.add(renameContent(object.getType()));
   dataProvider.flush();
   dataProvider.refresh();
 }
Exemplo n.º 4
0
 public void setList(ArrayList<ExtSource> list) {
   clearTable();
   this.list.addAll(list);
   for (ExtSource object : list) {
     oracle.add(object.getName());
     oracle.add(renameContent(object.getType()));
   }
   dataProvider.flush();
   dataProvider.refresh();
 }