use of org.gwtbootstrap3.client.ui.gwt.ButtonCell 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, "");
}
use of org.gwtbootstrap3.client.ui.gwt.ButtonCell in project kie-wb-common by kiegroup.
the class DatabaseSchemaExplorerViewImpl method addOpenColumn.
private void addOpenColumn() {
Column<DatabaseSchemaRow, String> column = new Column<DatabaseSchemaRow, String>(new ButtonCell(ButtonType.DEFAULT, ButtonSize.SMALL)) {
@Override
public String getValue(DatabaseSchemaRow row) {
return translationService.getTranslation(DataSourceManagementConstants.DatabaseSchemaExplorerViewImpl_schemaOpenAction);
}
};
column.setFieldUpdater(new FieldUpdater<DatabaseSchemaRow, String>() {
@Override
public void update(int index, DatabaseSchemaRow row, String value) {
onOpen(row);
}
});
dataGrid.addColumn(column, translationService.getTranslation(DataSourceManagementConstants.DatabaseSchemaExplorerViewImpl_actionColumn));
dataGrid.setColumnWidth(column, 10, Style.Unit.PCT);
}
use of org.gwtbootstrap3.client.ui.gwt.ButtonCell 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);
}
use of org.gwtbootstrap3.client.ui.gwt.ButtonCell 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);
}
use of org.gwtbootstrap3.client.ui.gwt.ButtonCell 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);
}
Aggregations