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

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

Introduction

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

Prototype

public FlexTable() 

Source Link

Usage

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

License:Open Source License

/**
 * To set view.//  w  w  w.j  a  v a 2s. c  o m
 */
public void setView() {
    editTable = new FlexTable();
    editTable.setWidth("100%");
    flexEditTable.setWidget(0, 0, editTable);
    flexEditTable.getCellFormatter().setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_TOP);
}

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

License:Open Source License

/**
 * Constructor./*w ww.j  a  v  a 2  s.  c  o m*/
 */
public FuzzyDBPropertiesView() {
    super();
    initWidget(BINDER.createAndBindUi(this));
    detailTable = new FlexTable();
    detailTable.setWidth("100%");
    detailTable.getColumnFormatter().setWidth(0, "40%");
    detailTable.getColumnFormatter().setWidth(1, "1%");
    detailTable.getColumnFormatter().setWidth(2, "59%");
    viewTable.setWidget(0, 0, detailTable);
    viewTable.getCellFormatter().setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_TOP);
    edit.setText(AdminConstants.EDIT_BUTTON);
    mappingButton.setText(AdminConstants.MAPPING_BUTTON);
    mappingButton.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent arg0) {
            presenter.getController().getMainPresenter().showDocTypeMappingView();
        }
    });
}

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

License:Open Source License

/**
 * To set view./*from  ww w .jav  a  2 s. com*/
 */
public void setView() {

    cancel = new Button();
    cancel.setText(AdminConstants.CANCEL_BUTTON);
    cancel.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            presenter.onCancel();
        }
    });
    save = new Button();
    save.setText(AdminConstants.OK_BUTTON);
    save.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            presenter.onSave();
        }
    });
    editTable = new FlexTable();
    editTable.setWidth("100%");
    flexEditTable.setWidget(0, 0, editTable);
    flexEditTable.getCellFormatter().setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_TOP);
}

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

License:Open Source License

/**
 * To set the view./*from  w w  w  .  j av a2  s.  co  m*/
 */
public void setView() {
    dataTable = new FlexTable();
    dataTable.setWidth("100%");
    flexEditTable.setWidget(0, 0, dataTable);
    flexEditTable.getCellFormatter().setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_TOP);
    saveButton.setText(AdminConstants.OK_BUTTON);
    cancelButton.setText(AdminConstants.CANCEL_BUTTON);
    saveButton.setHeight(AdminConstants.BUTTON_HEIGHT);
    cancelButton.setHeight(AdminConstants.BUTTON_HEIGHT);
    editScannerViewPanel.setSpacing(BatchClassManagementConstants.FIVE);
}

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

License:Open Source License

/**
 * To set view.// w ww . j ava  2  s  .com
 */
public void setView() {
    dataTable = new FlexTable();
    dataTable.setWidth("100%");
    flexEditTable.setWidget(0, 0, dataTable);
    flexEditTable.getCellFormatter().setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_TOP);
}

From source file:com.ephesoft.dcma.gwt.rv.client.view.DocumentTree.java

License:Open Source License

