Search in sources :

Example 36 with Column

use of org.gwtbootstrap3.client.ui.Column in project kie-wb-common by kiegroup.

the class ActivityDataIOEditorViewImpl method init.

public void init(final Presenter presenter) {
    this.presenter = presenter;
    container.setFluid(true);
    container.add(row);
    row.add(column);
    setTitle(StunnerFormsClientFieldsConstants.CONSTANTS.Data_IO());
    inputAssignmentsWidget.setVariableType(Variable.VariableType.INPUT);
    inputAssignmentsWidget.setNotifier(this);
    inputAssignmentsWidget.setAllowDuplicateNames(false, StunnerFormsClientFieldsConstants.CONSTANTS.A_Data_Input_with_this_name_already_exists());
    column.add(inputAssignmentsWidget.getWidget());
    outputAssignmentsWidget.setVariableType(Variable.VariableType.OUTPUT);
    outputAssignmentsWidget.setNotifier(this);
    outputAssignmentsWidget.setAllowDuplicateNames(true, "");
    column.add(outputAssignmentsWidget.getWidget());
    final Row btnRow = new Row();
    btnRow.getElement().getStyle().setMarginTop(10, Style.Unit.PX);
    final Column btnColumn = new Column(ColumnSize.MD_12);
    btnRow.add(btnColumn);
    btnOk = new Button(StunnerFormsClientFieldsConstants.CONSTANTS.Ok());
    btnOk.setType(ButtonType.PRIMARY);
    btnOk.setPull(Pull.RIGHT);
    btnOk.addClickHandler(clickEvent -> presenter.handleOkClick());
    btnColumn.add(btnOk);
    btnCancel = new Button(StunnerFormsClientFieldsConstants.CONSTANTS.Cancel());
    btnCancel.setPull(Pull.RIGHT);
    btnCancel.addClickHandler(event -> presenter.handleCancelClick());
    btnColumn.add(btnCancel);
    container.add(btnRow);
    setWidth("1200px");
    setBody(container);
}
Also used : Column(org.gwtbootstrap3.client.ui.Column) Button(org.gwtbootstrap3.client.ui.Button) AssignmentRow(org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.AssignmentRow) Row(org.gwtbootstrap3.client.ui.Row)

Example 37 with Column

use of org.gwtbootstrap3.client.ui.Column in project kie-wb-common by kiegroup.

the class ReassignmentWidgetViewImpl method initDelete.

private void initDelete() {
    AbstractCell<ReassignmentRow> buttonCell = new AbstractCell<ReassignmentRow>(ClickEvent.getType().getName()) {

        @Override
        public void render(Context context, ReassignmentRow value, SafeHtmlBuilder sb) {
            Button button = new Button();
            button.setSize(ButtonSize.SMALL);
            button.add(new Icon(IconType.REMOVE));
            sb.append(SafeHtmlUtils.fromTrustedString(button.toString()));
        }

        @Override
        public void onBrowserEvent(Context context, Element parent, ReassignmentRow value, NativeEvent event, ValueUpdater<ReassignmentRow> valueUpdater) {
            if (!readOnly) {
                delete(value);
            }
        }
    };
    Column<ReassignmentRow, ReassignmentRow> deleteColumn = new Column<ReassignmentRow, ReassignmentRow>(buttonCell) {

        @Override
        public ReassignmentRow getValue(ReassignmentRow object) {
            return object;
        }
    };
    deleteColumn.setSortable(false);
    table.addColumn(deleteColumn, presenter.getDeleteLabel());
    table.setColumnWidth(deleteColumn, 60, Style.Unit.PX);
}
Also used : Button(org.gwtbootstrap3.client.ui.Button) ValueUpdater(com.google.gwt.cell.client.ValueUpdater) Column(com.google.gwt.user.cellview.client.Column) HTMLButtonElement(elemental2.dom.HTMLButtonElement) Element(com.google.gwt.dom.client.Element) AbstractCell(com.google.gwt.cell.client.AbstractCell) Icon(org.gwtbootstrap3.client.ui.Icon) SafeHtmlBuilder(com.google.gwt.safehtml.shared.SafeHtmlBuilder) ReassignmentRow(org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.ReassignmentRow) NativeEvent(com.google.gwt.dom.client.NativeEvent)

Example 38 with Column

use of org.gwtbootstrap3.client.ui.Column in project kie-wb-common by kiegroup.

the class NotificationWidgetViewImpl method initEdit.

private void initEdit() {
    AbstractCell<NotificationRow> buttonCell = new AbstractCell<NotificationRow>(ClickEvent.getType().getName()) {

        @Override
        public void render(Context context, NotificationRow value, SafeHtmlBuilder sb) {
            Button button = new Button();
            button.setSize(ButtonSize.SMALL);
            button.add(new Icon(IconType.EDIT));
            sb.append(SafeHtmlUtils.fromTrustedString(button.toString()));
        }

        @Override
        public void onBrowserEvent(Context context, Element parent, NotificationRow value, NativeEvent event, ValueUpdater<NotificationRow> valueUpdater) {
            if (!readOnly) {
                addOrEdit(value);
            }
        }
    };
    Column<NotificationRow, NotificationRow> editColumn = new Column<NotificationRow, NotificationRow>(buttonCell) {

        @Override
        public NotificationRow getValue(NotificationRow object) {
            return object;
        }
    };
    editColumn.setSortable(false);
    table.addColumn(editColumn, StunnerFormsClientFieldsConstants.CONSTANTS.Edit());
    table.setColumnWidth(editColumn, 50, Style.Unit.PX);
}
Also used : Button(org.gwtbootstrap3.client.ui.Button) ValueUpdater(com.google.gwt.cell.client.ValueUpdater) Column(com.google.gwt.user.cellview.client.Column) HTMLButtonElement(elemental2.dom.HTMLButtonElement) Element(com.google.gwt.dom.client.Element) NotificationRow(org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.NotificationRow) AbstractCell(com.google.gwt.cell.client.AbstractCell) Icon(org.gwtbootstrap3.client.ui.Icon) SafeHtmlBuilder(com.google.gwt.safehtml.shared.SafeHtmlBuilder) NativeEvent(com.google.gwt.dom.client.NativeEvent)

