public class PageActionManager
extends java.lang.Object
implements javafx.event.EventHandler<javafx.event.ActionEvent>
Modifier and Type | Class and Description |
---|---|
static interface |
PageActionManager.ActionSourceTransformer
for some widgets, a subcomponent will fire the event, but a parent widget has
the action attached to it.
|
Constructor and Description |
---|
PageActionManager(ClientDisplay clientdisplay,
PageActionManager.ActionSourceTransformer actionsourcetransformer)
Creates a new action manager
|
Modifier and Type | Method and Description |
---|---|
void |
addUnsavedDataWarning(UnsavedDataWarning unsaveddatawarning) |
boolean |
checkContinueWarning() |
protected UnsavedDataWarning |
checkwarnings(CPageAction currentaction) |
protected UnsavedDataWarning |
checkwarnings(CPageInlineAction currentaction) |
void |
directfireEvent(CPageAction action)
directly fires an event to be processed.
|
void |
directfireEvent(CPageAction action,
Callback callback) |
void |
directfireInlineEvent(CPageInlineAction action) |
ClientDisplay |
getClientDisplay() |
ClientSession |
getClientSession() |
javafx.event.EventHandler<javafx.scene.input.MouseEvent> |
getMouseHandler() |
void |
handle(javafx.event.ActionEvent event) |
void |
registerCallback(java.lang.Object object,
Callback callback) |
void |
registerEvent(java.lang.Object object,
CPageAction action) |
void |
registerEventWithModifier(java.lang.Object object,
CPageAction action,
PageActionModifier modifier)
Register an event with modifier for display of action result in the same tab
|
void |
registerEventWithModifier(java.lang.Object object,
CPageAction action,
PageActionModifier modifier,
boolean openinnewtab)
Register an event with modifier for display of action result in the same tab
|
void |
registerInlineAction(java.lang.Object widget,
CPageInlineAction inlineaction)
registers an inline action
|
void |
registerInlineActionWithModifier(java.lang.Object widget,
CPageInlineAction inlineaction,
PageActionModifier modifier) |
void |
registerInlineActionwithPopupClose(java.lang.Object widget,
CPageInlineAction inlineaction)
registers an inline action that should close the attached popup
|
void |
removedUnsavedDataWarningForNode(CPageNode node) |
void |
reset()
removes all stored information before displaying a new page
|
void |
resetWarnings()
reset all warnings for unsaved data
|
void |
setPage(CPage page) |
public PageActionManager(ClientDisplay clientdisplay, PageActionManager.ActionSourceTransformer actionsourcetransformer)
clientdisplay
- parent displayactionsourcetransformer
- transformer that gets, when relevant, the higher level widget (e.g.
tableview) from the lowest level widget (e.g. tablecell)public ClientDisplay getClientDisplay()
public ClientSession getClientSession()
public void addUnsavedDataWarning(UnsavedDataWarning unsaveddatawarning)
unsaveddatawarning
- configures an unsaveddatawarning on a node. If an
action is fired from another node, the unsaved data warning will display firstpublic void removedUnsavedDataWarningForNode(CPageNode node)
node
- remove an unsaveddatawarning on a node.public void reset()
public void resetWarnings()
public void registerCallback(java.lang.Object object, Callback callback)
object
- object the callback is configured oncallback
- callback objectpublic void registerEvent(java.lang.Object object, CPageAction action)
object
- the object (JAVAFX widget) that will fire an eventaction
- the action to launch in that casepublic void registerEventWithModifier(java.lang.Object object, CPageAction action, PageActionModifier modifier)
object
- the object (JAVAFX widget) that will fire an eventaction
- the action to launch in that casemodifier
- relevant modifier (like Control, Shift pressed)public void registerEventWithModifier(java.lang.Object object, CPageAction action, PageActionModifier modifier, boolean openinnewtab)
object
- the object (JAVAFX widget) that will fire an eventaction
- the action to launch in that casemodifier
- relevant modifier (like Control, Shift pressed)openinnewtab
- if true, action result shown in new tab (keeping current
page in current tab), if false action result shown on
current tab (overwriting current page)public javafx.event.EventHandler<javafx.scene.input.MouseEvent> getMouseHandler()
protected UnsavedDataWarning checkwarnings(CPageAction currentaction)
currentaction
- the action being triggeredprotected UnsavedDataWarning checkwarnings(CPageInlineAction currentaction)
currentaction
- the inline action behind triggeredpublic boolean checkContinueWarning()
public void directfireEvent(CPageAction action)
action
- the action firedpublic void directfireEvent(CPageAction action, Callback callback)
action
- the action to firecallback
- the callbackpublic void directfireInlineEvent(CPageInlineAction action)
action
- an inline actionpublic void handle(javafx.event.ActionEvent event)
handle
in interface javafx.event.EventHandler<javafx.event.ActionEvent>
public void setPage(CPage page)
page
- sets the page for the widget (does not perform any processing)public void registerInlineAction(java.lang.Object widget, CPageInlineAction inlineaction)
widget
- widget to trigger the actioninlineaction
- inline action to launchpublic void registerInlineActionwithPopupClose(java.lang.Object widget, CPageInlineAction inlineaction)
widget
- widget to trigger the actioninlineaction
- inline action to launchpublic void registerInlineActionWithModifier(java.lang.Object widget, CPageInlineAction inlineaction, PageActionModifier modifier)
widget
- widget to trigger the actioninlineaction
- forcePopupClosemodifier
- a modifier (like shift pressed...)