});
TableItem[] children = projectMoveViewer.getTable().getItems();
for (int i = 0; i < children.length; i++) {
TableItem item = children[i];
IProject data = (IProject) item.getData();
RepositoryFinder repositoryFinder = new RepositoryFinder(data);
repositoryFinder.setFindInChildren(false);
try {
Collection<RepositoryMapping> find = repositoryFinder
.find(new NullProgressMonitor());
if (find.size() != 1)
item.setChecked(true);
} catch (CoreException e1) {
item.setText(2, e1.getMessage());
}
}
parentRepoComposite = new Composite(main, SWT.NONE);
parentRepoComposite.setLayout(new GridLayout(3, false));
GridDataFactory.fillDefaults().grab(true, true)
.applyTo(parentRepoComposite);
tree = new Tree(parentRepoComposite, SWT.BORDER | SWT.MULTI
| SWT.FULL_SELECTION | SWT.CHECK);
viewer = new CheckboxTreeViewer(tree);
tree.setHeaderVisible(true);
tree.setLayout(new GridLayout());
tree.setLayoutData(GridDataFactory.fillDefaults().grab(true, true)
.span(3, 1).create());
viewer.addCheckStateListener(new ICheckStateListener() {
public void checkStateChanged(CheckStateChangedEvent event) {
if (event.getChecked()) {
ProjectAndRepo checkable = (ProjectAndRepo) event
.getElement();
for (TreeItem ti : tree.getItems()) {
if (ti.getItemCount() > 0
|| ((ProjectAndRepo) ti.getData()).getRepo()
.equals("")) //$NON-NLS-1$
ti.setChecked(false);
for (TreeItem subTi : ti.getItems()) {
IProject project = ((ProjectAndRepo) subTi
.getData()).getProject();
if (checkable.getProject() != null
&& !subTi.getData().equals(checkable)
&& checkable.getProject().equals(project))
subTi.setChecked(false);
}
}
}
}
});
TreeColumn c1 = new TreeColumn(tree, SWT.NONE);
c1.setText(UIText.ExistingOrNewPage_HeaderProject);
c1.setWidth(100);
TreeColumn c2 = new TreeColumn(tree, SWT.NONE);
c2.setText(UIText.ExistingOrNewPage_HeaderLocation);
c2.setWidth(400);
TreeColumn c3 = new TreeColumn(tree, SWT.NONE);
c3.setText(UIText.ExistingOrNewPage_HeaderRepository);
c3.setWidth(200);
boolean allProjectsInExistingRepos = true;
for (IProject project : myWizard.projects) {
RepositoryFinder repositoryFinder = new RepositoryFinder(project);
repositoryFinder.setFindInChildren(false);
try {
Collection<RepositoryMapping> mappings;
mappings = repositoryFinder.find(new NullProgressMonitor());
Iterator<RepositoryMapping> mi = mappings.iterator();
RepositoryMapping m = mi.hasNext() ? mi.next() : null;
if (m == null) {
// no mapping found, enable repository creation
TreeItem treeItem = new TreeItem(tree, SWT.NONE);