public class DefaultFormContext extends java.lang.Object implements FormContextI, java.lang.Cloneable, TransactionListenerI, DBManEventListenerI, SaveBOListenerI
BREADCRUMB_FINDER_FOR_THREAD| Constructor and Description |
|---|
DefaultFormContext(ClientContextI _ctx,
BO _bo) |
DefaultFormContext(ClientContextI _ctx,
BO _bo,
javax.swing.JRootPane _jRootPane) |
DefaultFormContext(ClientContextI _ctx,
BO _bo,
javax.swing.JRootPane _jRootPane,
DBManEventProviderI _eventProvider) |
| Modifier and Type | Method and Description |
|---|---|
BO |
_getBO() |
void |
addFormContextListener(FormContextListenerI l) |
void |
addSubContext(FormContextI a) |
void |
afterSave() |
void |
appendThisAndAllSubContexts(java.util.List l) |
void |
beforeSave() |
boolean |
boWasChangedExternally() |
VisibilityI |
cacheVisibility(VisibilityI v)
caches the given value b but only if visibilityTransient is false and returns the passed value
|
void |
checkPoint()
Callback after a transaction has been arrived at a checkpoint, e.g. after being committed or has no
uncommitted changes anymore.
|
void |
clearCachedVisibility()
removes the cached value for PanelVisibility
|
void |
clearTransaction() |
void |
close() |
void |
closeAllSubContexts() |
FormContextI |
createSubFormContext() |
void |
debug(java.lang.String s) |
void |
debug(java.lang.String s,
java.lang.Throwable t) |
void |
disableConflictCheckDuringSave()
Don't ignore conflicts during saving anymore if previously enabled.
|
void |
enableConflictCheckDuringSave()
Enables conflict checking during save on the root context.
|
void |
fireViewChange() |
java.util.LinkedHashMap |
getAllActionsOfKind() |
java.util.LinkedHashMap |
getAllActionsOfKind(int kind) |
java.util.LinkedHashMap |
getAllActionsOfKind(int kind,
java.util.LinkedHashMap m) |
FormElementI |
getAt(java.lang.String n) |
Transaction.Savepoint |
getBeforeUserChangesSavepoint() |
BO |
getBO() |
BO |
getBO(boolean _synchronized) |
BOLoaderI |
getBOLoader() |
BO[] |
getBOs() |
ClientContextI |
getClientContext() |
javax.swing.JComponent |
getComponentToStallRefresh()
Retrieves the JComponent whose repaint should be temporarily stalled during a refresh operation.
|
ClientContextI |
getCtx() |
DBManEventProviderI |
getEventProvider() |
FormElementI |
getFormElement() |
java.awt.Component |
getIconContextObject() |
javax.swing.JRootPane |
getJRootPane() |
EntityI |
getLowestCommonDenominateEntity() |
FormElementI |
getNamedElement(java.lang.String n) |
FormContextI |
getParent() |
java.lang.String |
getPath() |
void |
getPath(java.lang.StringBuilder s) |
FormContextI |
getRoot()
Gets the Root-FormContextI which has no parent.
|
javax.swing.RootPaneContainer |
getRootPaneContainer() |
FormContextSaveHandlerI |
getSaveHandler() |
BeanShellScript |
getScript() |
java.util.Map |
getScriptParameters() |
FormContextI |
getSoleSubContext() |
java.util.List |
getSubContexts() |
java.util.Iterator |
getSubContextsIterator() |
FormContextI[] |
getThisAndAllSubContextsAsArray() |
Transaction |
getTransaction() |
VisibilityI |
getVisibility()
returns the cached value for PanelVisibility or null if visibilityTransient is true
|
boolean |
hasCachedVisibility() |
boolean |
hasScript() |
boolean |
hasUnsavedFormData() |
boolean |
hasUnsavedUserData() |
void |
initScript() |
void |
invalidateAllSubContextsCache() |
boolean |
isClosed() |
boolean |
isRoot() |
boolean |
isSyncEventHandlingPaused()
If true, then {link #sync()} calls for this element should be ignored, e.g. because the form is currently saving.
|
void |
mdiActivate(MDIElementI me) |
void |
mdiClose(MDIElementI me) |
void |
mdiDeactivate(MDIElementI me) |
void |
mdiOpen(MDIElementI me) |
void |
newProcOnEDT(long mostRecent)
Callback used by
newProcs(BOProc[]) after recorded changes into the Transaction. |
void |
newProcs(BOProc[] bps)
Callback for
Transaction#fireNewProcs after procs have been added
in the transaction used by this DefaultFormContext. |
void |
newUndo(BOProc bp) |
boolean |
pauseFiringNewProcs()
Creates a token to pause updating the GUI with changes in the Transaction for a while.
|
void |
postRefresh() |
void |
postRefresh(int from) |
void |
processDBManEvent(DBManEvent _event)
Invoked when a subscribed DBManEvent occurs.
|
void |
refreshBO(FormContextI _realFtx,
java.lang.String _propertyname,
boolean _transactionControl,
boolean _autoCreate,
electric.xml.Element _confRoot) |
boolean |
refreshForm(boolean viewRefresh,
boolean forceRefreshRelation)
Deprecated.
|
boolean |
refreshForm(boolean viewRefresh,
boolean forceRefreshRelation,
int from)
Deprecated.
|
void |
refreshForms()
Refreshes the form-parts that belong to this FormContextI and all subforms that belong to
any subcontext of this FormContextI.
|
void |
refreshForms(int from)
Refreshes the form-parts that belong to this FormContextI and all subforms that belong to
any subcontext of this FormContextI.
|
void |
refreshForms(int from,
long onlyBOId,
long ifNotSince)
Refreshes the form-parts that belong to this FormContextI and all subforms that belong to
any subcontext of this FormContextI.
|
void |
refreshFormsFromInitialViewRefresh()
Refreshes the form-parts that belong to this FormContextI and all subforms that belong to
any subcontext of this FormContextI in the context of an initial view refresh.
|
void |
refreshView()
Only refreshes the window titles and other 'outside' stuff, not the form itself or parts of it.
|
void |
removeAllFormContextListeners() |
void |
removeFormContextListener(FormContextListenerI l) |
void |
removeSubContext(FormContextI a) |
void |
resetBOWasChangedExternally() |
boolean |
resumeFiringNewProcs()
Resumes updates to the GUI after a previous call of pauseFiringNewProcs(),
unless updates are inh, due to changes in the Transaction for a while.
|
boolean |
saveFormData() |
boolean |
saveFormData(boolean willCloseRightAfter) |
void |
setBeforeUserChangesSavepoint(Transaction.Savepoint _sp) |
boolean |
setBO(BO _bo) |
void |
setBOLoader(BOLoaderI bol) |
void |
setCtx(ClientContextI $106) |
void |
setEditable(boolean b) |
void |
setEditable(boolean b,
boolean dontRefresh) |
void |
setEventProvider(DBManEventProviderI $108) |
void |
setFormElement(FormElementI $102) |
void |
setJRootPane(javax.swing.JRootPane $109) |
void |
setLowestCommonDenominateEntity(EntityI $101)
FormContextSaveHandler that doesn't ignore conflicts during saving.
|
void |
setNamedElement(java.lang.String n,
FormElementI e) |
void |
setParent(FormContextI $105) |
void |
setRootPaneContainer(javax.swing.RootPaneContainer $110) |
void |
setSaveHandler(FormContextSaveHandlerI $107) |
void |
setScript(BeanShellScript $103) |
void |
setScriptParameters(java.util.Map $104) |
void |
setTransaction(Transaction tx) |
void |
setVisibilityTransient()
marks this FormContextI as visibilityTransient, thus defecting cache of PanelVisibility-values
|
void |
startListeningNewProcs()
internal
|
void |
sync()
Synchronize the data of the form and the model
|
void |
toast(java.lang.String text) |
void |
toast(java.lang.String text,
int delayMs) |
void |
toastError(java.lang.String text) |
void |
toastError(java.lang.String text,
int delayMs) |
void |
transactionSaveSuccess(Transaction stubTx,
java.util.Map<java.lang.Long,java.lang.Long> tempIdToDbIdMap,
java.util.function.Predicate<Transaction> isSavedTransactionInstancePredicate)
Callback for implementing SaveBOListenerI.
|
boolean |
tryFocus()
Attempts to set the keyboard focus to an appropriate component within this
form context or its sub-contexts.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitenterBreadcrumb, exitBreadcrumb, findOnlyFormElement, getContextBO, getIcon, getIcon, getIcon, getIcon, getIcon, getIcon, getIcon, getIcon, getIcon, getIcon, getIcon, getIcon, getParentBreadcrumbContextfindFirstBO, findFirstBOOfType, findFirstBOWhere, findParentBOpublic DefaultFormContext(ClientContextI _ctx, BO _bo)
public DefaultFormContext(ClientContextI _ctx, BO _bo, javax.swing.JRootPane _jRootPane)
public DefaultFormContext(ClientContextI _ctx, BO _bo, javax.swing.JRootPane _jRootPane, DBManEventProviderI _eventProvider)
public java.awt.Component getIconContextObject()
getIconContextObject in interface FormContextIpublic void addFormContextListener(FormContextListenerI l)
addFormContextListener in interface FormContextIpublic void removeFormContextListener(FormContextListenerI l)
removeFormContextListener in interface FormContextIpublic void removeAllFormContextListeners()
removeAllFormContextListeners in interface FormContextIpublic void processDBManEvent(DBManEvent _event)
DBManEventListenerIDBManBOChangeEvent for events triggered after modification on BOs.processDBManEvent in interface DBManEventListenerIpublic boolean boWasChangedExternally()
boWasChangedExternally in interface FormContextIpublic void resetBOWasChangedExternally()
resetBOWasChangedExternally in interface FormContextIpublic void refreshView()
FormContextIrefreshView in interface FormContextIpublic void close()
close in interface FormContextIpublic boolean isClosed()
isClosed in interface FormContextIpublic FormContextI createSubFormContext()
createSubFormContext in interface FormContextIpublic void initScript()
initScript in interface FormContextIpublic boolean hasScript()
hasScript in interface FormContextIpublic BeanShellScript getScript()
getScript in interface FormContextIpublic void clearTransaction()
clearTransaction in interface FormContextIpublic void setTransaction(Transaction tx)
setTransaction in interface FormContextIpublic void startListeningNewProcs()
FormContextIstartListeningNewProcs in interface FormContextIpublic Transaction getTransaction()
getTransaction in interface FormContextIpublic void setBOLoader(BOLoaderI bol)
setBOLoader in interface FormContextIpublic BOLoaderI getBOLoader()
getBOLoader in interface FormContextIpublic boolean pauseFiringNewProcs()
FormContextIpauseFiringNewProcs in interface FormContextIpublic boolean resumeFiringNewProcs()
FormContextIresumeFiringNewProcs in interface FormContextIpublic boolean isSyncEventHandlingPaused()
FormContextIisSyncEventHandlingPaused in interface FormContextIpublic void invalidateAllSubContextsCache()
invalidateAllSubContextsCache in interface FormContextIpublic void addSubContext(FormContextI a)
addSubContext in interface FormContextIpublic void removeSubContext(FormContextI a)
removeSubContext in interface FormContextIpublic java.util.List getSubContexts()
getSubContexts in interface FormContextIpublic FormContextI[] getThisAndAllSubContextsAsArray()
getThisAndAllSubContextsAsArray in interface FormContextIpublic void appendThisAndAllSubContexts(java.util.List l)
appendThisAndAllSubContexts in interface FormContextIpublic FormContextI getSoleSubContext()
public java.util.Iterator getSubContextsIterator()
getSubContextsIterator in interface FormContextIpublic void closeAllSubContexts()
public ClientContextI getClientContext()
public boolean isRoot()
isRoot in interface FormContextIpublic FormContextI getRoot()
getRoot in interface FormContextIpublic FormElementI getNamedElement(java.lang.String n)
getNamedElement in interface FormContextIpublic void setNamedElement(java.lang.String n,
FormElementI e)
setNamedElement in interface FormContextIpublic FormElementI getAt(java.lang.String n)
getAt in interface FormContextIpublic EntityI getLowestCommonDenominateEntity()
getLowestCommonDenominateEntity in interface FormContextIpublic BO getBO()
getBO in interface FormContextIpublic BO getBO(boolean _synchronized)
getBO in interface FormContextIpublic BO _getBO()
public boolean setBO(BO _bo)
setBO in interface FormContextIpublic BO[] getBOs()
getBOs in interface FormContextIpublic DBManEventProviderI getEventProvider()
getEventProvider in interface FormContextIpublic Transaction.Savepoint getBeforeUserChangesSavepoint()
getBeforeUserChangesSavepoint in interface FormContextIpublic void setBeforeUserChangesSavepoint(Transaction.Savepoint _sp)
setBeforeUserChangesSavepoint in interface FormContextIpublic boolean hasUnsavedFormData()
hasUnsavedFormData in interface FormContextIpublic boolean hasUnsavedUserData()
hasUnsavedUserData in interface FormContextIpublic void sync()
FormContextIsync in interface FormContextIpublic void beforeSave()
beforeSave in interface FormContextIpublic void afterSave()
afterSave in interface FormContextI@Deprecated
public boolean refreshForm(boolean viewRefresh,
boolean forceRefreshRelation)
@Deprecated
public boolean refreshForm(boolean viewRefresh,
boolean forceRefreshRelation,
int from)
public void postRefresh()
public void postRefresh(int from)
public void refreshForms()
FormContextIrefreshForms in interface FormContextIpublic void refreshForms(int from)
FormContextIrefreshForms in interface FormContextIfrom - An integer representing the source of the refreshForms request.
May be one of FormElementI.REFRESH_FROM_USER or
FormElementI.REFRESH_FROM_TRANSACTION.
Defaults to FormElementI.REFRESH_FROM_USER.public void refreshForms(int from,
long onlyBOId,
long ifNotSince)
FormContextIrefreshForms in interface FormContextIfrom - An integer representing the source of the refreshForms request.
May be one of FormElementI.REFRESH_FROM_USER or
FormElementI.REFRESH_FROM_TRANSACTION.
Defaults to FormElementI.REFRESH_FROM_USER.onlyBOId - A long. If specified and positive, the refresh will only be done for
the Business Object (BO) having the given Id.
Defaults to 0, meaning no specific BO ID filter.ifNotSince - A long specifying a point in time (in milliseconds since epoch).
A refresh will only be performed if the internally stored last refresh
time is earlier (smaller) than this given time.
Defaults to System.currentTimeMillis().public void refreshFormsFromInitialViewRefresh()
FormContextIrefreshFormsFromInitialViewRefresh in interface FormContextIpublic javax.swing.JComponent getComponentToStallRefresh()
This private helper method traverses the form context hierarchy upwards until it reaches the root context. It then identifies the root pane of the form element (if available) or the form element itself as the component to stall repaints for. This is done to optimize performance during bulk UI updates.
JComponent (typically a JRootPane or the main form element)
whose repaint should be stalled.public boolean tryFocus()
This method first tries to set focus within its own direct form element
without recursing into child contexts (via tryFocusNoRecurse()).
If that fails, it then iterates through all registered sub-contexts
and recursively calls tryFocus() on each, returning true if any sub-context
successfully gains focus.
tryFocus in interface FormContextItrue if focus was successfully requested by any component
within this context or its sub-contexts, false otherwise.public boolean saveFormData()
saveFormData in interface FormContextIwith parameter falsepublic boolean saveFormData(boolean willCloseRightAfter)
saveFormData in interface FormContextIpublic void enableConflictCheckDuringSave()
<onBeforeSave language="groovy"><![CDATA[ ftx.enableConflictCheckDuringSave() ]]></onBeforeSave>
enableConflictCheckDuringSave in interface FormContextIpublic void disableConflictCheckDuringSave()
FormContextIdisableConflictCheckDuringSave in interface FormContextIpublic void fireViewChange()
public void mdiOpen(MDIElementI me)
mdiOpen in interface FormContextIpublic void mdiClose(MDIElementI me)
mdiClose in interface FormContextIpublic void mdiActivate(MDIElementI me)
mdiActivate in interface FormContextIpublic void mdiDeactivate(MDIElementI me)
mdiDeactivate in interface FormContextIpublic void newProcs(BOProc[] bps)
Transaction#fireNewProcs after procs have been added
in the transaction used by this DefaultFormContext.
This method is probably called on the EDT during the middle of handling a setter.
Since data consistence cannot be guaranteed at this point, move the update phase to later.
(called via FPanel#sync -> FPanel#setBOValue -> ... -> BO#recordAdd -> Transaction#recordAdd)
All received bps are queued into newProcPendingForBO, using newProcLock
as lock, so these changes can be accessed later on.newProcs in interface TransactionListenerIpublic void newProcOnEDT(long mostRecent)
newProcs(BOProc[]) after recorded changes into the Transaction.
Accesses newProcPendingForBO and updates the corresponding fields.public void newUndo(BOProc bp)
public void checkPoint()
TransactionListenerIcheckPoint in interface TransactionListenerIpublic java.util.LinkedHashMap getAllActionsOfKind()
public java.util.LinkedHashMap getAllActionsOfKind(int kind)
getAllActionsOfKind in interface FormContextIpublic java.util.LinkedHashMap getAllActionsOfKind(int kind,
java.util.LinkedHashMap m)
public java.lang.String getPath()
getPath in interface FormContextIpublic void getPath(java.lang.StringBuilder s)
getPath in interface FormContextIpublic void setEditable(boolean b)
setEditable in interface FormContextIpublic void setEditable(boolean b,
boolean dontRefresh)
setEditable in interface FormContextIpublic void refreshBO(FormContextI _realFtx, java.lang.String _propertyname, boolean _transactionControl, boolean _autoCreate, electric.xml.Element _confRoot)
refreshBO in interface FormContextIpublic void toastError(java.lang.String text)
toastError in interface de.ipcon.swing.ToastDisplayIpublic void toastError(java.lang.String text,
int delayMs)
toastError in interface de.ipcon.swing.ToastDisplayIpublic void toast(java.lang.String text)
toast in interface de.ipcon.swing.ToastDisplayIpublic void toast(java.lang.String text,
int delayMs)
toast in interface de.ipcon.swing.ToastDisplayIpublic void clearCachedVisibility()
clearCachedVisibility in interface FormContextIpublic VisibilityI cacheVisibility(VisibilityI v)
cacheVisibility in interface FormContextIpublic void setVisibilityTransient()
setVisibilityTransient in interface FormContextIpublic boolean hasCachedVisibility()
hasCachedVisibility in interface FormContextIpublic VisibilityI getVisibility()
getVisibility in interface FormContextIpublic void transactionSaveSuccess(Transaction stubTx, java.util.Map<java.lang.Long,java.lang.Long> tempIdToDbIdMap, java.util.function.Predicate<Transaction> isSavedTransactionInstancePredicate)
transactionSaveSuccess in interface SaveBOListenerIstubTx - A shallow copy (stub) of the saved Transaction object. This object contains
all the business data of the transaction but is detached from any active
persistence context. It is intended for read-only use, such as updating
display logic or triggering post-save business processes.tempIdToDbIdMap - A map containing the original temporary IDs of new entities
within the transaction as keys, and their newly assigned persistent
database IDs as values. This is crucial for updating references to
these entities in local data structures. A key-value pair of
(tempId, dbId) indicates that the entity with tempId was saved
and now has dbId.isSavedTransactionInstancePredicate - A predicate to verify if a given
Transaction instance is the same object that was just saved. This is
particularly useful in scenarios where multiple instances of a transaction
might exist in memory. By using this predicate, callers can efficiently
identify the specific instance that needs to be updated or processed,
avoiding redundant operations. The predicate returns true if the provided
transaction is the same instance, and false otherwise.public void debug(java.lang.String s)
public void debug(java.lang.String s,
java.lang.Throwable t)
public void setLowestCommonDenominateEntity(EntityI $101)
setLowestCommonDenominateEntity in interface FormContextIpublic FormElementI getFormElement()
getFormElement in interface FormContextIpublic void setFormElement(FormElementI $102)
setFormElement in interface FormContextIpublic void setScript(BeanShellScript $103)
setScript in interface FormContextIpublic java.util.Map getScriptParameters()
getScriptParameters in interface FormContextIpublic void setScriptParameters(java.util.Map $104)
setScriptParameters in interface FormContextIpublic FormContextI getParent()
getParent in interface FormContextIpublic void setParent(FormContextI $105)
setParent in interface FormContextIpublic ClientContextI getCtx()
getCtx in interface FormContextIpublic void setCtx(ClientContextI $106)
public FormContextSaveHandlerI getSaveHandler()
getSaveHandler in interface FormContextIpublic void setSaveHandler(FormContextSaveHandlerI $107)
setSaveHandler in interface FormContextIpublic void setEventProvider(DBManEventProviderI $108)
public javax.swing.JRootPane getJRootPane()
getJRootPane in interface FormContextIpublic void setJRootPane(javax.swing.JRootPane $109)
setJRootPane in interface FormContextIpublic javax.swing.RootPaneContainer getRootPaneContainer()
getRootPaneContainer in interface FormContextIpublic void setRootPaneContainer(javax.swing.RootPaneContainer $110)
setRootPaneContainer in interface FormContextICopyright © 2000-2025 OAshi S.à r.l. All Rights Reserved.