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

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

Introduction

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

Prototype

public HorizontalPanel() 

Source Link

Document

Creates an empty horizontal panel.

Usage

From source file:com.ephesoft.dcma.gwt.batchinstance.client.view.BatchInstanceView.java

License:Open Source License

/**
 * Constructor./* w  w w.j ava2s  . c om*/
 */
public BatchInstanceView() {
    super();
    initWidget(binder.createAndBindUi(this));
    restartBatchButton = new Button();

    deleteBatchButton = new Button();

    openBatchButton = new Button();

    refreshButtonPanel = new VerticalPanel();

    priorityListBox = new ListBox(Boolean.TRUE);

    batchInstanceListBox = new ListBox(Boolean.TRUE);

    priorityLabel = new Label();

    batchInstanceLabel = new Label();

    searchBatchButton = new Button();

    searchBatchLabel = new Label();

    deleteButtonPanel = new HorizontalPanel();

    searchBatchTextBox = new TextBox();

    refreshButton = new Button();

    restartOptions = new ListBox();

    restartAllButton = new Button();

    deleteAllButton = new Button();

    unlockButton = new Button();

    nextButton = new Button(LocaleDictionary.get().getConstantValue(BatchInstanceConstants.NEXT_TEXT));

    previousButton = new Button(LocaleDictionary.get().getConstantValue(BatchInstanceConstants.PREVIOUS_TEXT));

    unlockButtonPanel = new HorizontalPanel();

    deleteOpenPanel = new VerticalPanel();

    unlockRestartPanel = new VerticalPanel();

    refreshButton.setText(LocaleDictionary.get().getConstantValue(BatchInstanceConstants.BUTTON_REFRESH));
    refreshButton.setWidth(BatchInstanceConstants.BUTTON_WIDTH);
    refreshButton
            .setTitle(LocaleDictionary.get().getConstantValue(BatchInstanceConstants.BUTTON_REFRESH_TOOLTIP));
    refreshButton.addStyleName(CoreCommonConstants.MARGIN_BOTTOM_5_CSS);
    restartAllButton
            .setText(LocaleDictionary.get().getConstantValue(BatchInstanceConstants.BUTTON_RESTART_ALL));
    deleteAllButton.setText(LocaleDictionary.get().getConstantValue(BatchInstanceConstants.BUTTON_DELETE_ALL));
    deleteAllButton
            .setTitle(LocaleDictionary.get().getConstantValue(BatchInstanceConstants.BUTTON_DELETE_TOOLTIP));
    deleteAllButton.setWidth(BatchInstanceConstants.BUTTON_WIDTH);

    unlockButton.setText(LocaleDictionary.get().getConstantValue(BatchInstanceConstants.BUTTON_UNLOCK));
    unlockButton.addStyleName(CoreCommonConstants.MARGIN_BOTTOM_5_CSS);
    unlockButton
            .setTitle(LocaleDictionary.get().getConstantValue(BatchInstanceConstants.BUTTON_UNLOCK_TOOLTIP));
    searchBatchLabel.setText(LocaleDictionary.get().getConstantValue(BatchInstanceConstants.LABEL_SEARCH_BATCH)
            + BatchInstanceConstants.COLON);
    searchBatchButton
            .setText(LocaleDictionary.get().getConstantValue(BatchInstanceConstants.BUTTON_SEARCH_BATCH));
    searchBatchButton.addStyleName(CoreCommonConstants.MARGIN_LEFT_5_CSS);
    restartBatchButton
            .setText(LocaleDictionary.get().getConstantValue(BatchInstanceConstants.BUTTON_RESTART_BATCH));
    restartBatchButton.setTitle(
            LocaleDictionary.get().getConstantValue(BatchInstanceConstants.BUTTON_RESTART_BATCH_TITLE));
    restartBatchButton.addStyleName(CoreCommonConstants.MARGIN_LEFT_5_CSS);
    deleteBatchButton
            .setText(LocaleDictionary.get().getConstantValue(BatchInstanceConstants.BUTTON_DELETE_BATCH));
    deleteBatchButton.addStyleName(CoreCommonConstants.MARGIN_BOTTOM_5_CSS);
    deleteBatchButton.setTitle(
            LocaleDictionary.get().getConstantValue(BatchInstanceConstants.BUTTON_DELETE_BATCH_TOOLTIP));
    openBatchButton.setText(LocaleDictionary.get().getConstantValue(BatchInstanceConstants.BUTTON_OPEN_BATCH));
    openBatchButton
            .setTitle(LocaleDictionary.get().getConstantValue(BatchInstanceConstants.BUTTON_OPEN_BATCH_TITLE));
    openBatchButton.setWidth(CoreCommonConstants._58PX);
    deleteBatchButton.setWidth(CoreCommonConstants._58PX);
    restartAllButton.setWidth(CoreCommonConstants._97PX);
    unlockButton.setWidth(CoreCommonConstants._97PX);
    totalBatchesLabel.setText(LocaleDictionary.get().getConstantValue(BatchInstanceConstants.TOTAL_BATCHES));
    deletedBatchesLabel
            .setText(LocaleDictionary.get().getConstantValue(BatchInstanceConstants.DELETED_BATCHES));
    totalBatchesLabel.addStyleName(CoreCommonConstants.BOLD_TEXT_CSS);
    deletedBatchesLabel.addStyleName(CoreCommonConstants.BOLD_TEXT_CSS);
    searchBatchTextBox.setText(LocaleDictionary.get().getConstantValue(BatchInstanceConstants.SEARCH_CRITERIA));
    searchBatchTextBox.setTitle(LocaleDictionary.get().getConstantValue(BatchInstanceConstants.SEARCH_TYPE));
    batchAlerts.setText(LocaleDictionary.get().getConstantValue(BatchInstanceConstants.BATCH_ALERTS));
    batchInstanceListView = new BatchInstanceListView();
    batchInstanceLayoutPanel.add(batchInstanceListView.listView);
    searchBatchTextBox.setWidth(CoreCommonConstants._120PX);
    batchInstanceControlPanel.addStyleName(CoreCommonConstants.OPTIONS_PANEL);
    batchInstanceControlPanel.addStyleName(CoreCommonConstants.OPTION_PANEL_MARGIN_CSS);
    fillPriorityListBox();
    fillBatchInstanceListBox(batchInstanceListBox);
    setDefaultFilters();
    batchInstanceListPanel.addStyleName("mainPanelLayout");
    topPanelContainer.addStyleName(CoreCommonConstants.TOP_PANEL_CSS);
    searchPanel.addStyleName(BatchInstanceConstants.GRP_PANEL_STYLE_NAME);
    searchPanel.setWidth(CoreCommonConstants._100_PERCENTAGE);
    filterPanel.addStyleName(BatchInstanceConstants.GRP_PANEL_STYLE_NAME);
    filterPanel.setWidth(CoreCommonConstants._100_PERCENTAGE);
    restartPanel.addStyleName(BatchInstanceConstants.GRP_PANEL_STYLE_NAME);
    restartPanel.setWidth(CoreCommonConstants._100_PERCENTAGE);
    deleteButtonPanel.addStyleName(CoreCommonConstants.LAST_GRP_PANEL_CSS);
    unlockButtonPanel.addStyleName(CoreCommonConstants.LAST_GRP_PANEL_CSS);
    filterPanel.add(priorityLabel);
    filterPanel.add(priorityListBox);
    filterPanel.add(batchInstanceLabel);
    filterPanel.add(batchInstanceListBox);

    refreshButtonPanel.add(refreshButton);
    refreshButtonPanel.add(deleteAllButton);

    filterPanel.add(refreshButtonPanel);
    filterPanel.setCellVerticalAlignment(priorityLabel, HasVerticalAlignment.ALIGN_MIDDLE);
    filterPanel.setCellVerticalAlignment(batchInstanceLabel, HasVerticalAlignment.ALIGN_MIDDLE);
    filterPanel.setCellVerticalAlignment(refreshButton, HasVerticalAlignment.ALIGN_MIDDLE);
    filterPanel.setCellVerticalAlignment(deleteAllButton, HasVerticalAlignment.ALIGN_MIDDLE);

    searchPanel.add(searchBatchLabel);
    searchPanel.add(searchBatchTextBox);
    searchPanel.add(searchBatchButton);
    searchPanel.setCellVerticalAlignment(searchBatchLabel, HasVerticalAlignment.ALIGN_MIDDLE);
    searchPanel.setCellVerticalAlignment(searchBatchTextBox, HasVerticalAlignment.ALIGN_MIDDLE);
    searchPanel.setCellVerticalAlignment(searchBatchButton, HasVerticalAlignment.ALIGN_MIDDLE);

    restartPanel.add(restartOptions);
    restartPanel.add(restartBatchButton);
    restartPanel.setCellVerticalAlignment(restartBatchButton, HasVerticalAlignment.ALIGN_MIDDLE);
    restartPanel.setCellVerticalAlignment(restartOptions, HasVerticalAlignment.ALIGN_MIDDLE);

    deleteOpenPanel.add(deleteBatchButton);
    deleteOpenPanel.add(openBatchButton);
    deleteButtonPanel.add(deleteOpenPanel);
    deleteButtonPanel.add(nextButton);
    deleteButtonPanel.setCellVerticalAlignment(deleteBatchButton, HasVerticalAlignment.ALIGN_MIDDLE);
    deleteButtonPanel.setCellVerticalAlignment(nextButton, HasVerticalAlignment.ALIGN_MIDDLE);

    restartAllButton.setEnabled(false);

    unlockRestartPanel.add(unlockButton);
    unlockRestartPanel.add(restartAllButton);
    unlockButtonPanel.add(unlockRestartPanel);
    unlockButtonPanel.add(previousButton);
    unlockButtonPanel.setCellVerticalAlignment(unlockButton, HasVerticalAlignment.ALIGN_MIDDLE);
    unlockButtonPanel.setCellVerticalAlignment(restartAllButton, HasVerticalAlignment.ALIGN_MIDDLE);
    unlockButtonPanel.setCellVerticalAlignment(openBatchButton, HasVerticalAlignment.ALIGN_MIDDLE);
    unlockButtonPanel.setCellVerticalAlignment(previousButton, HasVerticalAlignment.ALIGN_MIDDLE);
    actionPanel.add(deleteButtonPanel);

    controlPanel.setWidth("100%");
    controlPanel.add(unlockButtonPanel);
    controlPanel.setCellHorizontalAlignment(unlockButtonPanel, HasHorizontalAlignment.ALIGN_LEFT);

    batchAlertPanel.setBorderWidth(0);
    setLabelsStyle();
    batchAlerts.setStyleName(CoreCommonConstants.HEADER_BOLD_TEXT_CSS);
    batchInstanceLabel
            .setText(LocaleDictionary.get().getConstantValue(BatchInstanceConstants.LABEL_TABLE_COLUMN_STATUS)
                    + BatchInstanceConstants.COLON);
    priorityLabel
            .setText(LocaleDictionary.get().getConstantValue(BatchInstanceConstants.LABEL_TABLE_COLUMN_PRIORITY)
                    + BatchInstanceConstants.COLON);
    mainLayoutPanel.addStyleName(CoreCommonConstants.MAIN_CONTAINER_CSS);
    priorityListBox.setVisibleItemCount(BatchInstanceConstants.THREE);
    batchInstanceListBox.setVisibleItemCount(BatchInstanceConstants.THREE);
    clearRestartOptions();
    restartOptions.setWidth(CoreCommonConstants._100_PERCENTAGE);
    slidingPanel.setWidget(actionPanel);
    slidingPanel.setVisible(true);

    refreshButton.addClickHandler(new ClickHandler() {

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

        }
    });

    deleteAllButton.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent clickEvent) {
            final List<DataFilter> statusFilters = new ArrayList<DataFilter>();

            List<String> selectedBatchInstanceStatus = getBatchInstanceSelected();

            statusFilters.clear();
            boolean isValidSelection = true;
            boolean foundInAllStatusList = false;
            BatchInstanceStatus[] allStatusList = BatchInstanceStatus.values();

            for (String batchInstanceStat : selectedBatchInstanceStatus) {
                for (BatchInstanceStatus batchInstanceStatus : allStatusList) {
                    if (batchInstanceStatus.getId() == Integer.parseInt(batchInstanceStat)) {
                        foundInAllStatusList = true;
                        if (!ActionableStatus.valuesAsString().contains(batchInstanceStatus.name())) {
                            isValidSelection = false;
                            break;
                        }
                    }
                }
            }

            if (!isValidSelection || !foundInAllStatusList) {
                ConfirmationDialogUtil.showConfirmationDialogError(LocaleDictionary.get()
                        .getMessageValue(BatchInstanceMessages.MSG_DELETE_ALL_STATUS_IMPROPER));
            } else {
                if (batchInstanceDTOMap == null || batchInstanceDTOMap.size() == 0) {
                    ConfirmationDialogUtil.showConfirmationDialogError(LocaleDictionary.get()
                            .getMessageValue(BatchInstanceMessages.MSG_DELETE_ALL_NO_RECORD));
                } else {
                    for (String batchInstance : selectedBatchInstanceStatus) {
                        statusFilters.add(new DataFilter(BatchInstanceConstants.STATUS, batchInstance));
                    }
                    List<String> priorities = getPrioritySelected();
                    for (String priority : priorities) {
                        statusFilters.add(new DataFilter(BatchInstanceConstants.PRIORITY, priority));
                    }

                    final ConfirmationDialog confirmationDialog = ConfirmationDialogUtil.showConfirmationDialog(
                            LocaleDictionary.get()
                                    .getMessageValue(BatchInstanceMessages.MSG_DELETE_ALL_CONFIRM),
                            LocaleDictionary.get().getMessageValue(BatchInstanceMessages.MSG_DELETE_ALL_TITLE),
                            false);
                    confirmationDialog.addDialogListener(new DialogListener() {

                        @Override
                        public void onOkClick() {
                            presenter.onDeleteAllBatchButtonClick(statusFilters);
                        }

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

        }
    });

    addButtonHandlers();

    addBoxHandlers();

}

From source file:com.ephesoft.dcma.gwt.core.client.ui.table.Table.java

License:Open Source License

private void createTableHeader(boolean isRadioButton) {
    Images images = GWT.create(Images.class);
    final TableHeader header = tableData.getHeader();
    final List<HeaderColumn> columns = header.getHeaderColumns(isRadioButton);
    String width = null;/*from w  ww .j a v a 2s . c om*/
    int counter = 0;
    for (final HeaderColumn column : columns) {
        width = column.getWidth() + "%";
        headerTable.getCellFormatter().setWidth(0, counter, width);
        headerTable.getCellFormatter().addStyleName(0, counter, "wordWrap");
        HorizontalPanel headerPanel = new HorizontalPanel();
        Label name = new Label(column.getName());
        headerPanel.add(name);
        final Label sortImage = new Label();
        sortImage.setWidth("5px");
        sortImage.setStyleName("alignMiddle");
        if (order != null && column.getDomainProperty() != null
                && order.getSortProperty().getProperty().equals(column.getDomainProperty().getProperty())) {
            if (column.isPrimaryAsc()) {
                DOM.setInnerHTML(sortImage.getElement(),
                        AbstractImagePrototype.create(images.sortUp()).getHTML());
            } else {
                DOM.setInnerHTML(sortImage.getElement(),
                        AbstractImagePrototype.create(images.sortDown()).getHTML());
            }
        }
        headerPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
        headerPanel.add(sortImage);

        if (counter == 0 && isRadioButton) {
            name.setText("");
        }
        headerTable.setWidget(0, counter, headerPanel);
        if (column.isSortable()) {
            name.addStyleName("cursorHand");
            name.addClickHandler(new ClickHandler() {

                @Override
                public void onClick(ClickEvent arg0) {
                    order = new Order(column.getDomainProperty(), !column.isPrimaryAsc());
                    navBar.setOrder(order);
                    column.setPrimaryAsc(!column.isPrimaryAsc());
                    navBar.getListner().onPagination(navBar.getStartIndex(), visibleRecodrCount, order);
                }
            });
        }
        headerTable.getFlexCellFormatter().setVerticalAlignment(0, counter, HasVerticalAlignment.ALIGN_TOP);
        headerTable.getCellFormatter().setHorizontalAlignment(0, counter, HasHorizontalAlignment.ALIGN_LEFT);
        counter++;
    }
    headerTable.getRowFormatter().setStyleName(0, selectionStyle.header());
}

From source file:com.ephesoft.dcma.gwt.core.client.ui.table.Table.java

License:Open Source License

private void setNavigationBar() {
    navBarTable.getCellFormatter().setWidth(0, 1, "30%");
    navBarTable.getCellFormatter().setWidth(0, 2, "10%");
    navBarTable.getCellFormatter().setWidth(0, 3, "10%");
    navBarTable.getCellFormatter().setWidth(0, 4, "22%");
    navBarTable.getCellFormatter().setWidth(0, 5, "23%");
    Label displayText = new Label(navBar.getCountString());
    Label searchPageText = new Label(
            LocaleDictionary.get().getConstantValue(LocaleCommonConstants.TITLE_GO_TO_PAGE));
    Label totalPageCountText = new Label("  /" + navBar.getTotalPageCount());
    HorizontalPanel searchPagePanel = new HorizontalPanel();
    displayText.setStyleName(selectionStyle.boldText());
    searchPageText.setStyleName(selectionStyle.boldText());
    totalPageCountText.setStyleName(selectionStyle.boldText());
    searchPagePanel.add(searchPageText);
    searchPagePanel.add(navBar.getSearchPageTextBox());
    searchPagePanel.add(totalPageCountText);
    searchPagePanel.setCellHorizontalAlignment(searchPageText, HasHorizontalAlignment.ALIGN_RIGHT);
    searchPagePanel.setCellHorizontalAlignment(navBar.getSearchPageTextBox(),
            HasHorizontalAlignment.ALIGN_RIGHT);
    searchPagePanel.setCellHorizontalAlignment(totalPageCountText, HasHorizontalAlignment.ALIGN_RIGHT);
    if (this.navBar.getOrderingListner() != null) {
        navBarTable.setWidget(0, 2, navBar.getOrderingPanel());
        navBarTable.getCellFormatter().setHorizontalAlignment(0, 2, HasHorizontalAlignment.ALIGN_RIGHT);
    }//from w w  w. j  a v a  2 s .  c om
    if (this.navBar.getListner() != null) {
        navBarTable.setWidget(0, 3, navBar.getPaginationPanel());
        navBarTable.getCellFormatter().setHorizontalAlignment(0, 3, HasHorizontalAlignment.ALIGN_RIGHT);
        navBarTable.setWidget(0, 4, searchPagePanel);
    }
    navBarTable.setWidget(0, 5, displayText);
    navBarTable.getCellFormatter().setHorizontalAlignment(0, 4, HasHorizontalAlignment.ALIGN_RIGHT);
    navBarTable.getCellFormatter().setHorizontalAlignment(0, 5, HasHorizontalAlignment.ALIGN_RIGHT);
}

From source file:com.ephesoft.dcma.gwt.core.client.ui.widget.ImageLabel.java

License:Open Source License

/**
 * Sets the outermost panel as horizontal panel. It add the image to the left of label or to the right depending upon the parameter
 * passed.//from   w  ww.  j a v  a 2s  .  com
 * 
 * @param isImageRight the true value means image is added to the right of label and false means to the left
 */
private void setHorizontalContainer(final boolean isImageRight) {
    horizontalPanel = new HorizontalPanel();
    if (isImage) {
        if (isImageRight) {
            horizontalPanel.add(label);
            horizontalPanel.add(labelIcon);
        } else {
            horizontalPanel.add(labelIcon);
            horizontalPanel.add(label);
        }
    } else {
        horizontalPanel.add(label);
    }
    isContainerHorizontal = Boolean.TRUE;
}

From source file:com.ephesoft.dcma.gwt.core.client.view.ExternalAppDialogBox.java

License:Open Source License

public ExternalAppDialogBox(String url, int xDimension, int yDimension, boolean showOkButton,
        boolean showCloseButton, boolean center, boolean isVisible) {
    setWidget(BINDER.createAndBindUi(this));
    addStyleName(CSS_CONFIGURABLE_DIALOG_BOX);
    setWidth(xDimension + "px");
    setHeight(yDimension + "px");
    frame = new Frame(url);
    frame.setWidth(xDimension + "px");
    frame.setHeight(yDimension + "px");
    okButton = new Button("Ok", new ClickHandler() {

        @Override//  w w w. j a va2  s  .c om
        public void onClick(ClickEvent arg0) {
            listener.onOkClick();
            hide();
        }
    });
    okButton.setTitle("Ctrl+a");
    closeButton = new Button("Close", new ClickHandler() {

        @Override
        public void onClick(ClickEvent arg0) {
            listener.onCloseClick();
            hide();
        }
    });
    closeButton.setTitle("Ctrl+z");
    okButton.getElement().setAttribute("id", "okButtonElement");
    closeButton.getElement().setAttribute("id", "closeButtonElement");
    okButton.setVisible(showOkButton);
    closeButton.setVisible(showCloseButton);
    HorizontalPanel horizontalButtonPanel = new HorizontalPanel();
    horizontalButtonPanel.setSpacing(5);
    if (showOkButton) {
        horizontalButtonPanel.add(okButton);
        horizontalButtonPanel.setCellHorizontalAlignment(okButton, HasHorizontalAlignment.ALIGN_CENTER);
    }
    if (showCloseButton) {
        horizontalButtonPanel.add(closeButton);
        horizontalButtonPanel.setCellHorizontalAlignment(closeButton, HasHorizontalAlignment.ALIGN_CENTER);
    }
    verticalPanel.add(frame);
    verticalPanel.setCellHorizontalAlignment(frame, HasHorizontalAlignment.ALIGN_CENTER);
    verticalPanel.setCellHorizontalAlignment(horizontalButtonPanel, HasHorizontalAlignment.ALIGN_CENTER);
    verticalPanel.add(horizontalButtonPanel);
    setModal(true);
    setVisible(true);
    if (center) {
        center();
    }
    if (isVisible) {
        show();
    }
}

From source file:com.ephesoft.dcma.gwt.customworkflow.client.view.CustomWorkflowBreadCrumbView.java

License:Open Source License

public CustomWorkflowBreadCrumbView() {
    super();//from w w  w . ja va2s .c  om
    initWidget(BINDER.createAndBindUi(this));

    previousButton.setText(LocaleDictionary.get().getConstantValue(CustomWorkflowConstants.BACK_CONSTANT));
    previousButton.setEnabled(false);

    breadCrumbPanel.setSpacing(10);

    buttonsHorizontalPanel = new HorizontalPanel();
    buttonsHorizontalPanel.setSpacing(CustomWorkflowConstants.SPACING_5);
    buttonsHorizontalPanel.add(previousButton);
    breadCrumbPanel.add(buttonsHorizontalPanel);

    breadCrumbPanel.setCellHorizontalAlignment(buttonsHorizontalPanel, HasHorizontalAlignment.ALIGN_RIGHT);

    previousButton.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent arg0) {
            if (breadCrumbViews.size() == 0) {
                presenter.initializeBreadCrumb();
            }
            ((LinkedList<BreadCrumbView>) breadCrumbViews).removeLast();
            BreadCrumbView breadCrumbView = ((LinkedList<BreadCrumbView>) breadCrumbViews).getLast();
            createGivenBreadCrumbView(breadCrumbView.viewType);
        }

    });

}