Example 39 with Column

use of org.gwtbootstrap3.client.ui.Column in project kie-wb-common by kiegroup.

the class ReassignmentWidgetViewImpl method initEdit.

private void initEdit() {
    AbstractCell<ReassignmentRow> buttonCell = new AbstractCell<ReassignmentRow>(ClickEvent.getType().getName()) {

        @Override
        public void render(Context context, ReassignmentRow value, SafeHtmlBuilder sb) {
            Button button = new Button();
            button.setSize(ButtonSize.SMALL);
            button.add(new Icon(IconType.EDIT));
            sb.append(SafeHtmlUtils.fromTrustedString(button.toString()));
        }

        @Override
        public void onBrowserEvent(Context context, Element parent, ReassignmentRow value, NativeEvent event, ValueUpdater<ReassignmentRow> valueUpdater) {
            if (!readOnly) {
                addOrEdit(value);
            }
        }
    };
    Column<ReassignmentRow, ReassignmentRow> editColumn = new Column<ReassignmentRow, ReassignmentRow>(buttonCell) {

        @Override
        public ReassignmentRow getValue(ReassignmentRow object) {
            return object;
        }
    };
    editColumn.setSortable(false);
    table.addColumn(editColumn, StunnerFormsClientFieldsConstants.CONSTANTS.Edit());
    table.setColumnWidth(editColumn, 50, Style.Unit.PX);
}
Also used : Button(org.gwtbootstrap3.client.ui.Button) ValueUpdater(com.google.gwt.cell.client.ValueUpdater) Column(com.google.gwt.user.cellview.client.Column) HTMLButtonElement(elemental2.dom.HTMLButtonElement) Element(com.google.gwt.dom.client.Element) AbstractCell(com.google.gwt.cell.client.AbstractCell) Icon(org.gwtbootstrap3.client.ui.Icon) SafeHtmlBuilder(com.google.gwt.safehtml.shared.SafeHtmlBuilder) ReassignmentRow(org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.ReassignmentRow) NativeEvent(com.google.gwt.dom.client.NativeEvent)

Example 40 with Column

use of org.gwtbootstrap3.client.ui.Column in project kie-wb-common by kiegroup.

the class CrudComponentViewImpl method showDeleteButtons.

@Override
public void showDeleteButtons() {
    final Column<MODEL, String> column = new Column<MODEL, String>(new ButtonCell(IconType.TRASH, ButtonType.DANGER, ButtonSize.SMALL)) {

        @Override
        public String getValue(final MODEL model) {
            return translationService.getTranslation(CrudComponentConstants.CrudComponentViewImplDeleteInstance);
        }
    };
    column.setFieldUpdater(new FieldUpdater<MODEL, String>() {

        @Override
        public void update(final int index, final Object model, final String s) {
            if (Window.confirm(translationService.getTranslation(CrudComponentConstants.CrudComponentViewImplDeleteBody))) {
                presenter.deleteInstance(index);
            }
        }
    });
    table.addColumn(column, "");
}
Also used : Column(com.google.gwt.user.cellview.client.Column) ButtonCell(org.gwtbootstrap3.client.ui.gwt.ButtonCell)

Aggregations

Column (org.gwtbootstrap3.client.ui.Column)30 Row (org.gwtbootstrap3.client.ui.Row)24 Column (com.google.gwt.user.cellview.client.Column)17 ButtonCell (org.gwtbootstrap3.client.ui.gwt.ButtonCell)12 DListElement (com.google.gwt.dom.client.DListElement)10 Button (org.gwtbootstrap3.client.ui.Button)9 TextColumn (com.google.gwt.user.cellview.client.TextColumn)8 Element (com.google.gwt.dom.client.Element)5 IsWidget (com.google.gwt.user.client.ui.IsWidget)5 AbstractIconTypeColumn (org.ovirt.engine.ui.common.widget.table.column.AbstractIconTypeColumn)5 AbstractCell (com.google.gwt.cell.client.AbstractCell)4 ValueUpdater (com.google.gwt.cell.client.ValueUpdater)4 NativeEvent (com.google.gwt.dom.client.NativeEvent)4 SafeHtmlBuilder (com.google.gwt.safehtml.shared.SafeHtmlBuilder)4 HTMLButtonElement (elemental2.dom.HTMLButtonElement)4 Container (org.gwtbootstrap3.client.ui.Container)4 Icon (org.gwtbootstrap3.client.ui.Icon)4 Label (org.gwtbootstrap3.client.ui.Label)4 CellTable (com.google.gwt.user.cellview.client.CellTable)3 ListDataProvider (com.google.gwt.view.client.ListDataProvider)3