Class DayEditorCalendarableItemControl
- java.lang.Object
-
- org.eclipse.swt.widgets.Widget
-
- org.eclipse.swt.widgets.Control
-
- org.eclipse.swt.widgets.Scrollable
-
- org.eclipse.swt.widgets.Composite
-
- org.eclipse.swt.widgets.Canvas
-
- org.eclipse.nebula.widgets.compositetable.day.internal.DayEditorCalendarableItemControl
-
- All Implemented Interfaces:
ICalendarableItemControl
,org.eclipse.swt.graphics.Drawable
public class DayEditorCalendarableItemControl extends org.eclipse.swt.widgets.Canvas implements ICalendarableItemControl
Represents a graphical item inside a multi-day event editor.- Since:
- 3.2
-
-
Field Summary
Fields Modifier and Type Field Description private org.eclipse.swt.graphics.Color
BACKGROUND_COLOR
private org.eclipse.swt.graphics.Color
BORDER_COLOR
private CalendarableItem
calendarable
private int
clipping
private int
continued
private org.eclipse.swt.widgets.Label
label
private org.eclipse.swt.events.MouseListener
labelMouseListener
private static int
MARGIN
private java.util.List
mouseListeners
private org.eclipse.swt.events.PaintListener
paintListener
private org.eclipse.swt.graphics.Color
SELECTED_BACKGROUND_COLOR
private org.eclipse.swt.graphics.Color
SELECTED_BORDER_COLOR
-
Constructor Summary
Constructors Constructor Description DayEditorCalendarableItemControl(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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addMouseListener(org.eclipse.swt.events.MouseListener listener)
void
dispose()
CalendarableItem
getCalendarableItem()
int
getClipping()
int
getContinued()
private void
initialize()
Create the event control's layoutprivate org.eclipse.swt.graphics.RGB
lighten(org.eclipse.swt.graphics.RGB color, float amount)
void
removeMouseListener(org.eclipse.swt.events.MouseListener listener)
private org.eclipse.swt.graphics.RGB
saturate(org.eclipse.swt.graphics.RGB color, float saturation)
Sets the color's saturation to the specified value.void
setCalendarableItem(CalendarableItem calendarable)
Method setCalendarable.void
setClipping(int clipping)
Sets the clipping style bitsvoid
setContinued(int continued)
Sets the continued style bitsvoid
setImage(org.eclipse.swt.graphics.Image image)
void
setMenu(org.eclipse.swt.widgets.Menu menu)
void
setSelected(boolean selected)
Set or clear the selection indicator in the UI.void
setText(java.lang.String text)
void
setToolTipText(java.lang.String text)
-
Methods inherited from class org.eclipse.swt.widgets.Canvas
drawBackground, getCaret, getIME, scroll, setCaret, setFont, setIME
-
Methods inherited from class org.eclipse.swt.widgets.Composite
changed, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList
-
Methods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar
-
Methods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, 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, isAutoScalable, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, requestLayout, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setForeground, setLayoutData, setLocation, setLocation, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update
-
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkWidget, getData, getData, getDisplay, getListeners, getStyle, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString
-
-
-
-
Field Detail
-
MARGIN
private static final int MARGIN
- See Also:
- Constant Field Values
-
label
private org.eclipse.swt.widgets.Label label
-
BORDER_COLOR
private org.eclipse.swt.graphics.Color BORDER_COLOR
-
SELECTED_BORDER_COLOR
private org.eclipse.swt.graphics.Color SELECTED_BORDER_COLOR
-
BACKGROUND_COLOR
private org.eclipse.swt.graphics.Color BACKGROUND_COLOR
-
SELECTED_BACKGROUND_COLOR
private org.eclipse.swt.graphics.Color SELECTED_BACKGROUND_COLOR
-
clipping
private int clipping
-
continued
private int continued
-
paintListener
private org.eclipse.swt.events.PaintListener paintListener
-
mouseListeners
private java.util.List mouseListeners
-
labelMouseListener
private org.eclipse.swt.events.MouseListener labelMouseListener
-
calendarable
private CalendarableItem calendarable
-
-
Constructor Detail
-
DayEditorCalendarableItemControl
public DayEditorCalendarableItemControl(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.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 theint
"|" operator) two or more of thoseSWT
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- Throws:
java.lang.IllegalArgumentException
-- ERROR_NULL_ARGUMENT - if the parent is null
org.eclipse.swt.SWTException
-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent
- ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass
- See Also:
Widget.checkSubclass()
,Widget.getStyle()
-
-
Method Detail
-
saturate
private org.eclipse.swt.graphics.RGB saturate(org.eclipse.swt.graphics.RGB color, float saturation)
Sets the color's saturation to the specified value.- Parameters:
color
- The RGB of the colorsaturation
- the new saturation (between 0 and 1)- Returns:
- a Color that is saturated by the specified amount
-
lighten
private org.eclipse.swt.graphics.RGB lighten(org.eclipse.swt.graphics.RGB color, float amount)
- Parameters:
color
- The RGB of the coloramount
- The amount to lighten as a percentage expresssed as a float between -1 and 1.- Returns:
- The new RGB that is lightened by the specified amount
-
dispose
public void dispose()
- Specified by:
dispose
in interfaceICalendarableItemControl
- Overrides:
dispose
in classorg.eclipse.swt.widgets.Widget
-
initialize
private void initialize()
Create the event control's layout
-
setMenu
public void setMenu(org.eclipse.swt.widgets.Menu menu)
- Specified by:
setMenu
in interfaceICalendarableItemControl
- Overrides:
setMenu
in classorg.eclipse.swt.widgets.Control
-
setText
public void setText(java.lang.String text)
- Specified by:
setText
in interfaceICalendarableItemControl
-
setImage
public void setImage(org.eclipse.swt.graphics.Image image)
- Specified by:
setImage
in interfaceICalendarableItemControl
-
setToolTipText
public void setToolTipText(java.lang.String text)
- Specified by:
setToolTipText
in interfaceICalendarableItemControl
- Overrides:
setToolTipText
in classorg.eclipse.swt.widgets.Control
-
setClipping
public void setClipping(int clipping)
Description copied from interface:ICalendarableItemControl
Sets the clipping style bits- Specified by:
setClipping
in interfaceICalendarableItemControl
- Parameters:
clipping
- One of SWT.TOP or SWT.BOTTOM
-
getClipping
public int getClipping()
- Specified by:
getClipping
in interfaceICalendarableItemControl
- Returns:
- The clipping style bits
-
setContinued
public void setContinued(int continued)
Description copied from interface:ICalendarableItemControl
Sets the continued style bits- Specified by:
setContinued
in interfaceICalendarableItemControl
- Parameters:
continued
- One of SWT.TOP or SWT.BOTTOM
-
getContinued
public int getContinued()
- Specified by:
getContinued
in interfaceICalendarableItemControl
- Returns:
- the continued style bits
-
setSelected
public void setSelected(boolean selected)
Description copied from interface:ICalendarableItemControl
Set or clear the selection indicator in the UI.- Specified by:
setSelected
in interfaceICalendarableItemControl
- Parameters:
selected
- true if this control should appear selected; false otherwise.
-
addMouseListener
public void addMouseListener(org.eclipse.swt.events.MouseListener listener)
- Specified by:
addMouseListener
in interfaceICalendarableItemControl
- Overrides:
addMouseListener
in classorg.eclipse.swt.widgets.Control
-
removeMouseListener
public void removeMouseListener(org.eclipse.swt.events.MouseListener listener)
- Specified by:
removeMouseListener
in interfaceICalendarableItemControl
- Overrides:
removeMouseListener
in classorg.eclipse.swt.widgets.Control
-
setCalendarableItem
public void setCalendarableItem(CalendarableItem calendarable)
Description copied from interface:ICalendarableItemControl
Method setCalendarable. Sets the associated model.- Specified by:
setCalendarableItem
in interfaceICalendarableItemControl
-
getCalendarableItem
public CalendarableItem getCalendarableItem()
- Specified by:
getCalendarableItem
in interfaceICalendarableItemControl
- Returns:
- Returns the calendarable.
-
-