Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre Weinand2002-04-09 11:29:48 -0400
committerAndre Weinand2002-04-09 11:29:48 -0400
commit5d27344efd026117df8190ce0e85749d69065fea (patch)
treea83fd949aa169b9dab4a8fdb037eaeccbaa7d463
parentbaa7e11eccdcb618068eea6a23e459ce6e66aaa5 (diff)
downloadeclipse.platform.team-5d27344efd026117df8190ce0e85749d69065fea.tar.gz
eclipse.platform.team-5d27344efd026117df8190ce0e85749d69065fea.tar.xz
eclipse.platform.team-5d27344efd026117df8190ce0e85749d69065fea.zip
http://bugs.eclipse.org/bugs/show_bug.cgi?id=10434v20020409
-rw-r--r--bundles/org.eclipse.compare/buildnotes_compare.html9
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/InputPatchPage.java6
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchMessages.properties3
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PreviewPatchPage.java82
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/buildnotes_compare.html9
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/InputPatchPage.java6
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchMessages.properties3
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PreviewPatchPage.java82
8 files changed, 158 insertions, 42 deletions
diff --git a/bundles/org.eclipse.compare/buildnotes_compare.html b/bundles/org.eclipse.compare/buildnotes_compare.html
index 8bc22bb90..27538b092 100644
--- a/bundles/org.eclipse.compare/buildnotes_compare.html
+++ b/bundles/org.eclipse.compare/buildnotes_compare.html
@@ -11,10 +11,13 @@
<h1>
Eclipse Platform Build Notes<br>
Compare</h1>
-Eclipse Build Input April 2nd 2002
+Eclipse Build Input April 9th 2002
<h2>
What's new in this drop</h2>
+New context menu action 'Add From Local History'. Just select any resource container and
+'Add From Local History' presents all files that were deleted from the workspace but are
+still in the local history.
<h3>
API changes</h3>
@@ -27,6 +30,9 @@ Other highlights</h3>
<h2>
Known deficiencies</h2>
+The new 'Add From Local History' suffers from #12915. It works if the files were deleted
+within the same session. However if you shut down and restart a workspace some deleted
+files are nor listed.
<h2>
Problem reports fixed</h2>
@@ -39,6 +45,7 @@ Problem reports fixed</h2>
<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=8615">#8615</a>: Styled Text widget does not respond to system color change<br>
<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=9673">#9673</a>: editor background color - no effect on other viewers<br>
<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=11642">#11642</a>: Compare editors not using default background colors<br>
+<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=10434">#10434</a>: Compare browser fails silently and does not give result<br>
<h2>
Problem reports closed</h2>
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/InputPatchPage.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/InputPatchPage.java
index fc42b3797..aa67f74bf 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/InputPatchPage.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/InputPatchPage.java
@@ -148,9 +148,11 @@ import org.eclipse.compare.internal.Utilities;
Diff[] diffs= patcher.getDiffs();
if (diffs == null || diffs.length == 0) {
+ String source= getUseClipboard() ? "Clipboard" //$NON-NLS-1$
+ : "File"; //$NON-NLS-1$
MessageDialog.openError(null,
PatchMessages.getString("InputPatchPage.PatchErrorDialog.title"), //$NON-NLS-1$
- PatchMessages.getString("InputPatchPage.NoDiffsFound.message")); //$NON-NLS-1$
+ PatchMessages.getString("InputPatchPage.NoDiffsFound_"+source+".message")); //$NON-NLS-1$ //$NON-NLS-2$
return this;
}
@@ -162,6 +164,7 @@ import org.eclipse.compare.internal.Utilities;
}
private int guessPrefix(Diff[] diffs) {
+ /*
ArrayList list= new ArrayList();
IResource target= fPatchWizard.getTarget();
if (target instanceof IFile) {
@@ -180,6 +183,7 @@ import org.eclipse.compare.internal.Utilities;
}
}
}
+ */
return 0;
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchMessages.properties b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchMessages.properties
index e63f1642d..74146c7e2 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchMessages.properties
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchMessages.properties
@@ -40,7 +40,8 @@ InputPatchPage.NoFileName.message=No file name
InputPatchPage.SelectPatchFileDialog.title=Select Patch File
InputPatchPage.PatchFileNotFound.message=Patch file not found.
InputPatchPage.ParseError.message=Error while parsing patch
-InputPatchPage.NoDiffsFound.message=No diffs found in
+InputPatchPage.NoDiffsFound_Clipboard.message=Clipboard does not contain valid patch
+InputPatchPage.NoDiffsFound_File.message=File does not contain valid patch
#
# PreviewPatchPage
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PreviewPatchPage.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PreviewPatchPage.java
index 0b18ba2c1..3f23c8b98 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PreviewPatchPage.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PreviewPatchPage.java
@@ -190,15 +190,14 @@ import org.eclipse.compare.structuremergeviewer.*;
Object data= e.item.getData();
if (e.detail == SWT.CHECK) {
boolean checked= ti.getChecked();
+ String s= ti.getText();
if (data instanceof Hunk) {
Hunk hunk= (Hunk) data;
checked= checked && hunk.fMatches;
- hunk.setEnabled(checked);
+ //hunk.setEnabled(checked);
ti.setChecked(checked);
updateGrayedState(ti);
} else if (data instanceof Diff) {
- Diff diff= (Diff) data;
- diff.setEnabled(checked && diff.fMatches);
updateCheckedState(ti);
}
} else {
@@ -438,9 +437,7 @@ import org.eclipse.compare.structuremergeviewer.*;
error= PatchMessages.getString("PreviewPatchPage.FileDoesNotExist.error"); //$NON-NLS-1$
}
}
-
- boolean checked= false;
-
+
ArrayList failedHunks= new ArrayList();
fPatchWizard.getPatcher().apply(diff, file, create, failedHunks);
@@ -455,12 +452,12 @@ import org.eclipse.compare.structuremergeviewer.*;
String hunkError= null;
if (failed)
hunkError= PatchMessages.getString("PreviewPatchPage.NoMatch.error"); //$NON-NLS-1$
- hunk.setEnabled(diff.isEnabled() && !failed);
- hunkItems[h].setChecked(hunk.isEnabled());
- if (hunk.isEnabled()) {
+
+ boolean check= !failed;
+ hunkItems[h].setChecked(check);
+ if (check)
checkedSubs++;
- checked= true;
- }
+
String hunkLabel= hunk.getDescription();
if (hunkError != null)
hunkLabel+= " " + hunkError; //$NON-NLS-1$
@@ -473,22 +470,37 @@ import org.eclipse.compare.structuremergeviewer.*;
label+= " " + error; //$NON-NLS-1$
item.setText(label);
item.setImage(getImage(diff));
- item.setChecked(checked);
+ item.setChecked(checkedSubs > 0);
boolean gray= (checkedSubs > 0 && checkedSubs < hunkItems.length);
item.setGrayed(gray);
item.setExpanded(gray);
}
+ setPageComplete(updateModel());
}
/**
* Updates the gray state of the given diff and the checked state of its children.
*/
- private void updateCheckedState(TreeItem diff) {
- boolean checked= diff.getChecked();
- diff.setGrayed(false);
- TreeItem[] hunks= diff.getItems();
- for (int i= 0; i < hunks.length; i++)
- hunks[i].setChecked(checked);
+ private void updateCheckedState(TreeItem diffItem) {
+ boolean checked= diffItem.getChecked();
+ // check whether we can enable all hunks
+ TreeItem[] hunks= diffItem.getItems();
+ int checkedCount= 0;
+ for (int i= 0; i < hunks.length; i++) {
+ Hunk hunk= (Hunk) hunks[i].getData();
+ if (checked) {
+ if (hunk.fMatches) {
+ hunks[i].setChecked(true);
+ checkedCount++;
+ }
+ } else {
+ hunks[i].setChecked(false);
+ }
+ }
+ diffItem.setGrayed(checkedCount > 0 && checkedCount < hunks.length);
+ diffItem.setChecked(checkedCount > 0);
+
+ setPageComplete(updateModel());
}
/**
@@ -503,6 +515,8 @@ import org.eclipse.compare.structuremergeviewer.*;
checked++;
diff.setChecked(checked > 0);
diff.setGrayed(checked > 0 && checked < hunks.length);
+
+ setPageComplete(updateModel());
}
private void addSpacer(Composite parent) {
@@ -535,4 +549,36 @@ import org.eclipse.compare.structuremergeviewer.*;
}
return fuzzFactor;
}
+
+ public boolean updateModel() {
+ boolean atLeastOneIsEnabled= false;
+ if (fTree != null && !fTree.isDisposed()) {
+ TreeItem [] diffItems= fTree.getItems();
+ for (int i= 0; i < diffItems.length; i++) {
+ TreeItem diffItem= diffItems[i];
+ Object data= diffItem.getData();
+ if (data instanceof Diff) {
+ Diff diff= (Diff) data;
+ boolean b= diffItem.getChecked();
+ diff.setEnabled(b);
+ if (b) {
+ TreeItem [] hunkItems= diffItem.getItems();
+ for (int j= 0; j < hunkItems.length; j++) {
+ TreeItem hunkItem= hunkItems[j];
+ data= hunkItem.getData();
+ if (data instanceof Hunk) {
+ Hunk hunk= (Hunk) data;
+ b= hunkItem.getChecked();
+ hunk.setEnabled(b);
+ if (b) {
+ atLeastOneIsEnabled= true;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ return atLeastOneIsEnabled;
+ }
}
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/buildnotes_compare.html b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/buildnotes_compare.html
index 8bc22bb90..27538b092 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/buildnotes_compare.html
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/buildnotes_compare.html
@@ -11,10 +11,13 @@
<h1>
Eclipse Platform Build Notes<br>
Compare</h1>
-Eclipse Build Input April 2nd 2002
+Eclipse Build Input April 9th 2002
<h2>
What's new in this drop</h2>
+New context menu action 'Add From Local History'. Just select any resource container and
+'Add From Local History' presents all files that were deleted from the workspace but are
+still in the local history.
<h3>
API changes</h3>
@@ -27,6 +30,9 @@ Other highlights</h3>
<h2>
Known deficiencies</h2>
+The new 'Add From Local History' suffers from #12915. It works if the files were deleted
+within the same session. However if you shut down and restart a workspace some deleted
+files are nor listed.
<h2>
Problem reports fixed</h2>
@@ -39,6 +45,7 @@ Problem reports fixed</h2>
<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=8615">#8615</a>: Styled Text widget does not respond to system color change<br>
<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=9673">#9673</a>: editor background color - no effect on other viewers<br>
<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=11642">#11642</a>: Compare editors not using default background colors<br>
+<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=10434">#10434</a>: Compare browser fails silently and does not give result<br>
<h2>
Problem reports closed</h2>
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/InputPatchPage.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/InputPatchPage.java
index fc42b3797..aa67f74bf 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/InputPatchPage.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/InputPatchPage.java
@@ -148,9 +148,11 @@ import org.eclipse.compare.internal.Utilities;
Diff[] diffs= patcher.getDiffs();
if (diffs == null || diffs.length == 0) {
+ String source= getUseClipboard() ? "Clipboard" //$NON-NLS-1$
+ : "File"; //$NON-NLS-1$
MessageDialog.openError(null,
PatchMessages.getString("InputPatchPage.PatchErrorDialog.title"), //$NON-NLS-1$
- PatchMessages.getString("InputPatchPage.NoDiffsFound.message")); //$NON-NLS-1$
+ PatchMessages.getString("InputPatchPage.NoDiffsFound_"+source+".message")); //$NON-NLS-1$ //$NON-NLS-2$
return this;
}
@@ -162,6 +164,7 @@ import org.eclipse.compare.internal.Utilities;
}
private int guessPrefix(Diff[] diffs) {
+ /*
ArrayList list= new ArrayList();
IResource target= fPatchWizard.getTarget();
if (target instanceof IFile) {
@@ -180,6 +183,7 @@ import org.eclipse.compare.internal.Utilities;
}
}
}
+ */
return 0;
}
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchMessages.properties b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchMessages.properties
index e63f1642d..74146c7e2 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchMessages.properties
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchMessages.properties
@@ -40,7 +40,8 @@ InputPatchPage.NoFileName.message=No file name
InputPatchPage.SelectPatchFileDialog.title=Select Patch File
InputPatchPage.PatchFileNotFound.message=Patch file not found.
InputPatchPage.ParseError.message=Error while parsing patch
-InputPatchPage.NoDiffsFound.message=No diffs found in
+InputPatchPage.NoDiffsFound_Clipboard.message=Clipboard does not contain valid patch
+InputPatchPage.NoDiffsFound_File.message=File does not contain valid patch
#
# PreviewPatchPage
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PreviewPatchPage.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PreviewPatchPage.java
index 0b18ba2c1..3f23c8b98 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PreviewPatchPage.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PreviewPatchPage.java
@@ -190,15 +190,14 @@ import org.eclipse.compare.structuremergeviewer.*;
Object data= e.item.getData();
if (e.detail == SWT.CHECK) {
boolean checked= ti.getChecked();
+ String s= ti.getText();
if (data instanceof Hunk) {
Hunk hunk= (Hunk) data;
checked= checked && hunk.fMatches;
- hunk.setEnabled(checked);
+ //hunk.setEnabled(checked);
ti.setChecked(checked);
updateGrayedState(ti);
} else if (data instanceof Diff) {
- Diff diff= (Diff) data;
- diff.setEnabled(checked && diff.fMatches);
updateCheckedState(ti);
}
} else {
@@ -438,9 +437,7 @@ import org.eclipse.compare.structuremergeviewer.*;
error= PatchMessages.getString("PreviewPatchPage.FileDoesNotExist.error"); //$NON-NLS-1$
}
}
-
- boolean checked= false;
-
+
ArrayList failedHunks= new ArrayList();
fPatchWizard.getPatcher().apply(diff, file, create, failedHunks);
@@ -455,12 +452,12 @@ import org.eclipse.compare.structuremergeviewer.*;
String hunkError= null;
if (failed)
hunkError= PatchMessages.getString("PreviewPatchPage.NoMatch.error"); //$NON-NLS-1$
- hunk.setEnabled(diff.isEnabled() && !failed);
- hunkItems[h].setChecked(hunk.isEnabled());
- if (hunk.isEnabled()) {
+
+ boolean check= !failed;
+ hunkItems[h].setChecked(check);
+ if (check)
checkedSubs++;
- checked= true;
- }
+
String hunkLabel= hunk.getDescription();
if (hunkError != null)
hunkLabel+= " " + hunkError; //$NON-NLS-1$
@@ -473,22 +470,37 @@ import org.eclipse.compare.structuremergeviewer.*;
label+= " " + error; //$NON-NLS-1$
item.setText(label);
item.setImage(getImage(diff));
- item.setChecked(checked);
+ item.setChecked(checkedSubs > 0);
boolean gray= (checkedSubs > 0 && checkedSubs < hunkItems.length);
item.setGrayed(gray);
item.setExpanded(gray);
}
+ setPageComplete(updateModel());
}
/**
* Updates the gray state of the given diff and the checked state of its children.
*/
- private void updateCheckedState(TreeItem diff) {
- boolean checked= diff.getChecked();
- diff.setGrayed(false);
- TreeItem[] hunks= diff.getItems();
- for (int i= 0; i < hunks.length; i++)
- hunks[i].setChecked(checked);
+ private void updateCheckedState(TreeItem diffItem) {
+ boolean checked= diffItem.getChecked();
+ // check whether we can enable all hunks
+ TreeItem[] hunks= diffItem.getItems();
+ int checkedCount= 0;
+ for (int i= 0; i < hunks.length; i++) {
+ Hunk hunk= (Hunk) hunks[i].getData();
+ if (checked) {
+ if (hunk.fMatches) {
+ hunks[i].setChecked(true);
+ checkedCount++;
+ }
+ } else {
+ hunks[i].setChecked(false);
+ }
+ }
+ diffItem.setGrayed(checkedCount > 0 && checkedCount < hunks.length);
+ diffItem.setChecked(checkedCount > 0);
+
+ setPageComplete(updateModel());
}
/**
@@ -503,6 +515,8 @@ import org.eclipse.compare.structuremergeviewer.*;
checked++;
diff.setChecked(checked > 0);
diff.setGrayed(checked > 0 && checked < hunks.length);
+
+ setPageComplete(updateModel());
}
private void addSpacer(Composite parent) {
@@ -535,4 +549,36 @@ import org.eclipse.compare.structuremergeviewer.*;
}
return fuzzFactor;
}
+
+ public boolean updateModel() {
+ boolean atLeastOneIsEnabled= false;
+ if (fTree != null && !fTree.isDisposed()) {
+ TreeItem [] diffItems= fTree.getItems();
+ for (int i= 0; i < diffItems.length; i++) {
+ TreeItem diffItem= diffItems[i];
+ Object data= diffItem.getData();
+ if (data instanceof Diff) {
+ Diff diff= (Diff) data;
+ boolean b= diffItem.getChecked();
+ diff.setEnabled(b);
+ if (b) {
+ TreeItem [] hunkItems= diffItem.getItems();
+ for (int j= 0; j < hunkItems.length; j++) {
+ TreeItem hunkItem= hunkItems[j];
+ data= hunkItem.getData();
+ if (data instanceof Hunk) {
+ Hunk hunk= (Hunk) data;
+ b= hunkItem.getChecked();
+ hunk.setEnabled(b);
+ if (b) {
+ atLeastOneIsEnabled= true;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ return atLeastOneIsEnabled;
+ }
}

Back to the top