|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Dialog
javax.swing.JDialog
org.tentackle.ui.FormDialog
org.tentackle.appworx.AppDbObjectSearchDialog
public class AppDbObjectSearchDialog
A generic search dialog.
| 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 |
| 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.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 javax.swing.WindowConstants |
|---|
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
AppDbObjectSearchDialog(ContextDb contextDb,
Class<? extends AppDbObject> searchClass,
Class[] selectClasses,
boolean allowCreate,
boolean modal)
Creates a search dialog. |
|
AppDbObjectSearchDialog(QbfPlugin qbfPlugin,
Class[] selectClasses,
boolean allowCreate,
boolean modal)
Creates a search dialog. |
|
AppDbObjectSearchDialog(Window owner,
ContextDb contextDb,
Class<? extends AppDbObject> searchClass,
Class[] selectClasses,
boolean allowCreate,
boolean modal)
Creates a search dialog. |
|
AppDbObjectSearchDialog(Window owner,
QbfPlugin qbfPlugin,
Class[] selectClasses,
boolean allowCreate,
boolean modal)
Creates a search dialog. |
|
| Method Summary | |
|---|---|
boolean |
checkAutoClose()
Checks if window should be autoclosed. |
protected void |
clearResult()
Clears the search result. |
static AppDbObjectSearchDialog |
createAppDbObjectSearchDialog(Component comp,
ContextDb contextDb,
Class<? extends AppDbObject> searchClass,
Class[] selectClasses,
boolean allowCreate,
boolean modal)
Creates a search dialog. |
static AppDbObjectSearchDialog |
createAppDbObjectSearchDialog(Component comp,
QbfPlugin qbfPlugin,
Class[] selectClasses,
boolean allowCreate,
boolean modal)
Creates a search dialog. |
protected void |
doCancel()
Cancels the dialog. (clears the selection and the qbf parameter). |
protected void |
doMoreSearch()
Search in results. |
protected void |
doSearch(Db db)
Runs the database search. |
AppDbObjectNaviPanel |
getNaviPanel()
Gives access to the current navigation panel. |
QbfParameter |
getQbfParameter()
Gets the qbf parameter. |
QbfPlugin |
getQbfPlugin()
get the Qbf-Plugin |
AppDbObject |
getSelectedObject()
Gets the (first) selected object. |
List<AppDbObject> |
getSelectedObjects()
Gets the list of all selected objects. |
protected void |
insertTree(List<AppDbObject> list)
Inserts a list of objects into the navigation panel. |
boolean |
isAutoSelectFirstItem()
Returns whether the first object is automatically selected or not. |
boolean |
isMultiSelection()
Returns whether multiple selections are allowed or not. |
boolean |
isNoShowIfSingle()
Returnss whether the dialog should not show up if there is only one object matching. |
boolean |
isQbfSelection()
Returns whether this dialog is configured to "save a query". |
protected QbfPlugin |
makePlugin(ContextDb contextDb,
Class<? extends AppDbObject> searchClass)
Determines the plugin from the searchClass. |
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. |
void |
setMultiSelection(boolean multiSelection)
Sets whether multiple selections are allowed or not. |
void |
setNoShowIfSingle(boolean noShowIfSingle)
Sets whether the dialog should not show up if there is only one object matching. |
void |
setQbfParameter(QbfParameter qbfParameter)
Sets the qbf parameter. |
void |
setQbfPlugin(QbfPlugin qbfPlugin)
Set the qbf-Plugin (if custom) |
void |
setQbfSelection(boolean qbfSelection)
Enables a button for "save query" and configures the dialog to dispose if that button is pressed. |
protected void |
setup(ContextDb contextDb,
Class<? extends AppDbObject> searchClass,
Class[] selectClasses,
boolean allowCreate)
Sets up the dialog by context and searchclass. |
protected void |
setup(QbfPlugin qbfPlugin,
Class[] selectClasses,
boolean allowCreate)
Sets up the dialog by plugin. |
AppDbObject |
showDialog()
Shows the dialog (modal or non-modal). |
| Methods inherited from class java.awt.Dialog |
|---|
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setModalityType, setResizable, setTitle, setUndecorated, setVisible, show, toBack |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.tentackle.ui.FormContainer |
|---|
getTitle, setTitle |
| Constructor Detail |
|---|
public AppDbObjectSearchDialog(Window owner,
ContextDb contextDb,
Class<? extends AppDbObject> searchClass,
Class[] selectClasses,
boolean allowCreate,
boolean modal)
owner - the owner window, null if nonecontextDb - the database contextsearchClass - the object class'es table to search in, null = all tablesselectClasses - the allowed selectionsallowCreate - true if "new"-button for creation of a new object of searchClassmodal - true if modal dialog
public AppDbObjectSearchDialog(ContextDb contextDb,
Class<? extends AppDbObject> searchClass,
Class[] selectClasses,
boolean allowCreate,
boolean modal)
contextDb - the database contextsearchClass - the object class'es table to search in, null = all tablesselectClasses - the allowed selectionsallowCreate - true if "new"-button for creation of a new object of searchClassmodal - true if modal dialog
public AppDbObjectSearchDialog(Window owner,
QbfPlugin qbfPlugin,
Class[] selectClasses,
boolean allowCreate,
boolean modal)
owner - the owner window, null if noneqbfPlugin - the QBF pluginselectClasses - the allowed selectionsallowCreate - true if "new"-button for creation of a new object of searchClassmodal - true if modal dialog
public AppDbObjectSearchDialog(QbfPlugin qbfPlugin,
Class[] selectClasses,
boolean allowCreate,
boolean modal)
qbfPlugin - the QBF pluginselectClasses - the allowed selectionsallowCreate - true if "new"-button for creation of a new object of searchClassmodal - true if modal dialog| Method Detail |
|---|
public static AppDbObjectSearchDialog createAppDbObjectSearchDialog(Component comp,
QbfPlugin qbfPlugin,
Class[] selectClasses,
boolean allowCreate,
boolean modal)
comp - the component to determine the owner window, null if noneqbfPlugin - the QBF pluginselectClasses - the allowed selectionsallowCreate - true if "new"-button for creation of a new object of searchClassmodal - true if modal dialog
public static AppDbObjectSearchDialog createAppDbObjectSearchDialog(Component comp,
ContextDb contextDb,
Class<? extends AppDbObject> searchClass,
Class[] selectClasses,
boolean allowCreate,
boolean modal)
comp - the component to determine the owner window, null if nonecontextDb - the database contextsearchClass - the object class'es table to search in, null = all tablesselectClasses - the allowed selectionsallowCreate - true if "new"-button for creation of a new object of searchClassmodal - true if modal dialog
public QbfPlugin getQbfPlugin()
public void setQbfPlugin(QbfPlugin qbfPlugin)
qbfPlugin - New value of property qbfPlugin.public boolean checkAutoClose()
The default implementation returns true if the window is isAutoCloseable(), isVisible(), the time since the last change has elapsed and the formvalues were not changed.
Overridden to allow autoclosing whether the values in QbfPanels are changed or not. The time of last change is set in insertTree() and whenever a QBF-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 AppDbObjectNaviPanel 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 void setQbfParameter(QbfParameter qbfParameter)
qbfParameter - the qbf parameterpublic QbfParameter getQbfParameter()
public AppDbObject showDialog()
Notice: if multiSelection=true the first selected object is returned. U se getSelectedObjects() to get all objects
public AppDbObject getSelectedObject()
public List<AppDbObject> getSelectedObjects()
public boolean isQbfSelection()
public void setQbfSelection(boolean qbfSelection)
qbfSelection - true to enable qbf selection mode, default is falsepublic boolean isNoShowIfSingle()
public void setNoShowIfSingle(boolean noShowIfSingle)
noShowIfSingle - true if return single object immediately, false if show (default)protected void runSearch()
Depending on the qbf parameter the search is run in a separate thread.
QbfParameter.searchInExtraThreadprotected void doSearch(Db db)
db - the optional db, null if use default from qbf parameterprotected void doMoreSearch()
protected void insertTree(List<AppDbObject> list)
list - the list of objectsprotected void doCancel()
protected QbfPlugin makePlugin(ContextDb contextDb,
Class<? extends AppDbObject> searchClass)
throws ApplicationException
contextDb - the database contextsearchClass - the allowed selections
ApplicationException - if plugin could not be determined
protected void setup(ContextDb contextDb,
Class<? extends AppDbObject> searchClass,
Class[] selectClasses,
boolean allowCreate)
contextDb - the database contextsearchClass - the object class'es table to search in, null = all tablesselectClasses - the allowed selectionsallowCreate - true if "new"-button for creation of a new object of searchClass
protected void setup(QbfPlugin qbfPlugin,
Class[] selectClasses,
boolean allowCreate)
qbfPlugin - the QBF pluginselectClasses - the allowed selectionsallowCreate - true if "new"-button for creation of a new object of searchClassprotected void clearResult()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||