borland.jbcl Packages borland.jbcl Class Hierarchy borland.jbcl.control
java.lang.Object +----java.awt.Component +----java.awt.Container +----java.awt.Panel +----borland.jbcl.view.GridView +----borland.jbcl.control.GridControl
Variables Constructors Properties Methods Event Listeners
Implements AccessListener, DataChangeListener, NavigationListener, MatrixModel, MatrixSubfocusListener, WritableMatrixModel, BlackBox, HeaderListener, MatrixView, Scroller, MenuContainer, ImageObserver, Serializable, EventListener
This component allows database- or spreadsheet-type editing of data. It contains top and left Header objects and extends GridView.
The GridControl is a graphical user interface element that shows a table of values. Use a GridControl when you want to display a table of values in your application. This value can be any specific table of items, or a value stored in a DataSet.
The GridControl is a composite component that follows the model-view architecture and uses a Grid data model. Use the Grid data model if you want to display a specified table of values.
The GridControl can also derive its value from a DataSet. In such cases, the data source of this value is specified by its dataSet properties.
public GridControl()Uses GridView to construct a GridControl component with no generated columns. Includes a horizontal header and, if allowed, a vertical header. Creates a temporary placeholder dataset using TableDataSet. Includes a single column with a null heading.
public boolean isAutoInsert() public void setAutoInsert(boolean auto)
The autoInsert property stores whether to automatically insert a row. Inserts a blank data object when the GridControl is empty.
When focusGained is called, if the grid is not read-only and if there are variable rows, this method adds a row.
The default is true.
public int getColumnCount()The columnCount property stores the number of columns in the GridControl.
public void setColumnViews(borland.jbcl.view.ColumnView[] newViews)A ColumnView is the set of properties that describe a visible column in the GridControl.
Overrides: borland.jbcl.view.GridView.columnViews
public DataSet getDataSet() public void setDataSet(borland.jbcl.dataset.DataSet newDataSet)The data source that provides items to show in the GridControl.
public synchronized String[][] getItems() public synchronized void setItems(java.lang.String[][] newItems)Set this property to make the grid control behave like a string grid.
This is a non-data-aware property for data. Uses an internal model for spreadsheet-type uses.
The items property in the Component Inspector shows the following dialog:
public void setModel(borland.jbcl.model.MatrixModel model)The object that actually contains the data. Used by the items property.
public boolean isMultiSelect() public void setMultiSelect(boolean select)Allows or prevents user-selection of a range of cells. Overrides selectRow and selectColumn.
public boolean isNavigateWithDataSet() public void setNavigateWithDataSet(boolean navigate)Set this property to control whether the GridControl's sub-focus drives the dataSet and vice-versa. If true, navigating within the Grid navigates all controls connected to the same dataSet. If false, the Grid will navigate independently of other controls connected to the dataSet.
public int getRowCount()The rowCount property stores the number of rows that are in the model that supplies the GridControl.
public boolean isSelectColumn() public void setSelectColumn(boolean select)Selects the entire column as you navigate within the GridControl.
public boolean isSelectRow() public void setSelectRow(boolean select)Specifies whether the entire row is selected as you navigate within the GridControl.
public boolean isShowPopup() public void setShowPopup(boolean show)
Whether to show the context menu when the pointer is over the grid cells and the user right-clicks. The menu is shown below.
public boolean isSortOnHeaderClick() public void setSortOnHeaderClick(boolean sort)If true and dataSet is set, sorts on the selected column. If false or if dataSet is not set, moves the focus to that column.
public boolean isVariableColumns()The variableColumns property stores whether columns can be added to or removed from the matrix model that supplies the GridControl. If true, columns can be added or removed.
public boolean isVariableRows()The variableRows property stores whether rows can be added to or removed from the matrix model that supplies the GridControl. If true, rows can be added or removed.
public void addNotify()A hook to open the dataSet when the Grid is displayed, if the dataSet's autoOpen property is set.
protected ColumnView[] buildColumnViews(borland.jbcl.dataset.DataSet cursor, borland.jbcl.view.ColumnView[] oldViews, boolean rebuild)Returns an array of columnViews constructed from the passed DataSet and array of old columnView components. If rebuild is true, it ignores old columnView components and constructs a new array based on the passed DataSet. If rebuild is false, it merely fills in un-set properties in the old columnViews with values from the DataSet.
protected void columnHeaderClicked(int column)An event response. Checks on the states of sort and acts accordingly.
Overrides: borland.jbcl.view.CompositeGridView.columnHeaderClicked(int)
public void toggleColumnSort(int column)Calls DataSet.toggleViewOrder() for the current column. Only applies if a DataSet is used. If the DataSet is in the editing state, saves the current row to the DataSet.
public void addActionListener(java.awt.event.ActionListener l) public void removeActionListener(java.awt.event.ActionListener l)
public synchronized void addComponentListener(java.awt.event.ComponentListener l) public synchronized void removeComponentListener(java.awt.event.ComponentListener l)
public synchronized void addContainerListener(java.awt.event.ContainerListener l) public void removeContainerListener(java.awt.event.ContainerListener l)
public void addFocusListener(java.awt.event.FocusListener listener) public void removeFocusListener(java.awt.event.FocusListener listener)
public void addKeyListener(java.awt.event.KeyListener l) public void removeKeyListener(java.awt.event.KeyListener l)
public void addModelListener(borland.jbcl.model.MatrixModelListener listener) public void removeModelListener(borland.jbcl.model.MatrixModelListener listener)
public void addMouseListener(java.awt.event.MouseListener l) public void removeMouseListener(java.awt.event.MouseListener l)
public void addMouseMotionListener(java.awt.event.MouseMotionListener l) public void removeMouseMotionListener(java.awt.event.MouseMotionListener l)
public void addSelectionListener(borland.jbcl.model.MatrixSelectionListener listener) public void removeSelectionListener(borland.jbcl.model.MatrixSelectionListener listener)
public void addSubfocusListener(borland.jbcl.model.MatrixSubfocusListener listener) public void removeSubfocusListener(borland.jbcl.model.MatrixSubfocusListener listener)