Search in sources :

Example 6 with BaseModal

use of org.uberfire.ext.widgets.common.client.common.popups.BaseModal in project kie-wb-common by kiegroup.

the class DataSourceSelectorViewImpl method init.

@PostConstruct
private void init() {
    dataGrid.setHeight("200px");
    dataGrid.setColumnPickerButtonVisible(false);
    dataGrid.setEmptyTableCaption(translationService.getTranslation(DataSourceManagementConstants.DataSourceSelector_NoAvailableDataSourcesMessage));
    Column<DataSourceSelectorPageRow, String> nameColumn = new Column<DataSourceSelectorPageRow, String>(new TextCell()) {

        @Override
        public String getValue(DataSourceSelectorPageRow row) {
            return row.getDataSourceDefInfo().getName();
        }
    };
    dataGrid.addColumn(nameColumn, translationService.getTranslation(DataSourceManagementConstants.DataSourceSelector_DataSourceColumn));
    Column<DataSourceSelectorPageRow, String> selectorColumn = new Column<DataSourceSelectorPageRow, String>(new ButtonCell(ButtonType.PRIMARY, ButtonSize.SMALL)) {

        @Override
        public String getValue(DataSourceSelectorPageRow row) {
            return translationService.getTranslation(DataSourceManagementConstants.DataSourceSelector_SelectButton);
        }
    };
    selectorColumn.setFieldUpdater(new FieldUpdater<DataSourceSelectorPageRow, String>() {

        @Override
        public void update(int index, DataSourceSelectorPageRow row, String value) {
            selectedRow = row;
            cancelNextHiddenEvent = true;
            modal.hide();
            presenter.onSelect();
        }
    });
    dataGrid.addColumn(selectorColumn, "");
    mainPanel.add(dataGrid);
    this.modal = new BaseModal();
    this.modal.setTitle(translationService.getTranslation(DataSourceManagementConstants.DataSourceSelector_Title));
    this.modal.setBody(this);
    this.modal.addHiddenHandler(new ModalHiddenHandler() {

        @Override
        public void onHidden(ModalHiddenEvent evt) {
            if (!cancelNextHiddenEvent) {
                presenter.onClose();
            }
            cancelNextHiddenEvent = false;
        }
    });
}
Also used : BaseModal(org.uberfire.ext.widgets.common.client.common.popups.BaseModal) Column(com.google.gwt.user.cellview.client.Column) ModalHiddenHandler(org.gwtbootstrap3.client.shared.event.ModalHiddenHandler) ButtonCell(org.gwtbootstrap3.client.ui.gwt.ButtonCell) ModalHiddenEvent(org.gwtbootstrap3.client.shared.event.ModalHiddenEvent) TextCell(com.google.gwt.cell.client.TextCell) PostConstruct(javax.annotation.PostConstruct)

Example 7 with BaseModal

use of org.uberfire.ext.widgets.common.client.common.popups.BaseModal in project kie-wb-common by kiegroup.

the class NewResourceViewImpl method init.

@PostConstruct
public void init() {
    modal = new BaseModal();
    modal.setBody(ElementWrapperWidget.getWidget(this.getElement()));
    modal.add(footer);
    fileNameTextBox.setPlaceholder(translationService.getTranslation(KieWorkbenchWidgetsConstants.NewResourceViewResourceNamePlaceholder));
    fileTypeLabel.setShowRequiredIndicator(true);
}
Also used : BaseModal(org.uberfire.ext.widgets.common.client.common.popups.BaseModal) PostConstruct(javax.annotation.PostConstruct)

Example 8 with BaseModal

use of org.uberfire.ext.widgets.common.client.common.popups.BaseModal in project kie-wb-common by kiegroup.

the class ChangesNotificationDisplayerViewImpl method init.

@PostConstruct
public void init() {
    modal = new BaseModal();
    modal.setTitle(translationService.getTranslation(FormEditorConstants.ChangesNotificationDisplayerTitle));
    modal.setBody(ElementWrapperWidget.getWidget(this.getElement()));
    modal.add(footer);
}
Also used : BaseModal(org.uberfire.ext.widgets.common.client.common.popups.BaseModal) PostConstruct(javax.annotation.PostConstruct)

Example 9 with BaseModal

use of org.uberfire.ext.widgets.common.client.common.popups.BaseModal in project kie-wb-common by kiegroup.

the class FieldPropertiesRendererViewImpl method init.

@PostConstruct
protected void init() {
    modal = new BaseModal();
    modal.setClosable(false);
    modal.setBody(this);
    modal.add(new ModalFooterOKCancelButtons(this::maybeOk, this::close));
    modal.addHideHandler(evt -> presenter.onClose());
    formContent.add(formRenderer);
}
Also used : BaseModal(org.uberfire.ext.widgets.common.client.common.popups.BaseModal) ModalFooterOKCancelButtons(org.uberfire.ext.widgets.common.client.common.popups.footers.ModalFooterOKCancelButtons) PostConstruct(javax.annotation.PostConstruct)

Aggregations

BaseModal (org.uberfire.ext.widgets.common.client.common.popups.BaseModal)9 PostConstruct (javax.annotation.PostConstruct)7 ModalFooterOKCancelButtons (org.uberfire.ext.widgets.common.client.common.popups.footers.ModalFooterOKCancelButtons)2 TextCell (com.google.gwt.cell.client.TextCell)1 Column (com.google.gwt.user.cellview.client.Column)1 Command (com.google.gwt.user.client.Command)1 ModalHiddenEvent (org.gwtbootstrap3.client.shared.event.ModalHiddenEvent)1 ModalHiddenHandler (org.gwtbootstrap3.client.shared.event.ModalHiddenHandler)1 ButtonCell (org.gwtbootstrap3.client.ui.gwt.ButtonCell)1 ModalFooterOKButton (org.uberfire.ext.widgets.common.client.common.popups.footers.ModalFooterOKButton)1 ModalFooterYesNoCancelButtons (org.uberfire.ext.widgets.common.client.common.popups.footers.ModalFooterYesNoCancelButtons)1