Search in sources :

Example 1 with FullDateTimeRenderer

use of org.ovirt.engine.ui.common.widget.renderer.FullDateTimeRenderer in project ovirt-engine by oVirt.

the class VolumeGeoRepSessionDetailsPopUpView method intiEditors.

private void intiEditors(final ApplicationConstants constants) {
    checkPointStatus = new EntityModelLabelEditor<>(new AbstractRenderer<GlusterGeoRepSessionDetails>() {

        @Override
        public String render(GlusterGeoRepSessionDetails object) {
            String checkPointStatusValue = object.getCheckPointStatus();
            return checkPointStatusValue == null || checkPointStatusValue.isEmpty() ? constants.notAvailableLabel() : checkPointStatusValue;
        }
    });
    crawlStatus = new EntityModelLabelEditor<>(new AbstractRenderer<GlusterGeoRepSessionDetails>() {

        @Override
        public String render(GlusterGeoRepSessionDetails object) {
            return object.getCrawlStatus().toString();
        }
    });
    dataOpsPending = new EntityModelLabelEditor<>(new AbstractRenderer<GlusterGeoRepSessionDetails>() {

        @Override
        public String render(GlusterGeoRepSessionDetails object) {
            return object.getDataOpsPending().toString();
        }
    });
    metaOpsPending = new EntityModelLabelEditor<>(new AbstractRenderer<GlusterGeoRepSessionDetails>() {

        @Override
        public String render(GlusterGeoRepSessionDetails object) {
            return object.getMetaOpsPending().toString();
        }
    });
    entryOpsPending = new EntityModelLabelEditor<>(new AbstractRenderer<GlusterGeoRepSessionDetails>() {

        @Override
        public String render(GlusterGeoRepSessionDetails object) {
            return object.getEntryOpsPending().toString();
        }
    });
    failures = new EntityModelLabelEditor<>(new AbstractRenderer<GlusterGeoRepSessionDetails>() {

        @Override
        public String render(GlusterGeoRepSessionDetails object) {
            return object.getFailures().toString();
        }
    });
    checkPointTime = new EntityModelLabelEditor<>(new AbstractRenderer<GlusterGeoRepSessionDetails>() {

        @Override
        public String render(GlusterGeoRepSessionDetails object) {
            return new FullDateTimeRenderer().render(object.getCheckPointTime());
        }
    });
    checkPointCompletedAt = new EntityModelLabelEditor<>(new AbstractRenderer<GlusterGeoRepSessionDetails>() {

        @Override
        public String render(GlusterGeoRepSessionDetails object) {
            return new FullDateTimeRenderer().render(object.getCheckPointCompletedAt());
        }
    });
    geoRepSessionSummaryTable = new EntityModelCellTable<>(false, true);
    geoRepSessionSummaryTable.addColumn(new AbstractEntityModelTextColumn<GlusterGeoRepSessionDetails>() {

        @Override
        public String getText(GlusterGeoRepSessionDetails object) {
            return object.getMasterBrickHostName() == null ? constants.notAvailableLabel() : object.getMasterBrickHostName();
        }
    }, constants.geoRepSessionHostName());
    geoRepSessionSummaryTable.addColumn(new AbstractEntityModelTextColumn<GlusterGeoRepSessionDetails>() {

        @Override
        protected String getText(GlusterGeoRepSessionDetails entity) {
            return (entity == null || entity.getStatus() == null) ? constants.notAvailableLabel() : entity.getStatus().toString();
        }
    }, constants.geoRepSessionStatus());
    geoRepSessionSummaryTable.addColumn(new AbstractFullDateTimeColumn<EntityModel<GlusterGeoRepSessionDetails>>() {

        @Override
        protected Date getRawValue(EntityModel<GlusterGeoRepSessionDetails> object) {
            GlusterGeoRepSessionDetails sessionDetail = object.getEntity();
            return (sessionDetail == null || sessionDetail.getLastSyncedAt() == null) ? new Date() : sessionDetail.getLastSyncedAt();
        }
    }, constants.geoRepLastSyncedAt());
}
Also used : FullDateTimeRenderer(org.ovirt.engine.ui.common.widget.renderer.FullDateTimeRenderer) AbstractRenderer(com.google.gwt.text.shared.AbstractRenderer) EntityModel(org.ovirt.engine.ui.uicommonweb.models.EntityModel) GlusterGeoRepSessionDetails(org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionDetails) Date(java.util.Date)

Example 2 with FullDateTimeRenderer

use of org.ovirt.engine.ui.common.widget.renderer.FullDateTimeRenderer in project ovirt-engine by oVirt.

the class EventPopupView method edit.

@Override
public void edit(final EventModel eventModel) {
    driver.edit(eventModel);
    AuditLog event = eventModel.getEvent();
    eventIdLabel.asValueBox().setValue(String.valueOf(event.getLogTypeValue()));
    eventTimeLabel.asValueBox().setValue(new FullDateTimeRenderer().render(event.getLogTime()));
    eventMessageTextArea.asValueBox().setValue(event.getMessage());
}
Also used : FullDateTimeRenderer(org.ovirt.engine.ui.common.widget.renderer.FullDateTimeRenderer) AuditLog(org.ovirt.engine.core.common.businessentities.AuditLog)

Example 3 with FullDateTimeRenderer

use of org.ovirt.engine.ui.common.widget.renderer.FullDateTimeRenderer in project ovirt-engine by oVirt.

the class PermissionListModelTable method addCreationDateColum.

private void addCreationDateColum() {
    AbstractTextColumn<Permission> creationDateColumn = new AbstractRenderedTextColumn<Permission, Date>(new FullDateTimeRenderer()) {

        @Override
        public Date getRawValue(Permission object) {
            // GWT doesn't have TimeUnit.java
            return new Date(object.getCreationDate() * 1000);
        }
    };
    // $NON-NLS-1$
    getTable().addColumn(creationDateColumn, constants.permissionsCreationDate(), "300px");
    creationDateColumn.makeSortable();
}
Also used : AbstractRenderedTextColumn(org.ovirt.engine.ui.common.widget.table.column.AbstractRenderedTextColumn) FullDateTimeRenderer(org.ovirt.engine.ui.common.widget.renderer.FullDateTimeRenderer) Permission(org.ovirt.engine.core.common.businessentities.Permission) Date(java.util.Date)

Aggregations

FullDateTimeRenderer (org.ovirt.engine.ui.common.widget.renderer.FullDateTimeRenderer)3 Date (java.util.Date)2 AbstractRenderer (com.google.gwt.text.shared.AbstractRenderer)1 AuditLog (org.ovirt.engine.core.common.businessentities.AuditLog)1 Permission (org.ovirt.engine.core.common.businessentities.Permission)1 GlusterGeoRepSessionDetails (org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionDetails)1 AbstractRenderedTextColumn (org.ovirt.engine.ui.common.widget.table.column.AbstractRenderedTextColumn)1 EntityModel (org.ovirt.engine.ui.uicommonweb.models.EntityModel)1