|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.vaadin.server.AbstractClientConnector
com.vaadin.ui.AbstractComponent
com.vaadin.ui.AbstractField<java.lang.Double>
com.vaadin.ui.Slider
public class Slider
A component for selecting a numerical value within a range.
Nested Class Summary | |
---|---|
class |
Slider.ValueOutOfBoundsException
Thrown when the value of the slider is about to be set to a value that is outside the valid range of the slider. |
Nested classes/interfaces inherited from class com.vaadin.ui.AbstractField |
---|
AbstractField.FocusShortcut, AbstractField.ReadOnlyStatusChangeEvent |
Nested classes/interfaces inherited from interface com.vaadin.ui.Field |
---|
Field.ValueChangeEvent |
Nested classes/interfaces inherited from interface com.vaadin.data.Buffered |
---|
Buffered.SourceException |
Nested classes/interfaces inherited from interface com.vaadin.data.Property |
---|
Property.Editor, Property.ReadOnlyException, Property.ReadOnlyStatusChangeListener, Property.ReadOnlyStatusChangeNotifier, Property.Transactional<T>, Property.ValueChangeListener, Property.ValueChangeNotifier, Property.Viewer |
Nested classes/interfaces inherited from interface com.vaadin.ui.Component |
---|
Component.ErrorEvent, Component.Event, Component.Focusable, Component.Listener |
Nested classes/interfaces inherited from interface com.vaadin.server.ClientConnector |
---|
ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.ConnectorErrorEvent, ClientConnector.DetachEvent, ClientConnector.DetachListener |
Nested classes/interfaces inherited from interface com.vaadin.server.Sizeable |
---|
Sizeable.Unit |
Field Summary |
---|
Fields inherited from class com.vaadin.ui.AbstractComponent |
---|
DESIGN_ATTR_PLAIN_TEXT |
Fields inherited from interface com.vaadin.server.Sizeable |
---|
SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS |
Constructor Summary | |
---|---|
Slider()
Default slider constructor. |
|
Slider(double min,
double max,
int resolution)
Create a new slider with the given range and resolution. |
|
Slider(int min,
int max)
Create a new slider with the given range that only allows integer values. |
|
Slider(java.lang.String caption)
Create a new slider with the caption given as parameter. |
|
Slider(java.lang.String caption,
int min,
int max)
Create a new slider with the given caption and range that only allows integer values. |
Method Summary | |
---|---|
void |
clear()
Clears the value of the field. |
protected java.util.Collection<java.lang.String> |
getCustomAttributes()
Returns a collection of attributes that should not be handled by the basic implementation of the readDesign and writeDesign
methods. |
double |
getMax()
Gets the maximum slider value |
double |
getMin()
Gets the minimum slider value |
com.vaadin.shared.ui.slider.SliderOrientation |
getOrientation()
Get the current orientation of the slider (horizontal or vertical). |
int |
getResolution()
Get the current resolution of the slider. |
com.vaadin.shared.ui.slider.SliderState |
getState()
Returns the shared state bean with information to be sent from the server to the client. |
com.vaadin.shared.ui.slider.SliderState |
getState(boolean markAsDirty)
Returns the shared state for this connector. |
java.lang.Class<java.lang.Double> |
getType()
Returns the type of the Field. |
boolean |
isEmpty()
Is the field empty? In general, "empty" state is same as null. |
void |
readDesign(org.jsoup.nodes.Element design,
DesignContext context)
Reads the component state from the given design. |
protected void |
setInternalValue(java.lang.Double newValue)
Sets the internal field value. |
void |
setMax(double max)
Set the maximum slider value. |
void |
setMin(double min)
Set the minimum slider value. |
void |
setOrientation(com.vaadin.shared.ui.slider.SliderOrientation orientation)
Set the orientation of the slider. |
void |
setResolution(int resolution)
Set a new resolution for the slider. |
void |
setValue(java.lang.Double newFieldValue)
Sets the value of the field. |
protected void |
setValue(java.lang.Double value,
boolean repaintIsNotNeeded)
Sets the value of the slider. |
void |
writeDesign(org.jsoup.nodes.Element design,
DesignContext context)
Writes the component state to the given design. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.vaadin.ui.Component |
---|
addListener, addStyleName, getCaption, getDescription, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getUI, isEnabled, isVisible, removeListener, removeStyleName, setCaption, setEnabled, setIcon, setId, setParent, setPrimaryStyleName, setStyleName, setVisible |
Methods inherited from interface com.vaadin.server.ClientConnector |
---|
addAttachListener, addDetachListener, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler |
Methods inherited from interface com.vaadin.shared.Connector |
---|
getConnectorId |
Methods inherited from interface com.vaadin.server.Sizeable |
---|
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setHeightUndefined, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthUndefined |
Methods inherited from interface com.vaadin.event.Action.ShortcutNotifier |
---|
addShortcutListener, removeShortcutListener |
Constructor Detail |
---|
public Slider()
public Slider(java.lang.String caption)
caption
- The caption for this slider (e.g. "Volume").public Slider(double min, double max, int resolution)
min
- The minimum value of the slidermax
- The maximum value of the sliderresolution
- The number of digits after the decimal point.public Slider(int min, int max)
min
- The minimum value of the slidermax
- The maximum value of the sliderpublic Slider(java.lang.String caption, int min, int max)
caption
- The caption for the slidermin
- The minimum value of the slidermax
- The maximum value of the sliderMethod Detail |
---|
public com.vaadin.shared.ui.slider.SliderState getState()
AbstractComponent
getState
in class AbstractField<java.lang.Double>
public com.vaadin.shared.ui.slider.SliderState getState(boolean markAsDirty)
AbstractClientConnector
getState
in class AbstractField<java.lang.Double>
markAsDirty
- true if the connector should automatically be marked dirty,
false otherwise
AbstractClientConnector.getState()
public double getMax()
public void setMax(double max)
max
- The new maximum slider valuepublic double getMin()
public void setMin(double min)
min
- The new minimum slider valuepublic com.vaadin.shared.ui.slider.SliderOrientation getOrientation()
SliderOrientation.HORIZONTAL
or
SliderOrientation.VERTICAL
public void setOrientation(com.vaadin.shared.ui.slider.SliderOrientation orientation)
orientation
- The new orientation, either
SliderOrientation.HORIZONTAL
or
SliderOrientation.VERTICAL
public int getResolution()
public void setResolution(int resolution)
resolution
-
java.lang.IllegalArgumentException
- if resolution is negative.protected void setValue(java.lang.Double value, boolean repaintIsNotNeeded)
setValue
in class AbstractField<java.lang.Double>
value
- The new value of the slider.repaintIsNotNeeded
- If true, client-side is not requested to repaint itself.
Slider.ValueOutOfBoundsException
- If the given value is not inside the range of the slider.{@link #setMax(double)}
public void setValue(java.lang.Double newFieldValue)
AbstractField
setValue
in interface Property<java.lang.Double>
setValue
in class AbstractField<java.lang.Double>
newFieldValue
- the New value of the field.protected void setInternalValue(java.lang.Double newValue)
AbstractField
AbstractField.getInternalValue()
if necessary.
setInternalValue
in class AbstractField<java.lang.Double>
newValue
- the new value to be set.public java.lang.Class<java.lang.Double> getType()
AbstractField
getValue
and
setValue
must be compatible with this type: one must be able
to safely cast the value returned from getValue
to the given
type and pass any variable assignable to this type as an argument to
setValue
.
getType
in interface Property<java.lang.Double>
getType
in class AbstractField<java.lang.Double>
public void clear()
Field
The field value is typically reset to the initial value of the field.
Calling Field.isEmpty()
on a cleared field must always returns true.
clear
in interface Field<java.lang.Double>
clear
in class AbstractField<java.lang.Double>
public boolean isEmpty()
Field
isEmpty
in interface Field<java.lang.Double>
isEmpty
in class AbstractField<java.lang.Double>
public void readDesign(org.jsoup.nodes.Element design, DesignContext context)
Component
The component is responsible not only for updating its own state but also for ensuring that its children update their state based on the design.
It is assumed that the component is in its default state when this method is called. Reading should only take into consideration attributes specified in the design and not reset any unspecified attributes to their defaults.
This method must not modify the design.
readDesign
in interface Component
readDesign
in class AbstractField<java.lang.Double>
design
- The element to obtain the state fromcontext
- The DesignContext instance used for parsing the designpublic void writeDesign(org.jsoup.nodes.Element design, DesignContext context)
Component
The component is responsible not only for writing its own state but also for ensuring that its children write their state to the design.
This method must not modify the component state.
writeDesign
in interface Component
writeDesign
in class AbstractField<java.lang.Double>
design
- The element to write the component state to. Any previous
attributes or child nodes are not cleared.context
- The DesignContext instance used for writing the designprotected java.util.Collection<java.lang.String> getCustomAttributes()
AbstractComponent
readDesign
and writeDesign
methods. Typically these are handled in a custom way in the overridden
versions of the above methods
getCustomAttributes
in class AbstractField<java.lang.Double>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |