Search in sources :

Example 1 with Destination

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

the class GetAllRichDestinations method filterTable.

public void filterTable(String text) {
    // store list only for first time
    if (fullBackup.isEmpty() || fullBackup == null) {
        fullBackup.addAll(list);
    }
    // always clear selected items
    selectionModel.clear();
    list.clear();
    if (text.equalsIgnoreCase("")) {
        list.addAll(fullBackup);
    } else {
        for (Destination dst : fullBackup) {
            // store facility by filter
            if (service == null) {
                if (dst.getDestination().toLowerCase().contains(text.toLowerCase()) || dst.getService().getName().toLowerCase().contains(text.toLowerCase())) {
                    list.add(dst);
                }
            } else {
                if (dst.getDestination().toLowerCase().contains(text.toLowerCase()) || dst.getFacility().getName().toLowerCase().contains(text.toLowerCase())) {
                    list.add(dst);
                }
            }
        }
    }
    if (list.isEmpty() && !text.isEmpty()) {
        loaderImage.setEmptyResultMessage("No destination matching '" + text + "' found.");
    } else {
        if (showFac) {
            loaderImage.setEmptyResultMessage("Service has no destination.");
        } else {
            loaderImage.setEmptyResultMessage("Facility has no services destinations. Service configuration can't be propagated.");
        }
    }
    dataProvider.flush();
    dataProvider.refresh();
    loaderImage.loadingFinished();
}
Also used : Destination(cz.metacentrum.perun.webgui.model.Destination)

Example 2 with Destination

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

the class GetAllRichDestinations method setList.

public void setList(ArrayList<Destination> list) {
    clearTable();
    this.list.addAll(list);
    for (Destination d : list) {
        oracle.add(d.getDestination());
        if (service == null) {
            oracle.add(d.getService().getName());
        } else {
            oracle.add(d.getFacility().getName());
        }
    }
    dataProvider.flush();
    dataProvider.refresh();
}
Also used : Destination(cz.metacentrum.perun.webgui.model.Destination)

Example 3 with Destination

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

the class GetDestinations method onFinished.

/**
	 * Called, when operation finishes successfully.
	 */
public void onFinished(JavaScriptObject jso) {
    ArrayList<Destination> dest = JsonUtils.jsoAsList(jso);
    for (Destination d : dest) {
        d.setFacility(facility);
        d.setService(service);
        addToTable(d);
    }
    sortTable();
    loaderImage.loadingFinished();
    session.getUiElements().setLogText("Destinations loaded: " + list.size());
    events.onFinished(jso);
}
Also used : Destination(cz.metacentrum.perun.webgui.model.Destination)

Example 4 with Destination

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

the class GetDestinations method filterTable.

public void filterTable(String text) {
    // store list only for first time
    if (fullBackup.isEmpty() || fullBackup == null) {
        fullBackup.addAll(list);
    }
    // always clear selected items
    selectionModel.clear();
    list.clear();
    if (text.equalsIgnoreCase("")) {
        list.addAll(fullBackup);
    } else {
        for (Destination dst : fullBackup) {
            // store facility by filter
            if (dst.getService() != null) {
                if (dst.getDestination().toLowerCase().contains(text.toLowerCase()) || dst.getService().getName().toLowerCase().contains(text.toLowerCase())) {
                    list.add(dst);
                }
            } else {
                if (dst.getDestination().toLowerCase().contains(text.toLowerCase())) {
                    list.add(dst);
                }
            }
        }
    }
    dataProvider.flush();
    dataProvider.refresh();
    loaderImage.loadingFinished();
}
Also used : Destination(cz.metacentrum.perun.webgui.model.Destination)

Example 5 with Destination

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

the class GetDestinations method setList.

public void setList(ArrayList<Destination> list) {
    clearTable();
    this.list.addAll(list);
    for (Destination object : list) {
        if (object.getService() != null) {
            oracle.add(object.getService().getName());
        }
        oracle.add(object.getDestination());
    }
    dataProvider.flush();
    dataProvider.refresh();
}
Also used : Destination(cz.metacentrum.perun.webgui.model.Destination)

Aggregations

Destination (cz.metacentrum.perun.webgui.model.Destination)7 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)2 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)2 JsonCallbackEvents (cz.metacentrum.perun.webgui.json.JsonCallbackEvents)2 GetAllRichDestinations (cz.metacentrum.perun.webgui.json.servicesManager.GetAllRichDestinations)2 RemoveDestination (cz.metacentrum.perun.webgui.json.servicesManager.RemoveDestination)2 CustomButton (cz.metacentrum.perun.webgui.widgets.CustomButton)2 ArrayList (java.util.ArrayList)2 JavaScriptObject (com.google.gwt.core.client.JavaScriptObject)1 ChangeEvent (com.google.gwt.event.dom.client.ChangeEvent)1 ChangeHandler (com.google.gwt.event.dom.client.ChangeHandler)1 GetAssignedFacilities (cz.metacentrum.perun.webgui.json.facilitiesManager.GetAssignedFacilities)1 GetDestinations (cz.metacentrum.perun.webgui.json.servicesManager.GetDestinations)1 Facility (cz.metacentrum.perun.webgui.model.Facility)1 PerunError (cz.metacentrum.perun.webgui.model.PerunError)1 AddFacilityDestinationTabItem (cz.metacentrum.perun.webgui.tabs.facilitiestabs.AddFacilityDestinationTabItem)1 ExtendedSuggestBox (cz.metacentrum.perun.webgui.widgets.ExtendedSuggestBox)1 TabMenu (cz.metacentrum.perun.webgui.widgets.TabMenu)1