List of usage examples for com.google.gwt.user.client Window alert
public static void alert(String msg)
From source file:colt.json.gwt.client.JsonClient.java
License:Apache License
public void invoke(final String _url, final String _serviceName, String requestData, final IAsyncJSON result) { try {/*ww w.j a v a2s .co m*/ RequestBuilder requestBuilder = new RequestBuilder(RequestBuilder.POST, URL.encode(_url + _serviceName)); requestBuilder.setHeader("content-type", "application/x-www-form-urlencoded"); Request request = requestBuilder.sendRequest(requestData, new RequestCallback() { public void onError(Request request, Throwable exception) { result.error(exception); } public void onResponseReceived(Request request, Response response) { if (200 == response.getStatusCode()) { String text = response.getText(); JSONValue parser = JSONParser.parse(text); JSONObject jobj = parser.isObject(); result.done(jobj); } else { result.error(new RuntimeException(_url + _serviceName + " :(")); } } }); } catch (RequestException e) { Window.alert(e.getMessage()); result.error(e); } }
From source file:com.adamantium.company.gwtp.client.application.details.address.AddressPresenter.java
License:Apache License
@Override protected void onReset() { super.onReset(); dispatcher.execute(new GetAddressAction(companyId), new AsyncCallback<GetAddressResult>() { @Override/* ww w . ja v a 2 s . co m*/ public void onFailure(Throwable caught) { getView().setAddress(""); Window.alert("Error: unable to get company address from server"); } @Override public void onSuccess(GetAddressResult result) { if (Cookies.getCookie("JSESSIONID") == null) { System.out.println("Set security cookie."); Cookies.setCookie("JSESSIONID", "JSESSIONID"); } getView().setAddress(result.getAddress()); } }); }
From source file:com.adamantium.company.gwtp.client.application.details.description.CompanyDescriptionPresenter.java
License:Apache License
@Override protected void onReset() { super.onReset(); dispatcher.execute(new GetDescriptionAction(companyId), new AsyncCallback<GetDescriptionResult>() { @Override//from w ww . j ava2s.c om public void onFailure(Throwable caught) { getView().setCompanyDescription(""); Window.alert("Error: unable to get company description from server"); } @Override public void onSuccess(GetDescriptionResult result) { if (Cookies.getCookie("JSESSIONID") == null) { System.out.println("Set security cookie."); Cookies.setCookie("JSESSIONID", "JSESSIONID"); } getView().setCompanyDescription(result.getDescription()); } }); }
From source file:com.adamantium.company.gwtp.client.application.details.name.CompanyNamePresenter.java
License:Apache License
@Override protected void onReset() { super.onReset(); dispatcher.execute(new GetNameAction(companyId), new AsyncCallback<GetNameResult>() { @Override//from ww w. ja v a 2 s . c o m public void onFailure(Throwable caught) { getView().setCompanyName(""); Window.alert("Error: unable to get company name from server"); } @Override public void onSuccess(GetNameResult result) { if (Cookies.getCookie("JSESSIONID") == null) { System.out.println("Set security cookie."); Cookies.setCookie("JSESSIONID", "JSESSIONID"); } getView().setCompanyName(result.getName()); } }); }
From source file:com.adamantium.company.gwtp.client.application.details.phone.PhonePresenter.java
License:Apache License
@Override protected void onReset() { super.onReset(); dispatcher.execute(new GetPhoneAction(companyId), new AsyncCallback<GetPhoneResult>() { @Override/*w w w . ja v a2 s . com*/ public void onFailure(Throwable caught) { getView().setPhone(""); Window.alert("Error: unable to get company phone from server"); } @Override public void onSuccess(GetPhoneResult result) { if (Cookies.getCookie("JSESSIONID") == null) { System.out.println("Set security cookie."); Cookies.setCookie("JSESSIONID", "JSESSIONID"); } getView().setPhone(result.getPhone()); } }); }
From source file:com.adamantium.company.gwtp.client.application.list.ListPresenter.java
License:Apache License
@Override protected void onReset() { super.onReset(); // List<CompanyTableInfo> Company = new ArrayList<>(); // Company.add(new CompanyTableInfo(1, "name1")); // Company.add(new CompanyTableInfo(2, "name2")); // Company.add(new CompanyTableInfo(3, "name3")); // Company.add(new CompanyTableInfo(4, "name4")); // getView().setRowData(Company); // getView().setCompanyName(textToServer); // getView().setServerResponse("Waiting for response..."); dispatcher.execute(new GetCompanyListAction(), new AsyncCallback<GetCompanyListResult>() { @Override/*from ww w . java2 s . c om*/ public void onFailure(Throwable caught) { Window.alert("Error: unable to get company list from server"); } @Override public void onSuccess(GetCompanyListResult result) { if (Cookies.getCookie("JSESSIONID") == null) { System.out.println("Set security cookie."); Cookies.setCookie("JSESSIONID", "JSESSIONID"); } getView().setRowData(result.getCompanyList()); } }); }
From source file:com.adamantium.company.gwtp.client.application.list.ListView.java
License:Apache License
@UiHandler("detailsButton") void showDetails(ClickEvent event) { CompanyTableInfo selectedCompany = (CompanyTableInfo) ((SingleSelectionModel) cellTable.getSelectionModel()) .getSelectedObject();/* w w w . j a v a 2 s. co m*/ if (selectedCompany != null) { getUiHandlers().showDetails(selectedCompany.getId()); } else { Window.alert("Please, select any company before"); } }
From source file:com.admin.client.AppEngineData.java
License:Open Source License
public void saveEquation(String newEquation) { newEquation = newEquation.toLowerCase().replaceAll("\r|\n|\r\n|\t| {2,}", "").replaceAll("> <", "><"); adminService.saveEquation(newEquation, new AsyncCallback<String>() { @Override//from w ww. ja va2 s . c o m public void onSuccess(String result) { Window.alert("Saved as: " + result); } @Override public void onFailure(Throwable caught) { Window.alert("FAILED save!!!"); } }); }
From source file:com.admin.client.AppEngineData.java
License:Open Source License
public void doNot() { Window.alert("did"); }
From source file:com.agnie.gwt.common.client.widget.CustomMenuPan.java
License:Open Source License
public CustomMenuPan(String styleClassName) { container = (HTMLPanel) uiBinder.createAndBindUi(this); container.addStyleName(styleClassName); initWidget(container);// ww w.ja va 2 s . co m this.setCustomMenuTitle("Right click Test !"); /* ContextMenu related code starts here */ this.contextMenu.hide(); this.contextMenu.setAutoHideEnabled(true); addDomHandler(this, ContextMenuEvent.getType()); createDummyAccounts(); Command c1 = new Command() { @Override public void execute() { Window.alert("Command 1 executed."); container.add(accList.get(0)); } }; Command c2 = new Command() { @Override public void execute() { Window.alert("Command 2 executed."); container.add(accList.get(1)); } }; Command c3 = new Command() { @Override public void execute() { Window.alert("Command 3 executed."); container.add(accList.get(2)); } }; Command c4 = new Command() { @Override public void execute() { Window.alert("Command 4 executed."); container.add(accList.get(3)); } }; Command c5 = new Command() { @Override public void execute() { Window.alert("Command 5 executed."); container.add(accList.get(4)); } }; MenuItem fItem = new MenuItem("Command1", true, c1); MenuItem sItem = new MenuItem("Command2 ", true, c2); MenuItem tItem = new MenuItem("Command3 ", true, c3); MenuItem frItem = new MenuItem("Command4 ", true, c4); MenuItem fiItem = new MenuItem("Command5 ", true, c5); popupMenuBar1To3.addItem(fItem); popupMenuBar1To3.addItem(sItem); popupMenuBar1To3.addItem(tItem); popupMenuBar4To5.addItem(frItem); popupMenuBar4To5.addItem(fiItem); popupMenuBar1To3.setVisible(true); popupMenuBar4To5.setVisible(true); contextMenu.container.add(popupMenuBar1To3); contextMenu.addMenuSeparator(); contextMenu.container.add(popupMenuBar4To5); }