From source file:com.ephesoft.dcma.gwt.foldermanager.client.view.FolderTableView.java

License:Open Source License

private final void createTableHeader() {
    selectAll = new CheckBox();
    selectAll.addClickHandler(new ClickHandler() {

        @Override//from w  w  w  . j a  v  a 2 s . co m
        public void onClick(ClickEvent event) {
            Boolean isSelectAllSelected = selectAll.getValue();
            for (FolderTableRow folderTableRow : folderTableRows) {
                folderTableRow.checkBox.setValue(isSelectAllSelected);
            }
        }
    });
    headers.setWidget(0, 0, selectAll);
    String name = LocaleDictionary.get().getConstantValue(FolderManagementConstants.NAME);

    String modifiedAt = LocaleDictionary.get().getConstantValue(FolderManagementConstants.MODIFIED_AT);
    String type = LocaleDictionary.get().getConstantValue(FolderManagementConstants.TYPE);

    HTML nameHTML = new HTML(name);
    HTML modifiedAtHTML = new HTML(modifiedAt);
    HTML typeHTML = new HTML(type);
    final HorizontalPanel nameHorizontalPanel = new HorizontalPanel();
    final HorizontalPanel modifiedHorizontalPanel = new HorizontalPanel();
    final HorizontalPanel typeHorizontalPanel = new HorizontalPanel();
    nameHorizontalPanel.add(nameHTML);
    modifiedHorizontalPanel.add(modifiedAtHTML);
    typeHorizontalPanel.add(typeHTML);

    nameHorizontalPanel.addStyleName(FolderManagementConstants.CURSOR_HAND);
    modifiedHorizontalPanel.addStyleName(FolderManagementConstants.CURSOR_HAND);
    typeHorizontalPanel.addStyleName(FolderManagementConstants.CURSOR_HAND);
    nameHTML.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent arg0) {
            nameOrderAscending = toggleSortingAnchor(nameHorizontalPanel, nameOrderAscending);
            lastSortingOption = SortingOption.NAME;
            updateTableContent(presenter.getFolderPath());
        }

    });
    modifiedAtHTML.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent arg0) {
            dateOrderAscending = toggleSortingAnchor(modifiedHorizontalPanel, dateOrderAscending);
            lastSortingOption = SortingOption.DATE;
            updateTableContent(presenter.getFolderPath());
        }
    });
    typeHTML.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent arg0) {
            typeOrderAscending = toggleSortingAnchor(typeHorizontalPanel, typeOrderAscending);
            lastSortingOption = SortingOption.TYPE;
            updateTableContent(presenter.getFolderPath());
        }

    });

    headers.setWidget(0, 1, nameHorizontalPanel);
    headers.setWidget(0, 2, modifiedHorizontalPanel);
    headers.setWidget(0, 3, typeHorizontalPanel);
    headers.getCellFormatter().addStyleName(0, 0, FolderManagementConstants.FILES_TABLE_SMALL_COLUMN
            + FolderManagementConstants.SPACE + FolderManagementConstants.FILES_TABLE_HEADER_CELL);
    headers.getCellFormatter().addStyleName(0, 1, FolderManagementConstants.FILES_TABLE_HEADER_CELL);
    headers.getCellFormatter().addStyleName(0, 2, FolderManagementConstants.FILES_TABLE_HEADER_CELL);
    headers.getCellFormatter().addStyleName(0, 3, FolderManagementConstants.FILES_TABLE_HEADER_CELL);
    headers.getColumnFormatter().setWidth(0, PERCENTAGE_FIVE);
    headers.getColumnFormatter().setWidth(1, PERCENTAGE_FOURTY_EIGHT);
    headers.getColumnFormatter().setWidth(2, PERCENTAGE_TWENTY_EIGHT);
    headers.getColumnFormatter().setWidth(3, PERCENTAGE_ELEVEN);
    headers.setWidth(PERCENTAGE_HUNDRED);
}

