Class RibbonContextualTaskGroup
- java.lang.Object
-
- org.pushingpixels.radiance.component.api.ribbon.RibbonContextualTaskGroup
-
public class RibbonContextualTaskGroup extends java.lang.Object
A contextual group ofRibbonTask
s. The contextual ribbon task groups allow showing and hiding ribbon tasks based on the current selection in the application. For example, Word only shows the table tasks when a table is selected in the document. By default, tasks belonging to the groups added byJRibbon.addContextualTaskGroup(RibbonContextualTaskGroup)
are not visible. To show the tasks belonging to the specific group, callJRibbon.setVisible(RibbonContextualTaskGroup, boolean)
API. Note that you can have multiple task groups visible at the same time. This class is a logical entity that groups ribbon tasks belonging to the same contextual group.
-
-
Field Summary
Fields Modifier and Type Field Description static double
HUE_ALPHA
Alpha factor for colorizing the toggle tab buttons of tasks in contextual groups.private java.awt.Color
hueColor
Hue color for this group.private JRibbon
ribbon
The ribbon that contains this task group.private java.util.ArrayList<RibbonTask>
tasks
List of all tasks.private java.lang.String
title
Group title.
-
Constructor Summary
Constructors Constructor Description RibbonContextualTaskGroup(java.lang.String title, java.awt.Color hueColor, java.lang.Iterable<RibbonTask> tasks)
Creates a task contextual group that contains the specified tasks.RibbonContextualTaskGroup(java.lang.String title, java.awt.Color hueColor, RibbonTask... tasks)
Creates a task contextual group that contains the specified tasks.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.Color
getHueColor()
Returns the hue color for this group.RibbonTask
getTask(int index)
Returns task at the specified index fromthis
group.int
getTaskCount()
Returns the number of tasks inthis
group.java.lang.String
getTitle()
Returns the name of this group.(package private) void
setRibbon(JRibbon ribbon)
Associates this ribbon contextual task group with the specified ribbon.void
setTitle(java.lang.String title)
Changes the title of this ribbon contextual task group.java.lang.String
toString()
-
-
-
Field Detail
-
ribbon
private JRibbon ribbon
The ribbon that contains this task group.
-
tasks
private java.util.ArrayList<RibbonTask> tasks
List of all tasks.
-
title
private java.lang.String title
Group title.
-
hueColor
private java.awt.Color hueColor
Hue color for this group.
-
HUE_ALPHA
public static final double HUE_ALPHA
Alpha factor for colorizing the toggle tab buttons of tasks in contextual groups.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RibbonContextualTaskGroup
public RibbonContextualTaskGroup(java.lang.String title, java.awt.Color hueColor, RibbonTask... tasks)
Creates a task contextual group that contains the specified tasks.- Parameters:
title
- Group title.hueColor
- Hue color for this group. Should be a saturated non-dark color for good visuals.tasks
- Tasks to add to the group.
-
RibbonContextualTaskGroup
public RibbonContextualTaskGroup(java.lang.String title, java.awt.Color hueColor, java.lang.Iterable<RibbonTask> tasks)
Creates a task contextual group that contains the specified tasks.- Parameters:
title
- Group title.hueColor
- Hue color for this group. Should be a saturated non-dark color for good visuals.tasks
- Tasks to add to the group.
-
-
Method Detail
-
getTaskCount
public int getTaskCount()
Returns the number of tasks inthis
group.- Returns:
- Number of tasks in
this
group. - See Also:
getTask(int)
-
getTask
public RibbonTask getTask(int index)
Returns task at the specified index fromthis
group.- Parameters:
index
- Task index.- Returns:
- Task at the specified index.
- See Also:
getTaskCount()
-
getTitle
public java.lang.String getTitle()
Returns the name of this group.- Returns:
- The name of this group.
- See Also:
setTitle(String)
-
getHueColor
public java.awt.Color getHueColor()
Returns the hue color for this group.- Returns:
- The hue color for this group.
-
setTitle
public void setTitle(java.lang.String title)
Changes the title of this ribbon contextual task group.- Parameters:
title
- The new title for this ribbon contextual task group.- See Also:
getTitle()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
setRibbon
void setRibbon(JRibbon ribbon)
Associates this ribbon contextual task group with the specified ribbon. This method is package protected and is for internal use only.- Parameters:
ribbon
- The associated ribbon.
-
-