Package org.compiere.apps.search
Class Info
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- java.awt.Window
-
- java.awt.Dialog
-
- javax.swing.JDialog
-
- org.compiere.swing.CDialog
-
- org.compiere.apps.search.Info
-
- All Implemented Interfaces:
ActionListener
,MouseListener
,ImageObserver
,MenuContainer
,Serializable
,EventListener
,Accessible
,ListSelectionListener
,RootPaneContainer
,WindowConstants
- Direct Known Subclasses:
InfoAsset
,InfoAssignment
,InfoBPartner
,InfoCashLine
,InfoGeneral
,InfoInOut
,InfoInvoice
,InfoOrder
,InfoPayment
,InfoProduct
public abstract class Info extends CDialog implements ListSelectionListener
Search Information and return selection - Base Class.Structure: parameterPanel (JPanel) - for subclasses to add parameter fields scrollPame (JScrollPane) m_table (MiniTable) southPanel (JPanel) confirmPanel statusPanel
- Version:
- $Id: Info.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $
- Author:
- Jorg Janke, Teo Sarca
- FR [ 2846869 ] Info class - add more helper methods https://sourceforge.net/tracker/?func=detail&atid=879335&aid=2846869&group_id=176962
- FR [ 2847305 ] Info class improvements https://sourceforge.net/tracker/?func=detail&aid=2847305&group_id=176962&atid=879335
- BF [ 2860556 ] Info class throws false error https://sourceforge.net/tracker/?func=detail&aid=2860556&group_id=176962&atid=879332
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class javax.swing.JDialog
JDialog.AccessibleJDialog
-
Nested classes/interfaces inherited from class java.awt.Dialog
Dialog.AccessibleAWTDialog, Dialog.ModalExclusionType, Dialog.ModalityType
-
Nested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow, Window.Type
-
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 Modifier and Type Field Description protected CPanel
addonPanel
protected ConfirmPanel
confirmPanel
protected int
INFO_WIDTH
protected CLogger
log
Loggerprotected String
p_keyColumn
Key Column Nameprotected Info_Column[]
p_layout
Layout of Gridprotected boolean
p_loadedOK
Loading success indicatorprotected boolean
p_multiSelection
Enable more than one selectionprotected MiniTable
p_table
Tableprotected String
p_tableName
Table Nameprotected String
p_whereClause
Initial WHERE Clauseprotected int
p_WindowNo
Master (owning) Windowprotected CPanel
parameterPanel
protected int
SCREEN_HEIGHT
protected StatusBar
statusBar
-
Fields inherited from class org.compiere.swing.CDialog
ACTION_DISPOSE, s_dialogAction, s_disposeKeyStroke
-
Fields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabled
-
Fields inherited from class java.awt.Dialog
DEFAULT_MODALITY_TYPE
-
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
-
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Info(Frame frame, boolean modal, int WindowNo, String tableName, String keyColumn, boolean multiSelection, String whereClause)
Detail Constructorprotected
Info(Frame frame, boolean modal, int WindowNo, String tableName, String keyColumn, boolean multiSelection, String whereClause, boolean lookup)
Detail Constructor
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(ActionEvent e)
(Button) Action Listener & Popup Menustatic Info
create(Frame frame, boolean modal, int WindowNo, String tableName, String keyColumn, String value, boolean multiSelection, String whereClause)
Factory Constructorprotected void
customize()
Customize dialog To be overwritten by concrete classesvoid
dispose()
Dispose (not OK)void
dispose(boolean ok)
Dispose and save Selectionprotected void
doReset()
Reset Parameters To be overwritten by concrete classesprotected void
enableButtons()
Enable OK, History, Zoom if row/s selected --- Changes: Changed the logic for accomodating multiple selectionprotected void
executeQuery()
Execute Queryprotected int
getAD_Window_ID(String tableName, boolean isSOTrx)
Get Zoom Windowprotected String
getKeyColumn()
Get Key Column Nameprotected int
getKeyColumnIndex()
Object
getSelectedKey()
Get (first) selected KeyObject[]
getSelectedKeys()
Get selected Keysprotected Integer
getSelectedRowKey()
Get the key of currently selected rowprotected ArrayList<Integer>
getSelectedRowKeys()
Get the keys of selected row/s based on layout defined in prepareTableString
getSelectedSQL()
Get where clause for (first) selected keyprotected abstract String
getSQLWhere()
Get dynamic WHERE part of SQL To be overwritten by concrete classesprotected String
getTableName()
Get Table name Synonymprotected boolean
hasCustomize()
Has Customize (false) To be overwritten by concrete classesprotected boolean
hasHistory()
Has History (false) To be overwritten by concrete classesprotected boolean
hasReset()
Has Reset (false) To be overwritten by concrete classesprotected boolean
hasZoom()
Has Zoom (false) To be overwritten by concrete classesboolean
isCancelled()
Is cancelled?boolean
isCancelPressed()
boolean
isDefaultSelected()
(for multi-selection only)boolean
isDoubleClickTogglesSelection()
(for multi-selection only)boolean
isLookup()
boolean
isOkPressed()
boolean
isResetValue()
protected void
jbInit()
Static Initboolean
loadedOK()
Loaded correctlyvoid
mouseClicked(MouseEvent e)
Mouse Clickedprotected void
prepareTable(Info_Column[] layout, String from, String staticWhere, String orderBy)
Prepare Table, Construct SQL (m_m_sqlMain, m_sqlAdd) and size Windowprotected void
saveSelection()
Save Selection - Called by disposeprotected void
saveSelectionDetail()
Save Selection Details To be overwritten by concrete classesvoid
setDefaultSelected(boolean value)
Specify if the records should be checked(selected) by default.void
setDoubleClickTogglesSelection(boolean value)
(for multi-selection only)protected abstract void
setParameters(PreparedStatement pstmt, boolean forCount)
Set Parameters for Query To be overwritten by concrete classesvoid
setStatusDB(String text)
Set Status DBvoid
setStatusLine(String text, boolean error)
Set Status Linestatic void
showAsset(Frame frame, int WindowNo)
Show Asset Info (non modal)static void
showAssignment(Frame frame, int WindowNo, String value)
Show Assignment Info (non modal)static void
showBPartner(Frame frame, int WindowNo)
Show BPartner Info (non modal)static void
showCashLine(Frame frame, int WindowNo, String value)
Show Cash Line Info (non modal)protected void
showHistory()
History dialog To be overwritten by concrete classesstatic void
showInOut(Frame frame, int WindowNo, String value)
Show Shipment Info (non modal)static void
showInvoice(Frame frame, int WindowNo, String value)
Show Invoice Info (non modal)static void
showOrder(Frame frame, int WindowNo, String value)
Show Order Info (non modal)static void
showPayment(Frame frame, int WindowNo, String value)
Show Payment Info (non modal)static void
showProduct(Frame frame, int WindowNo)
Show Product Info (non modal)void
valueChanged(ListSelectionEvent e)
Table Selection Changedprotected void
zoom()
Zoom action To be overwritten by concrete classesprotected void
zoom(int AD_Window_ID, MQuery zoomQuery)
Zoom to target-
Methods inherited from class org.compiere.swing.CDialog
dialogInit, mouseEntered, mouseExited, mousePressed, mouseReleased, setTitle
-
Methods inherited from class javax.swing.JDialog
addImpl, createRootPane, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
-
Methods inherited from class java.awt.Dialog
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setUndecorated, setVisible, show, toBack
-
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, toFront
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
INFO_WIDTH
protected final int INFO_WIDTH
-
SCREEN_HEIGHT
protected final int SCREEN_HEIGHT
-
p_WindowNo
protected int p_WindowNo
Master (owning) Window
-
p_tableName
protected String p_tableName
Table Name
-
p_keyColumn
protected String p_keyColumn
Key Column Name
-
p_multiSelection
protected boolean p_multiSelection
Enable more than one selection
-
p_whereClause
protected String p_whereClause
Initial WHERE Clause
-
p_table
protected MiniTable p_table
Table
-
p_layout
protected Info_Column[] p_layout
Layout of Grid
-
p_loadedOK
protected boolean p_loadedOK
Loading success indicator
-
log
protected CLogger log
Logger
-
confirmPanel
protected ConfirmPanel confirmPanel
-
addonPanel
protected CPanel addonPanel
-
statusBar
protected StatusBar statusBar
-
parameterPanel
protected CPanel parameterPanel
-
-
Constructor Detail
-
Info
protected Info(Frame frame, boolean modal, int WindowNo, String tableName, String keyColumn, boolean multiSelection, String whereClause)
Detail Constructor- Parameters:
frame
- parent framemodal
- modalWindowNo
- window notableName
- table namekeyColumn
- key column namemultiSelection
- multiple selectionwhereClause
- where clause
-
Info
protected Info(Frame frame, boolean modal, int WindowNo, String tableName, String keyColumn, boolean multiSelection, String whereClause, boolean lookup)
Detail Constructor- Parameters:
frame
- parent framemodal
- modalWindowNo
- window notableName
- table namekeyColumn
- key column namemultiSelection
- multiple selectionwhereClause
- where clauselookup
-
-
-
Method Detail
-
create
public static Info create(Frame frame, boolean modal, int WindowNo, String tableName, String keyColumn, String value, boolean multiSelection, String whereClause)
Factory Constructor- Parameters:
frame
- parent framemodal
- new window is modalWindowNo
- window notableName
- table name of the searchkeyColumn
- key column of the searchvalue
- query valuemultiSelection
- allow to select more than one rowwhereClause
- fully qualified where clause for the search- Returns:
- special or general Info Window
-
showBPartner
public static void showBPartner(Frame frame, int WindowNo)
Show BPartner Info (non modal)- Parameters:
frame
- Parent FrameWindowNo
- window no
-
showAsset
public static void showAsset(Frame frame, int WindowNo)
Show Asset Info (non modal)- Parameters:
frame
- Parent FrameWindowNo
- window no
-
showProduct
public static void showProduct(Frame frame, int WindowNo)
Show Product Info (non modal)- Parameters:
frame
- Parent FrameWindowNo
- window no
-
showOrder
public static void showOrder(Frame frame, int WindowNo, String value)
Show Order Info (non modal)- Parameters:
frame
- Parent FrameWindowNo
- window novalue
- query value
-
showInvoice
public static void showInvoice(Frame frame, int WindowNo, String value)
Show Invoice Info (non modal)- Parameters:
frame
- Parent FrameWindowNo
- window novalue
- query value
-
showInOut
public static void showInOut(Frame frame, int WindowNo, String value)
Show Shipment Info (non modal)- Parameters:
frame
- Parent FrameWindowNo
- window novalue
- query value
-
showPayment
public static void showPayment(Frame frame, int WindowNo, String value)
Show Payment Info (non modal)- Parameters:
frame
- Parent FrameWindowNo
- window novalue
- query value
-
showCashLine
public static void showCashLine(Frame frame, int WindowNo, String value)
Show Cash Line Info (non modal)- Parameters:
frame
- Parent FrameWindowNo
- window novalue
- query value
-
showAssignment
public static void showAssignment(Frame frame, int WindowNo, String value)
Show Assignment Info (non modal)- Parameters:
frame
- Parent FrameWindowNo
- window novalue
- query value
-
loadedOK
public boolean loadedOK()
Loaded correctly- Returns:
- true if loaded OK
-
setStatusLine
public void setStatusLine(String text, boolean error)
Set Status Line- Parameters:
text
- texterror
- error
-
setStatusDB
public void setStatusDB(String text)
Set Status DB- Parameters:
text
- text
-
prepareTable
protected void prepareTable(Info_Column[] layout, String from, String staticWhere, String orderBy)
Prepare Table, Construct SQL (m_m_sqlMain, m_sqlAdd) and size Window- Parameters:
layout
- layout arrayfrom
- from clausestaticWhere
- where clauseorderBy
- order by clause
-
executeQuery
protected void executeQuery()
Execute Query
-
saveSelection
protected void saveSelection()
Save Selection - Called by dispose
-
getSelectedRowKey
protected Integer getSelectedRowKey()
Get the key of currently selected row- Returns:
- selected key
-
getSelectedRowKeys
protected ArrayList<Integer> getSelectedRowKeys()
Get the keys of selected row/s based on layout defined in prepareTable- Returns:
- IDs if selection present
-
getSelectedKeys
public Object[] getSelectedKeys()
Get selected Keys- Returns:
- selected keys (Integers)
-
getSelectedKey
public Object getSelectedKey()
Get (first) selected Key- Returns:
- selected key
-
isCancelled
public boolean isCancelled()
Is cancelled? - if pressed Cancel = true - if pressed OK or window closed = false- Returns:
- true if cancelled
-
getSelectedSQL
public String getSelectedSQL()
Get where clause for (first) selected key- Returns:
- WHERE Clause
-
actionPerformed
public void actionPerformed(ActionEvent e)
(Button) Action Listener & Popup Menu- Specified by:
actionPerformed
in interfaceActionListener
- Overrides:
actionPerformed
in classCDialog
- Parameters:
e
- event- See Also:
ActionListener.actionPerformed(java.awt.event.ActionEvent)
-
zoom
protected void zoom(int AD_Window_ID, MQuery zoomQuery)
Zoom to target- Parameters:
AD_Window_ID
- window idzoomQuery
- zoom query
-
dispose
public void dispose(boolean ok)
Dispose and save Selection- Parameters:
ok
- OK pressed
-
getTableName
protected String getTableName()
Get Table name Synonym- Returns:
- table name
-
getKeyColumn
protected String getKeyColumn()
Get Key Column Name- Returns:
- column name
-
valueChanged
public void valueChanged(ListSelectionEvent e)
Table Selection Changed- Specified by:
valueChanged
in interfaceListSelectionListener
- Parameters:
e
- event
-
enableButtons
protected void enableButtons()
Enable OK, History, Zoom if row/s selected --- Changes: Changed the logic for accomodating multiple selection
-
getSQLWhere
protected abstract String getSQLWhere()
Get dynamic WHERE part of SQL To be overwritten by concrete classes- Returns:
- WHERE clause
-
setParameters
protected abstract void setParameters(PreparedStatement pstmt, boolean forCount) throws SQLException
Set Parameters for Query To be overwritten by concrete classes- Parameters:
pstmt
- statementforCount
- for counting records- Throws:
SQLException
-
doReset
protected void doReset()
Reset Parameters To be overwritten by concrete classes
-
hasReset
protected boolean hasReset()
Has Reset (false) To be overwritten by concrete classes- Returns:
- true if it has reset (default false)
-
showHistory
protected void showHistory()
History dialog To be overwritten by concrete classes
-
hasHistory
protected boolean hasHistory()
Has History (false) To be overwritten by concrete classes- Returns:
- true if it has history (default false)
-
customize
protected void customize()
Customize dialog To be overwritten by concrete classes
-
hasCustomize
protected boolean hasCustomize()
Has Customize (false) To be overwritten by concrete classes- Returns:
- true if it has customize (default false)
-
zoom
protected void zoom()
Zoom action To be overwritten by concrete classes
-
hasZoom
protected boolean hasZoom()
Has Zoom (false) To be overwritten by concrete classes- Returns:
- true if it has zoom (default false)
-
saveSelectionDetail
protected void saveSelectionDetail()
Save Selection Details To be overwritten by concrete classes
-
getAD_Window_ID
protected int getAD_Window_ID(String tableName, boolean isSOTrx)
Get Zoom Window- Parameters:
tableName
- table nameisSOTrx
- sales trx- Returns:
- AD_Window_ID
-
getKeyColumnIndex
protected int getKeyColumnIndex()
- Returns:
- Index of Key Column
-
isOkPressed
public boolean isOkPressed()
- Returns:
- true if OK button was pressed
-
isCancelPressed
public boolean isCancelPressed()
- Returns:
- true if Cancel button was pressed
-
setDefaultSelected
public void setDefaultSelected(boolean value)
Specify if the records should be checked(selected) by default. (for multi-selection only)- Parameters:
value
-
-
isDefaultSelected
public boolean isDefaultSelected()
(for multi-selection only)- Returns:
- true if records are selected by default
-
setDoubleClickTogglesSelection
public void setDoubleClickTogglesSelection(boolean value)
(for multi-selection only)- Parameters:
value
- true if double click should toggle record selection
-
isDoubleClickTogglesSelection
public boolean isDoubleClickTogglesSelection()
(for multi-selection only)- Returns:
- true if double click should toggle record selection
-
isResetValue
public boolean isResetValue()
-
isLookup
public boolean isLookup()
-
mouseClicked
public void mouseClicked(MouseEvent e)
Mouse Clicked- Specified by:
mouseClicked
in interfaceMouseListener
- Overrides:
mouseClicked
in classCDialog
- Parameters:
e
- event- See Also:
MouseListener.mouseClicked(java.awt.event.MouseEvent)
-
-