Class CTabRendering

java.lang.Object
org.eclipse.swt.custom.CTabFolderRenderer
org.eclipse.e4.ui.workbench.renderers.swt.CTabRendering
All Implemented Interfaces:
IEclipsePreferences.IPreferenceChangeListener, org.eclipse.e4.ui.internal.css.swt.ICTabRendering

public class CTabRendering extends CTabFolderRenderer implements org.eclipse.e4.ui.internal.css.swt.ICTabRendering, IEclipsePreferences.IPreferenceChangeListener
  • Field Details

    • USE_ROUND_TABS

      public static final String USE_ROUND_TABS
      A named preference for setting CTabFolder's to be rendered with rounded corners

      The default value for this preference is: false (render CTabFolder's with square corners)

      See Also:
    • USE_ROUND_TABS_DEFAULT

      public static final boolean USE_ROUND_TABS_DEFAULT
      Default value for "use round tabs" preference
      See Also:
    • HIDE_ICONS_FOR_VIEW_TABS

      public static final String HIDE_ICONS_FOR_VIEW_TABS
      A named preference for setting CTabFolder's to be rendered without icons in view areas

      The default value for this preference is: false (render CTabFolder's with icons)

      See Also:
    • HIDE_ICONS_FOR_VIEW_TABS_DEFAULT

      public static final boolean HIDE_ICONS_FOR_VIEW_TABS_DEFAULT
      Default value for "hide icons" preference for view tabs
      See Also:
    • SHOW_FULL_TEXT_FOR_VIEW_TABS

      public static final String SHOW_FULL_TEXT_FOR_VIEW_TABS
      A named preference for setting CTabFolder's to show full text in view areas

      The default value for this preference is: false (render CTabFolder's without full text)

      See Also:
    • SHOW_FULL_TEXT_FOR_VIEW_TABS_DEFAULT

      public static final boolean SHOW_FULL_TEXT_FOR_VIEW_TABS_DEFAULT
      Default value for "show full text" preference for view tabs
      See Also:
  • Constructor Details

    • CTabRendering

      public CTabRendering(CTabFolder parent)
  • Method Details

    • setUnselectedHotTabsColorBackground

      public void setUnselectedHotTabsColorBackground(Color color)
      Specified by:
      setUnselectedHotTabsColorBackground in interface org.eclipse.e4.ui.internal.css.swt.ICTabRendering
    • computeTrim

      protected Rectangle computeTrim(int part, int state, int x, int y, int width, int height)
      Description copied from class: CTabFolderRenderer
      Given a desired client area for the part (as described by the arguments), returns the bounding rectangle which would be required to produce that client area.

      In other words, it returns a rectangle such that, if the part's bounds were set to that rectangle, the area of the part which is capable of displaying data (that is, not covered by the "trimmings") would be the rectangle described by the arguments (relative to the receiver's parent).

      Overrides:
      computeTrim in class CTabFolderRenderer
      Parameters:
      part - one of the part constants
      state - the state of the part
      x - the desired x coordinate of the client area
      y - the desired y coordinate of the client area
      width - the desired width of the client area
      height - the desired height of the client area
      Returns:
      the required bounds to produce the given client area
      See Also:
    • computeSize

      protected Point computeSize(int part, int state, GC gc, int wHint, int hHint)
      Description copied from class: CTabFolderRenderer
      Returns the preferred size of a part.

      The preferred size of a part 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 part 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.

      The part value indicated what component the preferred size is to be calculated for. Valid values are any of the part constants:

      • PART_BODY
      • PART_HEADER
      • PART_BORDER
      • PART_BACKGROUND
      • PART_MAX_BUTTON
      • PART_MIN_BUTTON
      • PART_CHEVRON_BUTTON
      • PART_CLOSE_BUTTON
      • A positive integer which is the index of an item in the CTabFolder.

      The state parameter may be one of the following:

      • SWT.NONE
      • SWT.SELECTED - whether the part is selected
      Overrides:
      computeSize in class CTabFolderRenderer
      Parameters:
      part - a part constant
      state - current state
      gc - the gc to use for measuring
      wHint - the width hint (can be SWT.DEFAULT)
      hHint - the height hint (can be SWT.DEFAULT)
      Returns:
      the preferred size of the part
    • draw

      protected void draw(int part, int state, Rectangle bounds, GC gc)
      Description copied from class: CTabFolderRenderer
      Draw a specified part of the CTabFolder using the provided bounds and GC.

      The valid CTabFolder part constants are:

      • PART_BODY - the entire body of the CTabFolder
      • PART_HEADER - the upper tab area of the CTabFolder
      • PART_BORDER - the border of the CTabFolder
      • PART_BACKGROUND - the background of the CTabFolder
      • PART_MAX_BUTTON
      • PART_MIN_BUTTON
      • PART_CHEVRON_BUTTON
      • PART_CLOSE_BUTTON
      • A positive integer which is the index of an item in the CTabFolder.

      The state parameter may be a combination of:

      • SWT.BACKGROUND - whether the background should be drawn
      • SWT.FOREGROUND - whether the foreground should be drawn
      • SWT.SELECTED - whether the part is selected
      • SWT.HOT - whether the part is hot (i.e. mouse is over the part)
      Overrides:
      draw in class CTabFolderRenderer
      Parameters:
      part - part to draw
      state - state of the part
      bounds - the bounds of the part
      gc - the gc to draw the part on
    • blur

      public ImageData blur(Image src, int radius, int sigma)
    • getPadding

      public Rectangle getPadding()
    • setPadding

      public void setPadding(int paddingLeft, int paddingRight, int paddingTop, int paddingBottom)
    • setCornerRadius

      public void setCornerRadius(int radius)
      Specified by:
      setCornerRadius in interface org.eclipse.e4.ui.internal.css.swt.ICTabRendering
    • setOuterKeyline

      public void setOuterKeyline(Color color)
      Specified by:
      setOuterKeyline in interface org.eclipse.e4.ui.internal.css.swt.ICTabRendering
    • setSelectedTabHighlight

      public void setSelectedTabHighlight(Color color)
      Specified by:
      setSelectedTabHighlight in interface org.eclipse.e4.ui.internal.css.swt.ICTabRendering
    • setSelectedTabFill

      public void setSelectedTabFill(Color color)
      Specified by:
      setSelectedTabFill in interface org.eclipse.e4.ui.internal.css.swt.ICTabRendering
    • setSelectedTabFill

      public void setSelectedTabFill(Color[] colors, int[] percents)
      Specified by:
      setSelectedTabFill in interface org.eclipse.e4.ui.internal.css.swt.ICTabRendering
    • setUnselectedTabsColor

      public void setUnselectedTabsColor(Color color)
      Specified by:
      setUnselectedTabsColor in interface org.eclipse.e4.ui.internal.css.swt.ICTabRendering
    • setUnselectedTabsColor

      public void setUnselectedTabsColor(Color[] colors, int[] percents)
      Specified by:
      setUnselectedTabsColor in interface org.eclipse.e4.ui.internal.css.swt.ICTabRendering
    • setTabOutline

      public void setTabOutline(Color color)
      Specified by:
      setTabOutline in interface org.eclipse.e4.ui.internal.css.swt.ICTabRendering
    • setInnerKeyline

      public void setInnerKeyline(Color color)
      Specified by:
      setInnerKeyline in interface org.eclipse.e4.ui.internal.css.swt.ICTabRendering
    • setActive

      public void setActive(boolean active)
    • setDrawCustomTabContentBackground

      public void setDrawCustomTabContentBackground(boolean drawCustomTabContentBackground)
      Sets whether to use a custom tab background (reusing tab colors and gradients), or default one from plain CTabFolder (using widget background color).
      Specified by:
      setDrawCustomTabContentBackground in interface org.eclipse.e4.ui.internal.css.swt.ICTabRendering
    • setSelectedTabHighlightTop

      public void setSelectedTabHighlightTop(boolean drawTabHiglightOnTop)
      Specified by:
      setSelectedTabHighlightTop in interface org.eclipse.e4.ui.internal.css.swt.ICTabRendering
    • preferenceChange

      public void preferenceChange(IEclipsePreferences.PreferenceChangeEvent event)
      Description copied from interface: IEclipsePreferences.IPreferenceChangeListener
      Notification that a preference value has changed in the preference store. The given event object describes the change details and must not be null.
      Specified by:
      preferenceChange in interface IEclipsePreferences.IPreferenceChangeListener
      Parameters:
      event - the event details
      See Also: