T - the PDO type@FxControllerService(binding=NO) public class PdoSearch<T extends PersistentDomainObject<T>> extends AbstractFxController implements PdoHolder<T>
| Constructor and Description |
|---|
PdoSearch() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
bindOkButton()
Binds the ok button so that it is enabled only if a PDO is selected.
|
void |
cancel()
Close and cancel.
|
void |
clearSelection()
Clears the selection.
|
void |
close()
Close the search.
|
void |
configure() |
void |
createPdo()
Creates a new PDO.
|
protected javafx.scene.Node |
createPlaceHolder()
Creates the placeholder node for the empty search result in table view.
|
void |
filterResult()
Filters the result.
|
void |
find()
Runs the search and displays the results.
|
FxHBox |
getButtonBox()
Gets the HBox containing all buttons.
|
Consumer<T> |
getDoubleClickHandler()
Gets the double click handler.
|
PdoFinder<T> |
getFinder()
Gets the pdo finder.
|
javafx.collections.ObservableList<T> |
getItems()
Gets the items shown in the table or tree.
|
String |
getNoDataMessage()
Gets the message displayed in tableview when there was no data found.
|
T |
getPdo()
Gets the pdo.
|
javafx.collections.ObservableList<T> |
getSelectedItems()
Returns the selected PDOs.
|
FxTableView<T> |
getTableView()
Gets access to the table view.
If the tree is shown, it will be switched to the table view. |
javafx.collections.ObservableList<T> |
getTotalsItems()
Gets the totals if shown.
|
FxTreeView<T> |
getTreeView()
Gets access to the tree view.
If the table is shown, it will be switched to the tree view. |
void |
initialize(URL location,
ResourceBundle resources) |
boolean |
isCreatePdoAllowed()
Returns whether creating a new PDO is allowed.
|
protected boolean |
isCrudShown()
Returns whether a CRUD is currently shown for this search.
|
boolean |
isFinderVisible()
Returns whether the finder is visible.
|
boolean |
isSingleSelectMode()
Returns single selection mode.
|
boolean |
isTreeShown()
Returns whether the tree is shown instead of the table.
|
void |
setCreatePdoAllowed(boolean allowed)
Sets whether creating a new PDO is allowed.
|
void |
setDoubleClickHandler(Consumer<T> doubleClickHandler)
Sets the double-click handler.
If the search dialog is non-modal and the user double-clicks on a row of the table view, this handler will be invoked instead of the default (showing the PDO editor, if any provided). |
void |
setFinder(PdoFinder<T> finder)
Sets the pdo finder.
|
void |
setFinderVisible(boolean visible)
Sets the visibility of the finder.
The method must be invoked after setPdo because the finder will be made visible according to |
void |
setItems(javafx.collections.ObservableList<T> items)
Shows the search results.
|
void |
setNoDataMessage(String noDataMessage)
Sets the message displayed in tableview when there was no data found.
|
void |
setPdo(T pdo)
Sets the pdo as a template for the search.
|
void |
setSingleSelectMode(boolean singleSelectMode)
Sets the single selection mode.
This mode is usually used in a modal dialog to select exactly one PDO. |
void |
setTotals(javafx.collections.ObservableList<T> totals)
Sets the totals.
Shows the results from PdoFinder.createTotals(javafx.collections.ObservableList<T>) or hides the totals if none. |
void |
showTable()
Switches to the table view.
|
void |
showTree()
Switches to the tree view.
|
void |
updateTitle()
Updates the window title if attached to its own stage.
|
createBinder, getBinder, getContainer, getDefaultScopes, getFXMLFields, getFXMLMethods, getStage, getView, setView, validateInjectionspublic String getNoDataMessage()
public void setNoDataMessage(String noDataMessage)
noDataMessage - the placeholder message, null if default message, empty if no message at allpublic Consumer<T> getDoubleClickHandler()
public void setDoubleClickHandler(Consumer<T> doubleClickHandler)
doubleClickHandler - the handler, null to clearpublic FxHBox getButtonBox()
public void setFinder(PdoFinder<T> finder)
finder - the finderpublic void setPdo(T pdo)
setPdo in interface PdoHolder<T extends PersistentDomainObject<T>>pdo - the pdopublic T getPdo()
getPdo in interface PdoHolder<T extends PersistentDomainObject<T>>public void setFinderVisible(boolean visible)
visible - true if visiblepublic boolean isFinderVisible()
public void setSingleSelectMode(boolean singleSelectMode)
singleSelectMode - true if select a single PDOpublic boolean isSingleSelectMode()
public void setCreatePdoAllowed(boolean allowed)
allowed - true if allowedpublic boolean isCreatePdoAllowed()
public void setTotals(javafx.collections.ObservableList<T> totals)
PdoFinder.createTotals(javafx.collections.ObservableList<T>) or hides the totals if none.totals - the totals (usually one item), null or empty if noneTotalsTableViewpublic javafx.collections.ObservableList<T> getTotalsItems()
public void updateTitle()
public void find()
public void setItems(javafx.collections.ObservableList<T> items)
items - the found PDOspublic javafx.collections.ObservableList<T> getItems()
public void filterResult()
public javafx.collections.ObservableList<T> getSelectedItems()
public void clearSelection()
public boolean isTreeShown()
public void showTree()
public FxTreeView<T> getTreeView()
public void showTable()
public FxTableView<T> getTableView()
public void cancel()
public void close()
public void createPdo()
public void initialize(URL location, ResourceBundle resources)
initialize in interface javafx.fxml.Initializableinitialize in class AbstractFxControllerpublic void configure()
configure in interface FxControllerconfigure in class AbstractFxControllerprotected void bindOkButton()
protected boolean isCrudShown()
protected javafx.scene.Node createPlaceHolder()
Tentackle - distributed, domain- and model-driven