Search in sources :

Example 6 with ExtSource

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

the class GetExtSources method filterTable.

@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().contains(filter.toLowerCase())) || renameContent(src.getType()).toLowerCase().contains(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();
}
Also used : ExtSource(cz.metacentrum.perun.webgui.model.ExtSource)

Example 7 with ExtSource

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

the class GetVoExtSources method filterTable.

@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().contains(filter.toLowerCase())) || renameContent(src.getType()).toLowerCase().contains(filter.toLowerCase())) {
                list.add(src);
            }
        }
    }
    if (list.isEmpty() && !filter.isEmpty()) {
        loaderImage.setEmptyResultMessage("No external source matching '" + filter + "' found.");
    } else {
        loaderImage.setEmptyResultMessage("VO has no external source of members.");
    }
    dataProvider.flush();
    dataProvider.refresh();
    loaderImage.loadingFinished();
}
Also used : ExtSource(cz.metacentrum.perun.webgui.model.ExtSource)

Example 8 with ExtSource

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

the class GetGroupExtSources method filterTable.

@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().contains(filter.toLowerCase())) || renameContent(src.getType()).toLowerCase().contains(filter.toLowerCase())) {
                list.add(src);
            }
        }
    }
    if (list.isEmpty() && !filter.isEmpty()) {
        loaderImage.setEmptyResultMessage("No external source matching '" + filter + "' found.");
    } else {
        loaderImage.setEmptyResultMessage("Group has no external source of members.");
    }
    dataProvider.flush();
    dataProvider.refresh();
    loaderImage.loadingFinished();
}
Also used : ExtSource(cz.metacentrum.perun.webgui.model.ExtSource)

Example 9 with ExtSource

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

the class GetGroupExtSources method setList.

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();
}
Also used : ExtSource(cz.metacentrum.perun.webgui.model.ExtSource)

Example 10 with ExtSource

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

the class GetExtSources method setList.

public void setList(ArrayList<ExtSource> list) {
    clearTable();
    if (!extSourceTypeFilter.isEmpty()) {
        // filter only them
        for (ExtSource object : list) {
            if (!extSourceTypeFilter.contains(object.getType())) {
                this.list.add(object);
                oracle.add(object.getName());
                oracle.add(renameContent(object.getType()));
            }
        }
    } else {
        this.list.addAll(list);
        for (ExtSource object : list) {
            oracle.add(object.getName());
            oracle.add(renameContent(object.getType()));
        }
    }
    dataProvider.flush();
    dataProvider.refresh();
}
Also used : ExtSource(cz.metacentrum.perun.webgui.model.ExtSource)

Aggregations

ExtSource (cz.metacentrum.perun.webgui.model.ExtSource)12 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)6 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)6 CustomButton (cz.metacentrum.perun.webgui.widgets.CustomButton)6 TabMenu (cz.metacentrum.perun.webgui.widgets.TabMenu)6 JsonCallbackEvents (cz.metacentrum.perun.webgui.json.JsonCallbackEvents)5 ExtendedSuggestBox (cz.metacentrum.perun.webgui.widgets.ExtendedSuggestBox)5 ArrayList (java.util.ArrayList)4 JavaScriptObject (com.google.gwt.core.client.JavaScriptObject)3 GetExtSources (cz.metacentrum.perun.webgui.json.extSourcesManager.GetExtSources)3 GetVoExtSources (cz.metacentrum.perun.webgui.json.extSourcesManager.GetVoExtSources)3 JsArray (com.google.gwt.core.client.JsArray)2 PerunSearchEvent (cz.metacentrum.perun.webgui.client.resources.PerunSearchEvent)2 AddExtSource (cz.metacentrum.perun.webgui.json.extSourcesManager.AddExtSource)2 GetGroupExtSources (cz.metacentrum.perun.webgui.json.extSourcesManager.GetGroupExtSources)2 RemoveExtSource (cz.metacentrum.perun.webgui.json.extSourcesManager.RemoveExtSource)2 TabItem (cz.metacentrum.perun.webgui.tabs.TabItem)2 KeyUpEvent (com.google.gwt.event.dom.client.KeyUpEvent)1 KeyUpHandler (com.google.gwt.event.dom.client.KeyUpHandler)1 FlexCellFormatter (com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter)1