public class PGroup
extends org.eclipse.swt.widgets.Canvas
This widget is customizable through alternative AbstractGroupStrategy
s. Each
strategy determines the size and appearance of the widget.
Constructor and Description |
---|
PGroup(org.eclipse.swt.widgets.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 |
addExpandListener(org.eclipse.swt.events.ExpandListener listener)
Adds the listener to the collection of listeners who will
be notified when the receiver is expanded or collapsed
by sending it one of the messages defined in the
ExpandListener
interface. |
(package private) void |
addToolItem(PGroupToolItem toolitem) |
org.eclipse.swt.graphics.Point |
computeSize(int arg0,
int arg1,
boolean arg2) |
org.eclipse.swt.graphics.Rectangle |
computeTrim(int x,
int y,
int width,
int height) |
org.eclipse.swt.graphics.Color |
getBackground() |
org.eclipse.swt.graphics.Rectangle |
getClientArea() |
boolean |
getExpanded()
Returns the expanded/collapsed state.
|
org.eclipse.swt.graphics.Image |
getImage()
Returns the image.
|
int |
getImagePosition()
Returns the image position.
|
int |
getLinePosition()
Returns the line position.
|
AbstractGroupStrategy |
getStrategy()
Returns the strategy.
|
java.lang.String |
getText()
Returns the text.
|
int |
getTogglePosition()
Returns the toggle position.
|
AbstractRenderer |
getToggleRenderer()
Returns the toggle renderer or
null . |
AbstractToolItemRenderer |
getToolItemRenderer() |
PGroupToolItem[] |
getToolItems() |
(package private) org.eclipse.swt.graphics.Color |
internalGetBackground() |
void |
removeExpandListener(org.eclipse.swt.events.ExpandListener listener)
Removes the listener from the collection of listeners who will
be notified when the receiver are expanded or collapsed.
|
(package private) void |
removeToolItem(PGroupToolItem toolitem) |
void |
setBackground(org.eclipse.swt.graphics.Color color)
Sets the receiver's background color to the color specified
by the argument, or to the default system color for the control
if the argument is null.
|
void |
setExpanded(boolean expanded)
Sets the expanded state of the group.
|
void |
setFont(org.eclipse.swt.graphics.Font font) |
void |
setImage(org.eclipse.swt.graphics.Image image)
Sets the image.
|
void |
setImagePosition(int imagePosition)
Sets the image position.
|
void |
setLinePosition(int linePosition)
Sets the line position.
|
void |
setStrategy(AbstractGroupStrategy strategy)
Sets the strategy.
|
void |
setText(java.lang.String text)
Sets the text.
|
void |
setTogglePosition(int togglePosition)
Sets the toggle position.
|
void |
setToggleRenderer(AbstractRenderer toggleRenderer)
Sets the toggle renderer.
|
void |
setToolItemRenderer(AbstractToolItemRenderer toolItemRenderer) |
drawBackground, getCaret, getIME, scroll, setCaret, setIME
changed, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList
getHorizontalBar, getScrollbarsMode, getVerticalBar
addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getTextDirection, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, requestLayout, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString
public PGroup(org.eclipse.swt.widgets.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.
To ensure that the color of corners is equal to one of the underlying control
invoke the parent composites Composite.setBackgroundMode(int)
with SWT.INHERIT_DEFAULT
or SWT.INHERIT_DEFAULT
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
- org.eclipse.swt.SWTException
- SWT
,
Widget.checkSubclass()
,
Widget.getStyle()
public org.eclipse.swt.graphics.Color getBackground()
getBackground
in class org.eclipse.swt.widgets.Control
Control.getBackground()
org.eclipse.swt.graphics.Color internalGetBackground()
public void setBackground(org.eclipse.swt.graphics.Color color)
Note: This operation is a hint and may be overridden by the platform. For example, on Windows the background of a Button cannot be changed.
To ensure that the color of corners is equal to one of the underlying control
invoke the parent composites Composite.setBackgroundMode(int)
with SWT.INHERIT_DEFAULT
or SWT.INHERIT_DEFAULT
Note: If a new strategy is set on the receiver it may overwrite the existing background color.
setBackground
in class org.eclipse.swt.widgets.Control
color
- the new color (or null)java.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public AbstractRenderer getToggleRenderer()
null
.org.eclipse.swt.SWTException
- public void setToggleRenderer(AbstractRenderer toggleRenderer)
null
the control
will not show a toggle or allow the user to expand/collapse the group by clicking on the title.toggleRenderer
- the toggleRenderer to set or null
org.eclipse.swt.SWTException
- public AbstractGroupStrategy getStrategy()
org.eclipse.swt.SWTException
- public void setStrategy(AbstractGroupStrategy strategy)
strategy
- the strategy to setjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public org.eclipse.swt.graphics.Image getImage()
org.eclipse.swt.SWTException
- public void setImage(org.eclipse.swt.graphics.Image image)
java.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public void setFont(org.eclipse.swt.graphics.Font font)
setFont
in class org.eclipse.swt.widgets.Canvas
Canvas.setFont(org.eclipse.swt.graphics.Font)
public java.lang.String getText()
org.eclipse.swt.SWTException
- public void setText(java.lang.String text)
java.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public org.eclipse.swt.graphics.Point computeSize(int arg0, int arg1, boolean arg2)
computeSize
in class org.eclipse.swt.widgets.Control
Control.computeSize(int, int, boolean)
public boolean getExpanded()
org.eclipse.swt.SWTException
- public void setExpanded(boolean expanded)
org.eclipse.swt.SWTException
- public void addExpandListener(org.eclipse.swt.events.ExpandListener listener)
ExpandListener
interface.listener
- the listener which should be notifiedjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- ExpandListener
,
removeExpandListener(org.eclipse.swt.events.ExpandListener)
public void removeExpandListener(org.eclipse.swt.events.ExpandListener listener)
listener
- the listener which should no longer be notifiedjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- ExpandListener
,
addExpandListener(org.eclipse.swt.events.ExpandListener)
public int getImagePosition()
org.eclipse.swt.SWTException
- public void setImagePosition(int imagePosition)
SWT.LEFT
and SWT.RIGHT
(mutually exclusive).
SWT.TOP
is hint interpreted by some strategies.java.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public int getTogglePosition()
org.eclipse.swt.SWTException
- public void setTogglePosition(int togglePosition)
SWT.LEFT
and SWT.RIGHT
(mutually exclusive).org.eclipse.swt.SWTException
- public int getLinePosition()
org.eclipse.swt.SWTException
- public void setLinePosition(int linePosition)
SWT.BOTTOM
and SWT.CENTER
(mutually exclusive).org.eclipse.swt.SWTException
- public org.eclipse.swt.graphics.Rectangle computeTrim(int x, int y, int width, int height)
computeTrim
in class org.eclipse.swt.widgets.Scrollable
public org.eclipse.swt.graphics.Rectangle getClientArea()
getClientArea
in class org.eclipse.swt.widgets.Scrollable
void addToolItem(PGroupToolItem toolitem)
void removeToolItem(PGroupToolItem toolitem)
public AbstractToolItemRenderer getToolItemRenderer()
public void setToolItemRenderer(AbstractToolItemRenderer toolItemRenderer)
public PGroupToolItem[] getToolItems()