private void createTree(boolean fireEvent) {
    clearView();/* ww w.j a v a 2s  .c  om*/
    List<Document> docBeans = presenter.batchDTO.getBatch().getDocuments().getDocument();

    int counter = 0;
    TreeItem item = null;
    boolean isThumbNailLoaded = false;
    boolean isFirstThumbNail = false;
    for (final Document docBean : docBeans) {

        VerticalPanel docTitleVerticalPanel = new VerticalPanel();
        HorizontalPanel docTitlePanel = new HorizontalPanel();
        docTitlePanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
        docTitleVerticalPanel.add(docTitlePanel);
        Label docTitleLabel = new Label();
        Label docType = new Label();
        docTitlePanel.add(docTitleLabel);

        Label icon = new Label();
        icon.setStyleName(ReviewValidateConstants.NO_ERROR_ICON);

        docTitlePanel.add(icon);
        docTitleVerticalPanel.add(docType);
        final TreeItem docItem = docTree.addItem(docTitleVerticalPanel);

        addDocDisplayItemsAndHandlers(docBean, docTitleLabel, docType, icon, docItem);

        if (presenter.batchDTO.isErrorContained(docBean)) {
            isThumbNailLoaded = true;
            icon.setStyleName(ReviewValidateConstants.ERROR_ICON);
            if (counter == 0) {
                item = docItem;
                counter++;
            }
        }

        Iterator<Page> iter = docBean.getPages().getPage().iterator();
        for (int i = 0; i < Math.ceil(docBean.getPages().getPage().size() / 2.0); i++) {
            FlexTable flexTable = new FlexTable();
            for (int j = 0; j < 2; j++) {
                if (iter.hasNext()) {
                    final Page pageTypeBean = iter.next();
                    final RotatableImage image = new RotatableImage();
                    if (isThumbNailLoaded && !isFirstThumbNail) {
                        isThumbNailLoaded = false;
                        isFirstThumbNail = true;
                        if (!pageTypeBean.isIsRotated()) {
                            image.setUrl(
                                    presenter.batchDTO.getAbsoluteURLFor(pageTypeBean.getThumbnailFileName()),
                                    pageTypeBean.getDirection());
                        } else {
                            image.setUrl(
                                    presenter.batchDTO.getAbsoluteURLForRotatedImage(
                                            pageTypeBean.getThumbnailFileName(),
                                            pageTypeBean.getDirection().toString()),
                                    pageTypeBean.getDirection());
                        }
                    }
                    image.addStyleName(ReviewValidateConstants.THUMBNAIL_DEFAULT);

                    image.addClickHandler(new ClickHandler() {

                        @Override
                        public void onClick(ClickEvent arg0) {
                            setPageSelected(image, true);
                        }
                    });

                    VerticalPanel imagePanel = setImagesForTree(pageTypeBean, image);
                    flexTable.setWidget(0, j, imagePanel);
                }
                docItem.addItem(flexTable);

            }
        }

    }

    if (fireEvent) {
        setDocumentSelected(item);
        if (selectedDocItem != null) {
            selectedDocItem.setState(true);
        }
    }
}

From source file:com.ephesoft.dcma.gwt.rv.client.view.FuzzySearchResultView.java

License:Open Source License

public FuzzySearchResultView(final ReviewValidatePresenter reviewValidatePresenter, String width,
        String height) {//from w  ww . jav a2  s.c  o  m
    super();
    initWidget(BINDER.createAndBindUi(this));
    // fuzzySearchScrollPanel.setSize("100%", "100%");

    fuzzyTable = new FlexTable();
    fuzzyTable.setWidth("100%");

    buttonHorizontalPanel = new HorizontalPanel();
    Button cancelBtn = new Button();
    selectBtn = new Button();
    buttonHorizontalPanel.add(selectBtn);
    buttonHorizontalPanel.add(cancelBtn);
    buttonHorizontalPanel.setSpacing(5);
    buttonHorizontalPanel.setVerticalAlignment(HasAlignment.ALIGN_TOP);
    addStyleName("overflow_scroll");
    fuzzySearchListPanel.add(buttonHorizontalPanel);
    setWidth(width);
    setHeight(height);
    fuzzySearchListPanel.add(fuzzyTable);
    fuzzySearchListPanel.addStyleName("border");

    // cancelBtn.setText("Cancel");
    // selectBtn.setText("Select");

    cancelBtn.setText(LocaleDictionary.get().getConstantValue(ReviewValidateConstants.FUZZY_SEARCH_CANCEL_BTN));
    selectBtn.setText(LocaleDictionary.get().getConstantValue(ReviewValidateConstants.FUZZY_SEARCH_SELECT_BTN));

    selectBtn.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent arg0) {

            // TODO remove this hard coding and get it from hash map.
            int returnIndex = getSelectedRowId();
            FuzzySearchResultView.this.fireEvent(new FuzzySearchEvent(returnIndex));
            dialogBox.hide(true);
            ScreenMaskUtility.unmaskScreen();
            reviewValidatePresenter.setFocus();
        }

    });

    cancelBtn.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent arg0) {
            dialogBox.hide(true);
            ScreenMaskUtility.unmaskScreen();
            reviewValidatePresenter.setFocus();
        }

    });

}

From source file:com.ephesoft.dcma.gwt.rv.client.view.TableExtractionView.java

License:Open Source License

