Search in sources :

Example 6 with UiHandler

use of com.google.gwt.uibinder.client.UiHandler in project opennms by OpenNMS.

the class Navigation method linkTopOpenNMSClicked.

@UiHandler("m_link")
public void linkTopOpenNMSClicked(ClickEvent event) {
    StringBuffer postData = new StringBuffer();
    // note param pairs are separated by a '&' 
    // and each key-value pair is separated by a '='
    postData.append(URL.encode("j_username")).append("=").append(URL.encode("ipv6"));
    postData.append("&");
    postData.append(URL.encode("j_password")).append("=").append(URL.encode("ipv6"));
    postData.append("&");
    postData.append(URL.encode("Login")).append("=").append(URL.encode("login"));
    RequestBuilder builder = new RequestBuilder(RequestBuilder.POST, URL.encode("/opennms/j_spring_security_check"));
    builder.setHeader("Content-type", "application/x-www-form-urlencoded");
    try {
        builder.sendRequest(postData.toString(), new RequestCallback() {

            @Override
            public void onResponseReceived(Request request, Response response) {
                if (response.getStatusCode() == 200) {
                    Window.open("/opennms/index.jsp", "_target", null);
                } else {
                    Window.alert("Failed to login");
                }
            }

            @Override
            public void onError(Request request, Throwable exception) {
                Window.alert("Problem Logging in");
            }
        });
    } catch (RequestException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
//Window.alert("Cliking link to OpenNMS");
}
Also used : Response(com.google.gwt.http.client.Response) RequestBuilder(com.google.gwt.http.client.RequestBuilder) RequestCallback(com.google.gwt.http.client.RequestCallback) Request(com.google.gwt.http.client.Request) RequestException(com.google.gwt.http.client.RequestException) UiHandler(com.google.gwt.uibinder.client.UiHandler)

Example 7 with UiHandler

use of com.google.gwt.uibinder.client.UiHandler in project gerrit by GerritCodeReview.

the class ChangeScreen method onHideTaggedComments.

@UiHandler("hideTaggedComments")
void onHideTaggedComments(@SuppressWarnings("unused") ClickEvent e) {
    hideTaggedComments.setVisible(false);
    showTaggedComments.setVisible(true);
    int n = history.getWidgetCount();
    for (int i = 0; i < n; i++) {
        Message m = ((Message) history.getWidget(i));
        if (m.getMessageInfo().tag() != null) {
            m.setVisible(false);
        }
    }
}
Also used : GerritUiExtensionPoint(com.google.gerrit.client.GerritUiExtensionPoint) UiHandler(com.google.gwt.uibinder.client.UiHandler)

Example 8 with UiHandler

use of com.google.gwt.uibinder.client.UiHandler in project gerrit by GerritCodeReview.

the class ChangeScreen method onChangeRevision.

@UiHandler("diffBase")
void onChangeRevision(@SuppressWarnings("unused") ChangeEvent e) {
    int idx = diffBase.getSelectedIndex();
    if (0 <= idx) {
        String n = diffBase.getValue(idx);
        loadConfigInfo(changeInfo, DiffObject.parse(changeInfo.legacyId(), n));
    }
}
Also used : JsArrayString(com.google.gwt.core.client.JsArrayString) GerritUiExtensionPoint(com.google.gerrit.client.GerritUiExtensionPoint) UiHandler(com.google.gwt.uibinder.client.UiHandler)

Example 9 with UiHandler

use of com.google.gwt.uibinder.client.UiHandler in project gerrit by GerritCodeReview.

the class ChangeScreen method onExpandAll.

@UiHandler("expandAll")
void onExpandAll(@SuppressWarnings("unused") ClickEvent e) {
    int n = history.getWidgetCount();
    for (int i = 0; i < n; i++) {
        ((Message) history.getWidget(i)).setOpen(true);
    }
    expandAll.setVisible(false);
    collapseAll.setVisible(true);
}
Also used : GerritUiExtensionPoint(com.google.gerrit.client.GerritUiExtensionPoint) UiHandler(com.google.gwt.uibinder.client.UiHandler)

Example 10 with UiHandler

use of com.google.gwt.uibinder.client.UiHandler in project gerrit by GerritCodeReview.

the class EditPreferencesBox method onSave.

@UiHandler("save")
void onSave(@SuppressWarnings("unused") ClickEvent e) {
    AccountApi.putEditPreferences(prefs, new GerritCallback<EditPreferences>() {

        @Override
        public void onSuccess(EditPreferences p) {
            Gerrit.setEditPreferences(p.copyTo(new EditPreferencesInfo()));
        }
    });
    close();
}
Also used : EditPreferences(com.google.gerrit.client.account.EditPreferences) EditPreferencesInfo(com.google.gerrit.extensions.client.EditPreferencesInfo) UiHandler(com.google.gwt.uibinder.client.UiHandler)

Aggregations

UiHandler (com.google.gwt.uibinder.client.UiHandler)30 GerritUiExtensionPoint (com.google.gerrit.client.GerritUiExtensionPoint)5 CallbackGroup (com.google.gerrit.client.rpc.CallbackGroup)3 Command (com.google.gwt.user.client.Command)3 AccessSection (com.google.gerrit.common.data.AccessSection)2 ProjectAccess (com.google.gerrit.common.data.ProjectAccess)2 Theme (com.google.gerrit.extensions.client.Theme)2 CheckBox (com.gwtmobile.ui.client.widgets.CheckBox)2 RadioButton (com.gwtmobile.ui.client.widgets.RadioButton)2 ErrorDialog (com.google.gerrit.client.ErrorDialog)1 EditPreferences (com.google.gerrit.client.account.EditPreferences)1 GerritCallback (com.google.gerrit.client.rpc.GerritCallback)1 NativeString (com.google.gerrit.client.rpc.NativeString)1 EditPreferencesInfo (com.google.gerrit.extensions.client.EditPreferencesInfo)1 KeyMapType (com.google.gerrit.extensions.client.KeyMapType)1 Change (com.google.gerrit.reviewdb.client.Change)1 JavaScriptObject (com.google.gwt.core.client.JavaScriptObject)1 JsArrayString (com.google.gwt.core.client.JsArrayString)1 DomEvent (com.google.gwt.event.dom.client.DomEvent)1 HasValueChangeHandlers (com.google.gwt.event.logical.shared.HasValueChangeHandlers)1