use of org.ovirt.engine.ui.webadmin.widget.table.column.NetworkClusterStatusColumn in project ovirt-engine by oVirt.
the class SubTabNetworkClusterView method initTable.
private void initTable() {
getTable().enableColumnResizing();
AbstractTextColumn<PairQueryable<Cluster, NetworkCluster>> nameColumn = new AbstractLinkColumn<PairQueryable<Cluster, NetworkCluster>>(new FieldUpdater<PairQueryable<Cluster, NetworkCluster>, String>() {
@Override
public void update(int index, PairQueryable<Cluster, NetworkCluster> cluster, String value) {
Map<String, String> parameters = new HashMap<>();
parameters.put(FragmentParams.NAME.getName(), cluster.getFirst().getName());
getPlaceTransitionHandler().handlePlaceTransition(WebAdminApplicationPlaces.clusterGeneralSubTabPlace, parameters);
}
}) {
@Override
public String getValue(PairQueryable<Cluster, NetworkCluster> object) {
return object.getFirst().getName();
}
};
nameColumn.makeSortable();
// $NON-NLS-1$
getTable().addColumn(nameColumn, constants.nameCluster(), "400px");
AbstractTextColumn<PairQueryable<Cluster, NetworkCluster>> versionColumn = new AbstractTextColumn<PairQueryable<Cluster, NetworkCluster>>() {
@Override
public String getValue(PairQueryable<Cluster, NetworkCluster> object) {
return object.getFirst().getCompatibilityVersion().getValue();
}
};
versionColumn.makeSortable();
// $NON-NLS-1$
getTable().addColumn(versionColumn, constants.comptVersCluster(), "130px");
AbstractCheckboxColumn<PairQueryable<Cluster, NetworkCluster>> attachedColumn = new AbstractCheckboxColumn<PairQueryable<Cluster, NetworkCluster>>(true) {
@Override
public Boolean getValue(PairQueryable<Cluster, NetworkCluster> object) {
return object.getSecond() != null;
}
@Override
protected boolean canEdit(PairQueryable<Cluster, NetworkCluster> object) {
return false;
}
};
attachedColumn.makeSortable();
// $NON-NLS-1$
getTable().addColumn(attachedColumn, constants.attachedNetworkCluster(), "120px");
NetworkClusterStatusColumn statusColumn = new NetworkClusterStatusColumn();
statusColumn.makeSortable(new SimpleStatusColumnComparator<>(statusColumn));
// $NON-NLS-1$
getTable().addColumn(statusColumn, constants.networkStatus(), "120px");
AbstractCheckboxColumn<PairQueryable<Cluster, NetworkCluster>> netRequiredColumn = new AbstractCheckboxColumn<PairQueryable<Cluster, NetworkCluster>>(true) {
@Override
public Boolean getValue(PairQueryable<Cluster, NetworkCluster> object) {
if (object.getSecond() != null) {
return object.getSecond().isRequired();
}
return false;
}
@Override
protected boolean canEdit(PairQueryable<Cluster, NetworkCluster> object) {
return false;
}
};
netRequiredColumn.makeSortable();
// $NON-NLS-1$
getTable().addColumn(netRequiredColumn, constants.requiredNetCluster(), "120px");
AbstractSafeHtmlColumn<PairQueryable<Cluster, NetworkCluster>> netRoleColumn = createNetRoleColumn();
netRoleColumn.makeSortable(new NetRoleColumnComparator());
// $NON-NLS-1$
getTable().addColumn(netRoleColumn, constants.roleNetCluster(), "120px");
AbstractTextColumn<PairQueryable<Cluster, NetworkCluster>> descriptionColumn = new AbstractTextColumn<PairQueryable<Cluster, NetworkCluster>>() {
@Override
public String getValue(PairQueryable<Cluster, NetworkCluster> object) {
return object.getFirst().getDescription();
}
};
descriptionColumn.makeSortable();
// $NON-NLS-1$
getTable().addColumn(descriptionColumn, constants.descriptionCluster(), "400px");
}
Aggregations