Class Ribbons

java.lang.Object
org.apache.juneau.console.views.Ribbons

public final class Ribbons extends Object
Builds the standard table ribbon.

[search] [create] [filters] [export: copy/csv/link + extras] [view: collapse / columns / reset] [refresh]

Each slot has a canonical group, so the ribbon sorts the same way everywhere:

Ribbon slots
SlotGroupItem ids
searchsearchsearch
createentityyour Ribbons.Standard.create(RibbonItem...) items
filtersfilteryour Ribbons.Standard.filter(RibbonItem...) items
exportexportexport (buttons copy, csv plus extras), link
viewviewingcollapse, columns, reset
refreshpagerefresh

Every item carries an explicit id, so the output describes itself. The ids collapse and reset are explicit overrides of the stock defaults collapseAll and resetDefaults. build() replaces the group of every item you pass to create or filter with the slot's group.

The copy and csv buttons need the DataTables Buttons extension, so a page using the preset must list the datatables-buttons toolkit pack. Without it the export cluster is omitted at runtime and the link button still renders. The collapse button is hidden at runtime on a table with no row detail, and the columns and reset buttons on a table without columnConfig.

Example:

TableSpec.create("pets") .ribbon(Ribbons.standard() .create(RibbonItem.dialog("add-pet").title("Add pet")) .export("excel", "pdf") .build());

  • Method Details