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.TableColumnaddColumn(javax.swing.JTable aTable, java.lang.String aHeader, java.lang.String aBindKey, int anIndex, int aWidth)Adds a column for header, bind key, width.voidaddColumns(javax.swing.JTable aTable, java.util.List<java.lang.String> theKeys)Adds columns for a list of keys.intgetChildCount(T anObj)Override to suppress children.java.util.ListgetItems(T aTable)Returns the items for an object.java.lang.StringgetPropertyNameMapped(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.intgetSelectedIndex(T aTable)Returns the selected index property of given object.java.lang.ObjectgetSelectedItem(T aTable)Returns the selected object property of given object.voidinitUI(T aTable, UIOwner anOwner)Initializes newly created object.booleanisValueAdjusting(T aTable)Returns whether table value is adjusting.voidremoveColumns(javax.swing.JTable aTable)Removes columns.static voidscrollCellToVisible(javax.swing.JTable aTable, int aRow, int aColumn)Scrolls a table so that given row and column are visible.static voidsetColumnWidths(javax.swing.JTable aTable)Sets table column widths to preferred size.voidsetItems(T aTable, java.util.List theItems)Sets the items for an object.voidsetSelectedIndex(T aTable, int anIndex)Sets the selected index property of given object to given value.voidsetSelectedItem(T aTable, java.lang.Object aValue)Sets the selected object property of given object to given value.voidsetValue(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:
getChildCountin classJComponentHpr<T extends javax.swing.JTable>
-
initUI
public void initUI(T aTable, UIOwner anOwner)
Initializes newly created object.- Overrides:
initUIin 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:
getPropertyNamesImplin classJComponentHpr<T extends javax.swing.JTable>
-
getPropertyNameMapped
public java.lang.String getPropertyNameMapped(T anObj, java.lang.String aName)
Returns a mapped property name.- Overrides:
getPropertyNameMappedin 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:
getSelectedIndexin 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:
setSelectedIndexin classUIHelper<T extends javax.swing.JTable>
-
getSelectedItem
public java.lang.Object getSelectedItem(T aTable)
Returns the selected object property of given object.- Overrides:
getSelectedItemin 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:
setSelectedItemin classUIHelper<T extends javax.swing.JTable>
-
isValueAdjusting
public boolean isValueAdjusting(T aTable)
Returns whether table value is adjusting.- Overrides:
isValueAdjustingin classUIHelper<T extends javax.swing.JTable>
-
-