Search in sources :

Example 1 with NetworkStatusColumn

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

the class SubTabClusterNetworkView method initTable.

private void initTable() {
    getTable().enableColumnResizing();
    NetworkStatusColumn statusIconColumn = new NetworkStatusColumn();
    statusIconColumn.setContextMenuTitle(constants.statusIconNetwork());
    // $NON-NLS-1$ //$NON-NLS-2$
    getTable().addColumn(statusIconColumn, "", "20px");
    AbstractTextColumn<Network> nameColumn = new AbstractLinkColumn<Network>(new FieldUpdater<Network, String>() {

        @Override
        public void update(int index, Network network, String value) {
            Map<String, String> parameters = new HashMap<>();
            parameters.put(FragmentParams.NAME.getName(), network.getName());
            parameters.put(FragmentParams.DATACENTER.getName(), getModelProvider().getMainModel().getSelectedItem().getStoragePoolName());
            getPlaceTransitionHandler().handlePlaceTransition(WebAdminApplicationPlaces.networkGeneralSubTabPlace, parameters);
        }
    }) {

        @Override
        public String getValue(Network object) {
            return object.getName();
        }
    };
    nameColumn.makeSortable();
    // $NON-NLS-1$
    getTable().addColumn(nameColumn, constants.nameNetwork(), "400px");
    AbstractTextColumn<Network> statusColumn = new AbstractEnumColumn<Network, NetworkStatus>() {

        @Override
        public NetworkStatus getRawValue(Network object) {
            return object.getCluster().getStatus();
        }
    };
    statusColumn.makeSortable();
    // $NON-NLS-1$
    getTable().addColumn(statusColumn, constants.statusNetwork(), "100px");
    // $NON-NLS-1$
    getTable().addColumn(createNetRoleColumn(), constants.roleNetwork(), "90px");
    AbstractTextColumn<Network> descColumn = new AbstractTextColumn<Network>() {

        @Override
        public String getValue(Network object) {
            return object.getDescription();
        }
    };
    descColumn.makeSortable();
    // $NON-NLS-1$
    getTable().addColumn(descColumn, constants.descriptionNetwork(), "400px");
}
Also used : AbstractEnumColumn(org.ovirt.engine.ui.common.widget.table.column.AbstractEnumColumn) AbstractLinkColumn(org.ovirt.engine.ui.common.widget.table.column.AbstractLinkColumn) NetworkStatusColumn(org.ovirt.engine.ui.webadmin.widget.table.column.NetworkStatusColumn) Network(org.ovirt.engine.core.common.businessentities.network.Network) AbstractTextColumn(org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) Map(java.util.Map)

Aggregations

HashMap (java.util.HashMap)1 LinkedHashMap (java.util.LinkedHashMap)1 Map (java.util.Map)1 Network (org.ovirt.engine.core.common.businessentities.network.Network)1 AbstractEnumColumn (org.ovirt.engine.ui.common.widget.table.column.AbstractEnumColumn)1 AbstractLinkColumn (org.ovirt.engine.ui.common.widget.table.column.AbstractLinkColumn)1 AbstractTextColumn (org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn)1 NetworkStatusColumn (org.ovirt.engine.ui.webadmin.widget.table.column.NetworkStatusColumn)1