Package dyntabs

Class DynTabConfig

java.lang.Object
dyntabs.DynTabConfig

public abstract class DynTabConfig extends Object
Abstract configuration class that defines which tabs are opened at startup and the maximum number of tabs allowed.

To use DynTabs, create an @ApplicationScoped subclass of this class in your application. For example, given a HomeBean annotated with @DynTab:

 
 @Named
 @TabScoped
 @DynTab(name = "HomeDynTab",
         title = "Welcome",
         includePage = "/WEB-INF/include/home/home.xhtml",
         closeable = false)
 public class HomeBean implements DyntabBeanInterface {
     // ...
 }
 
 

Override getInitialTabNames() to specify which tabs open on startup:

 
 @ApplicationScoped
 public class MyAppTabConfig extends DynTabConfig {

     @Override
     public List<String> getInitialTabNames() {
         return List.of("HomeDynTab");
     }

     @Override
     public int getMaxNumberOfTabs() {
         return 7;
     }
 }
 
 

Startup call chain for initial tabs:

  1. CDI bootstrap: DynTabDiscoveryExtension scans @DynTab annotations and stores discovered tabs
  2. User opens the page: DynTabTracker is created (@ViewScoped)
  3. DynTabTracker.init() calls config.getInitialTabNames() to get the list of tab names (e.g. ["HomeDynTab"])
  4. For each name, calls DynTabRegistry.createTab(String) which invokes the registered Supplier to create a fresh DynTab instance with all annotation data
  5. The tab gets an ID (r0), is set to active, and its CDI bean is resolved
Author:
DynTabs
See Also:
  • Constructor Details

    • DynTabConfig

      public DynTabConfig()
  • Method Details

    • getInitialTabNames

      public abstract List<String> getInitialTabNames()
      Returns the names of tabs to open when the application starts. These tabs must be previously registered in DynTabRegistry (either via @DynTab annotation or manual register() call).
      Returns:
      list of registered tab names (e.g. List.of("HomeDynTab", "DashboardDynTab"))
    • getMaxNumberOfTabs

      public int getMaxNumberOfTabs()
      Returns the maximum number of tabs that can be open simultaneously. Default is 7. Override to change.
      Returns:
      the maximum number of open tabs