use of org.obeonetwork.dsl.environment.design.ui.providers.ArrayTreeContentProvider in project InformationSystem by ObeoNetwork.
the class ChooseTypesAndReferencesPage method createControl.
/**
* Create contents of the wizard.
* @param parent
*/
public void createControl(Composite parent) {
Composite container = new Composite(parent, SWT.NULL);
setControl(container);
container.setLayout(new GridLayout(2, true));
Label lblTypes = new Label(container, SWT.NONE);
lblTypes.setFont(SWTResourceManager.getFont("Segoe UI", 9, SWT.BOLD));
lblTypes.setText("Types :");
Label lblReferences = new Label(container, SWT.NONE);
lblReferences.setFont(SWTResourceManager.getFont("Segoe UI", 9, SWT.BOLD));
lblReferences.setText("References :");
typesTreeViewer = new CheckboxTreeViewer(container, SWT.BORDER);
typesTreeViewer.setUseHashlookup(true);
final Tree typesTree = typesTreeViewer.getTree();
typesTree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
typesTreeViewer.setContentProvider(new StructuredTypesContentProvider(sourceTypeName));
typesTreeViewer.setLabelProvider(labelProvider);
typesTreeViewer.setSorter(new ViewerSorter());
referencesTreeViewer = new CheckboxTreeViewer(container, SWT.BORDER);
referencesTreeViewer.setUseHashlookup(true);
Tree referencesTree = referencesTreeViewer.getTree();
referencesTree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
referencesTreeViewer.setContentProvider(new ArrayTreeContentProvider());
referenceLabelProvider = new ReferenceLabelProvider();
referencesTreeViewer.setLabelProvider(referenceLabelProvider);
referencesTreeViewer.setSorter(new ViewerSorter());
typesTreeViewer.addCheckStateListener(new ICheckStateListener() {
public void checkStateChanged(CheckStateChangedEvent event) {
// Check/uncheck all subtree
typesTreeViewer.setSubtreeChecked(event.getElement(), event.getChecked());
Collection<StructuredType> checkedTypes = getCheckedTypes();
setPageComplete(!checkedTypes.isEmpty());
List<Reference> references = referencesServices.getReferencesBetweenTypes(checkedTypes);
referencesTreeViewer.setInput(references);
}
});
initContents();
}
Aggregations