Package com.vaadin.client.ui
Class VSlider
- 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.vaadin.client.ui.SimpleFocusablePanel
-
- com.vaadin.client.ui.VSlider
-
- All Implemented Interfaces:
com.google.gwt.event.dom.client.HasBlurHandlers
,com.google.gwt.event.dom.client.HasFocusHandlers
,com.google.gwt.event.dom.client.HasKeyDownHandlers
,com.google.gwt.event.dom.client.HasKeyPressHandlers
,com.google.gwt.event.logical.shared.HasAttachHandlers
,com.google.gwt.event.logical.shared.HasValueChangeHandlers<Double>
,com.google.gwt.event.shared.HasHandlers
,com.google.gwt.user.client.EventListener
,com.google.gwt.user.client.TakesValue<Double>
,com.google.gwt.user.client.ui.AcceptsOneWidget
,com.google.gwt.user.client.ui.HasOneWidget
,com.google.gwt.user.client.ui.HasValue<Double>
,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
,Focusable
,Field
,SubPartAware
,Iterable<com.google.gwt.user.client.ui.Widget>
public class VSlider extends SimpleFocusablePanel implements Field, com.google.gwt.user.client.ui.HasValue<Double>, SubPartAware
-
-
Field Summary
Fields Modifier and Type Field Description static String
CLASSNAME
protected ApplicationConnection
client
protected boolean
disabled
protected String
id
protected boolean
immediate
protected double
max
protected double
min
protected SliderOrientation
orientation
protected boolean
readonly
protected int
resolution
protected Double
value
-
Constructor Summary
Constructors Constructor Description VSlider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.gwt.event.shared.HandlerRegistration
addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler<Double> handler)
void
buildBase()
For internal use only.protected int
getEventPosition(com.google.gwt.user.client.Event event)
TODO consider extracting touches support to an impl class specific for webkit (only browser that really supports touches).protected int
getNavigationDownKey()
Get the key that decreases the vertical slider.protected int
getNavigationLeftKey()
Get the key that decreases the horizontal slider.protected int
getNavigationRightKey()
Get the key that increases the horizontal slider.protected int
getNavigationUpKey()
Get the key that increases the vertical slider.com.google.gwt.user.client.Element
getSubPartElement(String subPart)
Locates an element inside a component using the identifier provided insubPart
.String
getSubPartName(com.google.gwt.user.client.Element subElement)
Provides an identifier that identifies the element within the component.Double
getValue()
boolean
handleNavigation(int keycode, boolean ctrl, boolean shift)
Handles the keyboard events handled by the Slidervoid
iLayout()
void
onBrowserEvent(com.google.gwt.user.client.Event event)
void
setConnection(ApplicationConnection client)
void
setDisabled(boolean disabled)
void
setFeedbackValue(double value)
void
setId(String id)
void
setImmediate(boolean immediate)
void
setMaxValue(double value)
void
setMinValue(double value)
void
setOrientation(SliderOrientation orientation)
void
setReadOnly(boolean readonly)
void
setResolution(int resolution)
void
setStyleName(String style)
void
setStylePrimaryName(String style)
void
setValue(Double value)
void
setValue(Double value, boolean fireEvents)
protected void
updateStyleNames(String styleName, boolean isPrimaryStyleName)
-
Methods inherited from class com.vaadin.client.ui.SimpleFocusablePanel
addBlurHandler, addFocusHandler, addKeyDownHandler, addKeyPressHandler, addKeyUpHandler, focus, setFocus, setTabIndex
-
Methods inherited from class com.google.gwt.user.client.ui.SimplePanel
add, getContainerElement, getWidget, iterator, remove, setWidget, 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, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
-
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString
-
-
-
-
Field Detail
-
CLASSNAME
public static final String CLASSNAME
- See Also:
- Constant Field Values
-
client
protected ApplicationConnection client
-
id
protected String id
-
immediate
protected boolean immediate
-
disabled
protected boolean disabled
-
readonly
protected boolean readonly
-
min
protected double min
-
max
protected double max
-
resolution
protected int resolution
-
value
protected Double value
-
orientation
protected SliderOrientation orientation
-
-
Method Detail
-
setStyleName
public void setStyleName(String style)
- Overrides:
setStyleName
in classcom.google.gwt.user.client.ui.UIObject
-
setStylePrimaryName
public void setStylePrimaryName(String style)
- Overrides:
setStylePrimaryName
in classcom.google.gwt.user.client.ui.UIObject
-
updateStyleNames
protected void updateStyleNames(String styleName, boolean isPrimaryStyleName)
-
setFeedbackValue
public void setFeedbackValue(double value)
-
buildBase
public void buildBase()
For internal use only. May be removed or replaced in the future.
-
onBrowserEvent
public void onBrowserEvent(com.google.gwt.user.client.Event event)
- Specified by:
onBrowserEvent
in interfacecom.google.gwt.user.client.EventListener
- Overrides:
onBrowserEvent
in classcom.google.gwt.user.client.ui.Widget
-
getEventPosition
protected int getEventPosition(com.google.gwt.user.client.Event event)
TODO consider extracting touches support to an impl class specific for webkit (only browser that really supports touches).- Parameters:
event
-- Returns:
-
iLayout
public void iLayout()
-
handleNavigation
public boolean handleNavigation(int keycode, boolean ctrl, boolean shift)
Handles the keyboard events handled by the Slider- Parameters:
event
- The keyboard event received- Returns:
- true iff the navigation event was handled
-
getNavigationUpKey
protected int getNavigationUpKey()
Get the key that increases the vertical slider. By default it is the up arrow key but by overriding this you can change the key to whatever you want.- Returns:
- The keycode of the key
-
getNavigationDownKey
protected int getNavigationDownKey()
Get the key that decreases the vertical slider. By default it is the down arrow key but by overriding this you can change the key to whatever you want.- Returns:
- The keycode of the key
-
getNavigationLeftKey
protected int getNavigationLeftKey()
Get the key that decreases the horizontal slider. By default it is the left arrow key but by overriding this you can change the key to whatever you want.- Returns:
- The keycode of the key
-
getNavigationRightKey
protected int getNavigationRightKey()
Get the key that increases the horizontal slider. By default it is the right arrow key but by overriding this you can change the key to whatever you want.- Returns:
- The keycode of the key
-
setConnection
public void setConnection(ApplicationConnection client)
-
setId
public void setId(String id)
-
setImmediate
public void setImmediate(boolean immediate)
-
setDisabled
public void setDisabled(boolean disabled)
-
setReadOnly
public void setReadOnly(boolean readonly)
-
setOrientation
public void setOrientation(SliderOrientation orientation)
-
setMinValue
public void setMinValue(double value)
-
setMaxValue
public void setMaxValue(double value)
-
setResolution
public void setResolution(int resolution)
-
addValueChangeHandler
public com.google.gwt.event.shared.HandlerRegistration addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler<Double> handler)
- Specified by:
addValueChangeHandler
in interfacecom.google.gwt.event.logical.shared.HasValueChangeHandlers<Double>
-
getValue
public Double getValue()
-
setValue
public void setValue(Double value)
-
setValue
public void setValue(Double value, boolean fireEvents)
- Specified by:
setValue
in interfacecom.google.gwt.user.client.ui.HasValue<Double>
-
getSubPartElement
public com.google.gwt.user.client.Element getSubPartElement(String subPart)
Description copied from interface:SubPartAware
Locates an element inside a component using the identifier provided insubPart
. ThesubPart
identifier is component specific and may be any string of characters, numbers, space characters and brackets.- Specified by:
getSubPartElement
in interfaceSubPartAware
- Parameters:
subPart
- The identifier for the element inside the component- Returns:
- The element identified by subPart or null if the element could not be found.
-
getSubPartName
public String getSubPartName(com.google.gwt.user.client.Element subElement)
Description copied from interface:SubPartAware
Provides an identifier that identifies the element within the component. ThesubElement
is a part of the component and must never be null.Note!
getSubPartElement(getSubPartName(element)) == element
is not always true. A component can choose to provide a more generic identifier for any given element if the results of all interactions withsubElement
are the same as interactions with the element identified by the return value. For example a button can return an identifier for the root element even though a DIV inside the button was passed assubElement
because interactions with the DIV and the root button element produce the same result.- Specified by:
getSubPartName
in interfaceSubPartAware
- Parameters:
subElement
- The element the identifier string should uniquely identify- Returns:
- An identifier that uniquely identifies
subElement
or null if no identifier could be provided.
-
-