public class HomePresenter extends BasePresenter<HomePresenter.MyView,HomePresenter.MyProxy> implements MenuService
Modifier and Type | Class and Description |
---|---|
(package private) static interface |
HomePresenter.MyProxy
The presenter's proxy.
|
(package private) static interface |
HomePresenter.MyView
Presenter's view.
|
Modifier and Type | Field and Description |
---|---|
private AdminServiceAsync |
adm
Admin service reference
|
private Alarm |
alarm
Alarm service reference
|
private com.google.inject.Provider<InputDialog> |
inputDialog
Input dialog provider
|
private MenuPresenter |
menu
Menu presenter
|
private static boolean |
menuBuilt
Flag that is set to true when the menu is built
|
private static MenuSetupCallback |
menuSetupCallback
Callback called at the time the menu needs to be initialized
|
private ModalDialogs |
modalDialogs
Modal dialogs
|
static com.gwtplatform.mvp.client.presenter.slots.NestedSlot |
SLOT_CONTENT
Content slot
|
static com.gwtplatform.mvp.client.presenter.slots.PermanentSlot<MenuPresenter> |
SLOT_MENU
Menu slot
|
private com.gwtplatform.mvp.shared.proxy.TokenFormatter |
tokenFormatter
Place token formatter reference
|
FILTER, filterExp, logger
Constructor and Description |
---|
HomePresenter(com.google.web.bindery.event.shared.EventBus eventBus,
HomePresenter.MyView view,
HomePresenter.MyProxy proxy,
MenuPresenter menu,
com.google.inject.Provider<InputDialog> inputDialog,
AdminServiceAsync adm,
Alarm alarm,
ModalDialogs modalDialogs,
com.gwtplatform.mvp.client.proxy.PlaceManager placeManager,
com.gwtplatform.mvp.shared.proxy.TokenFormatter tokenFormatter)
Ctor.
|
Modifier and Type | Method and Description |
---|---|
void |
addMenu(StandardMenu position,
MenuDef menuDef)
Adds menu entry into the main menu at the specified position.
|
void |
appendNewItemTo(StandardMenu position,
int subMenuPosition,
MenuDef menuDef)
Appends menu entry under the given standard menu at the specified position that defines
the target site within the given standard menu.
|
private void |
attachRefreshHandler()
Attach click handler to the refresh menu item.
|
private void |
buildMenu()
Fetches admin definition data from the server and builds the main menu from this data.
|
private java.util.Map<java.lang.String,java.lang.String> |
buildSelectionURLParameters(PrintingContext printingContext)
Used by
setupPrintHandler() to build print query parameters from the print context. |
private void |
buildShowACLByResourceMenu(AdminDef adminDef)
Initializes the show ACL by resource name menu item click handler.
|
private void |
displayPreviewSelectionDialog(PrintingContext pctx,
java.util.function.Consumer<PrintingContext.Range> done)
Initializes the preview selection dialog menu item click handler.
|
private com.google.gwt.dom.client.Element[] |
findDescendants(com.google.gwt.dom.client.Element e,
java.lang.String selector)
Finds the descendants of the given element filtered by the given selector.
|
private void |
logoff()
Logs off currently logged in user.
|
protected void |
onBind()
Lifecycle method called when binding the object.
|
protected void |
onReveal()
Lifecycle method called whenever this presenter is about to be
revealed.
|
static void |
registerMenuSetupCallback(MenuSetupCallback callback)
Sets the menu setup callback.
|
private void |
setEnabled(com.google.gwt.dom.client.Element el,
AdminProfile[] profiles,
java.lang.String name)
Enables a menu item.
|
private void |
setupAboutAdminClientHandler()
Initializes the about menu item click handler.
|
private void |
setupBackupDirectoryHandler()
Initializes the backup directory menu item click handler.
|
private void |
setupBulkAuthModeUpdateHandler()
Initializes the bulk auth mode menu item click handler.
|
private void |
setupClearMessagesHandler()
Initializes the clear server messages menu item click handler.
|
private void |
setupLogOffHandler()
Initilized the logoff link handler.
|
private void |
setupPrintHandler()
Initializes the print menu item click handler.
|
private void |
setupReloadDirectoryHandler()
Initializes the reload directory menu item click handler.
|
private void |
setupShowACLByAccountHandler()
Initializes the show ACL by account menu item click handler.
|
private void |
setupShutdownHandler()
Initializes the server shutdown menu item click handler.
|
private void |
setupTargetLiveHandler()
Initializes the live menu item click handler.
|
private void |
setupTargetRefreshHandler()
Initializes the refresh menu item click handler.
|
private void |
updateMenuAuthorization(AdminDef adminDef)
Enables or disables individual menu items according to the permissions of the logged in
user.
|
backTo, clearRequestParameter, getCurrentFilter, getCurrentParameter, getPlaceManager, getQueryParametersMap, getQueryString, getQueryString, setFilter, updateBrowserHistory
bind, forceReveal, getProxy, getRevealType, getSlot, prepareFromRequest, revealInParent, setRevealType, setSlot, unbind, useManualReveal
addHandler, addRegisteredHandler, addToPopupSlot, addToPopupSlot, addToSlot, addToSlot, addVisibleHandler, asWidget, clearSlot, clearSlot, equals, fireEvent, fireEvent, getChild, getChildren, getChildren, getEventBus, getView, hashCode, isVisible, onHide, onReset, registerVisibleHandler, removeFromParentSlot, removeFromPopupSlot, removeFromSlot, removeFromSlot, setInSlot, setInSlot, setInSlot, setInSlot
public static final com.gwtplatform.mvp.client.presenter.slots.PermanentSlot<MenuPresenter> SLOT_MENU
public static final com.gwtplatform.mvp.client.presenter.slots.NestedSlot SLOT_CONTENT
private static MenuSetupCallback menuSetupCallback
private static boolean menuBuilt
private MenuPresenter menu
private com.google.inject.Provider<InputDialog> inputDialog
private AdminServiceAsync adm
private Alarm alarm
private ModalDialogs modalDialogs
private com.gwtplatform.mvp.shared.proxy.TokenFormatter tokenFormatter
@Inject HomePresenter(com.google.web.bindery.event.shared.EventBus eventBus, HomePresenter.MyView view, HomePresenter.MyProxy proxy, MenuPresenter menu, com.google.inject.Provider<InputDialog> inputDialog, AdminServiceAsync adm, Alarm alarm, ModalDialogs modalDialogs, com.gwtplatform.mvp.client.proxy.PlaceManager placeManager, com.gwtplatform.mvp.shared.proxy.TokenFormatter tokenFormatter)
eventBus
- Event bus reference.view
- Presenter's view.proxy
- Presenter's proxy.menu
- Menu presenter.inputDialog
- Input dialog presenter.adm
- Admin service reference.alarm
- Alarm service reference.modalDialogs
- Modal dialogs.placeManager
- Place manager reference.tokenFormatter
- Token formatter reference.public static void registerMenuSetupCallback(MenuSetupCallback callback)
callback
- An instance of MenuSetupCallback
.public void addMenu(StandardMenu position, MenuDef menuDef)
addMenu
in interface MenuService
position
- The position where the new menu entry will be added.menuDef
- The new menu entry.public void appendNewItemTo(StandardMenu position, int subMenuPosition, MenuDef menuDef)
appendNewItemTo
in interface MenuService
position
- Defines the standard menu to which the new menu entry will be added as a sub menu.subMenuPosition
- Defines the menu items site where the new menu entry will be added.menuDef
- The new menu entry.protected void onBind()
onBind()
. Also, do
not call directly, call Presenter.bind()
instead.
Any event handler should be
initialised here rather than in the constructor. Also, it is good practice to
perform any costly initialisation here.onBind
in class com.gwtplatform.mvp.client.HandlerContainerImpl
protected void onReveal()
onReveal
in class com.gwtplatform.mvp.client.PresenterWidget<HomePresenter.MyView>
private void setupLogOffHandler()
private void setupBackupDirectoryHandler()
private void setupReloadDirectoryHandler()
private void setupShutdownHandler()
private void setupBulkAuthModeUpdateHandler()
private void setupClearMessagesHandler()
private void setupAboutAdminClientHandler()
private void displayPreviewSelectionDialog(PrintingContext pctx, java.util.function.Consumer<PrintingContext.Range> done)
private java.util.Map<java.lang.String,java.lang.String> buildSelectionURLParameters(PrintingContext printingContext)
setupPrintHandler()
to build print query parameters from the print context.printingContext
- Print context.private void setupPrintHandler()
private void logoff()
private void setupShowACLByAccountHandler()
private void buildShowACLByResourceMenu(AdminDef adminDef)
private void updateMenuAuthorization(AdminDef adminDef)
private void setEnabled(com.google.gwt.dom.client.Element el, AdminProfile[] profiles, java.lang.String name)
el
- A DOM element representing the menu item to enable.profiles
- Admin profile.name
- Admin profile name.private void buildMenu()
private void setupTargetLiveHandler()
private void setupTargetRefreshHandler()
private void attachRefreshHandler()
private com.google.gwt.dom.client.Element[] findDescendants(com.google.gwt.dom.client.Element e, java.lang.String selector)
e
- The given ancestor html elementselector
- The given selector