List of usage examples for com.google.gwt.user.client Cookies getCookie
public static String getCookie(String name)
From source file:org.pentaho.gwt.widgets.login.client.LoginDialog.java
License:Open Source License
private Widget buildLoginPanel(boolean openInNewWindowDefault) { userTextBox.setWidth("100%"); //$NON-NLS-1$ passwordTextBox.setWidth("100%"); //$NON-NLS-1$ usersListBox.setWidth("100%"); //$NON-NLS-1$ VerticalPanel loginPanel = new VerticalPanel(); loginPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); loginPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_TOP); SimplePanel spacer;/*from w w w . j a v a 2 s . co m*/ if (showUsersList) { // populate default users list box addDefaultUsers(); loginPanel.add(new Label(Messages.getString("sampleUser") + ":")); //$NON-NLS-1$ //$NON-NLS-2$ loginPanel.add(usersListBox); spacer = new SimplePanel(); spacer.setHeight("8px"); //$NON-NLS-1$ loginPanel.add(spacer); } loginPanel.add(new Label(Messages.getString("username") + ":")); //$NON-NLS-1$ //$NON-NLS-2$ loginPanel.add(userTextBox); spacer = new SimplePanel(); spacer.setHeight("8px"); //$NON-NLS-1$ loginPanel.add(spacer); loginPanel.setCellHeight(spacer, "8px"); //$NON-NLS-1$ loginPanel.add(new HTML(Messages.getString("password") + ":")); //$NON-NLS-1$ //$NON-NLS-2$ loginPanel.add(passwordTextBox); boolean reallyShowNewWindowOption = openInNewWindowDefault; String showNewWindowOverride = Window.Location.getParameter("showNewWindowOption"); //$NON-NLS-1$ if (showNewWindowOverride != null && !"".equals(showNewWindowOverride)) { //$NON-NLS-1$ // if the override is set, we MUST obey it above all else reallyShowNewWindowOption = "true".equals(showNewWindowOverride); //$NON-NLS-1$ } else if (getReturnLocation() != null && !"".equals(getReturnLocation())) { //$NON-NLS-1$ StringTokenizer st = new StringTokenizer(getReturnLocation(), "?&"); //$NON-NLS-1$ // first token will be ignored, it is 'up to the ?' for (int i = 1; i < st.countTokens(); i++) { StringTokenizer paramTokenizer = new StringTokenizer(st.tokenAt(i), "="); //$NON-NLS-1$ if (paramTokenizer.countTokens() == 2) { // we've got a name=value token if (paramTokenizer.tokenAt(0).equalsIgnoreCase("showNewWindowOption")) { //$NON-NLS-1$ reallyShowNewWindowOption = "true".equals(paramTokenizer.tokenAt(1)); //$NON-NLS-1$ break; } } } } // New Window checkbox if (reallyShowNewWindowOption) { spacer = new SimplePanel(); spacer.setHeight("8px"); //$NON-NLS-1$ loginPanel.add(spacer); loginPanel.setCellHeight(spacer, "8px"); //$NON-NLS-1$ newWindowChk.setText(Messages.getString("launchInNewWindow")); //$NON-NLS-1$ String cookieCheckedVal = Cookies.getCookie("loginNewWindowChecked"); //$NON-NLS-1$ if (cookieCheckedVal != null) { newWindowChk.setChecked(Boolean.parseBoolean(cookieCheckedVal)); } else { // default is false, per BISERVER-2384 newWindowChk.setChecked(openInNewWindowDefault); } loginPanel.add(newWindowChk); } userTextBox.setTabIndex(1); passwordTextBox.setTabIndex(2); if (reallyShowNewWindowOption) { newWindowChk.setTabIndex(3); } passwordTextBox.setText(""); //$NON-NLS-1$ setFocusWidget(userTextBox); return loginPanel; }
From source file:org.pentaho.mantle.client.commands.SessionExpiredCommand.java
License:Open Source License
@VisibleForTesting protected String getCookie(final String name) { return Cookies.getCookie(name); }
From source file:org.pentaho.mantle.login.client.MantleLoginDialog.java
License:Open Source License
protected Widget buildLoginPanel(boolean openInNewWindowDefault) { userTextBox.setWidth("100%"); //$NON-NLS-1$ passwordTextBox.setWidth("100%"); //$NON-NLS-1$ usersListBox.setWidth("100%"); //$NON-NLS-1$ userTextBox.setStyleName("login-panel-label"); passwordTextBox.setStyleName("login-panel-label"); newWindowChk.setStyleName("login-panel-label"); VerticalPanel credentialsPanel = new VerticalPanel(); credentialsPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); credentialsPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_TOP); SimplePanel spacer;//from www . j a va 2 s . c o m Label usernameLabel = new Label(Messages.getString("username") + ":"); usernameLabel.setStyleName("login-panel-label"); credentialsPanel.add(usernameLabel); //$NON-NLS-1$ //$NON-NLS-2$ credentialsPanel.add(userTextBox); spacer = new SimplePanel(); spacer.setHeight("8px"); //$NON-NLS-1$ credentialsPanel.add(spacer); credentialsPanel.setCellHeight(spacer, "8px"); //$NON-NLS-1$ HTML passwordLabel = new HTML(Messages.getString("password") + ":"); passwordLabel.setStyleName("login-panel-label"); credentialsPanel.add(passwordLabel); //$NON-NLS-1$ //$NON-NLS-2$ credentialsPanel.add(passwordTextBox); boolean reallyShowNewWindowOption = showNewWindowOption; String showNewWindowOverride = Window.Location.getParameter("showNewWindowOption"); //$NON-NLS-1$ if (showNewWindowOverride != null && !"".equals(showNewWindowOverride)) { //$NON-NLS-1$ // if the override is set, we MUST obey it above all else reallyShowNewWindowOption = "true".equals(showNewWindowOverride); //$NON-NLS-1$ } else if (getReturnLocation() != null && !"".equals(getReturnLocation())) { //$NON-NLS-1$ StringTokenizer st = new StringTokenizer(getReturnLocation(), "?&"); //$NON-NLS-1$ // first token will be ignored, it is 'up to the ?' for (int i = 1; i < st.countTokens(); i++) { StringTokenizer paramTokenizer = new StringTokenizer(st.tokenAt(i), "="); //$NON-NLS-1$ if (paramTokenizer.countTokens() == 2) { // we've got a name=value token if (paramTokenizer.tokenAt(0).equalsIgnoreCase("showNewWindowOption")) { //$NON-NLS-1$ reallyShowNewWindowOption = "true".equals(paramTokenizer.tokenAt(1)); //$NON-NLS-1$ break; } } } } // New Window checkbox if (reallyShowNewWindowOption) { spacer = new SimplePanel(); spacer.setHeight("8px"); //$NON-NLS-1$ credentialsPanel.add(spacer); credentialsPanel.setCellHeight(spacer, "8px"); //$NON-NLS-1$ newWindowChk.setText(Messages.getString("launchInNewWindow")); //$NON-NLS-1$ String cookieCheckedVal = Cookies.getCookie("loginNewWindowChecked"); //$NON-NLS-1$ if (cookieCheckedVal != null) { newWindowChk.setValue(Boolean.parseBoolean(cookieCheckedVal)); } else { // default is false, per BISERVER-2384 newWindowChk.setValue(openInNewWindowDefault); } credentialsPanel.add(newWindowChk); } userTextBox.setTabIndex(1); passwordTextBox.setTabIndex(2); if (reallyShowNewWindowOption) { newWindowChk.setTabIndex(3); } passwordTextBox.setText(""); //$NON-NLS-1$ setFocusWidget(userTextBox); Image lockImage = new Image(GWT.getModuleBaseURL() + "images/icon_login_lock.png"); HorizontalPanel loginPanel = new HorizontalPanel(); loginPanel.setSpacing(5); loginPanel.setStyleName("login-panel"); loginPanel.add(lockImage); loginPanel.add(credentialsPanel); return loginPanel; }
From source file:org.rebioma.client.ApplicationView.java
License:Apache License
/** * Checks whether the current session id is still valid. If the user is logged * again in other system, the session id of the older systems will be invalid. *///from w w w .j a v a 2s . com protected static void checkCurrentSession() { if (sessionId == null) { sessionId = Cookies.getCookie(SESSION_ID_NAME); } DataSwitch.get().isSessionIdValid(sessionId, new AsyncCallback<User>() { public void onFailure(Throwable caught) { GWT.log(caught.getMessage(), caught); Window.alert(constants.SessionExpired()); ApplicationView.getApplication().signOutUser(false); } public void onSuccess(User result) { if (result == null || result.getEmail() == null || result.getEmail().equals("")) { onFailure(new IllegalStateException("Invalid user")); } } }); }
From source file:org.rebioma.client.ApplicationView.java
License:Apache License
/** * Returns true if there is a sessionId in the browser * /*ww w . java 2 s.c om*/ * @return true if the browser contains a sessionId */ private boolean isSessionIdInBrowser() { String sessionId = Cookies.getCookie(SESSION_ID_NAME); return sessionId != null && !sessionId.equals(""); }
From source file:org.rebioma.client.CsvDownloadWidget.java
License:Apache License
public void onClick(ClickEvent event) { Object source = event.getSource(); if (source == downloadButton) { if (!form.isValid() && !myDownload) return; if (queryFilters != null) { String sid = Cookies.getCookie(ApplicationView.SESSION_ID_NAME); submit(sid);// w w w. j a va 2 s .c o m hide(); } } else if (source == downloadModelButton) { if (!form.isValid()) return; MailingService.Proxy.get().sendEmail(command != null ? command.toString() : "", ((TextField) fieldTitle.getWidget()).getText(), ((TextField) fieldFirstN.getWidget()).getText(), ((TextField) fieldLastN.getWidget()).getText(), ((TextField) fieldActivity.getWidget()).getText(), ((TextField) fieldEmail.getWidget()).getText(), ((TextField) fieldInstitution.getWidget()).getText(), ((TextArea) fieldDataUE.getWidget()).getText(), new AsyncCallback<Void>() { @Override public void onSuccess(Void result) { } @Override public void onFailure(Throwable caught) { } }); if (command != null) command.execute(); hide(); } else if (source == cancelButton) { hide(); } }
From source file:org.rebioma.client.DataSwitch.java
License:Apache License
private static boolean sessionExpired() { String sessionId = Cookies.getCookie(ApplicationView.SESSION_ID_NAME); return sessionId == null || sessionId.equals(""); }
From source file:org.rebioma.client.forms.ChangePasswordForm.java
License:Apache License
/** * Uses {@link DataSwitch} to invoke {@link UserService}. * /*from w ww. j a va2 s.c o m*/ */ @Override protected void onSubmit() { String newPassValue = newPassword.getInputValue(); String confirmPassValue = newPasswordConfirmed.getInputValue(); if (!newPassValue.equals(confirmPassValue)) { Window.alert(constants.UnmatchPassMsg()); return; } Email email = createEmail(); String sessionId = Cookies.getCookie(ApplicationView.SESSION_ID_NAME); DataSwitch.get().changeUserPassword(password.getInputValue(), newPassword.getInputValue(), sessionId, email, new AsyncCallback<Integer>() { public void onFailure(Throwable caught) { fireOnSubmitFailed(caught); } public void onSuccess(Integer result) { fireOnSubmitSuccess(result); } }); }
From source file:org.rebioma.client.ListView.java
License:Apache License
private ListView(View parent, OccurrenceQuery query, PageListener<Occurrence> pageListener, OccurrenceListener oListener) {/*w w w . ja va 2s. c o m*/ super(parent, false); occurrenceListener = oListener; boolean isMyOccurenceToReviewSelected = isMyOccurenceToReviewSelected(History.getToken()); List<ColumnConfig<Occurrence, ?>> authenticatedHeaders = isMyOccurenceToReviewSelected ? OccurrenceSummary.getReviewerColumnModel() : //REVIEWER_REQUIRED_HEADERS: OccurrenceSummary.getUserColumnModel();//USER_REQUIRED_HEADERS; // List<ColumnConfig<Occurrence, ?>> authenticatedHeadersStyle[] = isMyOccurenceToReviewSelected? // REVIEWER_HEADER_CSS_STYLES: // USER_HEADER_CSS_STYLES; currentHeaders = signedIn ? authenticatedHeaders : OccurrenceSummary.getGuestColumnModel();//GUEST_REQUIRED_HEADERS; ColumnModel<Occurrence> cm = new ColumnModel<Occurrence>(currentHeaders); ListStore<Occurrence> store = new ListStore<Occurrence>(OccurrenceSummary.properties.key()); // store.addAll(); cm.getColumn(1).setCell(cellRebiomaId); table = new Grid<Occurrence>(store, cm); table.getView().setAdjustForHScroll(true); table.setSelectionModel(OccurrenceSummary.sm); OccurrenceSummary.sm.addSelectionHandler(new SelectionHandler<Occurrence>() { @Override public void onSelection(SelectionEvent<Occurrence> event) { if (!table.getSelectionModel().isSelected(event.getSelectedItem())) { setApplyAllChecked(false); } updateChecksState(); addHistoryItem(false); } }); // table.getView().setForceFit(true); table.setLoadMask(true); // table.getView().setAutoExpandColumn(currentHeaders.get(0)); // table = new TableWidget(currentHeaders, signedIn ? authenticatedHeadersStyle // : GUEST_HEADER_CSS_STYLES, 0); int pageSize = query.getLimit(); if (pageSize < 0) { pageSize = OccurrencePagerWidget.DEFAULT_PAGE_SIZE; } this.pagerWidget = new OccurrencePagerWidget(pageSize, query, true); applyToAllCb = new CheckBox(); actionTool = new ActionTool() { protected void setCheckedAll(boolean checked) { ListView.this.setCheckedAll(checked); addHistoryItem(false); } }; actionTool.setDefaultSelection(0); query.addDataRequestListener(this); if (pageListener != null) { pagerWidget.addPageListener(pageListener); } pagerWidget.addPageListener(this); pagerWidget.addPageClickListener(this); pagerWidget.addPageSizeChangeListener(this); actionTool.addWidget(applyToAllCb); // HorizontalPanel toolHp = new HorizontalPanel(); toolHp = new ToolBar(); //{WD this.pagerWidget.setXElement(table.getElement()); this.pagerWidget.setToolBar(toolHp); //} // WidgetComponent wc = new WidgetComponent(actionTool); // actionTool.setWidth("480px"); toolHp.setEnableOverflow(true); toolHp.setHeight("28px"); toolHp.add(actionTool); toolHp.add(new FillToolItem()); // pagerWidget.setWidth("450px"); HorizontalPanel pWHp = new HorizontalPanel(); pWHp.add(pagerWidget); pWHp.setCellHorizontalAlignment(pagerWidget, HasHorizontalAlignment.ALIGN_RIGHT); // pWHp.setWidth("470px"); pWHp.add(editHp); reset.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { table.getStore().rejectChanges(); } }); save.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { if (table.getStore().getModifiedRecords().isEmpty()) { Info.display("", "There is no modification to save"); return; } table.getStore().commitChanges(); String sessionId = Cookies.getCookie(ApplicationView.SESSION_ID_NAME); List<Occurrence> occurrences = new ArrayList<Occurrence>(); occurrences.addAll(table.getStore().getAll()); DataSwitch.get().editUpdate(occurrences, sessionId, new AsyncCallback<Boolean>() { public void onFailure(Throwable caught) { Window.alert(caught.getMessage()); GWT.log(caught.getMessage(), caught); } /** * If result != null, update is a successful. Clears the * {@link DataSwitch} cache. * * @param result */ public void onSuccess(Boolean result) { if (result) { Info.display("", "Modification done successfully"); } else { Window.confirm(constants.UnexpectedError()); } } }); } }); initModifLink(); showModifLink(false); pWHp.setCellHorizontalAlignment(editHp, HasHorizontalAlignment.ALIGN_RIGHT); toolHp.add(pWHp); // toolHp.setStylePrimaryName("Tool"); mainVp = new VerticalLayoutContainer();//new AbsolutePanel(); mainSp.setHeaderVisible(false); mainSp.setHeight(Window.getClientHeight() - 115 + "px"); // mainSp.setWidth("100%"); mainSp.setBorders(false); mainSp.setBodyBorder(false); mainSp.addStyleName("margin-0"); //mainVp.setSpacing(0); // mainVp.add(toolHp); // scrollPanel = new ScrollPanel(); // scrollPanel.setStyleName("l-table"); // scrollPanel.add(table); // mainVp.add(table); //mainVp.add(table); // mainVp.setStyleName(DEFAULT_STYLE); // toolHp.setCellHorizontalAlignment(pagerWidget, // HasHorizontalAlignment.ALIGN_RIGHT); // toolHp.setCellVerticalAlignment(pagerWidget, // HasVerticalAlignment.ALIGN_MIDDLE); // mainVp.setCellWidth(table, "100%"); // mainVp.setWidth("100%"); mainVp.setBorders(true); mainVp.add(toolHp); mainVp.add(table, new VerticalLayoutData(1, 1)); mainSp.setWidget(mainVp); initWidget(mainSp); applyToAllCb.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { boolean isChecked = applyToAllCb.getValue(); setApplyAllChecked(isChecked); if (isChecked) { setCheckedAll(true); } else { setCheckedAll(false); } addHistoryItem(false); } }); String historyToken = History.getToken(); if (!historyToken.trim().equals("")) { handleOnValueChange(historyToken); } }
From source file:org.rebioma.client.ListView.java
License:Apache License
/** * Constructs an 2 dimension array widget represents display content for the * table of the current page./*w ww .j a va 2 s . c o m*/ * * @param summaries {@link OccurrenceSummary} * @return Widget[][] data for the current page. */ // private List<Occurrence> constructWidgetContent(List<OccurrenceSummary> summaries) { // int length = summaries.size(); // // // This is to make sure only display the table with at most page size from // // the pager. // if (length > pagerWidget.getPageSize()) { // length = pagerWidget.getPageSize(); // } // List<Occurrence> rowsWidget = new ArrayList<Occurrence>(); // boolean isMyOccurenceToReviewSelected = // isMyOccurenceToReviewSelected(History // .getToken()); // // List<ColumnConfig<Occurrence, ?>> authenticatedHeaders = isMyOccurenceToReviewSelected? // OccurrenceSummary.getReviewerColumnModel()://REVIEWER_REQUIRED_HEADERS: // OccurrenceSummary.getUserColumnModel();//USER_REQUIRED_HEADERS; // // if (currentHeaders != authenticatedHeaders) { // // table.resetHeader(authenticatedHeaders, // // (isMyOccurenceToReviewSelected ? REVIEWER_HEADER_CSS_STYLES // // : USER_HEADER_CSS_STYLES));My Reviewed // // } // List<ColumnConfig<Occurrence, ?>> headers = signedIn ? authenticatedHeaders // : OccurrenceSummary.getGuestColumnModel();//.GUEST_REQUIRED_HEADERS; // currentSearchColOccIdsMap.clear(); // // for(ColumnConfig<Occurrence, ?> col : headers){ // String cellData = rowData[(col - 1)]; // if (cellData == null) { // cellData = "----"; // } else if (cellData.equalsIgnoreCase("none")) { // cellData = "----"; // } // if (cellData.equals(OccurrenceSummary.MY_REVIEWED)) { // currentSearchColOccIdsMap.put(row, occurrence.getId()); // currentRow[col] = new HTML(constants.Loading()); // } else if (cellData.equalsIgnoreCase("waiting")) { // currentRow[col] = new HTML("<img src='" + WAITING_IMG_URL + "'/>"); // // currentRow[col].setTitle("waiting"); // } else if (cellData.equalsIgnoreCase("pos")) { // currentRow[col] = new HTML("<img src='" + THUMB_UP_URL + "'/>"); // } else if (cellData.equalsIgnoreCase("neg")) { // currentRow[col] = new HTML("<img src='" + THUMB_DOWN_URL + "'/>"); // } else if (cellData.equalsIgnoreCase("yes")) { // currentRow[col] = new HTML("<img src='" + CHECK_IMG_URL + "'/>"); // } else if (cellData.equalsIgnoreCase("no")) { // // currentRow[col] = new HTML("No <img src='" + X_IMG_URL + // // "'/>"); // currentRow[col] = new HTML("<img src='" + X_IMG_URL + "'/>"); // } else { // if (col != 1) { //// if (headers[col].equals(constants.Owner()) //// && !OccurrenceSummary.isEmailVisisble(occurrence)) { //// currentRow[col] = new Label(constants.EmailNotShow()); //// } else if (headers[col].equals(constants.Collaborators())) { //// String modifiedShowUsersCSV = cellData.replaceAll(",", ", "); //// currentRow[col] = new Label(modifiedShowUsersCSV); //// } else { //// currentRow[col] = new Label(cellData); //// } // } else { // HTML link = new HTML(cellData); // currentRow[col] = link; // // /* // * This click listener updates the tables currently selected row. // */ // link.addClickHandler(new ClickHandler() { // // public void onClick(ClickEvent event) { // parent.switchView(DETAIL, true); // occurrenceListener.onOccurrenceSelected(occurrence); // } // }); // } // } // } // for (int row = 0; row < length; row++) { // OccurrenceSummary summary = summaries.get(row); // final Occurrence occurrence = summary.getOccurrence(); // // String[] userSummary = isMyOccurenceToReviewSelected? // null://summary.getReviewerSummary(): // null;//summary.getUserSummary(); // // String[] rowData = signedIn ? userSummary : null;//summary.getUnauthenticatedSummary(); // Widget[] currentRow = new Widget[rowData.length + 1]; // SimplePanel panel = new SimplePanel(); // CheckBox cb = new CheckBox(); // cb.addClickHandler(new ClickHandler() { // // public void onClick(ClickEvent event) { // CheckBox cb = (CheckBox) event.getSource(); // if (!cb.getValue()) { // setApplyAllChecked(false); // } // updateChecksState(); // addHistoryItem(false); // } // // }); // // cb.setEnabled(occurrence.isValidated()); // panel.add(cb); // currentRow[0] = panel; // for (int col = 1; col < currentRow.length; col++) { // String cellData = rowData[(col - 1)]; // if (cellData == null) { // cellData = "----"; // } else if (cellData.equalsIgnoreCase("none")) { // cellData = "----"; // } // if (cellData.equals(OccurrenceSummary.MY_REVIEWED)) { // currentSearchColOccIdsMap.put(row, occurrence.getId()); // currentRow[col] = new HTML(constants.Loading()); // } else if (cellData.equalsIgnoreCase("waiting")) { // currentRow[col] = new HTML("<img src='" + WAITING_IMG_URL + "'/>"); // // currentRow[col].setTitle("waiting"); // } else if (cellData.equalsIgnoreCase("pos")) { // currentRow[col] = new HTML("<img src='" + THUMB_UP_URL + "'/>"); // } else if (cellData.equalsIgnoreCase("neg")) { // currentRow[col] = new HTML("<img src='" + THUMB_DOWN_URL + "'/>"); // } else if (cellData.equalsIgnoreCase("yes")) { // currentRow[col] = new HTML("<img src='" + CHECK_IMG_URL + "'/>"); // } else if (cellData.equalsIgnoreCase("no")) { // // currentRow[col] = new HTML("No <img src='" + X_IMG_URL + // // "'/>"); // currentRow[col] = new HTML("<img src='" + X_IMG_URL + "'/>"); // } else { // if (col != 1) { //// if (headers[col].equals(constants.Owner()) //// && !OccurrenceSummary.isEmailVisisble(occurrence)) { //// currentRow[col] = new Label(constants.EmailNotShow()); //// } else if (headers[col].equals(constants.Collaborators())) { //// String modifiedShowUsersCSV = cellData.replaceAll(",", ", "); //// currentRow[col] = new Label(modifiedShowUsersCSV); //// } else { //// currentRow[col] = new Label(cellData); //// } // } else { // HTML link = new HTML(cellData); // currentRow[col] = link; // // /* // * This click listener updates the tables currently selected row. // */ // link.addClickHandler(new ClickHandler() { // // public void onClick(ClickEvent event) { // parent.switchView(DETAIL, true); // occurrenceListener.onOccurrenceSelected(occurrence); // } // }); // } // } // } // rowsWidget[row] = currentRow; // } // return rowsWidget; // } private void deleteAll() { if (!Window.confirm(constants.Delete() + " " + pagerWidget.getTotalRow() + " " + constants.Records())) { return; } String sessionId = Cookies.getCookie(ApplicationView.SESSION_ID_NAME); DataSwitch.get().delete(sessionId, pagerWidget.getQuery(), new AsyncCallback<Integer>() { public void onFailure(Throwable caught) { Window.alert(caught.getMessage()); GWT.log(caught.getMessage(), caught); } public void onSuccess(Integer result) { if (result == 0) { showMsg(constants.DeleteMsg()); } else { pagerWidget.init(pagerWidget.getCurrentPageNumber()); } } }); }