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;
}
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");
}
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");
}
Aggregations