use of org.yakindu.sct.ui.wizards.WorkspaceTreeContentProvider in project statecharts by Yakindu.
the class SGenWizardPage2 method createObjectTree.
private void createObjectTree(Composite container) {
lblNewLabel = new Label(container, SWT.NONE);
lblNewLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1));
lblNewLabel.setText("Choose: " + getSelectedGenerator().getContentType());
resourceTree = new CheckboxTreeViewer(container, SWT.BORDER);
resourceTree.getTree().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
resourceTree.setContentProvider(new WorkspaceTreeContentProvider());
resourceTree.setLabelProvider(new SGenWorkspaceLabelProvider());
TreePropagatingCheckStateListener checkStateListener = new TreePropagatingCheckStateListener(resourceTree) {
@Override
public void checkStateChanged(CheckStateChangedEvent event) {
super.checkStateChanged(event);
}
};
resourceTree.addCheckStateListener(checkStateListener);
resourceTree.addDoubleClickListener(new TreeExpandingDoubleClickListener(resourceTree, checkStateListener));
resourceTree.setAutoExpandLevel(AbstractTreeViewer.ALL_LEVELS);
resourceTree.setFilters(new ViewerFilter[] { new ViewerFilter() {
@Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
// '.' prefixed folder
if (element instanceof IFolder) {
return !((IFolder) element).getName().startsWith(".");
}
return true;
}
} });
}
Aggregations