public class Sash extends Control
Note: Only one of the styles HORIZONTAL and VERTICAL may be specified.
IMPORTANT: This class is intended to be subclassed only within the SWT implementation.
Constructor and Description |
---|
Sash(Composite parent,
int style)
Constructs a new instance of this class given its parent and a style
value describing its behavior and appearance.
|
Modifier and Type | Method and Description |
---|---|
void |
addSelectionListener(SelectionListener listener)
Adds the listener to the collection of listeners who will
be notified when the control is selected, by sending
it one of the messages defined in the
SelectionListener
interface. |
Point |
computeSize(int wHint,
int hHint,
boolean changed)
Returns the preferred size of the receiver.
|
<T> T |
getAdapter(java.lang.Class<T> adapter)
Implementation of the
Adaptable interface. |
void |
removeSelectionListener(SelectionListener listener)
Removes the listener from the collection of listeners who will
be notified when the control is selected.
|
addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addTouchListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getShell, getSize, getToolTipText, getTouchEnabled, getVisible, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeTouchListener, removeTraverseListener, requestLayout, setBackground, setBackgroundImage, setBounds, setBounds, setCursor, setData, setEnabled, setFocus, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setSize, setSize, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, update
addDisposeListener, addListener, checkSubclass, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, toString
public Sash(Composite parent, int style)
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.
parent
- a composite control which will be the parent of the new
instance (cannot be null)style
- the style of control to constructjava.lang.IllegalArgumentException
- SWTException
- SWT.HORIZONTAL
,
SWT.VERTICAL
,
Widget.checkSubclass()
,
Widget.getStyle()
public Point computeSize(int wHint, int hHint, boolean changed)
Control
The preferred size of a control is the size that it would
best be displayed at. The width hint and height hint arguments
allow the caller to ask a control questions such as "Given a particular
width, how high does the control need to be to show all of the contents?"
To indicate that the caller does not wish to constrain a particular
dimension, the constant SWT.DEFAULT
is passed for the hint.
If the changed flag is true
, it indicates that the receiver's
contents have changed, therefore any caches that a layout manager
containing the control may have been keeping need to be flushed. When the
control is resized, the changed flag will be false
, so layout
manager caches can be retained.
computeSize
in class Control
wHint
- the width hint (can be SWT.DEFAULT
)hHint
- the height hint (can be SWT.DEFAULT
)changed
- true
if the control's contents have changed, and false
otherwiseLayout
,
Control.getBorderWidth()
,
Control.getBounds()
,
Control.getSize()
,
Control.pack(boolean)
,
"computeTrim, getClientArea for controls that implement them"public void addSelectionListener(SelectionListener listener)
SelectionListener
interface.
When widgetSelected
is called, the x, y, width, and height fields of the event object are valid.
If the receiver is being dragged, the event object detail field contains the value SWT.DRAG
.
widgetDefaultSelected
is not called.
listener
- the listener which should be notifiedjava.lang.IllegalArgumentException
- SWTException
- SelectionListener
,
removeSelectionListener(org.eclipse.swt.events.SelectionListener)
,
SelectionEvent
public void removeSelectionListener(SelectionListener listener)
listener
- the listener which should no longer be notifiedjava.lang.IllegalArgumentException
- SWTException
- SelectionListener
,
addSelectionListener(org.eclipse.swt.events.SelectionListener)
public <T> T getAdapter(java.lang.Class<T> adapter)
Widget
Adaptable
interface.
IMPORTANT: This method is not part of the RWT public API. It is marked public only so that it can be shared within the packages provided by RWT. It should never be accessed from application code.
getAdapter
in interface Adaptable
getAdapter
in class Control
adapter
- the lookup classnull
if
there is no adapter associated with the given class.
Copyright (c) EclipseSource and others 2002, 2016.
All rights reserved. This program and the accompanying materials
are made available under the terms of the
Eclipse Public License v1.0