use of org.tigris.subversion.subclipse.core.repo.RepositoryComparator in project subclipse by subclipse.
the class CheckoutWizardLocationPage method refreshLocations.
public void refreshLocations() {
ISVNRepositoryLocation[] locations = SVNUIPlugin.getPlugin().getRepositoryManager().getKnownRepositoryLocations(null);
Arrays.sort(locations, new RepositoryComparator());
AdaptableList input = new AdaptableList(locations);
table.setInput(input);
if (locations.length == 0) {
newButton.setSelection(true);
existingButton.setSelection(false);
table.getTable().setEnabled(false);
setPageComplete(true);
} else {
existingButton.setSelection(true);
newButton.setSelection(false);
table.getTable().setEnabled(true);
}
}
use of org.tigris.subversion.subclipse.core.repo.RepositoryComparator in project subclipse by subclipse.
the class RepositorySelectionPage method createControl.
/**
* Creates the UI part of the page.
*
* @param parent the parent of the created widgets
*/
public void createControl(Composite parent) {
Composite composite = createComposite(parent, 1);
// set F1 help
PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IHelpContextIds.SHARING_SELECT_REPOSITORY_PAGE);
createWrappingLabel(composite, Policy.bind("RepositorySelectionPage.description"), 0, /* indent */
1);
useNewRepo = createRadioButton(composite, Policy.bind("RepositorySelectionPage.useNew"), // $NON-NLS-1$
1);
useExistingRepo = createRadioButton(composite, Policy.bind("RepositorySelectionPage.useExisting"), // $NON-NLS-1$
1);
table = createTable(composite, 1);
table.setContentProvider(new WorkbenchContentProvider());
table.setLabelProvider(new WorkbenchLabelProvider());
table.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
result = (ISVNRepositoryLocation) ((IStructuredSelection) table.getSelection()).getFirstElement();
settings.put(LAST_LOCATION, result.getLocation());
setPageComplete(canFinish());
}
});
SelectionListener selectionListener = new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
if (useNewRepo.getSelection()) {
table.getTable().setEnabled(false);
result = null;
} else {
table.getTable().setEnabled(true);
result = (ISVNRepositoryLocation) ((IStructuredSelection) table.getSelection()).getFirstElement();
}
setPageComplete(canFinish());
}
};
useNewRepo.addSelectionListener(selectionListener);
useExistingRepo.addSelectionListener(selectionListener);
setControl(composite);
IRunnableWithProgress runnable = new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
locations = SVNUIPlugin.getPlugin().getRepositoryManager().getKnownRepositoryLocations(monitor);
}
};
try {
new ProgressMonitorDialog(getShell()).run(true, false, runnable);
} catch (Exception e) {
SVNUIPlugin.openError(getShell(), null, null, e, SVNUIPlugin.LOG_TEAM_EXCEPTIONS);
}
Arrays.sort(locations, new RepositoryComparator());
AdaptableList input = new AdaptableList(locations);
table.setInput(input);
if (locations.length == 0) {
useNewRepo.setSelection(true);
} else {
useExistingRepo.setSelection(true);
int selectionIndex = 0;
String lastLocation = settings.get(LAST_LOCATION);
if (lastLocation != null) {
for (int i = 0; i < locations.length; i++) {
ISVNRepositoryLocation location = locations[i];
if (lastLocation.equals(location.getLocation())) {
selectionIndex = i;
break;
}
}
}
table.setSelection(new StructuredSelection(locations[selectionIndex]));
result = locations[selectionIndex];
}
setPageComplete(canFinish());
}
use of org.tigris.subversion.subclipse.core.repo.RepositoryComparator in project subclipse by subclipse.
the class AllRootsElement method internalGetChildren.
public Object[] internalGetChildren(Object o, IProgressMonitor monitor) {
ISVNRepositoryLocation[] locations = SVNUIPlugin.getPlugin().getRepositoryManager().getKnownRepositoryLocations(null);
Arrays.sort(locations, new RepositoryComparator());
return locations;
}
Aggregations