Search in sources :

Example 1 with AbstractCell

use of com.google.gwt.cell.client.AbstractCell in project kie-wb-common by kiegroup.

the class NotificationWidgetViewImpl method initDelete.

private void initDelete() {
    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.TRASH));
            sb.append(SafeHtmlUtils.fromTrustedString(button.toString()));
        }

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

        @Override
        public NotificationRow getValue(NotificationRow 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) 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 2 with AbstractCell

use of com.google.gwt.cell.client.AbstractCell 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 3 with AbstractCell

use of com.google.gwt.cell.client.AbstractCell 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 4 with AbstractCell

use of com.google.gwt.cell.client.AbstractCell 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)

Aggregations

AbstractCell (com.google.gwt.cell.client.AbstractCell)4 ValueUpdater (com.google.gwt.cell.client.ValueUpdater)4 Element (com.google.gwt.dom.client.Element)4 NativeEvent (com.google.gwt.dom.client.NativeEvent)4 SafeHtmlBuilder (com.google.gwt.safehtml.shared.SafeHtmlBuilder)4 Column (com.google.gwt.user.cellview.client.Column)4 HTMLButtonElement (elemental2.dom.HTMLButtonElement)4 Button (org.gwtbootstrap3.client.ui.Button)4 Icon (org.gwtbootstrap3.client.ui.Icon)4 NotificationRow (org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.NotificationRow)2 ReassignmentRow (org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.ReassignmentRow)2