Example usage for com.google.gwt.user.client.ui DialogBox DialogBox

List of usage examples for com.google.gwt.user.client.ui DialogBox DialogBox

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui DialogBox DialogBox.

Prototype

public DialogBox() 

Source Link

Document

Creates an empty dialog box.

Usage

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   ww  w.jav a2s. c om*/
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.
 *//*  w  w w .ja va  2s. c om*/
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.admin.bm.client.view.batch.BatchClassView.java

License:Open Source License

/**
 * To perform operations on copy Document button clicked.
 * /*from   ww w. java2 s.  c om*/
 * @param clickEvent ClickEvent
 */
@UiHandler("copyDocumentButton")
public void onCopyDocumentButtonClicked(ClickEvent clickEvent) {
    String rowIndex = docTypeListView.listView.getSelectedRowIndex();
    int rowCount = docTypeListView.listView.getTableRecordCount();
    if (rowIndex == null || rowIndex.isEmpty()) {
        if (rowCount == 0) {
            ConfirmationDialogUtil.showConfirmationDialog(
                    LocaleDictionary.get().getMessageValue(BatchClassManagementMessages.NO_RECORD_TO_COPY),
                    LocaleDictionary.get().getConstantValue(BatchClassManagementConstants.COPY_DOCUMENT_TITLE),
                    Boolean.TRUE);
        } else {
            ConfirmationDialogUtil.showConfirmationDialog(
                    LocaleDictionary.get().getMessageValue(BatchClassManagementMessages.NONE_SELECTED_WARNING),
                    LocaleDictionary.get().getConstantValue(BatchClassManagementConstants.COPY_DOCUMENT_TITLE),
                    Boolean.TRUE);
        }
        return;
    }
    final DialogBox dialogBox = new DialogBox();
    final CopyDocumentView copyDocumentView = new CopyDocumentView();
    CopyDocumentTypePresenter copyDocumentTypePresenter = new CopyDocumentTypePresenter(
            presenter.getController(), copyDocumentView);
    copyDocumentTypePresenter.setDocumentTypeDTO(presenter.getController().getDocumentByIdentifier(rowIndex));
    copyDocumentView.setDialogBox(dialogBox);
    copyDocumentTypePresenter.bind();
    copyDocumentTypePresenter.showDocumentCopyView();
    copyDocumentView.getSaveButton().setFocus(true);
}

From source file:com.ephesoft.dcma.gwt.admin.bm.client.view.BatchClassManagementView.java

License:Open Source License

/**
 * Constructor.//from w w w .ja  va  2s .  co  m
 * 
 * @param eventBus HandlerManager
 */
