List of usage examples for org.eclipse.jface.viewers ICheckStateProvider isGrayed
public boolean isGrayed(Object element);
From source file:org.bonitasoft.studio.properties.sections.forms.wizard.SelectGeneratedWidgetsWizardPageTest.java
License:Open Source License
@Test public void should_a_widget_container_be_grayed_if_not_all_of_its_children_is_selected() throws Exception { final WidgetMapping parent = new WidgetMapping(BusinessObjectDataBuilder.aBusinessData() .havingDataType(BusinessObjectDataTypeBuilder.aBusinessObjectDataType()).build()); final SimpleField modelElement = new SimpleField(); modelElement.setType(FieldType.BOOLEAN); final WidgetMapping mapping1 = new WidgetMapping(modelElement); when(checkboxTreeViewer.getChecked(mapping1)).thenReturn(true); final WidgetMapping mapping2 = new WidgetMapping(modelElement); when(checkboxTreeViewer.getChecked(mapping2)).thenReturn(false); parent.addChild(mapping1);//ww w . j a v a 2s . co m parent.addChild(mapping2); final ICheckStateProvider checkStateProvider = selectGeneratedWidgetsWizardPage .getCheckStateProvider(checkboxTreeViewer); assertThat(checkStateProvider.isGrayed(parent)).isTrue(); assertThat(checkStateProvider.isChecked(parent)).isFalse(); }
From source file:org.bonitasoft.studio.properties.sections.forms.wizard.SelectGeneratedWidgetsWizardPageTest.java
License:Open Source License
@Test public void should_a_widget_not_grayed_if_a_leaf() throws Exception { final SimpleField modelElement = new SimpleField(); modelElement.setType(FieldType.BOOLEAN); final WidgetMapping mapping1 = new WidgetMapping(modelElement); when(checkboxTreeViewer.getChecked(mapping1)).thenReturn(true); final ICheckStateProvider checkStateProvider = selectGeneratedWidgetsWizardPage .getCheckStateProvider(checkboxTreeViewer); assertThat(checkStateProvider.isGrayed(mapping1)).isFalse(); }