From source file:com.ephesoft.dcma.gwt.foldermanager.client.view.FolderTableView.java

License:Open Source License

private void showTableOptions() {
    folderUploadWidget.setVisible(true);
    if (multipleSelectionPanel == null) {
        multipleSelectionPanel = new VerticalPanel();
        HorizontalPanel labelPanel = new HorizontalPanel();
        Label label = new Label(
                LocaleDictionary.get().getMessageValue(FolderManagementMessages.MULTI_SELECT_OPTIONS));
        labelPanel.add(label);/*ww w  .  j  a  v  a 2s .  c  om*/
        labelPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
        multipleSelectionPanel.add(labelPanel);
        HorizontalPanel multipleSelectionButtonPanel = new HorizontalPanel();
        multipleSelectionPanel.add(multipleSelectionButtonPanel);
        multipleSelectionButtonPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
        multipleSelectionButtonPanel.add(cut);
        multipleSelectionButtonPanel.add(copy);
        multipleSelectionButtonPanel.add(paste);
        multipleSelectionButtonPanel.add(deleteSelected);
        multipleSelectionButtonPanel.setSpacing(2);
    }
    if (folderPathOperationsPanel == null) {
        folderPathOperationsPanel = new VerticalPanel();
        HorizontalPanel folderLabelPanel = new HorizontalPanel();
        Label label = new Label(LocaleDictionary.get().getConstantValue(FolderManagementConstants.FOLDER));
        folderLabelPanel.add(label);
        folderLabelPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
        HorizontalPanel folderPathOperationButtonsPanel = new HorizontalPanel();
        folderPathOperationButtonsPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
        folderPathOperationButtonsPanel.setSpacing(2);
        createNewFolder.setWidth(_100PX);
        folderPathOperationButtonsPanel.add(createNewFolder);
        folderPathOperationButtonsPanel.add(folderUpButton);
        folderPathOperationButtonsPanel.add(refresh);
        folderPathOperationsPanel.add(folderLabelPanel);
        folderPathOperationsPanel.add(folderPathOperationButtonsPanel);
    }
    optionsPanel.add(folderPathOperationsPanel);
    optionsPanel.setCellHorizontalAlignment(folderPathOperationsPanel, HasHorizontalAlignment.ALIGN_LEFT);
    optionsPanel.add(folderUploadWidget);
    optionsPanel.setCellHorizontalAlignment(folderUploadWidget, HasHorizontalAlignment.ALIGN_CENTER);
    optionsPanel.add(multipleSelectionPanel);
    optionsPanel.setCellHorizontalAlignment(multipleSelectionPanel, HasHorizontalAlignment.ALIGN_RIGHT);
    optionsPanel.addStyleName(OPTIONS_CSS);
}

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  . j  a  v a2  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.foldermanager.client.view.widget.DisplayDialogBox.java

