use of com.google.gwt.cell.client.TextCell in project che by eclipse.
the class HistoryViewImpl method createRevisionsTable.
private void createRevisionsTable(org.eclipse.che.ide.Resources coreRes) {
Column<Revision, String> idColumn = new Column<Revision, String>(new TextCell()) {
@Override
public String getValue(Revision revision) {
return revision.getId().substring(0, 8) + "...";
}
};
Column<Revision, String> timeColumn = new Column<Revision, String>(new TextCell()) {
@Override
public String getValue(Revision revision) {
return dateTimeFormatter.getFormattedDate(revision.getCommitTime());
}
};
Column<Revision, String> authorColumn = new Column<Revision, String>(new TextCell()) {
@Override
public String getValue(Revision revision) {
return revision.getCommitter().getName();
}
};
Column<Revision, String> titleColumn = new Column<Revision, String>(new TextCell()) {
@Override
public String getValue(Revision revision) {
return revision.getMessage().substring(0, 50);
}
};
revisions = new CellTable<>(15, coreRes);
revisions.setWidth("100%");
revisions.addColumn(idColumn, locale.viewCompareRevisionTableIdTitle());
revisions.addColumn(timeColumn, locale.viewCompareRevisionTableTimeTitle());
revisions.addColumn(authorColumn, locale.viewCompareRevisionTableAuthorTitle());
revisions.addColumn(titleColumn, locale.viewCompareRevisionTableTitleTitle());
selectionModel = new SingleSelectionModel<Revision>();
selectionModel.addSelectionChangeHandler(new SelectionChangeEvent.Handler() {
@Override
public void onSelectionChange(SelectionChangeEvent event) {
description.setText(selectionModel.getSelectedObject().getMessage());
delegate.onRevisionSelected(selectionModel.getSelectedObject());
}
});
revisions.setSelectionModel(selectionModel);
revisions.addDomHandler(new DoubleClickHandler() {
@Override
public void onDoubleClick(DoubleClickEvent event) {
delegate.onRevisionDoubleClicked();
}
}, DoubleClickEvent.getType());
this.revisionsPanel.add(revisions);
}
use of com.google.gwt.cell.client.TextCell in project che by eclipse.
the class ResetToCommitViewImpl method createCommitsTable.
/** Creates table what contains list of available commits. */
private void createCommitsTable() {
commits = new CellTable<Revision>(15, tableRes);
Column<Revision, String> dateColumn = new Column<Revision, String>(new TextCell()) {
@Override
public String getValue(Revision revision) {
return DateTimeFormat.getFormat(DateTimeFormat.PredefinedFormat.DATE_TIME_MEDIUM).format(new Date((long) revision.getCommitTime()));
}
@Override
public void render(Cell.Context context, Revision revision, SafeHtmlBuilder sb) {
sb.appendHtmlConstant("<div id=\"" + UIObject.DEBUG_ID_PREFIX + "git-reset-cellTable-" + context.getIndex() + "\">");
super.render(context, revision, sb);
}
};
Column<Revision, String> commiterColumn = new Column<Revision, String>(new TextCell()) {
@Override
public String getValue(Revision revision) {
if (revision.getCommitter() == null) {
return "";
}
return revision.getCommitter().getName();
}
};
Column<Revision, String> commentColumn = new Column<Revision, String>(new TextCell()) {
@Override
public String getValue(Revision revision) {
return revision.getMessage();
}
};
commits.addColumn(dateColumn, locale.commitGridDate());
commits.setColumnWidth(dateColumn, "20%");
commits.addColumn(commiterColumn, locale.commitGridCommiter());
commits.setColumnWidth(commiterColumn, "20%");
commits.addColumn(commentColumn, locale.commitGridComment());
commits.setColumnWidth(commentColumn, "60%");
final SingleSelectionModel<Revision> selectionModel = new SingleSelectionModel<Revision>();
selectionModel.addSelectionChangeHandler(new SelectionChangeEvent.Handler() {
@Override
public void onSelectionChange(SelectionChangeEvent event) {
Revision selectedObject = selectionModel.getSelectedObject();
delegate.onRevisionSelected(selectedObject);
}
});
commits.setSelectionModel(selectionModel);
}
use of com.google.gwt.cell.client.TextCell in project kie-wb-common by kiegroup.
the class DatabaseSchemaExplorerViewImpl method addNameColumn.
private void addNameColumn() {
Column<DatabaseSchemaRow, String> column = new Column<DatabaseSchemaRow, String>(new TextCell()) {
@Override
public String getValue(DatabaseSchemaRow row) {
return row.getName();
}
};
dataGrid.addColumn(column, translationService.getTranslation(DataSourceManagementConstants.DatabaseSchemaExplorerViewImpl_schemaNameColumn));
dataGrid.setColumnWidth(column, 80, Style.Unit.PCT);
}
use of com.google.gwt.cell.client.TextCell in project kie-wb-common by kiegroup.
the class TemplateParamsTableView method addParamNameColumn.
private void addParamNameColumn() {
Column<TemplateParam, String> column = new Column<TemplateParam, String>(new TextCell()) {
@Override
public String getValue(TemplateParam templateParam) {
return templateParam.isRequired() ? templateParam.getName() : templateParam.getName();
}
};
dataGrid.addColumn(column, translationService.getTranslation(TemplateParamsTableView_ParamNameColumn));
dataGrid.setColumnWidth(column, 40, Style.Unit.PCT);
}
use of com.google.gwt.cell.client.TextCell in project kie-wb-common by kiegroup.
the class ContainerConfigParamsView method addNameColumn.
private void addNameColumn() {
Column<ContainerConfig, String> column = new Column<ContainerConfig, String>(new TextCell()) {
@Override
public String getValue(ContainerConfig containerConfig) {
return containerConfig.getName();
}
};
dataGrid.addColumn(column, translationService.getTranslation(ContainerConfigParamsView_ContainerNameColumn));
}
Aggregations