Search in sources :

Example 16 with ResourceTag

use of cz.metacentrum.perun.webgui.model.ResourceTag in project perun by CESNET.

the class GetRichResources method setList.

public void setList(ArrayList<RichResource> list) {
    clearTable();
    this.list.addAll(list);
    for (RichResource r : list) {
        oracle.add(r.getName());
        for (ResourceTag rt : r.getResourceTags()) {
            oracle.add(rt.getName() + " (tag)");
        }
    }
    dataProvider.flush();
    dataProvider.refresh();
}
Also used : ResourceTag(cz.metacentrum.perun.webgui.model.ResourceTag) RichResource(cz.metacentrum.perun.webgui.model.RichResource)

Example 17 with ResourceTag

use of cz.metacentrum.perun.webgui.model.ResourceTag in project perun by CESNET.

the class GetRichResources method insertToTable.

public void insertToTable(int index, RichResource object) {
    list.add(index, object);
    oracle.add(object.getName());
    for (ResourceTag rt : object.getResourceTags()) {
        oracle.add(rt.getName() + " (tag)");
    }
    dataProvider.flush();
    dataProvider.refresh();
}
Also used : ResourceTag(cz.metacentrum.perun.webgui.model.ResourceTag)

Example 18 with ResourceTag

use of cz.metacentrum.perun.webgui.model.ResourceTag in project perun by CESNET.

the class GetRichResources method filterTable.

public void filterTable(String filter) {
    // store list only for first time
    if (fullBackup.isEmpty() || fullBackup == null) {
        fullBackup.addAll(list);
    }
    // always clear selected items
    selectionModel.clear();
    list.clear();
    if (filter.equalsIgnoreCase("")) {
        list.addAll(fullBackup);
    } else {
        for (RichResource res : fullBackup) {
            // store facility by filter
            if (res.getName().toLowerCase().contains(filter.toLowerCase())) {
                list.add(res);
            }
            for (ResourceTag r : res.getResourceTags()) {
                // remove " (tag)" from tag name
                if (r.getName().contains(filter.substring(0, (filter.length() > 6) ? filter.length() - 6 : filter.length()).trim())) {
                    list.add(res);
                    break;
                }
            }
        }
    }
    if (list.isEmpty() && !filter.isEmpty()) {
        loaderImage.setEmptyResultMessage("No resource matching '" + filter + "' found.");
    } else {
        loaderImage.setEmptyResultMessage("VO has no resources.");
    }
    dataProvider.flush();
    dataProvider.refresh();
    loaderImage.loadingFinished();
}
Also used : ResourceTag(cz.metacentrum.perun.webgui.model.ResourceTag) RichResource(cz.metacentrum.perun.webgui.model.RichResource)

Aggregations

ResourceTag (cz.metacentrum.perun.webgui.model.ResourceTag)18 RichResource (cz.metacentrum.perun.webgui.model.RichResource)6 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)3 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)3 GetAllResourcesTags (cz.metacentrum.perun.webgui.json.resourcesManager.GetAllResourcesTags)3 CustomButton (cz.metacentrum.perun.webgui.widgets.CustomButton)3 ExtendedSuggestBox (cz.metacentrum.perun.webgui.widgets.ExtendedSuggestBox)3 TabMenu (cz.metacentrum.perun.webgui.widgets.TabMenu)3 ArrayList (java.util.ArrayList)3 JsonCallbackEvents (cz.metacentrum.perun.webgui.json.JsonCallbackEvents)2 TextInputCell (com.google.gwt.cell.client.TextInputCell)1 Column (com.google.gwt.user.cellview.client.Column)1 ListHandler (com.google.gwt.user.cellview.client.ColumnSortEvent.ListHandler)1 AssignResourceTag (cz.metacentrum.perun.webgui.json.resourcesManager.AssignResourceTag)1 DeleteResourceTag (cz.metacentrum.perun.webgui.json.resourcesManager.DeleteResourceTag)1 RemoveResourceTag (cz.metacentrum.perun.webgui.json.resourcesManager.RemoveResourceTag)1 UpdateResourceTag (cz.metacentrum.perun.webgui.json.resourcesManager.UpdateResourceTag)1 TabItem (cz.metacentrum.perun.webgui.tabs.TabItem)1