Search in sources :

Example 6 with VmTypeColumn

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

the class SubTabClusterVmView method initTable.

void initTable() {
    getTable().enableColumnResizing();
    VmStatusColumn<VM> statusIconColumn = new VmStatusColumn<>();
    statusIconColumn.setContextMenuTitle(constants.statusIconVm());
    statusIconColumn.makeSortable(VmConditionFieldAutoCompleter.STATUS);
    // $NON-NLS-1$
    getTable().addColumn(statusIconColumn, constants.empty(), "30px");
    AbstractTextColumn<VM> nameColumn = new AbstractLinkColumn<VM>(new FieldUpdater<VM, String>() {

        @Override
        public void update(int index, VM vm, String value) {
            Map<String, String> parameters = new HashMap<>();
            parameters.put(FragmentParams.NAME.getName(), vm.getName());
            getPlaceTransitionHandler().handlePlaceTransition(WebAdminApplicationPlaces.virtualMachineGeneralSubTabPlace, parameters);
        }
    }) {

        @Override
        public String getValue(VM object) {
            return object.getName();
        }
    };
    nameColumn.makeSortable(VmConditionFieldAutoCompleter.NAME);
    // $NON-NLS-1$
    getTable().addColumn(nameColumn, constants.nameVm(), "220px");
    VmTypeColumn typeColumn = new VmTypeColumn();
    typeColumn.setContextMenuTitle(constants.typeVm());
    typeColumn.makeSortable(VmConditionFieldAutoCompleter.TYPE);
    // $NON-NLS-1$
    getTable().addColumn(typeColumn, constants.empty(), "60px");
    AbstractTextColumn<VM> statusColumn = new AbstractEnumColumn<VM, VMStatus>() {

        @Override
        protected VMStatus getRawValue(VM object) {
            return object.getStatus();
        }
    };
    statusColumn.makeSortable(VmConditionFieldAutoCompleter.STATUS);
    // $NON-NLS-1$
    getTable().addColumn(statusColumn, constants.statusVm(), "220px");
    AbstractTextColumn<VM> uptimeColumn = new AbstractUptimeColumn<VM>() {

        @Override
        protected Double getRawValue(VM object) {
            return object.getElapsedTime();
        }
    };
    uptimeColumn.makeSortable(VmConditionFieldAutoCompleter.UPTIME);
    // $NON-NLS-1$
    getTable().addColumn(uptimeColumn, constants.uptimeVm(), "220px");
}
Also used : VmStatusColumn(org.ovirt.engine.ui.webadmin.widget.table.column.VmStatusColumn) AbstractUptimeColumn(org.ovirt.engine.ui.webadmin.widget.table.column.AbstractUptimeColumn) AbstractEnumColumn(org.ovirt.engine.ui.common.widget.table.column.AbstractEnumColumn) AbstractLinkColumn(org.ovirt.engine.ui.common.widget.table.column.AbstractLinkColumn) VM(org.ovirt.engine.core.common.businessentities.VM) VmTypeColumn(org.ovirt.engine.ui.webadmin.widget.table.column.VmTypeColumn) HashMap(java.util.HashMap) Map(java.util.Map)

Aggregations

VM (org.ovirt.engine.core.common.businessentities.VM)6 AbstractEnumColumn (org.ovirt.engine.ui.common.widget.table.column.AbstractEnumColumn)6 AbstractUptimeColumn (org.ovirt.engine.ui.webadmin.widget.table.column.AbstractUptimeColumn)6 VmTypeColumn (org.ovirt.engine.ui.webadmin.widget.table.column.VmTypeColumn)6 HashMap (java.util.HashMap)5 Map (java.util.Map)5 AbstractLinkColumn (org.ovirt.engine.ui.common.widget.table.column.AbstractLinkColumn)5 AbstractTextColumn (org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn)5 VmStatusColumn (org.ovirt.engine.ui.webadmin.widget.table.column.VmStatusColumn)5 List (java.util.List)2 HasCell (com.google.gwt.cell.client.HasCell)1 ArrayList (java.util.ArrayList)1 GraphicsInfo (org.ovirt.engine.core.common.businessentities.GraphicsInfo)1 GraphicsType (org.ovirt.engine.core.common.businessentities.GraphicsType)1 VDS (org.ovirt.engine.core.common.businessentities.VDS)1 StatusCompositeCell (org.ovirt.engine.ui.common.widget.table.cell.StatusCompositeCell)1 AbstractColumn (org.ovirt.engine.ui.common.widget.table.column.AbstractColumn)1 AbstractImageResourceColumn (org.ovirt.engine.ui.common.widget.table.column.AbstractImageResourceColumn)1 UnitVmModel (org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel)1 AbstractPercentColumn (org.ovirt.engine.ui.webadmin.widget.table.column.AbstractPercentColumn)1