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");
}
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);
}
}
}
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));
}
}
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);
}
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();
}
Aggregations