Search in sources :

Example 16 with TextCell

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);
}
Also used : Revision(org.eclipse.che.api.git.shared.Revision) Column(com.google.gwt.user.cellview.client.Column) DoubleClickHandler(com.google.gwt.event.dom.client.DoubleClickHandler) DoubleClickEvent(com.google.gwt.event.dom.client.DoubleClickEvent) TextCell(com.google.gwt.cell.client.TextCell) SelectionChangeEvent(com.google.gwt.view.client.SelectionChangeEvent)

Example 17 with TextCell

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);
}
Also used : SingleSelectionModel(com.google.gwt.view.client.SingleSelectionModel) SafeHtmlBuilder(com.google.gwt.safehtml.shared.SafeHtmlBuilder) Date(java.util.Date) TextCell(com.google.gwt.cell.client.TextCell) SelectionChangeEvent(com.google.gwt.view.client.SelectionChangeEvent) Revision(org.eclipse.che.api.git.shared.Revision) Column(com.google.gwt.user.cellview.client.Column)

Example 18 with TextCell

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);
}
Also used : Column(com.google.gwt.user.cellview.client.Column) TextCell(com.google.gwt.cell.client.TextCell)

Example 19 with TextCell

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);
}
Also used : TemplateParamsTableView_ParamNameColumn(org.guvnor.ala.ui.openshift.client.resources.i18n.GuvnorAlaOpenShiftUIConstants.TemplateParamsTableView_ParamNameColumn) TemplateParamsTableView_ParamValueColumn(org.guvnor.ala.ui.openshift.client.resources.i18n.GuvnorAlaOpenShiftUIConstants.TemplateParamsTableView_ParamValueColumn) TemplateParamsTableView_ParamRequiredColumn(org.guvnor.ala.ui.openshift.client.resources.i18n.GuvnorAlaOpenShiftUIConstants.TemplateParamsTableView_ParamRequiredColumn) Column(com.google.gwt.user.cellview.client.Column) TemplateParam(org.guvnor.ala.ui.openshift.model.TemplateParam) TextCell(com.google.gwt.cell.client.TextCell) EditTextCell(com.google.gwt.cell.client.EditTextCell)

Example 20 with TextCell

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));
}
Also used : ContainerConfigParamsView_ArtifactIdColumn(org.guvnor.ala.ui.client.resources.i18n.GuvnorAlaUIConstants.ContainerConfigParamsView_ArtifactIdColumn) ContainerConfigParamsView_VersionColumn(org.guvnor.ala.ui.client.resources.i18n.GuvnorAlaUIConstants.ContainerConfigParamsView_VersionColumn) ContainerConfigParamsView_GroupIdColumn(org.guvnor.ala.ui.client.resources.i18n.GuvnorAlaUIConstants.ContainerConfigParamsView_GroupIdColumn) ContainerConfigParamsView_ContainerNameColumn(org.guvnor.ala.ui.client.resources.i18n.GuvnorAlaUIConstants.ContainerConfigParamsView_ContainerNameColumn) Column(com.google.gwt.user.cellview.client.Column) TextCell(com.google.gwt.cell.client.TextCell)

Aggregations

TextCell (com.google.gwt.cell.client.TextCell)23 Column (com.google.gwt.user.cellview.client.Column)21 SafeHtmlBuilder (com.google.gwt.safehtml.shared.SafeHtmlBuilder)4 SelectionChangeEvent (com.google.gwt.view.client.SelectionChangeEvent)4 ContainerConfigParamsView_ArtifactIdColumn (org.guvnor.ala.ui.client.resources.i18n.GuvnorAlaUIConstants.ContainerConfigParamsView_ArtifactIdColumn)4 ContainerConfigParamsView_ContainerNameColumn (org.guvnor.ala.ui.client.resources.i18n.GuvnorAlaUIConstants.ContainerConfigParamsView_ContainerNameColumn)4 ContainerConfigParamsView_GroupIdColumn (org.guvnor.ala.ui.client.resources.i18n.GuvnorAlaUIConstants.ContainerConfigParamsView_GroupIdColumn)4 ContainerConfigParamsView_VersionColumn (org.guvnor.ala.ui.client.resources.i18n.GuvnorAlaUIConstants.ContainerConfigParamsView_VersionColumn)4 Revision (org.eclipse.che.api.git.shared.Revision)3 ButtonCell (com.google.gwt.cell.client.ButtonCell)2 Context (com.google.gwt.cell.client.Cell.Context)2 EditTextCell (com.google.gwt.cell.client.EditTextCell)2 DoubleClickEvent (com.google.gwt.event.dom.client.DoubleClickEvent)2 DoubleClickHandler (com.google.gwt.event.dom.client.DoubleClickHandler)2 SingleSelectionModel (com.google.gwt.view.client.SingleSelectionModel)2 SshPairDto (org.eclipse.che.api.ssh.shared.dto.SshPairDto)2 TemplateParamsTableView_ParamNameColumn (org.guvnor.ala.ui.openshift.client.resources.i18n.GuvnorAlaOpenShiftUIConstants.TemplateParamsTableView_ParamNameColumn)2 TemplateParamsTableView_ParamRequiredColumn (org.guvnor.ala.ui.openshift.client.resources.i18n.GuvnorAlaOpenShiftUIConstants.TemplateParamsTableView_ParamRequiredColumn)2 TemplateParamsTableView_ParamValueColumn (org.guvnor.ala.ui.openshift.client.resources.i18n.GuvnorAlaOpenShiftUIConstants.TemplateParamsTableView_ParamValueColumn)2 TemplateParam (org.guvnor.ala.ui.openshift.model.TemplateParam)2