Search in sources :

Example 1 with ApplyOnDemandTabStyle

use of kutch.biff.marvin.task.ApplyOnDemandTabStyle in project Board-Instrumentation-Framework by intel.

the class OnDemandTabBuilder method Build.

@Override
public boolean Build(String Namespace, String ID, String Value, String strSortValue) {
    LOGGER.info("Creating OnDemand Tab for namespace: " + Namespace + ",  using Tab template ID: " + __tabID);
    Configuration config = Configuration.getConfig();
    TabPane parentPane = config.getPane();
    __builtCount++;
    String strTabID = __tabID + "." + Integer.toString(__builtCount);
    AliasMgr.getAliasMgr().PushAliasList(true);
    TabWidget tab = new TabWidget(strTabID);
    __createdTabs.add(tab);
    tab.setOnDemandSortBy(strSortValue);
    // So tab knows namespace
    AliasMgr.getAliasMgr().AddAlias("TriggeredNamespace", Namespace);
    AliasMgr.getAliasMgr().AddAlias("TriggeredID", ID);
    AliasMgr.getAliasMgr().AddAlias("TriggeredValue", Value);
    AliasMgr.getAliasMgr().AddAlias("TriggeredIndex", Integer.toString(__builtCount));
    AliasMgr.getAliasMgr().AddAlias("TabID", strTabID);
    __onDemandTrigger.tokenizeAndCreateAlias(ID);
    tab = ConfigurationReader.ReadTab(__node, tab, strTabID);
    if (null != tab) {
        tab.setCreatedOnDemand();
        if (tab.Create(parentPane, DataManager.getDataManager(), __tabIndex)) {
            ConfigurationReader.GetConfigReader().getTabs().add(tab);
            tab.PerformPostCreateActions(null, false);
            LOGGER.info("Performed LateCreateTask on Tab: " + tab.getName());
        } else {
            LOGGER.info("Error ocurred performing LateCreateTask on Tab: " + tab.getName());
        }
    } else {
        return false;
    }
    AliasMgr.getAliasMgr().PopAliasList();
    TabWidget.ReIndexTabs(parentPane);
    TaskManager tm = TaskManager.getTaskManager();
    ApplyOnDemandTabStyle objTask = new ApplyOnDemandTabStyle();
    tm.AddPostponedTask(objTask, 1000);
    if (null != tab.getOnDemandTask()) {
        tm.AddDeferredTask(tab.getOnDemandTask());
    }
    return true;
}
Also used : TabPane(javafx.scene.control.TabPane) TaskManager(kutch.biff.marvin.task.TaskManager) Configuration(kutch.biff.marvin.configuration.Configuration) ApplyOnDemandTabStyle(kutch.biff.marvin.task.ApplyOnDemandTabStyle) TabWidget(kutch.biff.marvin.widget.TabWidget)

Aggregations

TabPane (javafx.scene.control.TabPane)1 Configuration (kutch.biff.marvin.configuration.Configuration)1 ApplyOnDemandTabStyle (kutch.biff.marvin.task.ApplyOnDemandTabStyle)1 TaskManager (kutch.biff.marvin.task.TaskManager)1 TabWidget (kutch.biff.marvin.widget.TabWidget)1