|
Compiere 3.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.compiere.swing.CPanel
org.compiere.grid.GridController
public class GridController
The Grid Controller is the panel for single and multi-row presentation and links to the Model Tab.
UI Structure:
this (BorderLayout)
splitPane (JSplitPane)
left
graphicPanel
right
cardPanel JPanel (CardLayout)
srPane JSplitPane
vPane JScrollPane
vPanel VPanel (GridBagLayout)
vIncludedGC GridController
mrPane JScrollPane
vTable VTable
DataBinding:
- MultiRow - is automatic between VTable and MTable
- SingleRow
- from VEditors via fireVetoableChange(m_columnName, null, getText());
(vetoableChange)
- to VEditors via updateSingleRow -> Editor.setValue(object)
Event Chains
-- Navigation --
(VTable selection -> GridController.valueChanged)
(APanel selection)
+ GridTab.navivate
+ GridTab.setCurrentRow
+ Update all GridFields
+ GridField.setValue
+ setContext
+ fire PropertyChange "Value"
+ VEditor.propertyChange
+ VEditor.setValue
+ GridTab.fireProperyChange "CurrentRow"
+ VTable.propertyChange (setRowSelectionInterval)
+ GridController.valueChange
+ GridController.dynamicDisplay(complete)
+ GridTab.fireDataStatusChanged
+ APanel.statusChanged
-- ValueChanges --
VEditor.fireVetoableChange
+ (VCellEditor.vetoableChange/getCellEditorValue) -- multi-row source
+ (GridController.vetoableChange) -- single-row source
+ GridTable.setValueAt
+ GridField.setValue
+ setContext
+ fire PropertyChange "Value"
+ VEditor.setValue
+ GridTable.fireDataStatusChanged
+ GridTab.dataStatusChanged
+ GridTab.fireDataStatusChanged
+ APanel.statusChanged
+ GridController.dataStatusChanged
+ GridController.dynamicDisplay(selective)
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
JPanel.AccessibleJPanel |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary |
|---|
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
GridController(boolean withRowHeader)
Constructor - you need to call initGrid for instanciation |
|
| Method Summary | |
|---|---|
void |
activate()
Activate Grid Controller. |
void |
addDataStatusListener(DataStatusListener l)
Add Data Status Listener - pass on to MTab |
void |
dataStatusChanged(DataStatusEvent e)
Data Status Listener - for MTab events. |
void |
dispose()
Displose |
void |
dynamicDisplay(int col)
Dynamic Display |
String |
get_ValueAsString(String variableName)
Get Variable Value |
GridTab |
getMTab()
Get Model Tab |
VTable |
getTable()
Get VTable |
String |
getTitle()
Get Title |
boolean |
includeTab(GridController gc)
Include Tab |
boolean |
initGrid(GridTab mTab,
boolean onlyMultiRow,
int WindowNo,
APanel aPanel,
GridWindow mWindow)
Init Grid. |
boolean |
isDisplayed()
Is Tab displayed |
boolean |
isSingleRow()
Is Single Row presentation |
void |
mouseClicked(MouseEvent e)
Mouse Clicked |
void |
mouseEntered(MouseEvent e)
Mouse Entered |
void |
mouseExited(MouseEvent e)
Mouse Exited |
void |
mousePressed(MouseEvent e)
Mouse Pressed |
void |
mouseReleased(MouseEvent e)
Mouse Released |
void |
propertyChange(PropertyChangeEvent e)
PropertyChange Listener - Tree Panel - node selection |
boolean |
query(int onlyCurrentDays,
int maxRows,
boolean created)
Query Tab and resize Table (called from APanel) |
void |
registerESCAction(AppsAction aIgnore)
Register ESC Actions - overwrite VTable's Keystroke assignment for ESC |
void |
removeDataStatusListener(DataStatusListener l)
Remove Listener - pass on to MTab |
void |
requestFocus()
Request Focus - cancel editors |
boolean |
requestFocusInWindow()
Request Focus In Window |
void |
rowChanged(boolean save,
int keyID)
Row Changed - synchronize with Tree |
void |
setMnemonics(boolean set)
Set Window level Mnemonics |
void |
stopEditor(boolean saveValue)
Stop Table & SR Editors and move focus to graphPanel |
void |
switchMultiRow()
Switch to MultiRow Presentation |
void |
switchRowPresentation()
Switch from single to multi & vice versa |
void |
switchSingleRow()
Switch to SingleRow Presentation |
String |
toString()
toString |
void |
valueChanged(ListSelectionEvent e)
List Selection Listener (VTable) - row changed |
void |
vetoableChange(PropertyChangeEvent e)
Vetoable Change Listener. |
| Methods inherited from class org.compiere.swing.CPanel |
|---|
getBackgroundColor, getTabLevel, setBackground, setBackgroundColor, setTabLevel |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public GridController(boolean withRowHeader)
withRowHeader - with numbers in Front| Method Detail |
|---|
public String toString()
toString in class CPanelpublic void dispose()
public boolean initGrid(GridTab mTab,
boolean onlyMultiRow,
int WindowNo,
APanel aPanel,
GridWindow mWindow)
- Map table to model - Update (multi-row) table info with renderers/editors - build single-row panel - initialize display
mTab - tabonlyMultiRow - only tableWindowNo - window noaPanel - optional Application Panel for adding button listenersmWindow - parent Window Model
public boolean includeTab(GridController gc)
gc - grod controller to add
public String getTitle()
public void activate()
public void registerESCAction(AppsAction aIgnore)
aIgnore - ignore
public boolean query(int onlyCurrentDays,
int maxRows,
boolean created)
onlyCurrentDays - how many days backmaxRows - maximum rows or 0 for allcreated - query based on created if true otherwise updatedpublic void switchRowPresentation()
public void switchSingleRow()
public void switchMultiRow()
public boolean isSingleRow()
public boolean requestFocusInWindow()
requestFocusInWindow in class JComponentpublic void requestFocus()
requestFocus in class JComponentpublic void removeDataStatusListener(DataStatusListener l)
l - listenerpublic void addDataStatusListener(DataStatusListener l)
l - listenerpublic void dataStatusChanged(DataStatusEvent e)
Callouts are processed here for GUI changes - same as in MTab.setValue for batch changes
calls dynamicDisplay
dataStatusChanged in interface DataStatusListenere - eventpublic void valueChanged(ListSelectionEvent e)
valueChanged in interface ListSelectionListenere - eventpublic void propertyChange(PropertyChangeEvent e)
propertyChange in interface PropertyChangeListenere - eventpublic void dynamicDisplay(int col)
Single Row layout: the components's name is the ColumnName; if it matches, the MField.isDisplayed(true) is used to determine if it is visible if the component is a VEditor, setEnabled is set from the MField
Multi Row layout is not changed:
VCellRenderer calls JTable.isCellEditable -> checks MField.isEditable (Active, isDisplayed)
VCellEditor.isCellEditable calls MField.isEditable(true)
If a column is not displayed, the width is set to 0 in dynInit
Dynamic update of data is handeled in VLookup.focusGained/Lost.
When focus is gained the model is temporarily updated with the
specific validated data, if lost, it is switched back to the
unvalidated data (i.e. everything). This allows that the display
methods have a lookup to display.
Here: if the changed field has dependents and the dependent
is a Lookup and this lookup has a dynamic dependence of the changed field,
the value of that field is set to null (in MTab.processDependencies -
otherwise it would show an invalid value).
As Editors listen for value changed of their MField, the display is updated.
Called from GridController.valueChanged/dataStatusChanged, APane;.stateChanged/unlock/cmd_...
col - selective column number or 0 if all
public void rowChanged(boolean save,
int keyID)
save - true the row was saved (changed/added), false if the row was deletedkeyID - the ID of the row changed
public void vetoableChange(PropertyChangeEvent e)
throws PropertyVetoException
- for Save Confirmation dialog - for Single Row from VEditor: Update MTable
vetoableChange in interface VetoableChangeListenere - event
PropertyVetoExceptionpublic GridTab getMTab()
public boolean isDisplayed()
public VTable getTable()
public void setMnemonics(boolean set)
set - true if set otherwise unregiserpublic void stopEditor(boolean saveValue)
saveValue - save valuepublic void mouseClicked(MouseEvent e)
mouseClicked in interface MouseListenere - eventpublic void mousePressed(MouseEvent e)
mousePressed in interface MouseListenere - eventpublic void mouseReleased(MouseEvent e)
mouseReleased in interface MouseListenere - eventpublic void mouseEntered(MouseEvent e)
mouseEntered in interface MouseListenere - eventpublic void mouseExited(MouseEvent e)
mouseExited in interface MouseListenere - eventpublic String get_ValueAsString(String variableName)
get_ValueAsString in interface EvaluateevariableName - name
|
Compiere 3.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||