use of org.tigris.subversion.subclipse.ui.dialogs.CompareDialog in project subclipse by subclipse.
the class SvnWizardRevertPage method createControls.
public void createControls(Composite outerContainer) {
Composite composite = new Composite(outerContainer, SWT.NULL);
GridLayout layout = new GridLayout(1, false);
layout.marginHeight = 0;
layout.marginWidth = 0;
composite.setLayout(layout);
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
ResourceSelectionTree.IToolbarControlCreator toolbarControlCreator = new ResourceSelectionTree.IToolbarControlCreator() {
public void createToolbarControls(ToolBarManager toolbarManager) {
toolbarManager.add(new // $NON-NLS-1$
ControlContribution(// $NON-NLS-1$
"ignoreUnversioned") {
protected Control createControl(Composite parent) {
includeUnversionedButton = new Button(parent, SWT.CHECK);
includeUnversionedButton.setText(// $NON-NLS-1$
Policy.bind("CommitDialog.includeUnversioned"));
includeUnversionedButton.setSelection(includeUnversioned);
includeUnversionedButton.addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent e) {
includeUnversioned = includeUnversionedButton.getSelection();
if (!includeUnversioned) {
resourceSelectionTree.removeUnversioned();
} else {
resourceSelectionTree.addUnversioned();
}
selectedResources = resourceSelectionTree.getSelectedResources();
setPageComplete(canFinish());
if (!fromSyncView)
updatePreference(includeUnversioned);
}
public void widgetDefaultSelected(SelectionEvent e) {
}
});
return includeUnversionedButton;
}
});
}
public int getControlCount() {
return 1;
}
};
IResource[] dedupedResourcesToRevert = ResourceSelectionTree.dedupeResources(resourcesToRevert);
if (dedupedResourcesToRevert.length != resourcesToRevert.length) {
resourceRemoved = true;
}
resourceSelectionTree = new ResourceSelectionTree(composite, SWT.NONE, Policy.bind("GenerateSVNDiff.Changes"), dedupedResourcesToRevert, statusMap, null, true, toolbarControlCreator, // $NON-NLS-1$
null);
if (!resourceSelectionTree.showIncludeUnversionedButton())
includeUnversionedButton.setVisible(false);
// resourceSelectionTree.getTreeViewer().setAllChecked(true);
resourceSelectionTree.getTreeViewer().addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
selectedResources = resourceSelectionTree.getSelectedResources();
}
});
((CheckboxTreeViewer) resourceSelectionTree.getTreeViewer()).addCheckStateListener(new ICheckStateListener() {
public void checkStateChanged(CheckStateChangedEvent event) {
selectedResources = resourceSelectionTree.getSelectedResources();
}
});
resourceSelectionTree.getTreeViewer().addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent event) {
IStructuredSelection sel = (IStructuredSelection) event.getSelection();
Object sel0 = sel.getFirstElement();
if (sel0 instanceof IFile) {
final ISVNLocalResource localResource = SVNWorkspaceRoot.getSVNResourceFor((IFile) sel0);
try {
new CompareDialog(getShell(), new SVNLocalCompareInput(localResource, SVNRevision.BASE, true)).open();
} catch (Exception e1) {
}
}
}
});
if (!includeUnversioned) {
resourceSelectionTree.removeUnversioned();
}
resourceSelectionTree.getTreeViewer().getTree().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
// Composite composite_1 = new Composite(composite, SWT.NONE);
// composite_1.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
// composite_1.setLayout(new GridLayout());
selectedResources = resourceSelectionTree.getSelectedResources();
setPageComplete(canFinish());
PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IHelpContextIds.REVERT_DIALOG);
}
Aggregations