Package com.diffplug.common.swt
Class ColumnFormat
- java.lang.Object
-
- com.diffplug.common.swt.ColumnFormat
-
public class ColumnFormat extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ColumnFormat.ColumnBuilder
Builder for a single TableColumn.static class
ColumnFormat.ColumnPixelDataBuilder
A fluent API for manipulating aColumnPixelData
.static class
ColumnFormat.ColumnWeightDataBuilder
A fluent API for manipulating aColumnWeightData
.
-
Field Summary
Fields Modifier and Type Field Description protected List<ColumnFormat.ColumnBuilder>
columnBuilders
protected boolean
headerVisible
protected boolean
linesVisible
protected int
style
-
Constructor Summary
Constructors Modifier Constructor Description protected
ColumnFormat()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ColumnFormat.ColumnBuilder
addColumn()
Adds a column to the table.static ColumnFormat
builder()
Creates a `TableFormat` with the given style bits.Table
buildTable(Composite parent)
Builds aTable
with the specified columns and layout.protected static Table
buildTable(Composite parent, int style, boolean linesVisible, boolean headerVisible, List<? extends ColumnFormat.ColumnBuilder> columnBuilders)
Builds a table with the given columns.Tree
buildTree(Composite parent)
Builds aTree
with the specified columns and layout.protected static Tree
buildTree(Composite parent, int style, boolean linesVisible, boolean headerVisible, List<? extends ColumnFormat.ColumnBuilder> columnBuilders)
Builds a table with the given columns.List<ColumnFormat.ColumnBuilder>
getColumns()
Returns the columns array.int
getStyle()
Returns the style of this format.ColumnFormat
setHeaderVisible(boolean headerVisible)
Sets the header to be visible, defaults to true.ColumnFormat
setLinesVisible(boolean linesVisible)
Sets the lines to be visible, defaults to true.ColumnFormat
setStyle(int style)
Sets the SWT style flags.
-
-
-
Field Detail
-
style
protected int style
-
linesVisible
protected boolean linesVisible
-
headerVisible
protected boolean headerVisible
-
columnBuilders
protected final List<ColumnFormat.ColumnBuilder> columnBuilders
-
-
Method Detail
-
builder
public static ColumnFormat builder()
Creates a `TableFormat` with the given style bits.
-
getStyle
public int getStyle()
Returns the style of this format. Allows utilities that require a certain flag (e.g. SWT.VIRTUAL) to do error-checking.
-
setStyle
public ColumnFormat setStyle(int style)
Sets the SWT style flags.
-
setLinesVisible
public ColumnFormat setLinesVisible(boolean linesVisible)
Sets the lines to be visible, defaults to true.
-
setHeaderVisible
public ColumnFormat setHeaderVisible(boolean headerVisible)
Sets the header to be visible, defaults to true.
-
addColumn
public ColumnFormat.ColumnBuilder addColumn()
Adds a column to the table.
-
getColumns
public List<ColumnFormat.ColumnBuilder> getColumns()
Returns the columns array.
-
buildTable
public Table buildTable(Composite parent)
Builds aTable
with the specified columns and layout.
-
buildTree
public Tree buildTree(Composite parent)
Builds aTree
with the specified columns and layout.
-
buildTable
protected static Table buildTable(Composite parent, int style, boolean linesVisible, boolean headerVisible, List<? extends ColumnFormat.ColumnBuilder> columnBuilders)
Builds a table with the given columns.
-
buildTree
protected static Tree buildTree(Composite parent, int style, boolean linesVisible, boolean headerVisible, List<? extends ColumnFormat.ColumnBuilder> columnBuilders)
Builds a table with the given columns.
-
-