private void createTableView(final Document document) {
    verticalPanel.clear();/*  w  w w .  j  a  va 2s  . c  o  m*/
    tableNameVsButtonMap.clear();
    List<DataTable> dataTablesList = null;
    selectedDocument = document;
    if (document.getDataTables() != null && document.getDataTables().getDataTable() != null) {
        dataTablesList = document.getDataTables().getDataTable();
    }

    if (dataTablesList == null || dataTablesList.isEmpty()) {
        TableExtractionView.this.fireEvent(new TableViewDisplayEvent(0));
    } else {
        TableExtractionView.this.fireEvent(new TableViewDisplayEvent(dataTablesList.size()));
        for (final DataTable dataTable : dataTablesList) {
            HeaderRow headerRow = dataTable.getHeaderRow();
            final Document doc = document;
            final Rows rows = dataTable.getRows();
            tableNameVsCheckBoxMap.put(dataTable.getName(), new ArrayList<CheckBox>());
            if (dataTable != null && headerRow != null && headerRow.getColumns() != null
                    && headerRow.getColumns().getColumn() != null
                    && !headerRow.getColumns().getColumn().isEmpty()) {
                final List<Column> columnList = headerRow.getColumns().getColumn();
                final FlexTable flexTable = new FlexTable();
                selectedDataTableName = dataTable.getName();
                flexTable.setCellSpacing(0);
                flexTable.setBorderWidth(1);
                flexTable.setWidth("100%");
                addHeaderColumns(columnList, flexTable);
                flexTable.getRowFormatter().setStyleName(0, "header");
                setTableUI(flexTable, dataTable);
                // if (rows != null && rows.getRow() != null && !rows.getRow().isEmpty()) {
                if (rows != null && rows.getRow() != null) {
                    presenter.rpcService.getColumnRegexPattern(selectedDocument.getType(), dataTable.getName(),
                            new AsyncCallback<List<String>>() {

                                @Override
                                public void onSuccess(final List<String> listOfColumnPatterns) {
                                    columnPattern = listOfColumnPatterns;
                                    tableNameVsColumnPattern.put(dataTable.getName(), listOfColumnPatterns);
                                    createTableList(flexTable, rows.getRow(), columnList, dataTable, doc);
                                }

                                @Override
                                public void onFailure(final Throwable arg0) {
                                    final ConfirmationDialog confirmationDialog = ConfirmationDialogUtil
                                            .showConfirmationDialog(
                                                    LocaleDictionary.get().getMessageValue(
                                                            ReviewValidateMessages.REGEX_RETRIEVAL_FAIL),
                                                    LocaleDictionary.get().getConstantValue(
                                                            ReviewValidateConstants.REGEX_RETRIEVAL_FAIL),
                                                    Boolean.TRUE);

                                    confirmationDialog.addDialogListener(new DialogListener() {

                                        @Override
                                        public void onOkClick() {
                                            confirmationDialog.hide();
                                            createTableList(flexTable, rows.getRow(), columnList, dataTable,
                                                    doc);
                                        }

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

                                }
                            });
                }
                tableNameVsViewMap.put(dataTable.getName(), flexTable);
            }
        }
    }
}

From source file:com.ephesoft.dcma.gwt.uploadbatch.client.view.AssociateBCFView.java

License:Open Source License

public void setView() {

    cancel = new Button();
    cancel.setText("Cancel");
    cancel.addClickHandler(new ClickHandler() {

        @Override/*from  w  w  w. j av  a 2s  . c o m*/
        public void onClick(ClickEvent event) {
            validationMessage = new Label();
            dialogBox.hide();
        }
    });
    save = new Button();
    save.setText("Ok");
    save.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            presenter.onSave();
            if (presenter.isSetVisibleDialogue()) {
                dialogBox.hide();
            }
        }
    });
    editTable = new FlexTable();
    editTable.setWidth("100%");
    flexEditTable.setWidget(1, 0, editTable);
    flexEditTable.setWidget(0, 0, validationMessage);
    flexEditTable.getCellFormatter().setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_TOP);
}

From source file:com.ephesoft.dcma.gwt.uploadbatch.client.view.UploadBatchView.java

License:Open Source License

public UploadBatchView() {
    super();//from w w  w. j a v a2 s. c o m
    initWidget(BINDER.createAndBindUi(this));

    buttonPanel1.addStyleName("paddingTop");
    uploadBatchViewPanel.addStyleName("padding");
    mainDockPanel.addStyleName("deleteTable");

    batchClassPanel.addStyleName("paddingTop");

    fileUploadCaptionPanel
            .setCaptionHTML(LocaleDictionary.get().getConstantValue(UploadBatchConstants.UPLOAD_LABEL));
    fileUploadCaptionPanel.addStyleName(PANEL_BG);
    fileUploadCaptionPanel.addStyleName(BOLD_TEXT);
    fileUploadCaptionPanel.addStyleName(MARGIN_LOCAL);

    batchClassCaptionPanel
            .setCaptionHTML(LocaleDictionary.get().getConstantValue(UploadBatchConstants.BATCH_DETAIL));
    batchClassCaptionPanel.addStyleName(PANEL_BG);
    batchClassCaptionPanel.addStyleName(BOLD_TEXT);
    batchClassCaptionPanel.addStyleName(MARGIN_LOCAL);

    actionCaptionPanel.setCaptionHTML(LocaleDictionary.get().getConstantValue(UploadBatchConstants.ACTION));
    actionCaptionPanel.addStyleName(PANEL_BG);
    actionCaptionPanel.addStyleName(BOLD_TEXT);
    actionCaptionPanel.addStyleName(MARGIN_LOCAL);

    deleteCaptionPanel.setCaptionHTML(LocaleDictionary.get().getConstantValue(UploadBatchConstants.FILE_LIST));
    deleteCaptionPanel.addStyleName(PANEL_BG);
    deleteCaptionPanel.addStyleName(BOLD_TEXT);
    deleteCaptionPanel.addStyleName(MARGIN_LOCAL);

    editTable = new FlexTable();
    editTable.setWidth("100%");

    fileListTable.setWidget(0, 0, editTable);
    fileListTable.getCellFormatter().setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_TOP);

    associateBCFView = new AssociateBCFView();
    allFileList = new LinkedList<String>();
    deleteSelectedFileList = new LinkedList<String>();
    allFilesBox = new ArrayList<CheckBox>();

    finishButton.setText(LocaleDictionary.get().getConstantValue(UploadBatchConstants.FINISH_BUTTON));
    // disable Finish button by default
    finishButton.setEnabled(Boolean.FALSE);
    // disable Field(s) button by default
    addBCFButton.setEnabled(Boolean.FALSE);
    // disable Delete button by default
    deleteButton.setEnabled(Boolean.FALSE);
    deleteButton.setVisible(Boolean.FALSE);
    deleteCaptionPanel.setVisible(Boolean.FALSE);

    uploadLabel.setText(LocaleDictionary.get().getConstantValue(UploadBatchConstants.UPLOAD_TEXT));
    uploadStar.setText(UploadBatchConstants.STAR);
    uploadStar.setStyleName("font_red");
    uploadButton.setText(LocaleDictionary.get().getConstantValue(UploadBatchConstants.UPLOAD_BUTTON));

    resetButton.setText(LocaleDictionary.get().getConstantValue(UploadBatchConstants.RESET_BUTTON));
    addBCFButton.setText(LocaleDictionary.get().getConstantValue(UploadBatchConstants.ASSOCIATE_BCF_BUTTON));
    deleteButton.setText(LocaleDictionary.get().getConstantValue(UploadBatchConstants.DELETE_BUTTON));

    HTMLPanel panel = new HTMLPanel("<div id=\"swfupload\"></div>");
    uploadFilePlaceholder.getElement().appendChild(panel.getElement());
    RootPanel.get().clear();
    RootPanel.get().add(this);

    uploadBuilder.setButtonAction(ButtonAction.SELECT_FILES);
    uploadBuilder.setButtonCursor(ButtonCursor.HAND);
    uploadBuilder.setButtonImageURL("images/browse.png");
    //uploadBuilder.setButtonText(LocaleDictionary.get().getMessageValue(UploadBatchMessages.BROWSE));
    uploadBuilder.setButtonHeight(25);
    uploadBuilder.setButtonWidth(68);

    uploadBuilder.setButtonPlaceholderID("swfupload");
    uploadBuilder.setFileTypes("*.tif;*.tiff;*.pdf");
    uploadBuilder
            .setFileTypesDescription(LocaleDictionary.get().getConstantValue(UploadBatchConstants.FILE_TYPES));

    fileIndexList = new ArrayList<Integer>();

    /*uploadBuilder.setFileDialogCompleteHandler(new FileDialogCompleteHandler() {
            
       @Override
       public void onFileDialogComplete(FileDialogCompleteEvent e) {
    presenter.onSubmit(UPLOAD_FORM_ACTION);
    uploadButton.setEnabled(true);
       }
    });
     */

    // To maintain index of file queued for upload.
    uploadBuilder.setFileQueuedHandler(new FileQueuedHandler() {

        @Override
        public void onFileQueued(FileQueuedEvent event) {
            File file = event.getFile();
            fileIndexList.add(file.getIndex());
        }
    });

    uploadBuilder.setUploadProgressHandler(new UploadProgressHandler() {

        @Override
        public void onUploadProgress(UploadProgressHandler.UploadProgressEvent event) {
            String fileName = event.getFile().getName();
            double percent = Math
                    .ceil(((event.getBytesComplete() * 1000.0 / event.getBytesTotal()) * 100.0) / 1000.0);
            int indexInList = allFileList.indexOf(fileName);
            if (indexInList != -1) {
                String innerHTML = LocaleDictionary.get().getConstantValue(UploadBatchConstants.UPLOAD_PROGRESS)
                        + percent;
                innerHTML = innerHTML.split("\\.")[0] + "%";
                DOM.getElementById("progressBar_" + indexInList).setInnerHTML(innerHTML);
            }
        }
    });

    uploadBuilder.setUploadErrorHandler(new UploadErrorHandler() {

        @Override
        public void onUploadError(UploadErrorEvent event) {
            ConfirmationDialogUtil.showConfirmationDialogError(
                    LocaleDictionary.get().getMessageValue(UploadBatchMessages.UPLOAD_UNSUCCESSFUL)
                            + event.getFile());
        }
    });
    uploadBuilder.setUploadStartHandler(new UploadStartHandler() {

        @Override
        public void onUploadStart(UploadStartEvent event) {
            String currentFileName = event.getFile().getName();
            // update the file list
            if (!allFileList.contains(currentFileName)) {
                allFileList.add(currentFileName);
            }
            presenter.repaintFileList();
        }
    });

    uploadBuilder.setUploadCompleteHandler(new UploadCompleteHandler() {

        @Override
        public void onUploadComplete(UploadCompleteEvent event) {
            String currentFileName = event.getFile().getName();
            // update the file list
            if (!allFileList.contains(currentFileName)) {
                allFileList.add(currentFileName);
            }
            int fileLength = swfUpload.getStats().getFilesQueued();
            if (fileLength > 0) {
                swfUpload.startUpload();
            } else {
                ScreenMaskUtility.unmaskScreen();

                if (!getAllFileList().isEmpty()) {
                    // enable finish button
                    finishButton.setEnabled(Boolean.TRUE);
                    // enable field(s) button
                    addBCFButton.setEnabled(Boolean.TRUE);
                    // enable delete button
                    deleteButton.setVisible(Boolean.TRUE);
                    deleteButton.setEnabled(Boolean.TRUE);
                    deleteCaptionPanel.setVisible(Boolean.TRUE);
                    fileListPanel.addStyleName("deleteTable");

                    // If user browser is IE
                    if (ScreenMaskUtility.getUserAgent().contains(UploadBatchConstants.IE_BROWSER)) {
                        fileListPanel.setWidth(UploadBatchConstants.WIDTH_26_EM);
                    }

                }
                if (oversizedFileCount > 0) {
                    String fileSizeMessage = oversizedFileCount
                            + LocaleDictionary.get()
                                    .getMessageValue(UploadBatchMessages.FILE_SIZE_EXCEED_MESSAGE)
                            + UploadBatchConstants.SPACE + (presenter.getFileSizeLimit() / SIZE_MULTIPLIER)
                            + UploadBatchConstants.SPACE + UploadBatchConstants.MEGA_BYTE;
                    String title = LocaleDictionary.get().getMessageValue(UploadBatchMessages.LIMIT_REACHED);
                    ConfirmationDialogUtil.showConfirmationDialog(fileSizeMessage, title, true);
                } else {
                    ConfirmationDialogUtil.showConfirmationDialogSuccess(LocaleDictionary.get()
                            .getMessageValue(UploadBatchMessages.FILE_UPLOAD_COMPLETE_ALERT));
                }
            }
        }
    });

    uploadBuilder.preventSWFCaching(true);
    setSwfUpload(uploadBuilder.build());
}