public BatchClassManagementView(HandlerManager eventBus) {
    super();
    initWidget(BINDER.createAndBindUi(this));

    editModulesPluginSelectView = new ConfigureModulesPluginSelectView(eventBus);
    addModuleView = new ConfigureModuleView(eventBus);

    editModulesPluginSelectViewLayoutPanel.add(editModulesPluginSelectView);
    addModulesViewLayoutPanel.add(addModuleView);
    Button edit = new Button();
    copy = new Button();
    Button delete = new Button();
    Button export = new Button();
    importButton = new Button();
    bottomPanel.addStyleName("leftPadding");
    bottomPanel.addStyleName("fullWidth");
    edit.setText(AdminConstants.EDIT_BUTTON);
    copy.setText(AdminConstants.COPY_BUTTON);
    delete.setText(AdminConstants.DELETE_BUTTON);
    export.setText(AdminConstants.EXPORT_BUTTON);
    importButton.setText(AdminConstants.IMPORT_BUTTON);
    apply.setText(AdminConstants.APPLY_BUTTON);

    validate.setText(VALIDATE);
    validate.addStyleName(BUTTON_STYLE);

    buttonPanel = new HorizontalPanel();
    buttonPanel.setWidth("100%");
    buttonPanel.setSpacing(BatchClassManagementConstants.FIVE);
    buttonPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
    buttonPanel.setVerticalAlignment(HasAlignment.ALIGN_TOP);
    buttonPanel.add(export);
    buttonPanel.add(importButton);
    buttonPanel.add(edit);
    buttonPanel.setCellWidth(edit, "95%");
    buttonPanel.add(new Label(BatchClassManagementConstants.EMPTY_STRING));
    buttonPanel.add(copy);
    buttonPanel.add(new Label(BatchClassManagementConstants.EMPTY_STRING));
    buttonPanel.add(delete);

    batchListPanel = new LayoutPanel();
    batchClassListView = new BatchClassListView();
    batchClassFieldListView = new BatchClassFieldListView();
    batchListPanel.add(batchClassListView.listView);
    submit.setText(AdminConstants.SAVE_BUTTON);
    cancel.setText(AdminConstants.CANCEL_BUTTON);
    deploy.setText(AdminConstants.DEPLOY_BUTTON);
    learn.setText(AdminConstants.LEARN_FILES_BUTTON);
    sample.setText(AdminConstants.GENERATE_FOLDERS_BUTTON);
    learnDB.setText(AdminConstants.LEARN_DB_BUTTON);
    bottomButtons.setVisible(false);
    batchClassBreadCrumbView.setVisible(false);
    toggleDeployButtonEnable(false);

    edit.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent arg0) {
            presenter.onEditButtonClicked();
        }
    });

    copy.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent arg0) {
            String identifier = batchClassListView.listView.getSelectedRowIndex();
            if (identifier == null || identifier.isEmpty()) {
                ConfirmationDialogUtil.showConfirmationDialogError(
                        LocaleDictionary.get().getMessageValue(BatchClassManagementMessages.NO_RECORD_TO_COPY));
                return;
            }
            final DialogBox dialogBox = new DialogBox();
            final CopyBatchClassView copyBatchClassView = new CopyBatchClassView();
            CopyBatchClassPresenter copyBatchClassPresenter = new CopyBatchClassPresenter(
                    presenter.getController(), copyBatchClassView);
            copyBatchClassPresenter
                    .setBatchClassDTO(presenter.getController().getBatchClassByIdentifier(identifier));
            copyBatchClassView.setDialogBox(dialogBox);
            copyBatchClassPresenter.bind();
            copyBatchClassPresenter.showBatchClassCopyView();
            copyBatchClassView.getSaveButton().setFocus(true);
        }
    });

    importButton.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent arg0) {
            presenter.onImportButtonClicked();

        }
    });

    export.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent arg0) {
            String identifier = batchClassListView.listView.getSelectedRowIndex();
            if (identifier == null || identifier.isEmpty()) {
                ConfirmationDialogUtil.showConfirmationDialogError(LocaleDictionary.get()
                        .getMessageValue(BatchClassManagementMessages.NO_RECORD_TO_EXPORT));
                return;
            }
            presenter.onExportButtonClicked(identifier);
        }
    });

    delete.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent arg0) {
            final String identifier = batchClassListView.listView.getSelectedRowIndex();
            if (identifier == null || identifier.isEmpty()) {
                ConfirmationDialogUtil.showConfirmationDialogError(LocaleDictionary.get()
                        .getMessageValue(BatchClassManagementMessages.NO_RECORD_TO_DELETE));
                return;
            }
            final ConfirmationDialog confirmationDialog = ConfirmationDialogUtil.showConfirmationDialog(
                    LocaleDictionary.get()
                            .getMessageValue(BatchClassManagementMessages.DELETE_BATCH_CLASS_CONFORMATION),
                    LocaleDictionary.get().getConstantValue(
                            BatchClassManagementConstants.DELETE_BATCH_CLASS_TITLE),
                    Boolean.FALSE);

            confirmationDialog.addDialogListener(new DialogListener() {

                @Override
                public void onOkClick() {
                    confirmationDialog.hide();
                    presenter.onDeleteButtonClicked(identifier);
                }

                @Override
                public void onCancelClick() {
                    confirmationDialog.hide();
                }
            });

        }
    });
}

