Search in sources :

Example 26 with Confirm

use of cz.metacentrum.perun.webgui.widgets.Confirm in project perun by CESNET.

the class FillAttributes method testRemoving.

/**
 * Tests the values, if the process can continue
 *
 * @return true/false for continue/stop
 */
private boolean testRemoving() {
    boolean result = true;
    String errorMsg = "";
    if (this.ids.isEmpty()) {
        errorMsg += "Wrong attribute type value.\n";
        result = false;
    }
    // silent skip - used by save changes buttons on attributes pages
    if (attributes == null || attributes.isEmpty()) {
        result = false;
    }
    if (errorMsg.length() > 0) {
        Confirm c = new Confirm("Error while filling attributes", new Label(errorMsg), true);
        c.show();
    }
    return result;
}
Also used : Label(com.google.gwt.user.client.ui.Label) Confirm(cz.metacentrum.perun.webgui.widgets.Confirm)

Example 27 with Confirm

use of cz.metacentrum.perun.webgui.widgets.Confirm in project perun by CESNET.

the class RemoveAttributes method testRemoving.

/**
 * Tests the values, if the process can continue
 *
 * @return true/false for continue/stop
 */
private boolean testRemoving() {
    boolean result = true;
    String errorMsg = "";
    if (this.ids.isEmpty()) {
        errorMsg += "Wrong attribute type value.\n";
        result = false;
    }
    // silent skip - used by save changes buttons on attributes pages
    if (attributes == null || attributes.isEmpty()) {
        result = false;
    }
    if (errorMsg.length() > 0) {
        Confirm c = new Confirm("Error while removing attributes", new Label(errorMsg), true);
        c.show();
    }
    return result;
}
Also used : Label(com.google.gwt.user.client.ui.Label) Confirm(cz.metacentrum.perun.webgui.widgets.Confirm)

Example 28 with Confirm

use of cz.metacentrum.perun.webgui.widgets.Confirm in project perun by CESNET.

the class DeleteAttribute method testDeleting.

/**
 * Tests the values, if the process can continue
 *
 * @return true/false for continue/stop
 */
private boolean testDeleting() {
    boolean result = true;
    String errorMsg = "";
    if (attrDefId == 0) {
        errorMsg += "Wrong Attribute definition ID parameter.\n";
        result = false;
    }
    if (errorMsg.length() > 0) {
        Confirm c = new Confirm("Error while deleting attribute", new Label(errorMsg), true);
        c.show();
    }
    return result;
}
Also used : Label(com.google.gwt.user.client.ui.Label) Confirm(cz.metacentrum.perun.webgui.widgets.Confirm)

Example 29 with Confirm

use of cz.metacentrum.perun.webgui.widgets.Confirm in project perun by CESNET.

the class SetAttribute method testSetting.

/**
 * Tests the values, if the process can continue
 *
 * @return true/false for continue/stop
 */
private boolean testSetting() {
    boolean result = true;
    String errorMsg = "";
    if (this.ids.isEmpty()) {
        errorMsg += "Wrong attribute type value.\n";
        result = false;
    }
    // skip attribute with empty or null value
    if (attribute.getValue() == null || attribute.getValue().equalsIgnoreCase("")) {
        errorMsg += "Can't save attribute with null or empty value.\n";
        result = false;
    }
    if (errorMsg.length() > 0) {
        Confirm c = new Confirm("Error while setting attribute", new Label(errorMsg), true);
        c.show();
    }
    return result;
}
Also used : Label(com.google.gwt.user.client.ui.Label) Confirm(cz.metacentrum.perun.webgui.widgets.Confirm)

Example 30 with Confirm

use of cz.metacentrum.perun.webgui.widgets.Confirm in project perun by CESNET.

the class JsonUtils method cantParseIntConfirm.

/**
 * Provides popup notification
 *
 * @param origin (you can specified origin of value (name of check box)
 * @param value value that can't be parsed
 */
public static final void cantParseIntConfirm(String origin, String value) {
    FlexTable ft = new FlexTable();
    ft.setHTML(0, 0, "Value \"" + SafeHtmlUtils.fromString(value).asString() + "\" can't be parsed as number.");
    if (origin.length() > 0) {
        ft.setHTML(1, 0, "Input name: " + SafeHtmlUtils.fromString(origin).asString());
    }
    Confirm conf = new Confirm("Can't parse value", ft, true);
    conf.setNonScrollable(true);
    conf.show();
}
Also used : Confirm(cz.metacentrum.perun.webgui.widgets.Confirm)

Aggregations

Confirm (cz.metacentrum.perun.webgui.widgets.Confirm)49 HTML (com.google.gwt.user.client.ui.HTML)26 JSONString (com.google.gwt.json.client.JSONString)19 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)16 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)16 JavaScriptObject (com.google.gwt.core.client.JavaScriptObject)15 JsonCallbackEvents (cz.metacentrum.perun.webgui.json.JsonCallbackEvents)12 Label (com.google.gwt.user.client.ui.Label)8 PerunError (cz.metacentrum.perun.webgui.model.PerunError)8 CustomButton (cz.metacentrum.perun.webgui.widgets.CustomButton)8 Column (com.google.gwt.user.cellview.client.Column)5 ListHandler (com.google.gwt.user.cellview.client.ColumnSortEvent.ListHandler)5 ArrayList (java.util.ArrayList)5 FlexCellFormatter (com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter)4 JsonPostClient (cz.metacentrum.perun.webgui.json.JsonPostClient)4 FlexTable (com.google.gwt.user.client.ui.FlexTable)3 SimplePanel (com.google.gwt.user.client.ui.SimplePanel)3 RegistrarFormItemGenerator (cz.metacentrum.perun.webgui.client.applicationresources.RegistrarFormItemGenerator)3 TabMenu (cz.metacentrum.perun.webgui.widgets.TabMenu)3 Context (com.google.gwt.cell.client.Cell.Context)2