Search in sources :

Example 1 with XulTab

use of org.pentaho.ui.xul.components.XulTab in project pentaho-kettle by pentaho.

the class StarModelerPerspective method createTab.

public XulTabAndPanel createTab() {
    try {
        XulTab tab = (XulTab) document.createElement("tab");
        if (name != null) {
            tab.setLabel(name);
        }
        XulTabpanel panel = (XulTabpanel) document.createElement("tabpanel");
        panel.setSpacing(0);
        panel.setPadding(0);
        tabs.addChild(tab);
        panels.addChild(panel);
        tabbox.setSelectedIndex(panels.getChildNodes().indexOf(panel));
        return new XulTabAndPanel(tab, panel);
    } catch (XulException e) {
        e.printStackTrace();
    }
    return null;
}
Also used : XulTabpanel(org.pentaho.ui.xul.components.XulTabpanel) XulException(org.pentaho.ui.xul.XulException) XulTab(org.pentaho.ui.xul.components.XulTab)

Example 2 with XulTab

use of org.pentaho.ui.xul.components.XulTab in project pdi-dataservice-server-plugin by pentaho.

the class ServiceCacheController method initBindings.

public void initBindings(DataServiceModel model) {
    PushDownOptimizationMeta meta = locateServiceCacheMeta(model);
    ServiceCache serviceCache = (ServiceCache) meta.getType();
    BindingFactory bindingFactory = getBindingFactory();
    XulRadio normalModeRadio = getElementById("regular-type-radio");
    XulTab serviceCacheTab = getElementById("service-cache-tab");
    XulCheckbox serviceCacheCheckBox = getElementById("service-cache-checkbox");
    XulTextbox serviceCacheTextBox = getElementById("service-cache-ttl");
    bindingFactory.setBindingType(Binding.Type.ONE_WAY);
    serviceCacheCheckBox.setChecked(meta.isEnabled());
    serviceCacheTab.setVisible(!model.isStreaming());
    try {
        serviceCacheTextBox.setValue(serviceCache.getConfiguredTimeToLive());
    } catch (Exception e) {
        getLogChannel().logError("Unable to set default TTL", e);
    }
    bindingFactory.createBinding(serviceCacheTextBox, "value", serviceCache, "timeToLive");
    bindingFactory.createBinding(serviceCacheCheckBox, "checked", meta, "enabled");
    bindingFactory.createBinding(serviceCacheCheckBox, "checked", serviceCacheTextBox, "disabled", not());
    bindingFactory.createBinding(normalModeRadio, "selected", serviceCacheTab, "visible");
}
Also used : XulCheckbox(org.pentaho.ui.xul.components.XulCheckbox) XulRadio(org.pentaho.ui.xul.components.XulRadio) ServiceCache(org.pentaho.di.trans.dataservice.optimization.cache.ServiceCache) XulTextbox(org.pentaho.ui.xul.components.XulTextbox) PushDownOptimizationMeta(org.pentaho.di.trans.dataservice.optimization.PushDownOptimizationMeta) XulTab(org.pentaho.ui.xul.components.XulTab) BindingFactory(org.pentaho.ui.xul.binding.BindingFactory)

Example 3 with XulTab

use of org.pentaho.ui.xul.components.XulTab in project pdi-dataservice-server-plugin by pentaho.

the class StreamingController method initBindings.

/**
 * Inits the controller-ui bindings.
 *
 * @param model - The {@link org.pentaho.di.trans.dataservice.ui.model.DataServiceModel} dataservice model.
 * @throws InvocationTargetException
 * @throws XulException
 */
public void initBindings(DataServiceModel model) throws InvocationTargetException, XulException, KettleException {
    BindingFactory bindingFactory = getBindingFactory();
    XulRadio streamingRadioButton = getElementById("streaming-type-radio");
    XulTab streamingTab = getElementById("streaming-tab");
    XulTextbox streamingMaxRows = getElementById("streaming-max-rows");
    XulTextbox streamingMaxTime = getElementById("streaming-max-time");
    bindingFactory.setBindingType(Binding.Type.BI_DIRECTIONAL);
    // Set streaming max rows and time limit value on the text boxes.
    // Get the values from the model first and fallback to the appropriate Kettle Properties
    // if they don't exist in the mode.
    int modelStreamingMaxRows = model.getServiceMaxRows();
    streamingMaxRows.setValue(modelStreamingMaxRows > 0 ? Integer.toString(modelStreamingMaxRows) : kettleUtils.getKettleProperty("KETTLE_STREAMING_ROW_LIMIT", Integer.toString(DataServiceConstants.KETTLE_STREAMING_ROW_LIMIT)));
    long modelStreamingMaxTime = model.getServiceMaxTime();
    streamingMaxTime.setValue(modelStreamingMaxTime > 0 ? Long.toString(modelStreamingMaxTime) : kettleUtils.getKettleProperty("KETTLE_STREAMING_TIME_LIMIT", Integer.toString(DataServiceConstants.KETTLE_STREAMING_TIME_LIMIT)));
    streamingTab.setVisible(model.isStreaming());
    bindingFactory.createBinding(model, "serviceMaxRows", streamingMaxRows, "value", BindingConvertor.integer2String());
    bindingFactory.createBinding(model, "serviceMaxTime", streamingMaxTime, "value", BindingConvertor.long2String());
    bindingFactory.createBinding(streamingRadioButton, "selected", streamingTab, "visible");
}
Also used : XulRadio(org.pentaho.ui.xul.components.XulRadio) XulTextbox(org.pentaho.ui.xul.components.XulTextbox) XulTab(org.pentaho.ui.xul.components.XulTab) BindingFactory(org.pentaho.ui.xul.binding.BindingFactory)

Aggregations

XulTab (org.pentaho.ui.xul.components.XulTab)3 BindingFactory (org.pentaho.ui.xul.binding.BindingFactory)2 XulRadio (org.pentaho.ui.xul.components.XulRadio)2 XulTextbox (org.pentaho.ui.xul.components.XulTextbox)2 PushDownOptimizationMeta (org.pentaho.di.trans.dataservice.optimization.PushDownOptimizationMeta)1 ServiceCache (org.pentaho.di.trans.dataservice.optimization.cache.ServiceCache)1 XulException (org.pentaho.ui.xul.XulException)1 XulCheckbox (org.pentaho.ui.xul.components.XulCheckbox)1 XulTabpanel (org.pentaho.ui.xul.components.XulTabpanel)1