Class PickItemsDialog
- java.lang.Object
-
- com.google.gwt.user.client.ui.UIObject
-
- com.google.gwt.user.client.ui.Widget
-
- com.google.gwt.user.client.ui.Panel
-
- com.google.gwt.user.client.ui.SimplePanel
-
- com.google.gwt.user.client.ui.PopupPanel
-
- org.gcube.portlets.widgets.pickitem.client.dialog.PickItemsDialog
-
- All Implemented Interfaces:
com.google.gwt.event.logical.shared.HasAttachHandlers,com.google.gwt.event.logical.shared.HasCloseHandlers<com.google.gwt.user.client.ui.PopupPanel>,com.google.gwt.event.shared.HasHandlers,com.google.gwt.user.client.EventListener,com.google.gwt.user.client.EventPreview,com.google.gwt.user.client.ui.AcceptsOneWidget,com.google.gwt.user.client.ui.HasAnimation,com.google.gwt.user.client.ui.HasOneWidget,com.google.gwt.user.client.ui.HasVisibility,com.google.gwt.user.client.ui.HasWidgets,com.google.gwt.user.client.ui.HasWidgets.ForIsWidget,com.google.gwt.user.client.ui.IsWidget,com.google.gwt.user.client.ui.SourcesPopupEvents,Iterable<com.google.gwt.user.client.ui.Widget>
public class PickItemsDialog extends com.google.gwt.user.client.ui.PopupPanel- Author:
- Massimiliano Assante, ISTI-CNR
Use this widget to display a a dropdown user list you can attach to a textbox to make select portal users typing @
To get to know which user was selected listen for the
PickedItemEventon theHandlerManagerinstance you pass to this widget.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.PopupPanel
com.google.gwt.user.client.ui.PopupPanel.AnimationType, com.google.gwt.user.client.ui.PopupPanel.PositionCallback
-
-
Constructor Summary
Constructors Constructor Description PickItemsDialog(char triggerChar, com.google.gwt.event.shared.HandlerManager eventBus, int widthInPixel, String context)Use this constructor for users, the list of the users is automatically loaded from the VRE passed in the context param Note that you must declare the pick item widget servlet in this casePickItemsDialog(char triggerChar, ArrayList<ItemBean> beans, com.google.gwt.event.shared.HandlerManager eventBus, int widthInPixel)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidonKeyPress(int cursorPos, int keyCode, int x, int y, String currText)called for each onKeyPress event from the uservoidonKeyUp(int keyCode)called for each onKeyUp event from the uservoidselect(int displayIndex)select the user in the model and in the viewvoidshowSuggestions(String query)voidwithPhoto()use if you have want to show a photo for the item or not, remember to provide it inItemBeaninstancesvoidwithTriggerCharIncluded()use to include the trigger char in search if your suggestions start with the trigger char (e.g.-
Methods inherited from class com.google.gwt.user.client.ui.PopupPanel
addAutoHidePartner, addCloseHandler, addPopupListener, center, getAnimationType, getContainerElement, getGlassElement, getGlassStyleName, getOffsetHeight, getOffsetWidth, getPopupLeft, getPopupTop, getStyleElement, getTitle, hide, hide, isAnimationEnabled, isAutoHideEnabled, isAutoHideOnHistoryEventsEnabled, isGlassEnabled, isModal, isPreviewingAllNativeEvents, isShowing, isVisible, onEventPreview, onKeyDownPreview, onKeyPressPreview, onKeyUpPreview, onPreviewNativeEvent, onUnload, removeAutoHidePartner, removePopupListener, setAnimationEnabled, setAnimationType, setAutoHideEnabled, setAutoHideOnHistoryEventsEnabled, setGlassEnabled, setGlassStyleName, setHeight, setModal, setPopupPosition, setPopupPositionAndShow, setPreviewingAllNativeEvents, setTitle, setVisible, setWidget, setWidth, show, showRelativeTo
-
Methods inherited from class com.google.gwt.user.client.ui.SimplePanel
add, getWidget, iterator, remove, setWidget
-
Methods inherited from class com.google.gwt.user.client.ui.Panel
add, adopt, clear, doAttachChildren, doDetachChildren, orphan, remove
-
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, onLoad, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
-
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, sinkBitlessEvent, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
ARROW_UP
public static final int ARROW_UP
- See Also:
- Constant Field Values
-
ARROW_DOWN
public static final int ARROW_DOWN
- See Also:
- Constant Field Values
-
DELETE
public static final int DELETE
- See Also:
- Constant Field Values
-
ENTER
public static final int ENTER
- See Also:
- Constant Field Values
-
ESCAPE
public static final int ESCAPE
- See Also:
- Constant Field Values
-
TAB
public static final int TAB
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PickItemsDialog
public PickItemsDialog(char triggerChar, ArrayList<ItemBean> beans, com.google.gwt.event.shared.HandlerManager eventBus, int widthInPixel)
-
PickItemsDialog
public PickItemsDialog(char triggerChar, com.google.gwt.event.shared.HandlerManager eventBus, int widthInPixel, String context)Use this constructor for users, the list of the users is automatically loaded from the VRE passed in the context param Note that you must declare the pick item widget servlet in this case- Parameters:
triggerChar- the 'single char' used to trigger the items list show, e.g. '@', '#' ....eventBus- the event bus on where the widget will fire the selected user eventwidthInPixel- the desired width (grater than 199 pixel)context- the context (VRE scope e.g. /gcube/devNext/NextNext) from where to load the users and groups
-
-
Method Detail
-
withPhoto
public void withPhoto()
use if you have want to show a photo for the item or not, remember to provide it inItemBeaninstances
-
withTriggerCharIncluded
public void withTriggerCharIncluded()
use to include the trigger char in search if your suggestions start with the trigger char (e.g. #anHashTag triggered by #)
-
onKeyPress
public void onKeyPress(int cursorPos, int keyCode, int x, int y, String currText)called for each onKeyPress event from the user- Parameters:
keyCode- the event keycodex-y-currText-
-
onKeyUp
public void onKeyUp(int keyCode)
called for each onKeyUp event from the user- Parameters:
keyCode- the event keycode
-
showSuggestions
public void showSuggestions(String query)
-
select
public void select(int displayIndex)
select the user in the model and in the view- Parameters:
displayIndex-
-
-