From source file:com.ephesoft.dcma.gwt.admin.bm.client.view.module.AddNewModuleView.java

License:Open Source License

/**
 * Constructor./*from   w  w w .  j  ava2s.c  om*/
 */
public AddNewModuleView() {
    super();
    initWidget(BINDER.createAndBindUi(this));

    saveButton.setText(AdminConstants.SAVE_BUTTON);
    cancelButton.setText(AdminConstants.CANCEL_BUTTON);
    saveButton.setHeight(AdminConstants.BUTTON_HEIGHT);
    cancelButton.setHeight(AdminConstants.BUTTON_HEIGHT);
    dialogBox = new DialogBox();
    name.setReadOnly(false);
    validateNameTextBox = new ValidatableWidget<TextBox>(name);

    validateNameTextBox.getWidget().addValueChangeHandler(new ValueChangeHandler<String>() {

        @Override
        public void onValueChange(ValueChangeEvent<String> arg0) {
            validateNameTextBox.toggleValidDateBox();
        }
    });
    validateNameTextBox.addValidator(new EmptyStringValidator(name));
    validateDescTextBox = new ValidatableWidget<TextBox>(description);
    validateDescTextBox.getWidget().addValueChangeHandler(new ValueChangeHandler<String>() {

        @Override
        public void onValueChange(ValueChangeEvent<String> event) {
            validateDescTextBox.toggleValidDateBox();
        }
    });
    validateDescTextBox.addValidator(new EmptyStringValidator(description));

    addNewModuleViewPanel.setSpacing(BatchClassManagementConstants.FIVE);

    nameLabel.setText(AdminConstants.NAME);
    descLabel.setText(AdminConstants.DESCRIPTION);

    descStar.setText(AdminConstants.STAR);
    nameStar.setText(AdminConstants.STAR);

    nameLabel.setStyleName(AdminConstants.BOLD_TEXT_STYLE);
    descLabel.setStyleName(AdminConstants.BOLD_TEXT_STYLE);

    descStar.setStyleName(AdminConstants.FONT_RED_STYLE);
    nameStar.setStyleName(AdminConstants.FONT_RED_STYLE);
    addNewModuleViewButtonsPanel.setSpacing(BatchClassManagementConstants.TEN);
}

From source file:com.ephesoft.dcma.gwt.customworkflow.client.presenter.CustomWorkflowManagementPresenter.java

License:Open Source License

public void showImportPluginView() {
    final DialogBox dialogBox = new DialogBox();
    final ImportPluginView importPluginView = new ImportPluginView();
    ImportPluginPresenter importPluginPresenter = new ImportPluginPresenter(controller, importPluginView);

    importPluginView.setDialogBox(dialogBox);
    importPluginPresenter.bind();// w w  w.  ja va 2 s.  c o m

    importPluginPresenter.showPluginImportView();
    importPluginView.getSaveButton().setFocus(true);

}

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);/*w ww .  j  ava 2 s  .  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  w ww .  ja va2  s .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.ephesoft.dcma.gwt.uploadbatch.client.view.UploadBatchView.java

License:Open Source License

private void showAssociateBatchClassField(Boolean isFinishButtonClicked) {
    if (isFinishButtonClicked != null && isFinishButtonClicked) {
        presenter.getController().setIsFinishButtonClicked(isFinishButtonClicked);
    } else {/*from www. j  a  v a2  s.  c o  m*/
        presenter.getController().setIsFinishButtonClicked(Boolean.FALSE);
    }

    String identifier = getSelectedBatchClassNameListBoxValue();
    if (identifier == null || identifier.isEmpty()) {
        ConfirmationDialogUtil.showConfirmationDialogError(
                LocaleDictionary.get().getMessageValue(UploadBatchMessages.NONE_SELECTED_WARNING));
    } else {
        final DialogBox dialogBox = new DialogBox();
        associateBCFView.setDialogBox(dialogBox);
        presenter.onAssociateBatchClassFieldButtonClicked(identifier);
        associateBCFView.getSave().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);//from w ww  . j a va 2  s  .co  m
    dialogBox.show();
}