org.eclipse.swt.widgets
Class ScrollBar

java.lang.Object
  |
  +--org.eclipse.swt.widgets.Widget
        |
        +--org.eclipse.swt.widgets.ScrollBar

public class ScrollBar
extends Widget

Safe:


Field Summary
(package private)  int increment
           
(package private)  int pageIncrement
           
(package private)  Scrollable parent
           
 
Fields inherited from class org.eclipse.swt.widgets.Widget
CANVAS, COMCTL32_MAJOR, COMCTL32_MINOR, data, DEFAULT_HEIGHT, DEFAULT_WIDTH, DISABLED, DISPOSED, eventTable, HIDDEN, keys, MAJOR, MINOR, Mnemonic, state, style, values
 
Constructor Summary
(package private) ScrollBar(Scrollable parent, int style)
          Constructs a new instance of this class given its parent and a style value describing its behavior and appearance.
 
Method Summary
 void addSelectionListener(SelectionListener listener)
          Enabled: Adds the listener to the collection of listeners who will be notified when the receiver's value changes, by sending it one of the messages defined in the SelectionListener interface.
(package private) static int checkStyle(int style)
           
(package private)  void createWidget()
           
 void dispose()
          Enabled:
(package private)  Rectangle getBounds()
           
 Display getDisplay()
          Suppressed:
 boolean getEnabled()
          Enabled: Returns true if the receiver is enabled, and false otherwise.
 int getIncrement()
          Enabled: Returns the amount that the receiver's value will be modified by when the up/down (or right/left) arrows are pressed.
 int getMaximum()
          Enabled: Returns the maximum value which the receiver will allow.
 int getMinimum()
          Enabled: Returns the minimum value which the receiver will allow.
 int getPageIncrement()
          Enabled: Returns the amount that the receiver's value will be modified by when the page increment/decrement areas are selected.
 Scrollable getParent()
          Suppressed: Returns the receiver's parent, which must be scrollable.
 int getSelection()
          Enabled: Returns the single selection that is the receiver's value.
 Point getSize()
          Enabled: Returns a point describing the receiver's size.
 int getThumb()
          Enabled: Answers the size of the receiver's thumb relative to the difference between its maximum and minimum values.
 boolean getVisible()
          Enabled: Returns true if the receiver is visible, and false otherwise.
(package private)  int hwndScrollBar()
           
 boolean isEnabled()
          Enabled: Returns true if the receiver is enabled and all of the receiver's ancestors are enabled, and false otherwise.
 boolean isVisible()
          Enabled: Returns true if the receiver is visible and all of the receiver's ancestors are visible and false otherwise.
(package private)  void releaseChild()
           
(package private)  void releaseWidget()
           
 void removeSelectionListener(SelectionListener listener)
          Enabled: Removes the listener from the collection of listeners who will be notified when the receiver's value changes.
(package private)  int scrollBarType()
           
 void setEnabled(boolean enabled)
          Enabled: Enables the receiver if the argument is true, and disables it otherwise.
 void setIncrement(int value)
          Enabled: Sets the amount that the receiver's value will be modified by when the up/down (or right/left) arrows are pressed to the argument, which must be at least one.
 void setMaximum(int value)
          Enabled: Sets the maximum value which the receiver will allow to be the argument which must be greater than or equal to zero.
 void setMinimum(int value)
          Enabled: Sets the minimum value which the receiver will allow to be the argument which must be greater than or equal to zero.
 void setPageIncrement(int value)
          Enabled: Sets the amount that the receiver's value will be modified by when the page increment/decrement areas are selected to the argument, which must be at least one.
 void setSelection(int selection)
          Enabled: Sets the single selection that is the receiver's value to the argument which must be greater than or equal to zero.
 void setThumb(int value)
          Enabled: Sets the size of the receiver's thumb relative to the difference between its maximum and minimum values to the argument which must be at least one.
 void setValues(int selection, int minimum, int maximum, int thumb, int increment, int pageIncrement)
          Enabled: Sets the receiver's selection, minimum value, maximum value, thumb, increment and page increment all at once.
 void setVisible(boolean visible)
          Enabled: Marks the receiver as visible if the argument is true, and marks it invisible otherwise.
