Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2004-03-02 21:34:56 +0000
committerJean Michel-Lemieux2004-03-02 21:34:56 +0000
commit022f93e30e6a9d22a31b415d1884788cb3adc501 (patch)
tree645200b7830b960cd5b3cd308949b57be4205235
parent5a8cbc6a4f8db97629901af598e2a46889a97a44 (diff)
downloadeclipse.platform.team-022f93e30e6a9d22a31b415d1884788cb3adc501.tar.gz
eclipse.platform.team-022f93e30e6a9d22a31b415d1884788cb3adc501.tar.xz
eclipse.platform.team-022f93e30e6a9d22a31b415d1884788cb3adc501.zip
*** empty log message ***
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSCompareRevisionsInput.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/CompareDialog.java71
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/StructuredViewerAdvisor.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SynchronizeCompareInput.java7
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/html/00041.html5
5 files changed, 52 insertions, 37 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSCompareRevisionsInput.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSCompareRevisionsInput.java
index d53859d04..824fc99ba 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSCompareRevisionsInput.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSCompareRevisionsInput.java
@@ -16,6 +16,7 @@ import java.io.InputStream;
import java.lang.reflect.InvocationTargetException;
import org.eclipse.compare.*;
+import org.eclipse.compare.internal.CompareEditor;
import org.eclipse.compare.structuremergeviewer.*;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
@@ -171,6 +172,9 @@ public class CVSCompareRevisionsInput extends CompareEditorInput {
viewer.setContentProvider(new VersionCompareContentProvider());
+ // buffered merge mode, don't ask for save when switching nodes
+ getCompareConfiguration().setProperty(CompareEditor.CONFIRM_SAVE_PROPERTY, new Boolean(false));
+
MenuManager mm = new MenuManager();
mm.setRemoveAllWhenShown(true);
mm.addMenuListener(
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/CompareDialog.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/CompareDialog.java
index 2b598ecd4..6ff28f8c5 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/CompareDialog.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/CompareDialog.java
@@ -18,9 +18,11 @@ import org.eclipse.core.runtime.*;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.util.Assert;
+import org.eclipse.jface.util.*;
+import org.eclipse.swt.custom.BusyIndicator;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.*;
+import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.team.internal.ui.Utils;
import org.eclipse.team.ui.TeamUI;
import org.eclipse.team.ui.synchronize.*;
@@ -28,30 +30,38 @@ import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.WorkspaceModifyOperation;
-public class CompareDialog extends ResizableDialog {
+public class CompareDialog extends ResizableDialog implements IPropertyChangeListener {
private CompareEditorInput fCompareEditorInput;
private ISynchronizeParticipant participant;
+ private Button saveButton;
public CompareDialog(Shell shell, CompareEditorInput input) {
super(shell, null);
Assert.isNotNull(input);
fCompareEditorInput= input;
+ fCompareEditorInput.addPropertyChangeListener(this);
}
public void setSynchronizeParticipant(ISynchronizeParticipant participant) {
this.participant = participant;
}
+ public void propertyChange(PropertyChangeEvent event) {
+ if (saveButton != null && fCompareEditorInput != null)
+ saveButton.setEnabled(fCompareEditorInput.isSaveNeeded());
+ }
+
/* (non-Javadoc)
* Method declared on Dialog.
*/
protected void createButtonsForButtonBar(Composite parent) {
if(participant != null) {
- Button b = createButton(parent, IDialogConstants.OPEN_ID, "Remember", false);
+ Button b = createButton(parent, IDialogConstants.OPEN_ID, "Add to Synchronize View", false);
b.setToolTipText("Remembering this comparison will add it to the Synchronize View.");
}
- createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
+ saveButton = createButton(parent, IDialogConstants.OK_ID, "Save", true);
+ saveButton.setEnabled(false);
createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
}
@@ -84,39 +94,34 @@ public class CompareDialog extends ResizableDialog {
view.display(participant);
okPressed();
return;
- }
- super.buttonPressed(buttonId);
- }
-
- /* (non-Javadoc)
- * Method declared on Window.
- */
- public int open() {
-
- int rc= super.open();
-
- if (rc == IDialogConstants.OK_ID && fCompareEditorInput.isSaveNeeded()) {
-
+ } else if (buttonId == IDialogConstants.OK_ID && fCompareEditorInput.isSaveNeeded()) {
final WorkspaceModifyOperation operation= new WorkspaceModifyOperation() {
public void execute(IProgressMonitor pm) throws CoreException {
fCompareEditorInput.saveChanges(pm);
}
- };
-
- try {
- PlatformUI.getWorkbench().getProgressService().busyCursorWhile(new IRunnableWithProgress() {
- public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- operation.run(monitor);
+ };
+ TeamUIPlugin.getStandardDisplay().asyncExec(new Runnable() {
+ public void run() {
+ BusyIndicator.showWhile(null, new Runnable() {
+ public void run() {
+ try {
+ PlatformUI.getWorkbench().getProgressService().busyCursorWhile(new IRunnableWithProgress() {
+ public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
+ operation.run(monitor);
+ }
+ });
+ } catch (InterruptedException x) {
+ // NeedWork
+ } catch (OperationCanceledException x) {
+ // NeedWork
+ } catch (InvocationTargetException x) {
+ Utils.handle(x);
+ }
+ }
+ });
}
- });
- } catch (InterruptedException x) {
- // NeedWork
- } catch (OperationCanceledException x) {
- // NeedWork
- } catch (InvocationTargetException x) {
- Utils.handle(x);
- }
- }
- return rc;
+ });
+ }
+ super.buttonPressed(buttonId);
}
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/StructuredViewerAdvisor.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/StructuredViewerAdvisor.java
index e9b87355c..e6b7e228d 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/StructuredViewerAdvisor.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/StructuredViewerAdvisor.java
@@ -119,6 +119,8 @@ public abstract class StructuredViewerAdvisor {
modelProvider.prepareInput(null);
}
setInput(viewer);
+
+ navigate(true);
}
/**
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SynchronizeCompareInput.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SynchronizeCompareInput.java
index da8e99e4e..aaaad3c26 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SynchronizeCompareInput.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SynchronizeCompareInput.java
@@ -16,6 +16,7 @@ import org.eclipse.compare.*;
import org.eclipse.compare.internal.CompareEditor;
import org.eclipse.compare.internal.INavigatable;
import org.eclipse.compare.structuremergeviewer.DiffNode;
+import org.eclipse.compare.structuremergeviewer.IDiffElement;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.*;
import org.eclipse.jface.action.Separator;
@@ -207,7 +208,7 @@ public class SynchronizeCompareInput extends CompareEditorInput implements ICont
*/
public void saveChanges(IProgressMonitor pm) throws CoreException {
super.saveChanges(pm);
- SynchronizeModelElement root = diffViewerConfiguration.getModelProvider().getModelRoot();
+ SynchronizeModelElement root = (SynchronizeModelElement)diffViewerConfiguration.getViewer().getInput();
if (root != null) {
try {
commit(pm, root);
@@ -227,9 +228,9 @@ public class SynchronizeCompareInput extends CompareEditorInput implements ICont
((LocalResourceTypedElement) right).commit(pm);
//node.getC
- DiffNode[] children = (DiffNode[])node.getChildren();
+ IDiffElement[] children = (IDiffElement[])node.getChildren();
for (int i = 0; i < children.length; i++) {
- commit(pm, children[i]);
+ commit(pm, (DiffNode)children[i]);
}
}
diff --git a/tests/org.eclipse.team.tests.cvs.core/html/00041.html b/tests/org.eclipse.team.tests.cvs.core/html/00041.html
index cf04c052e..ecc435892 100644
--- a/tests/org.eclipse.team.tests.cvs.core/html/00041.html
+++ b/tests/org.eclipse.team.tests.cvs.core/html/00041.html
@@ -4,7 +4,7 @@
<meta NAME="since" content="">
</head><h2>File Revisions</h2>
<p>Since: M8<br>
-Last Modified: $Date: 2004/03/02 05:23:42 $</p><body>
+Last Modified: $Date: 2004/03/02 16:33:14 $</p><body>
Comparing
-> Team > Synchronize with Repository... (file, folder)
@@ -38,5 +38,8 @@ Features:
- ensure save behavior
- can you see the history for each file?
- what actions are enabled for dialog versus sync view mode?
+- view title bar Compare (45 changes, blah blah)
+- dialog/viewer icon
+- ability to change layout in the dialog
</body></html> \ No newline at end of file

Back to the top