org.bidib.wizard.nodes.client.model.NodeRow Maven / Gradle / Ivy
package org.bidib.wizard.nodes.client.model;
import org.apache.commons.lang3.StringUtils;
import com.jidesoft.grid.DefaultExpandableRow;
public class NodeRow extends DefaultExpandableRow {
private final AccessoryNode accessoryNode;
public NodeRow(final AccessoryNode accessoryNode) {
this.accessoryNode = accessoryNode;
}
@Override
public Object getValueAt(int column) {
if (column == 0) {
return getName();
}
return null;
}
public String getName() {
String label = this.accessoryNode.getLabel();
if (StringUtils.isBlank(label)) {
label = this.accessoryNode.getNode().toString();
}
return label;
}
public Long getUniqueId() {
return Long.valueOf(this.accessoryNode.getNode().getUniqueId());
}
}