(package private)  org.eclipse.swt.internal.win32.LRESULT wmScrollChild(int wParam, int lParam)
           
 
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkBits, checkOrientation, checkParent, checkSubclass, checkWidget, destroyWidget, error, filters, getData, getData, getName, getNameText, getStyle, hooks, isDisposed, isListening, isValidSubclass, isValidThread, mbcsToWcs, mbcsToWcs, notifyListeners, postEvent, postEvent, releaseHandle, releaseResources, removeDisposeListener, removeListener, removeListener, sendEvent, sendEvent, sendEvent, sendEvent, setData, setData, setInputState, setKeyState, toString, wcsToMbcs, wcsToMbcs
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

parent

Scrollable parent

increment

int increment

pageIncrement

int pageIncrement
Constructor Detail

ScrollBar

ScrollBar(Scrollable parent,
          int style)
Constructs a new instance of this class given its parent and a style value describing its behavior and appearance.

The style value is either one of the style constants defined in class SWT which is applicable to instances of this class, or must be built by bitwise OR'ing together (that is, using the int "|" operator) two or more of those SWT style constants. The class description lists the style constants that are applicable to the class. Style bits are also inherited from superclasses.

Parameters:
parent - a composite control which will be the parent of the new instance (cannot be null)
style - the style of control to construct
See Also:
SWT.HORIZONTAL, SWT.VERTICAL, Widget.checkSubclass(), Widget.getStyle()
Method Detail

addSelectionListener

public void addSelectionListener(SelectionListener listener)
Enabled: Adds the listener to the collection of listeners who will be notified when the receiver's value changes, by sending it one of the messages defined in the SelectionListener interface.

When widgetSelected is called, the event object detail field contains one of the following values: 0 - for the end of a drag. SWT.DRAG. SWT.HOME. SWT.END. SWT.ARROW_DOWN. SWT.ARROW_UP. SWT.PAGE_DOWN. SWT.PAGE_UP. widgetDefaultSelected is not called.

Parameters:
listener - the listener which should be notified
See Also:
SelectionListener, removeSelectionListener(org.eclipse.swt.events.SelectionListener), SelectionEvent

checkStyle

static int checkStyle(int style)

createWidget

void createWidget()

dispose

public void dispose()
Enabled:

Overrides:
dispose in class Widget
See Also:
Widget.addDisposeListener(org.eclipse.swt.events.DisposeListener), Widget.removeDisposeListener(org.eclipse.swt.events.DisposeListener), Widget.checkWidget()

getBounds

Rectangle getBounds()

getDisplay

public Display getDisplay()
Suppressed:

Specified by:
getDisplay in class Widget
Returns:
the receiver's display

getEnabled

public boolean getEnabled()
Enabled: Returns true if the receiver is enabled, and false otherwise. A disabled control is typically not selectable from the user interface and draws with an inactive or "grayed" look.

Returns:
the receiver's enabled state
See Also:
isEnabled()

getIncrement

public int getIncrement()
Enabled: Returns the amount that the receiver's value will be modified by when the up/down (or right/left) arrows are pressed.

Returns:
the increment

getMaximum

public int getMaximum()
Enabled: Returns the maximum value which the receiver will allow.

Returns:
the maximum

getMinimum

public int getMinimum()
Enabled: Returns the minimum value which the receiver will allow.

Returns:
the minimum

getPageIncrement

public int getPageIncrement()
Enabled: Returns the amount that the receiver's value will be modified by when the page increment/decrement areas are selected.

Returns:
the page increment

getParent

public Scrollable getParent()
Suppressed: Returns the receiver's parent, which must be scrollable.

Returns:
the receiver's parent

getSelection

public int getSelection()
Enabled: Returns the single selection that is the receiver's value.

Returns:
the selection

getSize

public Point getSize()
Enabled: Returns a point describing the receiver's size. The x coordinate of the result is the width of the receiver. The y coordinate of the result is the height of the receiver.

Returns:
the receiver's size

