use of com.google.gwt.cell.client.TextCell in project kie-wb-common by kiegroup.
the class ContainerConfigParamsView method addArtifactIdColumn.
private void addArtifactIdColumn() {
Column<ContainerConfig, String> column = new Column<ContainerConfig, String>(new TextCell()) {
@Override
public String getValue(ContainerConfig containerConfig) {
return containerConfig.getArtifactId();
}
};
dataGrid.addColumn(column, translationService.getTranslation(ContainerConfigParamsView_ArtifactIdColumn));
}
use of com.google.gwt.cell.client.TextCell in project mvp4g2-examples by mvp4g.
the class ListView method createView.
public void createView() {
panel = new ScrollPanel();
FlowPanel resultPanel = new FlowPanel();
resultPanel.addStyleName(style.resultPanel());
panel.add(resultPanel);
Label headline = new Label(ApplicationConstants.CONSTANTS.resultHeadline());
headline.addStyleName(style.headline());
resultPanel.add(headline);
resultTable = new CellTable<Person>();
resultPanel.add(resultTable);
resultTable.setEmptyTableWidget(new HTML(ApplicationConstants.CONSTANTS.resultText()));
Column<Person, String> nameColumn = addColumn(new ClickableTextCell(), ApplicationConstants.CONSTANTS.columnName(), new GetValue<String>() {
@Override
public String getValue(Person person) {
return person.getName() + ", " + person.getFirstName();
}
}, new FieldUpdater<Person, String>() {
@Override
public void update(int index, Person object, String value) {
getPresenter().doUpdate(object);
}
});
Column<Person, String> streetColumn = addColumn(new TextCell(), ApplicationConstants.CONSTANTS.columnStreet(), new GetValue<String>() {
@Override
public String getValue(Person person) {
return person.getAddress().getStreet();
}
}, null);
Column<Person, String> plzColumn = addColumn(new TextCell(), ApplicationConstants.CONSTANTS.columnPlz(), new GetValue<String>() {
@Override
public String getValue(Person person) {
return person.getAddress().getZip();
}
}, null);
plzColumn.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
Column<Person, String> cityColumn = addColumn(new TextCell(), ApplicationConstants.CONSTANTS.columnCity(), new GetValue<String>() {
@Override
public String getValue(Person person) {
return person.getAddress().getCity();
}
}, null);
// Tabellen und Spalten-Breite setzen
resultTable.setWidth("100%");
resultTable.setColumnWidth(nameColumn, "40%");
resultTable.setColumnWidth(streetColumn, "25%");
resultTable.setColumnWidth(plzColumn, "10%");
resultTable.setColumnWidth(cityColumn, "25%");
resetTable();
}
use of com.google.gwt.cell.client.TextCell in project perun by CESNET.
the class JsonUtils method addColumn.
/**
* Returns a column with a header and with automatic cell selection
*
* @param <R> the row type
* @param getter the value getter for the cell
* @param fieldUpdater Field updater - on click action
*/
public static <R> Column<R, String> addColumn(final GetValue<R, String> getter, final FieldUpdater<R, String> fieldUpdater) {
Cell<String> cell;
if (fieldUpdater == null) {
cell = new TextCell();
} else {
cell = new CustomClickableTextCell();
}
Column<R, String> column = new Column<R, String>(cell) {
@Override
public String getValue(R object) {
return getter.getValue(object);
}
@Override
public String getCellStyleNames(Cell.Context context, R object) {
if (fieldUpdater != null) {
return super.getCellStyleNames(context, object) + " pointer";
} else {
return super.getCellStyleNames(context, object);
}
}
};
if (fieldUpdater != null) {
column.setFieldUpdater(fieldUpdater);
}
return column;
}
Aggregations