Class TagTableColumnModelBuilder
- java.lang.Object
-
- org.openstreetmap.josm.gui.tagging.TagTableColumnModelBuilder
-
public class TagTableColumnModelBuilder extends java.lang.Object
Builder class allowing to construct customized tag table column models. All columns are resizable and share the same renderer.- Since:
- 9847
-
-
Field Summary
Fields Modifier and Type Field Description private javax.swing.table.DefaultTableColumnModelmodel
-
Constructor Summary
Constructors Constructor Description TagTableColumnModelBuilder(javax.swing.table.TableCellRenderer renderer, java.lang.String... headerValues)Construct a newTagTableColumnModelBuilder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.swing.table.DefaultTableColumnModelbuild()Returns the new tag table column model.TagTableColumnModelBuildersetCellEditor(javax.swing.table.TableCellEditor editor, int... indexes)Sets cell editor of specified columns.TagTableColumnModelBuildersetMaxWidth(int width, int... indexes)Sets max width of specified columns.TagTableColumnModelBuildersetPreferredWidth(int width, int... indexes)Sets preferred width of specified columns.TagTableColumnModelBuildersetSelectionModel(javax.swing.ListSelectionModel selectionModel)Sets selection model.TagTableColumnModelBuildersetWidth(int width, int... indexes)Sets width of specified columns.
-
-
-
Field Detail
-
model
private final javax.swing.table.DefaultTableColumnModel model
-
-
Constructor Detail
-
TagTableColumnModelBuilder
public TagTableColumnModelBuilder(javax.swing.table.TableCellRenderer renderer, java.lang.String... headerValues)
Construct a newTagTableColumnModelBuilder.- Parameters:
renderer- rendered used for all columnsheaderValues- header values of each column, determining the number of columns- See Also:
TableColumn.setHeaderValue(java.lang.Object),TableColumn.setCellRenderer(javax.swing.table.TableCellRenderer)
-
-
Method Detail
-
setWidth
public TagTableColumnModelBuilder setWidth(int width, int... indexes)
Sets width of specified columns.- Parameters:
width- the new widthindexes- indexes of columns to setup- Returns:
this- See Also:
TableColumn.setWidth(int)
-
setPreferredWidth
public TagTableColumnModelBuilder setPreferredWidth(int width, int... indexes)
Sets preferred width of specified columns.- Parameters:
width- the new widthindexes- indexes of columns to setup- Returns:
this- See Also:
TableColumn.setPreferredWidth(int)
-
setMaxWidth
public TagTableColumnModelBuilder setMaxWidth(int width, int... indexes)
Sets max width of specified columns.- Parameters:
width- the new widthindexes- indexes of columns to setup- Returns:
this- See Also:
TableColumn.setMaxWidth(int)
-
setCellEditor
public TagTableColumnModelBuilder setCellEditor(javax.swing.table.TableCellEditor editor, int... indexes)
Sets cell editor of specified columns.- Parameters:
editor- the new cell editorindexes- indexes of columns to setup- Returns:
this- See Also:
TableColumn.setCellEditor(javax.swing.table.TableCellEditor)
-
setSelectionModel
public TagTableColumnModelBuilder setSelectionModel(javax.swing.ListSelectionModel selectionModel)
Sets selection model.- Parameters:
selectionModel- new selection model- Returns:
this- See Also:
DefaultTableColumnModel.setSelectionModel(javax.swing.ListSelectionModel)
-
build
public javax.swing.table.DefaultTableColumnModel build()
Returns the new tag table column model.- Returns:
- the new tag table column model
-
-