getThumb

public int getThumb()
Enabled: Answers the size of the receiver's thumb relative to the difference between its maximum and minimum values.

Returns:
the thumb value
See Also:
ScrollBar

getVisible

public boolean getVisible()
Enabled: Returns true if the receiver is visible, and false otherwise.

If one of the receiver's ancestors is not visible or some other condition makes the receiver not visible, this method may still indicate that it is considered visible even though it may not actually be showing.

Returns:
the receiver's visibility state

hwndScrollBar

int hwndScrollBar()

isEnabled

public boolean isEnabled()
Enabled: Returns true if the receiver is enabled and all of the receiver's ancestors are enabled, and false otherwise. A disabled control is typically not selectable from the user interface and draws with an inactive or "grayed" look.

Returns:
the receiver's enabled state
See Also:
getEnabled()

isVisible

public boolean isVisible()
Enabled: Returns true if the receiver is visible and all of the receiver's ancestors are visible and false otherwise.

Returns:
the receiver's visibility state
See Also:
getVisible()

releaseChild

void releaseChild()
Overrides:
releaseChild in class Widget

releaseWidget

void releaseWidget()
Overrides:
releaseWidget in class Widget

removeSelectionListener

public void removeSelectionListener(SelectionListener listener)
Enabled: Removes the listener from the collection of listeners who will be notified when the receiver's value changes.

Parameters:
listener - the listener which should no longer be notified
See Also:
SelectionListener, addSelectionListener(org.eclipse.swt.events.SelectionListener)

scrollBarType

int scrollBarType()

setEnabled

public void setEnabled(boolean enabled)
Enabled: Enables the receiver if the argument is true, and disables it otherwise. A disabled control is typically not selectable from the user interface and draws with an inactive or "grayed" look.

Parameters:
enabled - the new enabled state

setIncrement

public void setIncrement(int value)
Enabled: Sets the amount that the receiver's value will be modified by when the up/down (or right/left) arrows are pressed to the argument, which must be at least one.

Parameters:
value - the new increment (must be greater than zero)

setMaximum

public void setMaximum(int value)
Enabled: Sets the maximum value which the receiver will allow to be the argument which must be greater than or equal to zero.

Parameters:
value - the new maximum (must be zero or greater)

setMinimum

public void setMinimum(int value)
Enabled: Sets the minimum value which the receiver will allow to be the argument which must be greater than or equal to zero.

Parameters:
value - the new minimum (must be zero or greater)

setPageIncrement

public void setPageIncrement(int value)
Enabled: Sets the amount that the receiver's value will be modified by when the page increment/decrement areas are selected to the argument, which must be at least one.

Returns:
the page increment (must be greater than zero)

setSelection

public void setSelection(int selection)
Enabled: Sets the single selection that is the receiver's value to the argument which must be greater than or equal to zero.


setThumb

public void setThumb(int value)
Enabled: Sets the size of the receiver's thumb relative to the difference between its maximum and minimum values to the argument which must be at least one.

Parameters:
value - the new thumb value (must be at least one)
See Also:
ScrollBar

setValues

public void setValues(int selection,
                      int minimum,
                      int maximum,
                      int thumb,
                      int increment,
                      int pageIncrement)
Enabled: Sets the receiver's selection, minimum value, maximum value, thumb, increment and page increment all at once.

Note: This is equivalent to setting the values individually using the appropriate methods, but may be implemented in a more efficient fashion on some platforms.

Parameters:
selection - the new selection value
minimum - the new minimum value
maximum - the new maximum value
thumb - the new thumb value
increment - the new increment value
pageIncrement - the new pageIncrement value

setVisible

public void setVisible(boolean visible)
Enabled: Marks the receiver as visible if the argument is true, and marks it invisible otherwise.

If one of the receiver's ancestors is not visible or some other condition makes the receiver not visible, marking it visible may not actually cause it to be displayed.

Parameters:
visible - the new visibility state

wmScrollChild

org.eclipse.swt.internal.win32.LRESULT wmScrollChild(int wParam,
                                                     int lParam)


comments?