use of org.pentaho.ui.xul.components.XulCheckbox in project pentaho-kettle by pentaho.
the class DataHandlerTest method testHandleUseSecurityCheckbox.
@Test
public void testHandleUseSecurityCheckbox() throws Exception {
dataHandler.handleUseSecurityCheckbox();
// Now add the widget
XulCheckbox useIntegratedSecurityCheck = mock(XulCheckbox.class);
when(useIntegratedSecurityCheck.isChecked()).thenReturn(false);
when(document.getElementById("use-integrated-security-check")).thenReturn(useIntegratedSecurityCheck);
dataHandler.getControls();
dataHandler.handleUseSecurityCheckbox();
when(useIntegratedSecurityCheck.isChecked()).thenReturn(true);
dataHandler.handleUseSecurityCheckbox();
}
use of org.pentaho.ui.xul.components.XulCheckbox in project pentaho-kettle by pentaho.
the class AbsController method setSelectedSystemRoleChanged.
/**
* The method is called when a user select a role from the role list. This method reads the current selected role and
* populates the Action Permission UI with the details
*/
public void setSelectedSystemRoleChanged(IUIRole role) throws Exception {
IUIAbsRole absRole = null;
uncheckAllSystemActionPermissions();
if (role instanceof IUIAbsRole) {
absRole = (IUIAbsRole) role;
if (absRole != null && absRole.getLogicalRoles() != null) {
for (String permission : absRole.getLogicalRoles()) {
XulCheckbox permissionCheckbox = findSystemRoleCheckbox(permission);
if (permissionCheckbox != null) {
permissionCheckbox.setChecked(true);
}
}
}
} else {
throw new IllegalStateException();
}
}
use of org.pentaho.ui.xul.components.XulCheckbox in project pentaho-kettle by pentaho.
the class AbsController method initializeLogicalSystemRolesUI.
/**
* Initialized the ActionPermissions UI with all the possible values from LogicalSystemRoles enum
*/
private void initializeLogicalSystemRolesUI() {
try {
Map<String, String> logicalRoles = ((IAbsSecurityManager) service).getAllLogicalRoles(GlobalMessages.getLocale().getDisplayName());
for (Entry<String, String> logicalRole : logicalRoles.entrySet()) {
XulCheckbox logicalSystemRoleCheckbox;
// $NON-NLS-1$
logicalSystemRoleCheckbox = (XulCheckbox) document.createElement("checkbox");
logicalSystemRoleCheckbox.setLabel(logicalRole.getValue());
logicalSystemRoleCheckbox.setId(logicalRole.getValue());
// $NON-NLS-1$
logicalSystemRoleCheckbox.setCommand("iSecurityController.updateSystemRoleActionPermission()");
logicalSystemRoleCheckbox.setFlex(1);
logicalSystemRoleCheckbox.setDisabled(true);
logicalSystemRolesBox.addChild(logicalSystemRoleCheckbox);
logicalSystemRoleChecboxMap.put(logicalSystemRoleCheckbox, logicalRole.getKey());
bf.setBindingType(Binding.Type.ONE_WAY);
// $NON-NLS-1$ //$NON-NLS-2$
bf.createBinding(systemRoleListBox, "selectedIndex", logicalSystemRoleCheckbox, "disabled", buttonConverter);
}
} catch (XulException xe) {
} catch (KettleException xe) {
}
}
use of org.pentaho.ui.xul.components.XulCheckbox 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.XulCheckbox in project pentaho-kettle by pentaho.
the class AbsController method initializeLogicalRolesUI.
/**
* Initialized the ActionPermissions UI with all the possible values from LogicalRoles enum
*/
private void initializeLogicalRolesUI() {
try {
Map<String, String> logicalRoles = ((IAbsSecurityManager) service).getAllLogicalRoles(GlobalMessages.getLocale().getDisplayName());
for (Entry<String, String> logicalRole : logicalRoles.entrySet()) {
XulCheckbox logicalRoleCheckbox;
// $NON-NLS-1$
logicalRoleCheckbox = (XulCheckbox) document.createElement("checkbox");
logicalRoleCheckbox.setLabel(logicalRole.getValue());
logicalRoleCheckbox.setId(logicalRole.getValue());
// $NON-NLS-1$
logicalRoleCheckbox.setCommand("iSecurityController.updateRoleActionPermission()");
logicalRoleCheckbox.setFlex(1);
logicalRoleCheckbox.setDisabled(true);
logicalRolesBox.addChild(logicalRoleCheckbox);
logicalRoleChecboxMap.put(logicalRoleCheckbox, logicalRole.getKey());
bf.setBindingType(Binding.Type.ONE_WAY);
// $NON-NLS-1$ //$NON-NLS-2$
bf.createBinding(roleListBox, "selectedIndex", logicalRoleCheckbox, "disabled", buttonConverter);
}
} catch (XulException xe) {
} catch (KettleException xe) {
}
}
Aggregations