Search in sources :

Example 1 with GlusterVolumeSnapshotStatusColumn

use of org.ovirt.engine.ui.webadmin.widget.table.column.GlusterVolumeSnapshotStatusColumn in project ovirt-engine by oVirt.

the class SubTabGlusterVolumeSnapshotView method initTable.

void initTable() {
    getTable().enableColumnResizing();
    GlusterVolumeSnapshotStatusColumn snapshotStatusColumn = new GlusterVolumeSnapshotStatusColumn();
    snapshotStatusColumn.makeSortable();
    // $NON-NLS-1$
    getTable().addColumn(snapshotStatusColumn, constants.empty(), "30px");
    AbstractTextColumn<GlusterVolumeSnapshotEntity> snapshotNameColumn = new AbstractTextColumn<GlusterVolumeSnapshotEntity>() {

        @Override
        public String getValue(GlusterVolumeSnapshotEntity snapshot) {
            return snapshot.getSnapshotName();
        }
    };
    snapshotNameColumn.makeSortable();
    // $NON-NLS-1$
    getTable().addColumn(snapshotNameColumn, constants.volumeSnapshotName(), "300px");
    AbstractTextColumn<GlusterVolumeSnapshotEntity> descriptionColumn = new AbstractTextColumn<GlusterVolumeSnapshotEntity>() {

        @Override
        public String getValue(GlusterVolumeSnapshotEntity snapshot) {
            return snapshot.getDescription();
        }
    };
    descriptionColumn.makeSortable();
    // $NON-NLS-1$
    getTable().addColumn(descriptionColumn, constants.volumeSnapshotDescription(), "400px");
    AbstractTextColumn<GlusterVolumeSnapshotEntity> creationTimeColumn = new AbstractTextColumn<GlusterVolumeSnapshotEntity>() {

        @Override
        public String getValue(GlusterVolumeSnapshotEntity snapshot) {
            // $NON-NLS-1$
            DateTimeFormat df = DateTimeFormat.getFormat("yyyy-MM-dd, HH:mm:ss");
            return df.format(snapshot.getCreatedAt());
        }
    };
    creationTimeColumn.makeSortable();
    // $NON-NLS-1$
    getTable().addColumn(creationTimeColumn, constants.volumeSnapshotCreationTime(), "400px");
}
Also used : GlusterVolumeSnapshotEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity) GlusterVolumeSnapshotStatusColumn(org.ovirt.engine.ui.webadmin.widget.table.column.GlusterVolumeSnapshotStatusColumn) AbstractTextColumn(org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn) DateTimeFormat(com.google.gwt.i18n.client.DateTimeFormat)

Aggregations

DateTimeFormat (com.google.gwt.i18n.client.DateTimeFormat)1 GlusterVolumeSnapshotEntity (org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity)1 AbstractTextColumn (org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn)1 GlusterVolumeSnapshotStatusColumn (org.ovirt.engine.ui.webadmin.widget.table.column.GlusterVolumeSnapshotStatusColumn)1