public class ACLWidget
extends com.google.gwt.user.client.ui.Composite
Modifier and Type | Class and Description |
---|---|
(package private) static interface |
ACLWidget.Binder
GWT binder.
|
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
account
Access Control filtered by account.
|
(package private) org.gwtbootstrap3.client.ui.html.Strong |
aclTitle
widget
|
private AdminServiceAsync |
adm
Admin service reference
|
private Alarm |
alarm
Alarm service
|
private java.util.List<AclRow> |
allAcls
All the ACLs, with no menu filters applied.
|
(package private) org.gwtbootstrap3.client.ui.Button |
bAdd
widget
|
(package private) org.gwtbootstrap3.client.ui.Button |
bClone
widget
|
(package private) org.gwtbootstrap3.client.ui.Button |
bDelete
widget
|
(package private) org.gwtbootstrap3.client.ui.Button |
bFilter
widget
|
(package private) org.gwtbootstrap3.client.ui.Button |
bMoveDown
widget
|
(package private) org.gwtbootstrap3.client.ui.Button |
bMoveUp
widget
|
(package private) org.gwtbootstrap3.client.ui.Button |
bRefresh
widget
|
(package private) org.gwtbootstrap3.client.ui.Button |
bResequence
widget
|
(package private) org.gwtbootstrap3.client.ui.InlineCheckBox |
cpcEv
widget
|
private ModalDialogs |
dialogs
Moda dialogs
|
private Rights |
editRights
The rights being edited
|
private boolean |
effectiveView
Effective view flag
|
(package private) org.gwtbootstrap3.client.ui.gwt.DataGrid |
grid
acl grid widget
|
private GridHandle<AclRow> |
gridHandle
ACL grid handle
|
private com.google.inject.Provider<InputDialog> |
inputDialogProvider
Input dialog provider
|
private java.lang.String |
lastFilter
The last applied filter
|
private com.google.gwt.regexp.shared.RegExp |
lastFilterRegexp
The last applied filter
|
(package private) com.google.gwt.user.client.ui.SimplePanel |
modalPanel
widget
|
private com.gwtplatform.mvp.client.proxy.PlaceManager |
placeManager
Place manager reference
|
private java.lang.String |
resourceName
Access Control filtered by resource instance name.
|
private java.lang.String |
resourceType
Access Control filtered by resource type.
|
(package private) com.google.gwt.user.client.ui.SimplePanel |
rightsModalPanel
widget
|
private static java.lang.String |
SHARED_INSTANCE
the string representation of shared instance
|
private boolean[] |
STATE_ACL_MULTI
state definition - multiple selection
|
private boolean[] |
STATE_ACL_SINGLE
state definition - single selection
|
private boolean[] |
STATE_INITIAL_EMPTY
state definition - initial empty
|
private ViewStateMachineImpl |
stateMachine
The ui state machine
|
Constructor and Description |
---|
ACLWidget(ACLWidget.Binder binder,
AdminServiceAsync adm,
Alarm alarm,
ModalDialogs dialogs,
com.gwtplatform.mvp.client.proxy.PlaceManager placeManager,
com.google.inject.Provider<InputDialog> inputDialogProvider)
Ctor.
|
Modifier and Type | Method and Description |
---|---|
private void |
addACLStep2(java.lang.String instance,
java.lang.String resType,
int aclId,
java.lang.String resName,
boolean regexpNature,
int[] subjs,
java.util.Map<java.lang.Integer,java.lang.String> subjMap,
Rights rights,
java.util.function.Consumer<java.lang.Boolean> doneHandler)
2nd phase of new ACL dialog.
|
void |
bAddClick(com.google.gwt.event.dom.client.ClickEvent event)
Click handler.
|
void |
bCloneClick(com.google.gwt.event.dom.client.ClickEvent event)
Click handler.
|
void |
bDeleteClick(com.google.gwt.event.dom.client.ClickEvent event)
Click handler.
|
void |
bFilterClick(com.google.gwt.event.dom.client.ClickEvent event)
Click handler.
|
void |
bMoveDownClick(com.google.gwt.event.dom.client.ClickEvent event)
Click handler.
|
void |
bMoveUpClick(com.google.gwt.event.dom.client.ClickEvent event)
Click handler.
|
void |
bRefreshClick(com.google.gwt.event.dom.client.ClickEvent event)
Click handler.
|
void |
bResequenceClick(com.google.gwt.event.dom.client.ClickEvent event)
Click handler.
|
void |
cpcEvChange(com.google.gwt.event.dom.client.ChangeEvent event)
Click handler.
|
private void |
deletedACL(java.util.Set<AclRow> rows)
Deletes the supplied set of acls.
|
private void |
editRights(java.lang.String resourceName,
boolean exact,
java.lang.String type,
Rights rights,
java.util.function.Consumer<Rights> doneHandler)
Shows right editor.
|
private AclRow |
getFirstSelectedRow()
Returns the first selected row.
|
private void |
handleACLCellEdit(AclRow aclItem,
int cell)
Handles edit request of the provided ACL record and the grid column.
|
private void |
handleACLsSelection()
Grid row selection change handler.
|
private void |
handleAddACL()
Handle Add ACL Item button press.
|
private void |
handleCloneACLItem()
Clone the selected ACL item.
|
private void |
handleDeleteSelectedACL()
Handle Delete Selected ACL button press.
|
private void |
handleFilter()
Handle row filtering using a generic filter.
|
private void |
handleMoveACLDown()
Handle Move ACL Down button press - if not last, it will move the ACL
one position down.
|
private void |
handleMoveACLUp()
Handle Move ACL Up button press - if not first, it will move the ACL
one position up.
|
private void |
handleResequenceACLs()
Clone the selected ACL item.
|
private boolean |
isPopup()
Checks whether the widget is displayed in a popup.
|
private void |
loadAclData(java.util.function.Consumer<java.util.List<AclRow>> resultConsumer)
Load the ACL items into
AclRow instances and return them. |
private void |
loadAclDataStep2(AclDef[] acls,
java.util.function.Consumer<java.util.List<AclRow>> resultConsumer)
Load the ACL items into
AclRow instances and return them. |
private void |
loadAllSubjects(java.util.function.Consumer<java.util.List<org.gwtbootstrap3.extras.select.client.ui.Option>> result)
Loads all subjects.
|
private AclRow |
locateAcl(java.lang.String resourceType,
java.lang.String instanceName,
int id)
Looks up the list of all ACLs and locates the one with given resource
type, instance and ID.
|
private void |
moveACL(AclRow row,
int newId)
Move an ACL to a directly specified position.
|
private void |
moveACLItem(boolean up)
Move the ACL item up or down.
|
private void |
navigateHere(java.lang.String param,
java.lang.String value)
Navigates to the view to pass new filter parameters in the view in a form of new browser
history entry.
|
private int |
nextId(boolean up,
boolean current)
Compute another ID based on the ID of the selected item.
|
void |
onNavigation()
Called when the view is navigated to.
|
private void |
populateACLList(java.lang.Runnable doneHandler)
Populate the list of ACLs with fresh data from the server.
|
void |
refresh()
Refresh the ACL list from the server.
|
private void |
setACLsMultiSelection()
Set the state of the screen when multiple rows are selected - some
buttons are enabled.
|
private void |
setACLsNoSelection()
Set the state of the screen when no row is selected - some buttons
are enabled.
|
private void |
setACLsSingleSelection()
Set the state of the screen when a single row is selected - all buttons
are enabled.
|
void |
setFilter(java.lang.String resourceType,
java.lang.String account,
java.lang.String filter,
java.lang.String name)
Sets ACL filter.
|
private void |
updateACLTitle()
Updates the ACL title.
|
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString
private static final java.lang.String SHARED_INSTANCE
@UiField org.gwtbootstrap3.client.ui.Button bRefresh
@UiField org.gwtbootstrap3.client.ui.Button bAdd
@UiField org.gwtbootstrap3.client.ui.Button bDelete
@UiField org.gwtbootstrap3.client.ui.Button bClone
@UiField org.gwtbootstrap3.client.ui.Button bMoveUp
@UiField org.gwtbootstrap3.client.ui.Button bMoveDown
@UiField org.gwtbootstrap3.client.ui.Button bFilter
@UiField org.gwtbootstrap3.client.ui.Button bResequence
@UiField(provided=true) org.gwtbootstrap3.client.ui.gwt.DataGrid grid
@UiField org.gwtbootstrap3.client.ui.InlineCheckBox cpcEv
@UiField com.google.gwt.user.client.ui.SimplePanel modalPanel
@UiField com.google.gwt.user.client.ui.SimplePanel rightsModalPanel
@UiField org.gwtbootstrap3.client.ui.html.Strong aclTitle
private final boolean[] STATE_INITIAL_EMPTY
private final boolean[] STATE_ACL_SINGLE
private final boolean[] STATE_ACL_MULTI
private java.lang.String account
private java.lang.String resourceType
private java.lang.String resourceName
private java.lang.String lastFilter
private com.google.gwt.regexp.shared.RegExp lastFilterRegexp
private java.util.List<AclRow> allAcls
private ViewStateMachineImpl stateMachine
private com.google.inject.Provider<InputDialog> inputDialogProvider
private AdminServiceAsync adm
private GridHandle<AclRow> gridHandle
private boolean effectiveView
private Rights editRights
private Alarm alarm
private ModalDialogs dialogs
private com.gwtplatform.mvp.client.proxy.PlaceManager placeManager
@Inject ACLWidget(ACLWidget.Binder binder, AdminServiceAsync adm, Alarm alarm, ModalDialogs dialogs, com.gwtplatform.mvp.client.proxy.PlaceManager placeManager, com.google.inject.Provider<InputDialog> inputDialogProvider)
binder
- GWT binder.adm
- Admin service.alarm
- Alarm service.dialogs
- Modal dialogs.placeManager
- Place manage.inputDialogProvider
- Input dialog provider.public void onNavigation()
public void setFilter(java.lang.String resourceType, java.lang.String account, java.lang.String filter, java.lang.String name)
resourceType
- Resource type.account
- Account id.filter
- Filter regular expression.name
- Resource instance name.@UiHandler(value="bRefresh") public void bRefreshClick(com.google.gwt.event.dom.client.ClickEvent event)
event
- Click event.@UiHandler(value="bAdd") public void bAddClick(com.google.gwt.event.dom.client.ClickEvent event)
event
- Click event.@UiHandler(value="bDelete") public void bDeleteClick(com.google.gwt.event.dom.client.ClickEvent event)
event
- Click event.@UiHandler(value="bClone") public void bCloneClick(com.google.gwt.event.dom.client.ClickEvent event)
event
- Click event.@UiHandler(value="bMoveUp") public void bMoveUpClick(com.google.gwt.event.dom.client.ClickEvent event)
event
- Click event.@UiHandler(value="bMoveDown") public void bMoveDownClick(com.google.gwt.event.dom.client.ClickEvent event)
event
- Click event.@UiHandler(value="bFilter") public void bFilterClick(com.google.gwt.event.dom.client.ClickEvent event)
event
- Click event.@UiHandler(value="bResequence") public void bResequenceClick(com.google.gwt.event.dom.client.ClickEvent event)
event
- Click event.@UiHandler(value="cpcEv") public void cpcEvChange(com.google.gwt.event.dom.client.ChangeEvent event)
event
- Click event.public void refresh()
private void handleACLsSelection()
private void updateACLTitle()
private void populateACLList(java.lang.Runnable doneHandler)
private void loadAclData(java.util.function.Consumer<java.util.List<AclRow>> resultConsumer)
AclRow
instances and return them. Any
menu filtering is applied at this time.
If filtering by resource type is in effect, this method takes into account the state of the Effective View check box and the existence of both the shared and private instances. It disables the check box if only one instance is found, but the check box remains selected.
resultConsumer
- Called with the result, null is passed when an error occurs.private void loadAclDataStep2(AclDef[] acls, java.util.function.Consumer<java.util.List<AclRow>> resultConsumer)
AclRow
instances and return them. Any
menu filtering is applied at this time. This is step 2 of the loading process.resultConsumer
- Called with the result, null is passed when an error occurs.private void setACLsNoSelection()
private void setACLsSingleSelection()
private void setACLsMultiSelection()
private void handleFilter()
private void navigateHere(java.lang.String param, java.lang.String value)
param
- URL query param name.value
- URL quert param value.private void handleACLCellEdit(AclRow aclItem, int cell)
aclItem
- ACL row.cell
- Cell index.private void loadAllSubjects(java.util.function.Consumer<java.util.List<org.gwtbootstrap3.extras.select.client.ui.Option>> result)
result
- The result consumer.private void handleAddACL()
private void addACLStep2(java.lang.String instance, java.lang.String resType, int aclId, java.lang.String resName, boolean regexpNature, int[] subjs, java.util.Map<java.lang.Integer,java.lang.String> subjMap, Rights rights, java.util.function.Consumer<java.lang.Boolean> doneHandler)
instance
- Instance name.resType
- Resource type.aclId
- Acl id.resName
- Resource name.regexpNature
- Regexp nature flag.subjs
- Subject ids.subjMap
- Subject map.rights
- Rights object.doneHandler
- Done handler.private int nextId(boolean up, boolean current)
up
- true
if the new ID must be lower than the item's
ID. false
if the ID must be greater than the
item's ID.current
- true
if the selected item is considered the
origin. false
if the prior/next item is used,
depending on the direction (up/down).private AclRow getFirstSelectedRow()
private void handleDeleteSelectedACL()
private void deletedACL(java.util.Set<AclRow> rows)
rows
- The acls to delete.private void handleCloneACLItem()
private void moveACLItem(boolean up)
up
- true
if the item needs to be moved up.private void handleMoveACLUp()
private void handleMoveACLDown()
private void moveACL(AclRow row, int newId)
row
- the ACL to movenewId
- new position for the ACLprivate AclRow locateAcl(java.lang.String resourceType, java.lang.String instanceName, int id)
resourceType
- resource type to search withininstanceName
- ACL instance name to search withinid
- ACL id of interestnull
private void handleResequenceACLs()
private void editRights(java.lang.String resourceName, boolean exact, java.lang.String type, Rights rights, java.util.function.Consumer<Rights> doneHandler)
resourceName
- Resource name.exact
- Exact match flag.type
- Resource type.rights
- The rights object.doneHandler
- Done handler.private boolean isPopup()
true
if in popup.