use of org.apache.hadoop.hbase.hbtop.field.Field in project hbase by apache.
the class FieldScreenPresenter method showField.
private void showField(int pos) {
Field field = fields.get(pos);
fieldScreenView.showField(pos, field, fieldDisplayMap.get(field), pos == currentPosition, headerMaxLength, descriptionMaxLength, moveMode);
}
use of org.apache.hadoop.hbase.hbtop.field.Field in project hbase by apache.
the class FieldScreenPresenter method switchFieldDisplay.
public void switchFieldDisplay() {
if (!moveMode) {
Field field = fields.get(currentPosition);
fieldDisplayMap.put(field, !fieldDisplayMap.get(field));
showField(currentPosition);
fieldScreenView.refreshTerminal();
}
}
use of org.apache.hadoop.hbase.hbtop.field.Field in project hbase by apache.
the class FieldScreenPresenter method arrowUp.
public void arrowUp() {
if (currentPosition > 0) {
currentPosition -= 1;
if (moveMode) {
Field tmp = fields.remove(currentPosition);
fields.add(currentPosition + 1, tmp);
}
showField(currentPosition);
showField(currentPosition + 1);
fieldScreenView.refreshTerminal();
}
}
use of org.apache.hadoop.hbase.hbtop.field.Field in project hbase by apache.
the class TestFieldScreenPresenter method setup.
@Before
public void setup() {
Field sortField = Mode.REGION.getDefaultSortField();
fields = Mode.REGION.getFieldInfos().stream().map(FieldInfo::getField).collect(Collectors.toList());
fieldDisplayMap = Mode.REGION.getFieldInfos().stream().collect(() -> new EnumMap<>(Field.class), (r, fi) -> r.put(fi.getField(), fi.isDisplayByDefault()), (r1, r2) -> {
});
fieldScreenPresenter = new FieldScreenPresenter(fieldScreenView, sortField, fields, fieldDisplayMap, resultListener, topScreenView);
for (int i = 0; i < fields.size(); i++) {
Field field = fields.get(i);
if (field == sortField) {
sortFieldPosition = i;
break;
}
}
}
Aggregations