public class AcquiredLocksPresenter extends PresenterWithStateMachine<AcquiredLocksPresenter.MyView,AcquiredLocksPresenter.MyProxy> implements AcquiredLocksUIHandler
| Modifier and Type | Class and Description |
|---|---|
static class |
AcquiredLocksPresenter.AcquiredLocksViewStates
Defines the Acquired Locks View states
|
static interface |
AcquiredLocksPresenter.MyProxy
Defines the proxy place for GWTP framework.
|
static interface |
AcquiredLocksPresenter.MyView
This view interface that must be implemented by the concrete view according to GWTP
framework.
|
| Modifier and Type | Field and Description |
|---|---|
private java.util.LinkedHashSet<RecordInfo> |
addedRecords
New records added to the acquired records table but not locked yet
|
private AdminServiceAsync |
adminService
Administration server interface
|
private static boolean[] |
ALL_BUTTONS
Defines the buttons mask in which all buttons are enabled.
|
private static boolean[] |
LOCK_TABLE_BUTTONS
Defines the buttons mask in which the Lock and Unlock buttons are enabled.
|
private java.util.LinkedHashSet<RecordInfo> |
lockedRecords
All locked records
|
static com.gwtplatform.mvp.client.presenter.slots.NestedSlot |
MODAL_CONTENT
The attachment point for modal dialogs on this view
|
private ModalDialogs |
modalDialogsManager
The common modal dialogs manager
|
private static boolean[] |
NO_RECORDS_STATE
Defines the view transitional state in which the acquired lock table is empty.
|
private static boolean[] |
SELECTION_BUTTONS
Defines the buttons mask in which the Delete Selected button is enabled.
|
private static boolean[] |
SELECTION_NOT_EMPTY_STATE
Defines the view transitional state in which the acquired lock table has selected rows.
|
private Alarm |
serverAlarmsManager
The server alarms manager
|
private static boolean[] |
TABLE_BUTTONS
Defines the buttons mask in which the Lock and Delete All buttons are enabled.
|
private static boolean[] |
THERE_IS_LOCK_STATE
Defines the view transitional state in which the acquired lock table has locked records.
|
private static boolean[] |
THERE_IS_RECORD_STATE
Defines the view transitional state in which the acquired lock table has a one row at least.
|
FILTER, filterExp, logger| Constructor and Description |
|---|
AcquiredLocksPresenter(com.google.web.bindery.event.shared.EventBus eventBus,
AcquiredLocksPresenter.MyView view,
AcquiredLocksPresenter.MyProxy proxy,
com.gwtplatform.mvp.client.proxy.PlaceManager placeManager,
ViewStateMachine viewStateMachine,
AdminServiceAsync adminService,
ModalDialogs modalDialogsManager,
Alarm serverAlarmsManager)
Defines the Acquired Locks presenter.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addRecordToLocks(java.lang.String databaseName,
java.lang.String tableName,
java.lang.Long recordID)
Adds new unlocked record to the acquired locks table view.
|
void |
deleteAllRecords()
Delete all unlocked records from the acquired locks table.
|
void |
deleteSelectedRecords(java.util.Set<RecordInfo> selected)
Delete the selected unlocked records.
|
void |
lockRecords()
Executes the action to lock new added records from the acquired locks table.
|
void |
prepareFromRequest(com.gwtplatform.mvp.shared.proxy.PlaceRequest request)
Loads the data before the associated view will be displayed.
|
void |
refreshDatabases()
Retrieves all managed databases asynchronously and refreshes the corresponding widgets.
|
void |
refreshTables(java.lang.String databaseName)
Retrieves all tables from the given database asynchronously and refreshes the corresponding
widgets.
|
void |
setCurrentState(ViewStateMachine.TransitionState transitionState)
Applies the given transitional state to the current state of the view state machine.
|
void |
unlockRecords()
Executes the action to unlock locked records.
|
private void |
updateLockedRecords()
Retrieves all locked records from the server asynchronously and refreshes the acquired locks
table model and view if this action is completed successfully.
|
private void |
updateLockedRecords(java.lang.Runnable command)
Retrieves all locked records from the server asynchronously and refreshes the acquired locks
table model and performs the ui command if this action is completed successfully.
|
changeState, restoreState, setStatebackTo, clearRequestParameter, getCurrentFilter, getCurrentParameter, getPlaceManager, getQueryParametersMap, getQueryString, getQueryString, setFilter, updateBrowserHistorybind, forceReveal, getProxy, getRevealType, getSlot, revealInParent, setRevealType, setSlot, unbind, useManualRevealaddHandler, addRegisteredHandler, addToPopupSlot, addToPopupSlot, addToSlot, addToSlot, addVisibleHandler, asWidget, clearSlot, clearSlot, equals, fireEvent, fireEvent, getChild, getChildren, getChildren, getEventBus, getView, hashCode, isVisible, onHide, onReset, onReveal, registerVisibleHandler, removeFromParentSlot, removeFromPopupSlot, removeFromSlot, removeFromSlot, setInSlot, setInSlot, setInSlot, setInSlotprivate static final boolean[] NO_RECORDS_STATE
private static final boolean[] THERE_IS_RECORD_STATE
private static final boolean[] THERE_IS_LOCK_STATE
private static final boolean[] SELECTION_NOT_EMPTY_STATE
private static final boolean[] LOCK_TABLE_BUTTONS
private static final boolean[] SELECTION_BUTTONS
private static final boolean[] TABLE_BUTTONS
private static final boolean[] ALL_BUTTONS
public static final com.gwtplatform.mvp.client.presenter.slots.NestedSlot MODAL_CONTENT
private final AdminServiceAsync adminService
private final Alarm serverAlarmsManager
private final ModalDialogs modalDialogsManager
private final java.util.LinkedHashSet<RecordInfo> lockedRecords
private final java.util.LinkedHashSet<RecordInfo> addedRecords
@Inject
AcquiredLocksPresenter(com.google.web.bindery.event.shared.EventBus eventBus,
AcquiredLocksPresenter.MyView view,
AcquiredLocksPresenter.MyProxy proxy,
com.gwtplatform.mvp.client.proxy.PlaceManager placeManager,
@Named(value="AcquiredLocksViewStateMachine")
ViewStateMachine viewStateMachine,
AdminServiceAsync adminService,
ModalDialogs modalDialogsManager,
Alarm serverAlarmsManager)
eventBus - The event busview - The associated viewproxy - The proxy placeplaceManager - The place managerviewStateMachine - The view state machineadminService - The administration servicemodalDialogsManager - The common modal dialogs managerserverAlarmsManager - The server alarmspublic void prepareFromRequest(com.gwtplatform.mvp.shared.proxy.PlaceRequest request)
prepareFromRequest in class com.gwtplatform.mvp.client.Presenter<AcquiredLocksPresenter.MyView,AcquiredLocksPresenter.MyProxy>request - The current requestpublic void refreshDatabases()
refreshDatabases in interface AcquiredLocksUIHandlerpublic void refreshTables(java.lang.String databaseName)
refreshTables in interface AcquiredLocksUIHandlerdatabaseName - The given databasepublic void lockRecords()
lockRecords in interface AcquiredLocksUIHandlerpublic void unlockRecords()
unlockRecords in interface AcquiredLocksUIHandlerpublic void addRecordToLocks(java.lang.String databaseName,
java.lang.String tableName,
java.lang.Long recordID)
addRecordToLocks in interface AcquiredLocksUIHandlerdatabaseName - The given databasetableName - The given table containing the target recordrecordID - The target record identification numberprivate void updateLockedRecords()
private void updateLockedRecords(java.lang.Runnable command)
command - The ui commandpublic void deleteSelectedRecords(java.util.Set<RecordInfo> selected)
deleteSelectedRecords in interface AcquiredLocksUIHandlerselected - The set of selected recordspublic void deleteAllRecords()
deleteAllRecords in interface AcquiredLocksUIHandlerpublic void setCurrentState(ViewStateMachine.TransitionState transitionState)
setCurrentState in interface AcquiredLocksUIHandlertransitionState - The given transitional state