use of org.tigris.subversion.subclipse.ui.wizards.WizardDialogWithPersistedLocation in project subclipse by subclipse.
the class GenerateDiffFileSynchronizeOperation method run.
protected void run(SVNTeamProvider provider, SyncInfoSet set, IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
IResource[] resources = set.getResources();
HashMap statusMap = new HashMap();
unaddedList = new ArrayList();
for (int i = 0; i < resources.length; i++) {
ISVNLocalResource svnResource = SVNWorkspaceRoot.getSVNResourceFor(resources[i]);
SyncInfo syncInfo = set.getSyncInfo(resources[i]);
SVNStatusKind statusKind = null;
try {
if (!svnResource.isManaged()) {
statusKind = SVNStatusKind.UNVERSIONED;
} else {
switch(SyncInfo.getChange(syncInfo.getKind())) {
case SyncInfo.ADDITION:
statusKind = SVNStatusKind.ADDED;
break;
case SyncInfo.DELETION:
statusKind = SVNStatusKind.DELETED;
break;
case SyncInfo.CONFLICTING:
statusKind = SVNStatusKind.CONFLICTED;
break;
default:
statusKind = SVNStatusKind.MODIFIED;
break;
}
}
statusMap.put(resources[i], statusKind);
if (!svnResource.isManaged() && !svnResource.isIgnored())
unaddedList.add(resources[i]);
} catch (SVNException e) {
SVNUIPlugin.log(IStatus.ERROR, e.getMessage(), e);
}
}
ArrayList dedupedList = new ArrayList();
Iterator iter = unaddedList.iterator();
while (iter.hasNext()) {
IResource resource = (IResource) iter.next();
if (!isDupe(resource))
dedupedList.add(resource);
}
IResource[] unversionedResources = new IResource[dedupedList.size()];
dedupedList.toArray(unversionedResources);
GenerateDiffFileWizard wizard = new GenerateDiffFileWizard(new StructuredSelection(resources), unversionedResources, statusMap);
// $NON-NLS-1$
wizard.setWindowTitle(Policy.bind("GenerateSVNDiff.title"));
wizard.setSelectedResources(selectedResources);
// final WizardDialog dialog = new WizardDialog(getShell(), wizard);
// dialog.setMinimumPageSize(350, 250);
final WizardDialog dialog = new WizardDialogWithPersistedLocation(getShell(), wizard, // $NON-NLS-1$
"GenerateDiffFileWizard");
dialog.setMinimumPageSize(350, 250);
getShell().getDisplay().syncExec(new Runnable() {
public void run() {
dialog.open();
}
});
}
use of org.tigris.subversion.subclipse.ui.wizards.WizardDialogWithPersistedLocation in project subclipse by subclipse.
the class GenerateDiffFileAction method execute.
/**
* (Non-javadoc) Method declared on IActionDelegate.
*
* @throws InterruptedException
* @throws InvocationTargetException
*/
public void execute(IAction action) throws InvocationTargetException, InterruptedException {
statusMap = new HashMap();
unaddedList = new ArrayList();
// $NON-NLS-1$
String title = Policy.bind("GenerateSVNDiff.title");
final IResource[] resources = getSelectedResources();
run(new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
try {
modifiedResources = getModifiedResources(resources, monitor);
} catch (SVNException e) {
SVNUIPlugin.log(IStatus.ERROR, e.getMessage(), e);
}
}
}, true, PROGRESS_BUSYCURSOR);
if (modifiedResources == null || modifiedResources.length == 0) {
MessageDialog.openInformation(getShell(), Policy.bind("GenerateSVNDiff.title"), // $NON-NLS-1$ //$NON-NLS-1$
Policy.bind("GenerateSVNDiff.noDiffsFoundMsg"));
return;
}
IResource[] unaddedResources = new IResource[unaddedList.size()];
unaddedList.toArray(unaddedResources);
GenerateDiffFileWizard wizard = new GenerateDiffFileWizard(new StructuredSelection(modifiedResources), unaddedResources, statusMap);
wizard.setWindowTitle(title);
wizard.setSelectedResources(getSelectedResources());
WizardDialog dialog = new WizardDialogWithPersistedLocation(getShell(), wizard, // $NON-NLS-1$
"GenerateDiffFileWizard");
dialog.setMinimumPageSize(350, 250);
dialog.open();
}
Aggregations