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.ColorBACKGROUND_COLORprivate org.eclipse.swt.graphics.ColorBORDER_COLORprivate CalendarableItemcalendarableprivate intclippingprivate intcontinuedprivate org.eclipse.swt.widgets.Labellabelprivate org.eclipse.swt.events.MouseListenerlabelMouseListenerprivate static intMARGINprivate java.util.ListmouseListenersprivate org.eclipse.swt.events.PaintListenerpaintListenerprivate org.eclipse.swt.graphics.ColorSELECTED_BACKGROUND_COLORprivate org.eclipse.swt.graphics.ColorSELECTED_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 voidaddMouseListener(org.eclipse.swt.events.MouseListener listener)voiddispose()CalendarableItemgetCalendarableItem()intgetClipping()intgetContinued()private voidinitialize()Create the event control's layoutprivate org.eclipse.swt.graphics.RGBlighten(org.eclipse.swt.graphics.RGB color, float amount)voidremoveMouseListener(org.eclipse.swt.events.MouseListener listener)private org.eclipse.swt.graphics.RGBsaturate(org.eclipse.swt.graphics.RGB color, float saturation)Sets the color's saturation to the specified value.voidsetCalendarableItem(CalendarableItem calendarable)Method setCalendarable.voidsetClipping(int clipping)Sets the clipping style bitsvoidsetContinued(int continued)Sets the continued style bitsvoidsetImage(org.eclipse.swt.graphics.Image image)voidsetMenu(org.eclipse.swt.widgets.Menu menu)voidsetSelected(boolean selected)Set or clear the selection indicator in the UI.voidsetText(java.lang.String text)voidsetToolTipText(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
SWTwhich 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 thoseSWTstyle 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:
disposein interfaceICalendarableItemControl- Overrides:
disposein 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:
setMenuin interfaceICalendarableItemControl- Overrides:
setMenuin classorg.eclipse.swt.widgets.Control
-
setText
public void setText(java.lang.String text)
- Specified by:
setTextin interfaceICalendarableItemControl
-
setImage
public void setImage(org.eclipse.swt.graphics.Image image)
- Specified by:
setImagein interfaceICalendarableItemControl
-
setToolTipText
public void setToolTipText(java.lang.String text)
- Specified by:
setToolTipTextin interfaceICalendarableItemControl- Overrides:
setToolTipTextin classorg.eclipse.swt.widgets.Control
-
setClipping
public void setClipping(int clipping)
Description copied from interface:ICalendarableItemControlSets the clipping style bits- Specified by:
setClippingin interfaceICalendarableItemControl- Parameters:
clipping- One of SWT.TOP or SWT.BOTTOM
-
getClipping
public int getClipping()
- Specified by:
getClippingin interfaceICalendarableItemControl- Returns:
- The clipping style bits
-
setContinued
public void setContinued(int continued)
Description copied from interface:ICalendarableItemControlSets the continued style bits- Specified by:
setContinuedin interfaceICalendarableItemControl- Parameters:
continued- One of SWT.TOP or SWT.BOTTOM
-
getContinued
public int getContinued()
- Specified by:
getContinuedin interfaceICalendarableItemControl- Returns:
- the continued style bits
-
setSelected
public void setSelected(boolean selected)
Description copied from interface:ICalendarableItemControlSet or clear the selection indicator in the UI.- Specified by:
setSelectedin interfaceICalendarableItemControl- Parameters:
selected- true if this control should appear selected; false otherwise.
-
addMouseListener
public void addMouseListener(org.eclipse.swt.events.MouseListener listener)
- Specified by:
addMouseListenerin interfaceICalendarableItemControl- Overrides:
addMouseListenerin classorg.eclipse.swt.widgets.Control
-
removeMouseListener
public void removeMouseListener(org.eclipse.swt.events.MouseListener listener)
- Specified by:
removeMouseListenerin interfaceICalendarableItemControl- Overrides:
removeMouseListenerin classorg.eclipse.swt.widgets.Control
-
setCalendarableItem
public void setCalendarableItem(CalendarableItem calendarable)
Description copied from interface:ICalendarableItemControlMethod setCalendarable. Sets the associated model.- Specified by:
setCalendarableItemin interfaceICalendarableItemControl
-
getCalendarableItem
public CalendarableItem getCalendarableItem()
- Specified by:
getCalendarableItemin interfaceICalendarableItemControl- Returns:
- Returns the calendarable.
-
-