List of usage examples for com.google.gwt.user.client.ui DialogBox show
@Override public void show()
From source file:com.ephesoft.dcma.gwt.admin.bm.client.presenter.kvextraction.advancedkvextraction.AdvancedKVExtractionPresenter.java
License:Open Source License
/** * To perform operations on Test Advanced KV Button click. *///from w ww . j ava 2s . com public void onTestAdvancedKvButtonClicked() { final String fileName = advancedKVExtractionDTO.getImageName(); if (validateFields()) { ScreenMaskUtility.maskScreen(); saveDataInDTO(controller.getSelectedKVExtraction()); controller.getRpcService().testAdvancedKVExtraction(controller.getBatchClass(), controller.getSelectedKVExtraction(), view.getDocName(), fileName, new EphesoftAsyncCallback<List<OutputDataCarrierDTO>>() { @Override public void customFailure(Throwable throwable) { ScreenMaskUtility.unmaskScreen(); ConfirmationDialogUtil.showConfirmationDialog(throwable.getMessage(), MessageConstants.TITLE_TEST_FAILURE, Boolean.TRUE); } @Override public void onSuccess(List<OutputDataCarrierDTO> outputDtos) { ScreenMaskUtility.unmaskScreen(); getUpdatedFileName(fileName); DialogBox dialogBox = new DialogBox(); dialogBox.addStyleName(STYLE_WIDTH500PX); dialogBox.setHeight("200px"); view.getKvExtractionTestResultView().createKVFieldList(outputDtos); view.getKvExtractionTestResultView().setDialogBox(dialogBox); dialogBox.setText(KV_EXTRACTION_RESULT); dialogBox.setWidget(view.getKvExtractionTestResultView()); dialogBox.center(); view.getKvExtractionTestResultView().getBackButton().setFocus(true); dialogBox.show(); } private void getUpdatedFileName(final String fileName) { controller.getRpcService().getUpdatedTestFileName(view.getBatchClassID(), view.getDocName(), fileName, new EphesoftAsyncCallback<String>() { @Override public void customFailure(Throwable arg0) { } @Override public void onSuccess(String updatedFileName) { advancedKVExtractionDTO.setImageName(updatedFileName); } }); } }); } }
From source file:com.ephesoft.dcma.gwt.admin.bm.client.presenter.tableinfo.TableInfoViewPresenter.java
License:Open Source License
/** * To perform operations on Test Table Button Click. *///from www . java 2 s .c o m public void onTestTableButtonClicked() { ScreenMaskUtility.maskScreen(); controller.setTableInfoSelectedField(controller.getSelectedTableInfoField()); controller.getRpcService().testTablePattern(controller.getBatchClass(), controller.getSelectedTableInfoField(), new EphesoftAsyncCallback<List<TestTableResultDTO>>() { @Override public void customFailure(Throwable throwable) { ScreenMaskUtility.unmaskScreen(); final ConfirmationDialog dialog = ConfirmationDialogUtil.showConfirmationDialog( throwable.getMessage(), MessageConstants.TITLE_TEST_FAILURE, Boolean.TRUE, Boolean.TRUE); dialog.addDialogListener(new DialogListener() { @Override public void onOkClick() { dialog.hide(true); } @Override public void onCancelClick() { // TODO Auto-generated method stub } }); dialog.okButton.setStyleName(AdminConstants.BUTTON_STYLE); } @Override public void onSuccess(List<TestTableResultDTO> outputDtos) { ScreenMaskUtility.unmaskScreen(); DialogBox dialogBox = new DialogBox(); dialogBox.addStyleName("width500px"); dialogBox.setHeight("200px"); tableTestResultView.createTestTableList(outputDtos); tableTestResultView.setDialogBox(dialogBox); dialogBox.setText(MessageConstants.TEST_TABLE_RESULT_HEADER); dialogBox.setWidget(tableTestResultView); dialogBox.center(); tableTestResultView.getBackButton().setFocus(true); dialogBox.show(); } }); }
From source file:com.ephesoft.dcma.gwt.foldermanager.client.view.FolderTableView.java
License:Open Source License
private void performOperationsOnRename(final String fileName, final ContextMenuPanel contextMenu) { final DialogBox dialogBox = new DialogBox(); dialogBox.addStyleName(FolderManagementConstants.CONFIGURABLE_DIALOG_BOX); dialogBox.setText(LocaleDictionary.get().getMessageValue(FolderManagementMessages.RENAME_TO)); final TextBox renameTextBox = new TextBox(); renameTextBox.setText(fileName);// ww w .ja va 2s . c o m HorizontalPanel renameTextBoxPanel = new HorizontalPanel(); renameTextBoxPanel.add(renameTextBox); HorizontalPanel buttonsPanel = new HorizontalPanel(); Button okButton = new Button(LocaleDictionary.get().getConstantValue(FolderManagementConstants.OK_STRING), new ClickHandler() { @Override public void onClick(ClickEvent event) { dialogBox.hide(); final String newFileName = renameTextBox.getText(); presenter.onRename(fileName, newFileName); } }); Button cancelButton = new Button(LocaleDictionary.get().getConstantValue(FolderManagementConstants.CANCEL), new ClickHandler() { @Override public void onClick(ClickEvent event) { dialogBox.hide(); } }); buttonsPanel.add(okButton); buttonsPanel.add(cancelButton); VerticalPanel layoutPanel = new VerticalPanel(); layoutPanel.add(renameTextBoxPanel); layoutPanel.add(buttonsPanel); dialogBox.add(layoutPanel); dialogBox.center(); dialogBox.show(); renameTextBox.setFocus(true); renameTextBox.selectAll(); contextMenu.hide(); }
From source file:com.ephesoft.dcma.gwt.rv.client.view.ValidatePanel.java
License:Open Source License
/** * @param value/*from ww w.j a v a2s . c o m*/ */ private void performFuzzySearch(String value) { if (presenter.document != null) { presenter.rpcService.fuzzyTextSearch(presenter.batchDTO.getBatch(), presenter.document.getType(), value, new AsyncCallback<List<List<String>>>() { @Override public void onFailure(Throwable arg0) { final ConfirmationDialog confirmationDialog = ConfirmationDialogUtil .showConfirmationDialog( LocaleDictionary.get().getMessageValue( ReviewValidateMessages.MSG_FUZZY_SEARCH_UNSUCCESSFUL), LocaleDictionary.get().getConstantValue( ReviewValidateConstants.FUZZY_SEARCH_TOOLTIP), Boolean.TRUE); confirmationDialog.addDialogListener(new DialogListener() { @Override public void onOkClick() { confirmationDialog.hide(); ScreenMaskUtility.unmaskScreen(); presenter.setFocus(); } @Override public void onCancelClick() { ScreenMaskUtility.unmaskScreen(); presenter.setFocus(); } }); } @Override public void onSuccess(List<List<String>> arg0) { if (arg0 == null || arg0.isEmpty()) { final ConfirmationDialog confirmationDialog = ConfirmationDialogUtil .showConfirmationDialog( LocaleDictionary.get().getMessageValue( ReviewValidateMessages.MSG_FUZZY_SEARCH_NO_RESULT), LocaleDictionary.get().getConstantValue( ReviewValidateConstants.FUZZY_SEARCH_TOOLTIP), Boolean.TRUE); confirmationDialog.addDialogListener(new DialogListener() { @Override public void onOkClick() { confirmationDialog.hide(); ScreenMaskUtility.unmaskScreen(); presenter.setFocus(); } @Override public void onCancelClick() { ScreenMaskUtility.unmaskScreen(); presenter.setFocus(); } }); } else { fuzzyDataCarrier = arg0; final DialogBox dialogBox = new DialogBox(); dialogBox.addStyleName(ReviewValidateConstants.CONFIGURED_DIMENSIONS_DIALOG); final FuzzySearchResultView fuzzySearchResultView = new FuzzySearchResultView( presenter, presenter.batchDTO.getFuzzySearchPopUpXDimension(), presenter.batchDTO.getFuzzySearchPopUpYDimension()); fuzzySearchResultView.setEventBus(eventBus); dialogBox.setWidget(fuzzySearchResultView); fuzzySearchResultView.setDialogBox(dialogBox); fuzzySearchResultView.createBatchList(arg0); fuzzySearchResultView.setWidth(presenter.batchDTO.getFuzzySearchPopUpYDimension()); dialogBox.center(); dialogBox.setText(LocaleDictionary.get() .getConstantValue(ReviewValidateConstants.FUZZY_SEARCH_TITLE)); dialogBox.show(); fuzzySearchResultView.getSelectBtn().setFocus(true); } } }); } }
From source file:com.google.api.services.samples.calendar.appengine.client.CalendarButtons.java
License:Apache License
@UiHandler("deleteButton") void handleDelete(ClickEvent e) { DialogBox dialogBox = new DialogBox(); dialogBox.setAnimationEnabled(true); dialogBox.setText("Are you sure you want to permanently delete the calendar?"); DeleteDialogContent content = new DeleteDialogContent(main, dialogBox, calendar, calendarIndex); dialogBox.add(content);// www . j ava 2 s . c om dialogBox.show(); }
From source file:com.google.api.services.samples.calendar.appengine.client.CalendarButtons.java
License:Apache License
@UiHandler("updateButton") void handleUpdate(ClickEvent e) { DialogBox dialogBox = new DialogBox(); dialogBox.setAnimationEnabled(true); dialogBox.setText("Update Calendar Title:"); UpdateDialogContent content = new UpdateDialogContent(main, dialogBox, calendar, calendarIndex); dialogBox.add(content);//from ww w . ja v a 2s . c om dialogBox.show(); }
From source file:com.google.appinventor.client.editor.blocks.BlocklyPanel.java
License:Open Source License
/** * Create a Dialog Box. We call this from Javascript (blockly) to * display a dialog box. We do this here because we can get calls * from the blocklyframe when it is not visible. Because we are in * the parent window, we can display dialogs that will be visible * even when the blocklyframe is not visible. * * @param title Title for the Dialog Box * @param mess The message to display * @param buttonName The string to display in the "OK" button. * @param size 0 or 1. 0 makes a smaller box 1 makes a larger box. * @param callback an opague JavaScriptObject that contains the * callback function provided by the Javascript code. * @return The created dialog box./*from w w w . j a v a2 s .c om*/ */ public static DialogBox createDialog(String title, String mess, final String buttonName, final String cancelButtonName, int size, final JavaScriptObject callback) { final DialogBox dialogBox = new DialogBox(); dialogBox.setStylePrimaryName("ode-DialogBox"); dialogBox.setText(title); if (size == 0) { dialogBox.setHeight("150px"); } else { dialogBox.setHeight("400px"); } dialogBox.setWidth("400px"); dialogBox.setGlassEnabled(true); dialogBox.setAnimationEnabled(true); dialogBox.center(); VerticalPanel DialogBoxContents = new VerticalPanel(); HTML message = new HTML(mess); HorizontalPanel holder = new HorizontalPanel(); if (buttonName != null) { // If buttonName and cancelButtonName are null Button ok = new Button(buttonName); // We won't have any buttons and other ok.addClickHandler(new ClickHandler() { // code is needed to dismiss us @Override public void onClick(ClickEvent event) { doCallBack(callback, buttonName); } }); holder.add(ok); } if (cancelButtonName != null) { Button cancel = new Button(cancelButtonName); cancel.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { doCallBack(callback, cancelButtonName); } }); holder.add(cancel); } DialogBoxContents.add(message); DialogBoxContents.add(holder); dialogBox.setWidget(DialogBoxContents); terminateDrag(); // cancel a drag before showing the modal dialog dialogBox.show(); return dialogBox; }
From source file:com.google.appinventor.client.editor.youngandroid.BlocklyPanel.java
License:Open Source License
/** * Create a Dialog Box. We call this from Javascript (blockly) to * display a dialog box. We do this here because we can get calls * from the blocklyframe when it is not visible. Because we are in * the parent window, we can display dialogs that will be visible * even when the blocklyframe is not visible. * * @param title Title for the Dialog Box * @param mess The message to display * @param buttonName The string to display in the "OK" button. * @param size 0 or 1. 0 makes a smaller box 1 makes a larger box. * @param callback an opague JavaScriptObject that contains the * callback function provided by the Javascript code. * @return The created dialog box.//from ww w . j a v a 2s . c o m */ public static DialogBox createDialog(String title, String mess, final String buttonName, final String cancelButtonName, int size, final JavaScriptObject callback) { final DialogBox dialogBox = new DialogBox(); dialogBox.setStylePrimaryName("ode-DialogBox"); dialogBox.setText(title); if (size == 0) { dialogBox.setHeight("150px"); } else { dialogBox.setHeight("400px"); } dialogBox.setWidth("400px"); dialogBox.setGlassEnabled(true); dialogBox.setAnimationEnabled(true); dialogBox.center(); VerticalPanel DialogBoxContents = new VerticalPanel(); HTML message = new HTML(mess); message.setStyleName("DialogBox-message"); HorizontalPanel holder = new HorizontalPanel(); if (buttonName != null) { // If buttonName and cancelButtonName are null Button ok = new Button(buttonName); // We won't have any buttons and other ok.addClickListener(new ClickListener() { // code is needed to dismiss us public void onClick(Widget sender) { doCallBack(callback, buttonName); } }); holder.add(ok); } if (cancelButtonName != null) { Button cancel = new Button(cancelButtonName); cancel.addClickListener(new ClickListener() { public void onClick(Widget sender) { doCallBack(callback, cancelButtonName); } }); holder.add(cancel); } DialogBoxContents.add(message); DialogBoxContents.add(holder); dialogBox.setWidget(DialogBoxContents); dialogBox.show(); return dialogBox; }
From source file:com.google.appinventor.client.editor.youngandroid.TutorialPanel.java
License:Open Source License
/** * Creates video on page!/*from w ww. j a v a2 s . c o m*/ */ private static void createVideoDialog(String tutorialId) { // Create the UI elements of the DialogBox final DialogBox dialogBox = new DialogBox(true, true); // DialogBox(autohide, modal) dialogBox.setStylePrimaryName("ode-DialogBox"); dialogBox.setText("Tutorial Video"); dialogBox.setGlassEnabled(true); dialogBox.setAnimationEnabled(true); VerticalPanel DialogBoxContents = new VerticalPanel(); // Adds Youtube Video HTML message = new HTML("<iframe width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/" + tutorialId + "?rel=0&autoplay=1\" frameborder=\"0\" allowfullscreen></iframe>"); message.setStyleName("DialogBox-message"); FlowPanel holder = new FlowPanel(); Button ok = new Button("Close"); ok.addClickListener(new ClickListener() { public void onClick(Widget sender) { dialogBox.hide(); } }); ok.setStyleName("DialogBox-button"); holder.add(ok); DialogBoxContents.add(message); DialogBoxContents.add(holder); dialogBox.setWidget(DialogBoxContents); dialogBox.center(); dialogBox.show(); }
From source file:com.google.appinventor.client.editor.youngandroid.TutorialPanel.java
License:Open Source License
/** * Enlarges image on page/*from ww w . java 2 s. c o m*/ */ private static void createImageDialog(String img) { // Create the UI elements of the DialogBox final DialogBox dialogBox = new DialogBox(true, true); // DialogBox(autohide, modal) dialogBox.setStylePrimaryName("ode-DialogBox"); dialogBox.setGlassEnabled(true); dialogBox.setAnimationEnabled(true); VerticalPanel DialogBoxContents = new VerticalPanel(); FlowPanel holder = new FlowPanel(); Button ok = new Button("Close"); ok.addClickListener(new ClickListener() { public void onClick(Widget sender) { dialogBox.hide(); } }); ok.setStyleName("DialogBox-button"); // Adds Image Image image = new Image(img); image.addLoadHandler(new LoadHandler() { public void onLoad(LoadEvent evt) { dialogBox.center(); } }); image.setStyleName("DialogBox-image"); holder.add(ok); DialogBoxContents.add(image); DialogBoxContents.add(holder); dialogBox.setWidget(DialogBoxContents); dialogBox.center(); dialogBox.show(); }