use of net.sourceforge.nattable.style.Style in project translationstudio8 by heartsome.
the class DisplayColumnStyleEditorCommandHandler method doCommand.
@Override
public boolean doCommand(DisplayColumnStyleEditorCommand command) {
ILayer nattableLayer = command.getNattableLayer();
int columnIndex = nattableLayer.getColumnIndexByPosition(command.columnPosition);
// Column style
Style slectedCellStyle = (Style) configRegistry.getConfigAttribute(CELL_STYLE, NORMAL, USER_EDITED_STYLE_LABEL + columnIndex);
dialog = new ColumnStyleEditorDialog(Display.getCurrent().getActiveShell(), slectedCellStyle);
dialog.open();
if (dialog.isCancelPressed()) {
return true;
}
applySelectedStyleToColumn(command, columnIndex);
return true;
}
use of net.sourceforge.nattable.style.Style in project translationstudio8 by heartsome.
the class DisplayColumnStyleEditorCommandHandler method applySelectedStyleToColumn.
protected void applySelectedStyleToColumn(DisplayColumnStyleEditorCommand command, int columnIndex) {
// Read the edited styles
Style newColumnCellStyle = dialog.getNewColumCellStyle();
if (newColumnCellStyle == null) {
stylesToPersist.remove(getConfigLabel(columnIndex));
} else {
newColumnCellStyle.setAttributeValue(CellStyleAttributes.BORDER_STYLE, dialog.getNewColumnBorderStyle());
stylesToPersist.put(getConfigLabel(columnIndex), newColumnCellStyle);
}
configRegistry.registerConfigAttribute(CELL_STYLE, newColumnCellStyle, NORMAL, getConfigLabel(columnIndex));
columnLabelAccumulator.registerColumnOverrides(columnIndex, getConfigLabel(columnIndex));
}
use of net.sourceforge.nattable.style.Style in project translationstudio8 by heartsome.
the class DefaultSummaryRowConfiguration method addSummaryRowStyleConfig.
protected void addSummaryRowStyleConfig(IConfigRegistry configRegistry) {
Style cellStyle = new Style();
cellStyle.setAttributeValue(CellStyleAttributes.FONT, summaryRowFont);
cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, summaryRowBgColor);
cellStyle.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR, summaryRowFgColor);
cellStyle.setAttributeValue(CellStyleAttributes.BORDER_STYLE, summaryRowBorderStyle);
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyle, DisplayMode.NORMAL, SummaryRowLayer.DEFAULT_SUMMARY_ROW_CONFIG_LABEL);
}
use of net.sourceforge.nattable.style.Style in project translationstudio8 by heartsome.
the class CellStyleEditorPanel method getNewValue.
@Override
public Style getNewValue() {
Style newStyle = new Style();
newStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, backgroundColorPicker.getSelectedColor());
newStyle.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR, foregroundColorPicker.getSelectedColor());
newStyle.setAttributeValue(CellStyleAttributes.FONT, fontPicker.getSelectedFont());
newStyle.setAttributeValue(CellStyleAttributes.HORIZONTAL_ALIGNMENT, horizontalAlignmentPicker.getSelectedAlignment());
newStyle.setAttributeValue(CellStyleAttributes.VERTICAL_ALIGNMENT, verticalAlignmentPicker.getSelectedAlignment());
return newStyle;
}
use of net.sourceforge.nattable.style.Style in project translationstudio8 by heartsome.
the class DefaultSelectionStyleConfiguration method configureSelectionAnchorStyle.
protected void configureSelectionAnchorStyle(IConfigRegistry configRegistry) {
// Selection anchor style for normal display mode
Style cellStyle = new Style();
cellStyle.setAttributeValue(CellStyleAttributes.BORDER_STYLE, anchorBorderStyle);
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyle, DisplayMode.NORMAL, SelectionStyleLabels.SELECTION_ANCHOR_STYLE);
// Selection anchor style for select display mode
cellStyle = new Style();
cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, anchorBgColor);
cellStyle.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR, anchorFgColor);
cellStyle.setAttributeValue(CellStyleAttributes.BORDER_STYLE, anchorBorderStyle);
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyle, DisplayMode.SELECT, SelectionStyleLabels.SELECTION_ANCHOR_STYLE);
}
Aggregations