Package org.eclipse.e4.ui.workbench.renderers.swt

# 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 Summary

Fields
Modifier and Type
Field
Description
`static final String`
`HIDE_ICONS_FOR_VIEW_TABS`
A named preference for setting CTabFolder's to be rendered without icons in view areas
`static final boolean`
`HIDE_ICONS_FOR_VIEW_TABS_DEFAULT`
Default value for "hide icons" preference for view tabs
`static final String`
`PREF_QUALIFIER_ECLIPSE_E4_UI_WORKBENCH_RENDERERS_SWT`
The preference qualifier.
`static final String`
`SHOW_FULL_TEXT_FOR_VIEW_TABS`
A named preference for setting CTabFolder's to show full text in view areas
`static final boolean`
`SHOW_FULL_TEXT_FOR_VIEW_TABS_DEFAULT`
Default value for "show full text" preference for view tabs

### Fields inherited from class org.eclipse.swt.custom.CTabFolderRenderer

`MINIMUM_SIZE, parent, PART_BACKGROUND, PART_BODY, PART_BORDER, PART_CHEVRON_BUTTON, PART_CLOSE_BUTTON, PART_HEADER, PART_MAX_BUTTON, PART_MIN_BUTTON`

## Constructor Summary

Constructors
Constructor
Description
`CTabRendering(CTabFolder parent)`

## Method Summary

Modifier and Type
Method
Description
`ImageData`
`blur(Image src, int radius, int sigma)`
`protected Point`
`computeSize(int part, int state, GC gc, int wHint, int hHint)`
Returns the preferred size of a part.
`protected Rectangle`
`computeTrim(int part, int state, int x, int y, int width, int height)`
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.
`protected void`
`draw(int part, int state, Rectangle bounds, GC gc)`
Draw a specified `part` of the CTabFolder using the provided `bounds` and `GC`.
`Rectangle`
`getPadding()`
`void`
`preferenceChange(IEclipsePreferences.PreferenceChangeEvent event)`
Notification that a preference value has changed in the preference store.
`void`
`setActive(boolean active)`
`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).
`void`
`setInnerKeyline(Color color)`
`void`
`setOuterKeyline(Color color)`
`void`
`setPadding(int paddingLeft, int paddingRight, int paddingTop, int paddingBottom)`
`void`
`setSelectedTabFill(Color color)`
`void`
`setSelectedTabFill(Color[] colors, int[] percents)`
`void`
`setSelectedTabHighlight(Color color)`
`void`
`setSelectedTabHighlightTop(boolean drawTabHiglightOnTop)`
`void`
`setTabOutline(Color color)`
`void`
`setUnselectedHotTabsColorBackground(Color color)`
`void`
`setUnselectedTabsColor(Color color)`
`void`
`setUnselectedTabsColor(Color[] colors, int[] percents)`

### Methods inherited from class org.eclipse.swt.custom.CTabFolderRenderer

`dispose`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### PREF_QUALIFIER_ECLIPSE_E4_UI_WORKBENCH_RENDERERS_SWT

public static final String PREF_QUALIFIER_ECLIPSE_E4_UI_WORKBENCH_RENDERERS_SWT
The preference qualifier.

See Also:
  - Constant Field Values

### 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:
  - Constant Field Values

### 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:
  - Constant Field Values

### 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:
  - Constant Field Values

### 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:
  - Constant Field Values

## 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:
  - `valid part and state values`

### 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)

### 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:
  - `IEclipsePreferences.PreferenceChangeEvent`
  - `IEclipsePreferences.addPreferenceChangeListener(IEclipsePreferences.IPreferenceChangeListener)`
  - `IEclipsePreferences.removePreferenceChangeListener(IEclipsePreferences.IPreferenceChangeListener)`