License:Open Source License

public DisplayDialogBox(Map<Integer, String> fileIndexVsNameMap, final HandlerManager eventBus) {
    super();/* ww w .j av a  2s  .c om*/
    setWidget(BINDER.createAndBindUi(this));
    this.eventBus = eventBus;
    final VerticalPanel labelPanel = new VerticalPanel();
    if (fileIndexVsNameMap != null && !fileIndexVsNameMap.isEmpty()) {
        for (final Entry<Integer, String> labelString : fileIndexVsNameMap.entrySet()) {
            totalCounter++;
            final HorizontalPanel horizontalPanel = new HorizontalPanel();
            HTML html = new HTML(FolderManagementConstants.REMOVE_ICON_FOLDER_GIF);
            Label label = new Label(labelString.getValue());
            horizontalPanel.add(html);
            horizontalPanel.add(label);
            horizontalPanel.setSpacing(3);
            labelPanel.add(horizontalPanel);
            html.addClickHandler(new ClickHandler() {

                @Override
                public void onClick(ClickEvent arg0) {
                    labelPanel.remove(horizontalPanel);
                    if (--totalCounter == 0) {
                        addNoFilesLabel(labelPanel);
                    }
                    eventBus.fireEvent(new RemoveAttachmentEvent(labelString.getKey()));
                }

            });

        }
    } else {
        addNoFilesLabel(labelPanel);
    }
    addStyleName(FolderManagementConstants.CSS_CONFIGURABLE_DIALOG_BOX);
    Button closeButton = new Button(LocaleDictionary.get().getConstantValue(FolderManagementConstants.CLOSE),
            new ClickHandler() {

                @Override
                public void onClick(ClickEvent arg0) {
                    hide();
                }
            });
    HorizontalPanel horizontalButtonPanel = new HorizontalPanel();
    horizontalButtonPanel.add(closeButton);
    horizontalButtonPanel.setCellHorizontalAlignment(closeButton, HasHorizontalAlignment.ALIGN_CENTER);
    ScrollPanel scrollPanel = new ScrollPanel();
    scrollPanel.add(labelPanel);
    scrollPanel.setWidth(_200PX);
    scrollPanel.setHeight(_200PX);
    scrollPanel.addStyleName(FolderManagementConstants.BORDER);
    setHeight(_100PX);
    verticalPanel.add(scrollPanel);
    verticalPanel.add(horizontalButtonPanel);
    verticalPanel.setCellHorizontalAlignment(horizontalButtonPanel, HasHorizontalAlignment.ALIGN_CENTER);
    setModal(true);
    setVisible(true);
    show();
    center();
    closeButton.setFocus(true);
}