use of net.sourceforge.nattable.layer.LabelStack in project translationstudio8 by heartsome.
the class EditUtils method isEditorSame.
public static boolean isEditorSame(SelectionLayer selectionLayer, IConfigRegistry configRegistry, ICellEditor lastSelectedCellEditor) {
PositionCoordinate[] selectedCells = selectionLayer.getSelectedCells();
boolean isAllSelectedCellsHaveSameEditor = true;
for (PositionCoordinate selectedCell : selectedCells) {
LabelStack labelStack = selectionLayer.getConfigLabelsByPosition(selectedCell.columnPosition, selectedCell.rowPosition);
ICellEditor cellEditor = configRegistry.getConfigAttribute(EditConfigAttributes.CELL_EDITOR, DisplayMode.EDIT, labelStack.getLabels());
if (cellEditor != lastSelectedCellEditor) {
isAllSelectedCellsHaveSameEditor = false;
}
}
return isAllSelectedCellsHaveSameEditor;
}
use of net.sourceforge.nattable.layer.LabelStack in project translationstudio8 by heartsome.
the class CellLabelMouseEventMatcher method matches.
@Override
public boolean matches(NatTable natTable, MouseEvent event, LabelStack regionLabels) {
NatEventData eventData = NatEventData.createInstanceFromEvent(event);
LabelStack customLabels = natTable.getConfigLabelsByPosition(eventData.getColumnPosition(), eventData.getRowPosition());
return super.matches(natTable, event, regionLabels) && customLabels.getLabels().contains(labelToMatch);
}
use of net.sourceforge.nattable.layer.LabelStack in project translationstudio8 by heartsome.
the class EditUtils method allCellsEditable.
public static boolean allCellsEditable(SelectionLayer selectionLayer, IConfigRegistry configRegistry) {
PositionCoordinate[] selectedCells = selectionLayer.getSelectedCells();
for (PositionCoordinate cell : selectedCells) {
LabelStack labelStack = selectionLayer.getConfigLabelsByPosition(cell.columnPosition, cell.rowPosition);
IEditableRule editableRule = configRegistry.getConfigAttribute(EditConfigAttributes.CELL_EDITABLE_RULE, DisplayMode.EDIT, labelStack.getLabels());
int columnIndex = selectionLayer.getColumnIndexByPosition(cell.columnPosition);
int rowIndex = selectionLayer.getRowIndexByPosition(cell.rowPosition);
if (!editableRule.isEditable(columnIndex, rowIndex)) {
return false;
}
}
return true;
}
use of net.sourceforge.nattable.layer.LabelStack in project translationstudio8 by heartsome.
the class RowHeaderLayer method getConfigLabelsByPosition.
@Override
public LabelStack getConfigLabelsByPosition(int columnPosition, int rowPosition) {
LabelStack labelStack = super.getConfigLabelsByPosition(columnPosition, rowPosition);
final int selectionLayerRowPosition = LayerUtil.convertRowPosition(this, rowPosition, selectionLayer);
if (selectionLayer.isRowFullySelected(selectionLayerRowPosition)) {
labelStack.addLabel(SelectionStyleLabels.ROW_FULLY_SELECTED_STYLE);
}
return labelStack;
}
use of net.sourceforge.nattable.layer.LabelStack in project translationstudio8 by heartsome.
the class ColumnHeaderLayer method getConfigLabelsByPosition.
@Override
public LabelStack getConfigLabelsByPosition(int columnPosition, int rowPosition) {
LabelStack labelStack = super.getConfigLabelsByPosition(columnPosition, rowPosition);
final int selectionLayerColumnPosition = LayerUtil.convertColumnPosition(this, columnPosition, selectionLayer);
if (selectionLayer.isColumnFullySelected(selectionLayerColumnPosition)) {
labelStack.addLabel(SelectionStyleLabels.COLUMN_FULLY_SELECTED_STYLE);
}
return labelStack;
}
Aggregations