Example usage for com.google.gwt.user.cellview.client Column setSortable

List of usage examples for com.google.gwt.user.cellview.client Column setSortable

Introduction

In this page you can find the example usage for com.google.gwt.user.cellview.client Column setSortable.

Prototype

public void setSortable(boolean sortable) 

Source Link

Document

Set whether or not the column can be sorted.

Usage

From source file:org.kie.workbench.common.stunner.bpmn.client.forms.fields.notificationsEditor.widget.NotificationWidgetViewImpl.java

License:Apache License

private void initBody() {
    PopoverTextCell typeCell = new PopoverTextCell();
    Column<NotificationRow, String> bodyColumn = new Column<NotificationRow, String>(typeCell) {
        @Override//  ww  w .ja v  a 2s.  c  o m
        public String getValue(NotificationRow object) {
            if (object.getBody() != null) {
                return object.getBody();
            }
            return "";
        }
    };
    bodyColumn.setSortable(false);
    table.addColumn(bodyColumn, presenter.getBodyLabel());
    table.setColumnWidth(bodyColumn, 190, Style.Unit.PX);
}

From source file:org.kie.workbench.common.stunner.bpmn.client.forms.fields.notificationsEditor.widget.NotificationWidgetViewImpl.java

License:Apache License

private void initType() {
    TextCell typeCell = new TextCell();
    Column<NotificationRow, String> typeColumn = new Column<NotificationRow, String>(typeCell) {
        @Override/* w  ww  .j a va2s.c  o m*/
        public String getValue(NotificationRow object) {
            if (object.getType() != null) {
                return object.getType().getType();
            }
            return "";
        }
    };
    typeColumn.setSortable(false);
    table.addColumn(typeColumn, presenter.getTypeLabel());
    table.setColumnWidth(typeColumn, 80, Style.Unit.PX);
}

From source file:org.kie.workbench.common.stunner.bpmn.client.forms.fields.notificationsEditor.widget.NotificationWidgetViewImpl.java

License:Apache License

private void initDelete() {
    AbstractCell<NotificationRow> buttonCell = new AbstractCell<NotificationRow>(
            ClickEvent.getType().getName()) {
        @Override/*  w  w w.  ja  v a2 s . c  om*/
        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);
}

From source file:org.kie.workbench.common.stunner.bpmn.client.forms.fields.notificationsEditor.widget.NotificationWidgetViewImpl.java

License:Apache License

private void initEdit() {
    AbstractCell<NotificationRow> buttonCell = new AbstractCell<NotificationRow>(
            ClickEvent.getType().getName()) {
        @Override/*from   w w  w.  j av  a 2s.  c om*/
        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.INSTANCE.Edit());
    table.setColumnWidth(editColumn, 50, Style.Unit.PX);
}

From source file:org.kie.workbench.common.stunner.bpmn.client.forms.fields.reassignmentsEditor.widget.ReassignmentWidgetViewImpl.java

License:Apache License

private void initUsers() {
    PopoverTextCell toUsers = new PopoverTextCell();
    Column<ReassignmentRow, String> toUsersColumn = new Column<ReassignmentRow, String>(toUsers) {
        @Override//from   w  ww.ja  v a2s . co  m
        public String getValue(ReassignmentRow object) {
            if (object.getUsers() != null) {
                return object.getUsers().stream().collect(Collectors.joining(","));
            } else {
                return "";
            }
        }
    };
    toUsersColumn.setSortable(false);
    table.addColumn(toUsersColumn, presenter.getToUsersLabel());
    table.setColumnWidth(toUsersColumn, 250, Style.Unit.PX);
}

From source file:org.kie.workbench.common.stunner.bpmn.client.forms.fields.reassignmentsEditor.widget.ReassignmentWidgetViewImpl.java

License:Apache License

private void initGroups() {
    PopoverTextCell toGroups = new PopoverTextCell();
    Column<ReassignmentRow, String> toGroupsColumn = new Column<ReassignmentRow, String>(toGroups) {
        @Override/*  w  w  w .  jav  a 2s . c  om*/
        public String getValue(ReassignmentRow object) {
            if (object.getGroups() != null) {
                return object.getGroups().stream().collect(Collectors.joining(","));
            } else {
                return "";
            }
        }
    };
    toGroupsColumn.setSortable(false);
    table.addColumn(toGroupsColumn, presenter.getToGroupsLabel());
    table.setColumnWidth(toGroupsColumn, 150, Style.Unit.PX);
}

From source file:org.kie.workbench.common.stunner.bpmn.client.forms.fields.reassignmentsEditor.widget.ReassignmentWidgetViewImpl.java

License:Apache License

private void initExpiresAt() {
    TextCell expiresAt = new TextCell();
    Column<ReassignmentRow, String> expiresAtColumn = new Column<ReassignmentRow, String>(expiresAt) {
        @Override/* w  w w.j a va2s. c  o  m*/
        public String getValue(ReassignmentRow object) {
            if (object.getDuration() != null) {
                return object.getDuration();
            }
            return "";
        }
    };
    expiresAtColumn.setSortable(false);
    table.addColumn(expiresAtColumn, presenter.getExpiresAtLabel());
    table.setColumnWidth(expiresAtColumn, 80, Style.Unit.PX);
}

From source file:org.kie.workbench.common.stunner.bpmn.client.forms.fields.reassignmentsEditor.widget.ReassignmentWidgetViewImpl.java

License:Apache License

private void initType() {
    TextCell typeCell = new TextCell();
    Column<ReassignmentRow, String> typeColumn = new Column<ReassignmentRow, String>(typeCell) {
        @Override/*from ww w .j a v  a  2 s .c o m*/
        public String getValue(ReassignmentRow object) {
            if (object.getType() != null) {
                return object.getType().getType();
            }
            return "";
        }
    };
    typeColumn.setSortable(false);
    table.addColumn(typeColumn, presenter.getTypeLabel());
    table.setColumnWidth(typeColumn, 140, Style.Unit.PX);
}

From source file:org.kie.workbench.common.stunner.bpmn.client.forms.fields.reassignmentsEditor.widget.ReassignmentWidgetViewImpl.java

License:Apache License

private void initDelete() {
    AbstractCell<ReassignmentRow> buttonCell = new AbstractCell<ReassignmentRow>(
            ClickEvent.getType().getName()) {
        @Override// ww w  .java2  s.  c o m
        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);
}

From source file:org.kie.workbench.common.stunner.bpmn.client.forms.fields.reassignmentsEditor.widget.ReassignmentWidgetViewImpl.java

License:Apache License

private void initEdit() {
    AbstractCell<ReassignmentRow> buttonCell = new AbstractCell<ReassignmentRow>(
            ClickEvent.getType().getName()) {
        @Override/* ww  w .  j  a  v a2s  .c  o  m*/
        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.INSTANCE.Edit());
    table.setColumnWidth(editColumn, 50, Style.Unit.PX);
}