Class JTableHpr<T extends javax.swing.JTable>
- java.lang.Object
-
- com.inductiveautomation.snap.ui.UIHelper<T>
-
- com.inductiveautomation.snap.swing.SwingHelper<T>
-
- com.inductiveautomation.snap.swing.helpers.JComponentHpr<T>
-
- com.inductiveautomation.snap.swing.helpers.JTableHpr<T>
-
public class JTableHpr<T extends javax.swing.JTable> extends JComponentHpr<T>
A Helper subclass for JTable.
-
-
Constructor Summary
Constructors Constructor Description JTableHpr()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.swing.table.TableColumn
addColumn(javax.swing.JTable aTable, java.lang.String aHeader, java.lang.String aBindKey, int anIndex, int aWidth)
Adds a column for header, bind key, width.void
addColumns(javax.swing.JTable aTable, java.util.List<java.lang.String> theKeys)
Adds columns for a list of keys.int
getChildCount(T anObj)
Override to suppress children.java.util.List
getItems(T aTable)
Returns the items for an object.java.lang.String
getPropertyNameMapped(T anObj, java.lang.String aName)
Returns a mapped property name.protected java.util.List<java.lang.String>
getPropertyNamesImpl(T anObj)
Returns the property names for given object.int
getSelectedIndex(T aTable)
Returns the selected index property of given object.java.lang.Object
getSelectedItem(T aTable)
Returns the selected object property of given object.void
initUI(T aTable, UIOwner anOwner)
Initializes newly created object.boolean
isValueAdjusting(T aTable)
Returns whether table value is adjusting.void
removeColumns(javax.swing.JTable aTable)
Removes columns.static void
scrollCellToVisible(javax.swing.JTable aTable, int aRow, int aColumn)
Scrolls a table so that given row and column are visible.static void
setColumnWidths(javax.swing.JTable aTable)
Sets table column widths to preferred size.void
setItems(T aTable, java.util.List theItems)
Sets the items for an object.void
setSelectedIndex(T aTable, int anIndex)
Sets the selected index property of given object to given value.void
setSelectedItem(T aTable, java.lang.Object aValue)
Sets the selected object property of given object to given value.void
setValue(T aTable, java.lang.String aPropertyName, java.lang.Object aValue)
Sets the selected row index.-
Methods inherited from class com.inductiveautomation.snap.swing.helpers.JComponentHpr
addBinding, createEventAdapter, getAutosizing, getBinding, getBindingCount, getBindings, getChangeListener, getChild, getConstraints, getEventAdapter, getName, getOwner, getParent, getSendActionOnFocusLost, getSendActionOnFocusLostDefault, isEnabled, removeBinding, setConstraints, setEnabled, setOwner, setSendActionOnFocusLost
-
Methods inherited from class com.inductiveautomation.snap.swing.SwingHelper
getHelper, getSwingHelper, getSwingHelper
-
Methods inherited from class com.inductiveautomation.snap.ui.UIHelper
enableEvents, getAction, getBinding, getChild, getItemDisplayKey, getKeyValue, getPropertyNames, getSelectedIndexes, getSelectedIndexs, getText, getValue, initUIDeep, isEnabled, isPropertyName, removeBinding, setAction, setEnabled, setItemDisplayKey, setItems, setKeyValue, setSelectedIndexes, setText
-
-
-
-
Method Detail
-
getChildCount
public int getChildCount(T anObj)
Override to suppress children.- Overrides:
getChildCount
in classJComponentHpr<T extends javax.swing.JTable>
-
initUI
public void initUI(T aTable, UIOwner anOwner)
Initializes newly created object.- Overrides:
initUI
in classJComponentHpr<T extends javax.swing.JTable>
-
addColumn
public javax.swing.table.TableColumn addColumn(javax.swing.JTable aTable, java.lang.String aHeader, java.lang.String aBindKey, int anIndex, int aWidth)
Adds a column for header, bind key, width.
-
addColumns
public void addColumns(javax.swing.JTable aTable, java.util.List<java.lang.String> theKeys)
Adds columns for a list of keys.
-
removeColumns
public void removeColumns(javax.swing.JTable aTable)
Removes columns.
-
scrollCellToVisible
public static void scrollCellToVisible(javax.swing.JTable aTable, int aRow, int aColumn)
Scrolls a table so that given row and column are visible.
-
setColumnWidths
public static void setColumnWidths(javax.swing.JTable aTable)
Sets table column widths to preferred size.
-
getPropertyNamesImpl
protected java.util.List<java.lang.String> getPropertyNamesImpl(T anObj)
Returns the property names for given object.- Overrides:
getPropertyNamesImpl
in classJComponentHpr<T extends javax.swing.JTable>
-
getPropertyNameMapped
public java.lang.String getPropertyNameMapped(T anObj, java.lang.String aName)
Returns a mapped property name.- Overrides:
getPropertyNameMapped
in classUIHelper<T extends javax.swing.JTable>
-
setValue
public void setValue(T aTable, java.lang.String aPropertyName, java.lang.Object aValue)
Sets the selected row index.
-
getItems
public java.util.List getItems(T aTable)
Returns the items for an object.
-
setItems
public void setItems(T aTable, java.util.List theItems)
Sets the items for an object.
-
getSelectedIndex
public int getSelectedIndex(T aTable)
Returns the selected index property of given object.- Overrides:
getSelectedIndex
in classUIHelper<T extends javax.swing.JTable>
-
setSelectedIndex
public void setSelectedIndex(T aTable, int anIndex)
Sets the selected index property of given object to given value.- Overrides:
setSelectedIndex
in classUIHelper<T extends javax.swing.JTable>
-
getSelectedItem
public java.lang.Object getSelectedItem(T aTable)
Returns the selected object property of given object.- Overrides:
getSelectedItem
in classUIHelper<T extends javax.swing.JTable>
-
setSelectedItem
public void setSelectedItem(T aTable, java.lang.Object aValue)
Sets the selected object property of given object to given value.- Overrides:
setSelectedItem
in classUIHelper<T extends javax.swing.JTable>
-
isValueAdjusting
public boolean isValueAdjusting(T aTable)
Returns whether table value is adjusting.- Overrides:
isValueAdjusting
in classUIHelper<T extends javax.swing.JTable>
-
-