Class 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
    • 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 layout
      private 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 bits
      void setContinued​(int continued)
      Sets the continued style bits
      void 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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • 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
    • 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 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
        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 color
        saturation - 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 color
        amount - 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 interface ICalendarableItemControl
        Overrides:
        dispose in class org.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 interface ICalendarableItemControl
        Overrides:
        setMenu in class org.eclipse.swt.widgets.Control
      • setToolTipText

        public void setToolTipText​(java.lang.String text)
        Specified by:
        setToolTipText in interface ICalendarableItemControl
        Overrides:
        setToolTipText in class org.eclipse.swt.widgets.Control
      • setSelected

        public void setSelected​(boolean selected)
        Description copied from interface: ICalendarableItemControl
        Set or clear the selection indicator in the UI.
        Specified by:
        setSelected in interface ICalendarableItemControl
        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 interface ICalendarableItemControl
        Overrides:
        addMouseListener in class org.eclipse.swt.widgets.Control
      • removeMouseListener

        public void removeMouseListener​(org.eclipse.swt.events.MouseListener listener)
        Specified by:
        removeMouseListener in interface ICalendarableItemControl
        Overrides:
        removeMouseListener in class org.eclipse.swt.widgets.Control