T - the pdo typepublic class PdoSearchDialog<T extends PersistentDomainObject<T>> extends FormDialog implements KeyEventDispatcher
JDialog.AccessibleJDialogDialog.AccessibleAWTDialog, Dialog.ModalExclusionType, Dialog.ModalityTypeWindow.AccessibleAWTWindow, Window.TypeContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategyaccessibleContext, rootPane, rootPaneCheckingEnabledDEFAULT_MODALITY_TYPEBOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTDISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSEABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
PdoSearchDialog(DomainContext context,
Class<T> pdoClass,
SelectionFilter selectionFilter,
boolean allowCreate,
boolean modal)
Creates a search dialog.
|
PdoSearchDialog(Window owner,
DomainContext context,
Class<T> pdoClass,
SelectionFilter selectionFilter,
boolean allowCreate,
boolean modal)
Creates a search dialog.
|
PdoSearchDialog(Window owner,
PdoSearch<T> pdoSearch,
SelectionFilter selectionFilter,
boolean allowCreate,
boolean modal)
Creates a search dialog.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkAutoClose() |
protected void |
clearResult()
Clears the search result.
|
PdoNavigationPanel<T> |
createNavigationPanel()
Creates the navigation panel.
|
protected PdoSearch<T> |
createPdoSearch(DomainContext context,
Class<T> searchClass)
Creates the default pdo search from the GUI-provider according to given PDO class.
|
boolean |
dispatchKeyEvent(KeyEvent e)
dispatch the special keys
|
protected void |
doCancel()
Cancels the dialog.
(clears the selection and the search parameter). |
protected void |
doMoreSearch()
Search in results.
|
PdoNavigationPanel<T> |
getNaviPanel()
Gives access to the current navigation panel.
|
List<T> |
getObjects()
Gets the list of all objects.
|
PdoSearch<T> |
getPdoSearch()
get the search plugin.
|
PersistentDomainObject<?> |
getSelectedObject()
Gets the (first) selected object.
|
List<PersistentDomainObject<?>> |
getSelectedObjects()
Gets the list of all selected objects.
|
SelectionFilter |
getSelectionFilter()
Gets the selection filter.
|
boolean |
isAllowCreate()
Gets the allowcreate flag.
|
boolean |
isAutoSelectFirstItem()
Returns whether the first object is automatically selected or not.
|
boolean |
isMultiSelection()
Returns whether multiple selections are allowed or not.
|
boolean |
isShowMessageIfNotFound()
Returns whether a message should be displayed if no object is found.
|
protected void |
processWindowEvent(WindowEvent e) |
protected void |
runSearch()
Runs the search.
|
void |
setAutoSelectFirstItem(boolean autoSelectFistItem)
Sets whether the first object is automatically selected or not.
|
void |
setButtonsEnabled(boolean flag)
Enables/disables all buttons.
|
protected void |
setInitialFocus()
Sets the focus to the initial or first component.
|
void |
setMultiSelection(boolean multiSelection)
Sets whether multiple selections are allowed or not.
|
void |
setPdoSearch(PdoSearch<T> pdoSearch)
Set the search plugin (if custom).
|
void |
setShowMessageIfNotFound(boolean showMessageIfNotFound)
Sets whether a message should be displayed if no object is found.
|
protected void |
setup(DomainContext context,
Class<T> pdoClass,
SelectionFilter selectionFilter,
boolean allowCreate)
Sets up the dialog by context and searchclass.
|
protected void |
setup(PdoSearch<T> pdoSearch,
SelectionFilter selectionFilter,
boolean allowCreate)
Sets up the dialog by plugin.
|
PersistentDomainObject<?> |
showDialog()
Shows the dialog (modal or non-modal).
|
protected void |
updateResult(List<T> list)
Updates the list of objects in the navigation panel.
|
addFormWrapListener, alignLocation, areValuesChanged, componentAdded, componentRemoved, createBinder, fireFormWrappedFocus, getAutoClose, getBinder, getFormValues, getHelpURL, getKeepChangedValues, getParentWindow, getRelatedWindow, getTimeOfLastValuesChanged, getTooltipDisplay, getUIVersion, invalidateParentInfo, isAutoCloseable, isAutoPosition, isAutoUpdate, isBindable, isChangeable, isHonourChangeable, isTriggerValuesChangedEnabled, pack, paint, removeFormWrapListener, saveValues, setAutoClose, setAutoPosition, setAutoUpdate, setBindable, setChangeable, setFormValues, setFormValuesKeepChanged, setHelpURL, setHonourChangeable, setKeepChangedValues, setRelatedWindow, setTimeOfLastValuesChanged, setTooltipDisplay, setTriggerValuesChangedEnabled, setUIVersion, showHelp, triggerValuesChangedaddImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, updateaddNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, setVisible, show, toBackaddPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, 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, 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, toFrontadd, 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, validateTreeaction, 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, getPeer, 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, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetTitle, setTitlepublic PdoSearchDialog(Window owner, DomainContext context, Class<T> pdoClass, SelectionFilter selectionFilter, boolean allowCreate, boolean modal)
owner - the owner window, null if nonecontext - the database contextpdoClass - the PDO class to searchselectionFilter - the section filter, null if all of PDO class are allowedallowCreate - true if "new"-button for creation of a new object of searchClassmodal - true if modal dialogpublic PdoSearchDialog(DomainContext context, Class<T> pdoClass, SelectionFilter selectionFilter, boolean allowCreate, boolean modal)
context - the database contextpdoClass - the object class'es table to search inselectionFilter - the section filter, null if all of PDO class are allowedallowCreate - true if "new"-button for creation of a new object of searchClassmodal - true if modal dialogpublic PdoSearchDialog(Window owner, PdoSearch<T> pdoSearch, SelectionFilter selectionFilter, boolean allowCreate, boolean modal)
owner - the owner window, null if nonepdoSearch - the search pluginselectionFilter - the section filter, null if all of PDO class are allowedallowCreate - true if "new"-button for creation of a new object of searchClassmodal - true if modal dialogpublic SelectionFilter getSelectionFilter()
public boolean isAllowCreate()
public PdoSearch<T> getPdoSearch()
public void setPdoSearch(PdoSearch<T> pdoSearch)
pdoSearch - New value of property pdoSearch.public boolean checkAutoClose()
Overridden to allow autoclosing whether the values in search panels are changed or not.
The time of last change is set in updateResult() and whenever a field is changed.
checkAutoClose in interface FormWindowcheckAutoClose in class FormDialogpublic void setButtonsEnabled(boolean flag)
Notice: the buttons of the plugin panel are not modified.
flag - true if all buttons enabled, false if all disabledpublic PdoNavigationPanel<T> getNaviPanel()
public void setMultiSelection(boolean multiSelection)
multiSelection - true if allowed, false if only single object (default)public boolean isMultiSelection()
public void setAutoSelectFirstItem(boolean autoSelectFistItem)
autoSelectFistItem - true if selected, false if not (default)public boolean isAutoSelectFirstItem()
public PersistentDomainObject<?> showDialog()
Notice: if multiSelection=true the first selected object is returned. U se getSelectedObjects() to get all objects
public PersistentDomainObject<?> getSelectedObject()
public List<PersistentDomainObject<?>> getSelectedObjects()
public List<T> getObjects()
public boolean isShowMessageIfNotFound()
public void setShowMessageIfNotFound(boolean showMessageIfNotFound)
showMessageIfNotFound - true if show (default), false if don't showpublic boolean dispatchKeyEvent(KeyEvent e)
dispatchKeyEvent in interface KeyEventDispatcherprotected void processWindowEvent(WindowEvent e)
Overridden to catch WINDOW_CLOSING event.
processWindowEvent in class FormDialogprotected void runSearch()
Depending on the search parameter the search is run in a separate thread.
protected void setInitialFocus()
protected void doMoreSearch()
public PdoNavigationPanel<T> createNavigationPanel()
protected void updateResult(List<T> list)
list - the list of objectsprotected void doCancel()
protected PdoSearch<T> createPdoSearch(DomainContext context, Class<T> searchClass)
context - the database contextsearchClass - the allowed selectionsprotected void setup(DomainContext context, Class<T> pdoClass, SelectionFilter selectionFilter, boolean allowCreate)
context - the database contextpdoClass - the object class'es table to search inselectionFilter - the filter for allowed selectionsallowCreate - true if "new"-button for creation of a new object of searchClassprotected void setup(PdoSearch<T> pdoSearch, SelectionFilter selectionFilter, boolean allowCreate)
pdoSearch - the search pluginselectionFilter - the filter for allowed selectionsallowCreate - true if "new"-button for creation of a new object of searchClassprotected void clearResult()
Tentackle - distributed, domain- and model-driven