Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre Weinand2003-02-04 16:14:41 +0000
committerAndre Weinand2003-02-04 16:14:41 +0000
commit619ddb12d65256bb5f0f19d32def57f2d1f16e96 (patch)
tree88df8dcc1a1bda1fba2ac63ba887e2dc71a93b76
parent142e5004566bf0928e4ca41452313f2224eb6fd6 (diff)
downloadeclipse.platform.team-619ddb12d65256bb5f0f19d32def57f2d1f16e96.tar.gz
eclipse.platform.team-619ddb12d65256bb5f0f19d32def57f2d1f16e96.tar.xz
eclipse.platform.team-619ddb12d65256bb5f0f19d32def57f2d1f16e96.zip
more support for #19114
-rw-r--r--bundles/org.eclipse.compare/buildnotes_compare.html1
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/EditionSelectionDialog.java75
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java22
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/buildnotes_compare.html1
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/EditionSelectionDialog.java75
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java22
6 files changed, 104 insertions, 92 deletions
diff --git a/bundles/org.eclipse.compare/buildnotes_compare.html b/bundles/org.eclipse.compare/buildnotes_compare.html
index f07c38e18..f66c63574 100644
--- a/bundles/org.eclipse.compare/buildnotes_compare.html
+++ b/bundles/org.eclipse.compare/buildnotes_compare.html
@@ -17,6 +17,7 @@ Eclipse Build Input February 6th 2003
Problem reports fixed</h2>
<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=30525">#30525</a>: "Team" menu item missing accelerator<br>
<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=28202">#28202</a>: contentmergeviewers do not work with mixed-case extensions<br>
+<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=19114">#19114</a>: Restore Java Element from Local History should also provide check boxes [compare]<br>
<h1>
<hr WIDTH="100%"></h1>
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/EditionSelectionDialog.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/EditionSelectionDialog.java
index e09e554b9..8fa8ba34d 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/EditionSelectionDialog.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/EditionSelectionDialog.java
@@ -700,7 +700,34 @@ public class EditionSelectionDialog extends ResizableDialog {
fMemberPane= new CompareViewerPane(hsplitter, SWT.BORDER | SWT.FLAT);
fMemberPane.setText(Utilities.getString(fBundle, "memberPaneTitle")); //$NON-NLS-1$
- //createTable();
+ int flags= SWT.H_SCROLL + SWT.V_SCROLL;
+ if (fMultiSelect)
+ flags|= SWT.CHECK;
+ fMemberTable= new Table(fMemberPane, flags);
+ fMemberTable.addSelectionListener(
+ new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ if (e.detail == SWT.CHECK) {
+ if (e.item instanceof TableItem) {
+ TableItem ti= (TableItem) e.item;
+ Object data= ti.getData();
+ if (ti.getChecked())
+ fArrayList.add(data);
+ else
+ fArrayList.remove(data);
+
+ if (fCommitButton != null)
+ fCommitButton.setEnabled(fArrayList.size() > 0);
+
+ fMemberTable.setSelection(new TableItem[] { ti });
+ }
+ }
+ handleMemberSelect(e.item);
+ }
+ }
+ );
+ fMemberPane.setContent(fMemberTable);
+ fMemberTable.setFocus();
fEditionPane= new CompareViewerPane(hsplitter, SWT.BORDER | SWT.FLAT);
} else {
@@ -763,40 +790,7 @@ public class EditionSelectionDialog extends ResizableDialog {
vsplitter.setWeights(new int[] { 30, 70 });
return vsplitter;
- }
-
- private void createTable(boolean error) {
- if (fMemberPane == null)
- return;
- if (fMemberTable == null) {
- int flags= SWT.H_SCROLL + SWT.V_SCROLL;
- if (fMultiSelect && !error)
- flags|= SWT.CHECK;
- fMemberTable= new Table(fMemberPane, flags);
- fMemberTable.addSelectionListener(
- new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- if (e.detail == SWT.CHECK) {
- if (e.item instanceof TableItem) {
- TableItem ti= (TableItem) e.item;
- if (ti.getChecked())
- fArrayList.add(ti.getData());
- else
- fArrayList.remove(ti.getData());
-
- if (fCommitButton != null)
- fCommitButton.setEnabled(fArrayList.size() > 0);
- }
- }
- handleMemberSelect(e.item);
- }
- }
- );
- fMemberPane.setContent(fMemberTable);
- fMemberTable.setFocus();
- fMemberPane.layout();
- }
- }
+ }
/* (non-Javadoc)
* Method declared on Dialog.
@@ -882,9 +876,13 @@ public class EditionSelectionDialog extends ResizableDialog {
private void addMemberEdition(Pair pair) {
if (pair == null) { // end of list of pairs
- createTable(true);
- if (fMemberTable != null) {
+ if (fMemberTable != null) {
if (!fMemberTable.isDisposed() && fMemberTable.getItemCount() == 0) {
+ if (fMultiSelect) {
+ fMemberTable.dispose();
+ fMemberTable= new Table(fMemberPane, SWT.NONE);
+ fMemberPane.setContent(fMemberTable);
+ }
TableItem ti= new TableItem(fMemberTable, SWT.NONE);
ti.setText(Utilities.getString(fBundle, "noAdditionalMembersMessage")); //$NON-NLS-1$
}
@@ -907,7 +905,6 @@ public class EditionSelectionDialog extends ResizableDialog {
if (editions == null) {
editions= new ArrayList();
fMemberEditions.put(item, editions);
- createTable(false);
if (fMemberTable != null && !fMemberTable.isDisposed()) {
ITypedElement te= (ITypedElement)item;
String name= te.getName();
@@ -942,7 +939,7 @@ public class EditionSelectionDialog extends ResizableDialog {
if (!fAddMode || editions == fCurrentEditions)
addEdition(pair);
}
-
+
/**
* Returns the number of s since Jan 1st, 1970.
* The given date is converted to GMT and daylight saving is taken into account too.
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
index dfb3b51d1..f3dc4ae31 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
@@ -252,7 +252,7 @@ public class TextMergeViewer extends ContentMergeViewer {
private Canvas fScrollCanvas;
private ScrollBar fVScrollBar;
private Canvas fBirdsEyeCanvas;
- private Label fSummaryLabel;
+ private Canvas fSummaryCanvas;
// SWT resources to be disposed
private Map fColors;
@@ -827,7 +827,7 @@ public class TextMergeViewer extends ContentMergeViewer {
fRightCanvas= null;
fVScrollBar= null;
fBirdsEyeCanvas= null;
- fSummaryLabel= null;
+ fSummaryCanvas= null;
unsetDocument(fAncestor);
unsetDocument(fLeft);
@@ -884,7 +884,15 @@ public class TextMergeViewer extends ContentMergeViewer {
fAncestor= createPart(composite);
fAncestor.setEditable(false);
- fSummaryLabel= new Label(composite, SWT.NONE);
+ fSummaryCanvas= new Canvas(composite, SWT.NONE);
+ fSummaryCanvas.addPaintListener(
+ new PaintListener() {
+ public void paintControl(PaintEvent e) {
+ // TODO Auto-generated method stub
+
+ }
+ }
+ );
updateResolveStatus();
// 2nd row
@@ -1963,8 +1971,8 @@ public class TextMergeViewer extends ContentMergeViewer {
}
if (fBirdsEyeCanvas != null) {
- if (fSummaryLabel != null)
- fSummaryLabel.setBounds(x+scrollbarWidth, y, BIRDS_EYE_VIEW_WIDTH, BIRDS_EYE_VIEW_WIDTH);
+ if (fSummaryCanvas != null)
+ fSummaryCanvas.setBounds(x+scrollbarWidth, y, BIRDS_EYE_VIEW_WIDTH, BIRDS_EYE_VIEW_WIDTH);
y+= scrollbarHeight;
fBirdsEyeCanvas.setBounds(x+scrollbarWidth, y, BIRDS_EYE_VIEW_WIDTH, height-(3*scrollbarHeight));
}
@@ -2556,14 +2564,14 @@ public class TextMergeViewer extends ContentMergeViewer {
}
}
if (hasIncoming) {
- Display d= fSummaryLabel.getDisplay();
+ Display d= fSummaryCanvas.getDisplay();
if (unresolved)
c= d.getSystemColor(SWT.COLOR_RED);
else
c= d.getSystemColor(SWT.COLOR_GREEN);
}
}
- fSummaryLabel.setBackground(c);
+ fSummaryCanvas.setBackground(c);
}
private void updateStatus(Diff diff) {
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 f07c38e18..f66c63574 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
@@ -17,6 +17,7 @@ Eclipse Build Input February 6th 2003
Problem reports fixed</h2>
<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=30525">#30525</a>: "Team" menu item missing accelerator<br>
<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=28202">#28202</a>: contentmergeviewers do not work with mixed-case extensions<br>
+<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=19114">#19114</a>: Restore Java Element from Local History should also provide check boxes [compare]<br>
<h1>
<hr WIDTH="100%"></h1>
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/EditionSelectionDialog.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/EditionSelectionDialog.java
index e09e554b9..8fa8ba34d 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/EditionSelectionDialog.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/EditionSelectionDialog.java
@@ -700,7 +700,34 @@ public class EditionSelectionDialog extends ResizableDialog {
fMemberPane= new CompareViewerPane(hsplitter, SWT.BORDER | SWT.FLAT);
fMemberPane.setText(Utilities.getString(fBundle, "memberPaneTitle")); //$NON-NLS-1$
- //createTable();
+ int flags= SWT.H_SCROLL + SWT.V_SCROLL;
+ if (fMultiSelect)
+ flags|= SWT.CHECK;
+ fMemberTable= new Table(fMemberPane, flags);
+ fMemberTable.addSelectionListener(
+ new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ if (e.detail == SWT.CHECK) {
+ if (e.item instanceof TableItem) {
+ TableItem ti= (TableItem) e.item;
+ Object data= ti.getData();
+ if (ti.getChecked())
+ fArrayList.add(data);
+ else
+ fArrayList.remove(data);
+
+ if (fCommitButton != null)
+ fCommitButton.setEnabled(fArrayList.size() > 0);
+
+ fMemberTable.setSelection(new TableItem[] { ti });
+ }
+ }
+ handleMemberSelect(e.item);
+ }
+ }
+ );
+ fMemberPane.setContent(fMemberTable);
+ fMemberTable.setFocus();
fEditionPane= new CompareViewerPane(hsplitter, SWT.BORDER | SWT.FLAT);
} else {
@@ -763,40 +790,7 @@ public class EditionSelectionDialog extends ResizableDialog {
vsplitter.setWeights(new int[] { 30, 70 });
return vsplitter;
- }
-
- private void createTable(boolean error) {
- if (fMemberPane == null)
- return;
- if (fMemberTable == null) {
- int flags= SWT.H_SCROLL + SWT.V_SCROLL;
- if (fMultiSelect && !error)
- flags|= SWT.CHECK;
- fMemberTable= new Table(fMemberPane, flags);
- fMemberTable.addSelectionListener(
- new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- if (e.detail == SWT.CHECK) {
- if (e.item instanceof TableItem) {
- TableItem ti= (TableItem) e.item;
- if (ti.getChecked())
- fArrayList.add(ti.getData());
- else
- fArrayList.remove(ti.getData());
-
- if (fCommitButton != null)
- fCommitButton.setEnabled(fArrayList.size() > 0);
- }
- }
- handleMemberSelect(e.item);
- }
- }
- );
- fMemberPane.setContent(fMemberTable);
- fMemberTable.setFocus();
- fMemberPane.layout();
- }
- }
+ }
/* (non-Javadoc)
* Method declared on Dialog.
@@ -882,9 +876,13 @@ public class EditionSelectionDialog extends ResizableDialog {
private void addMemberEdition(Pair pair) {
if (pair == null) { // end of list of pairs
- createTable(true);
- if (fMemberTable != null) {
+ if (fMemberTable != null) {
if (!fMemberTable.isDisposed() && fMemberTable.getItemCount() == 0) {
+ if (fMultiSelect) {
+ fMemberTable.dispose();
+ fMemberTable= new Table(fMemberPane, SWT.NONE);
+ fMemberPane.setContent(fMemberTable);
+ }
TableItem ti= new TableItem(fMemberTable, SWT.NONE);
ti.setText(Utilities.getString(fBundle, "noAdditionalMembersMessage")); //$NON-NLS-1$
}
@@ -907,7 +905,6 @@ public class EditionSelectionDialog extends ResizableDialog {
if (editions == null) {
editions= new ArrayList();
fMemberEditions.put(item, editions);
- createTable(false);
if (fMemberTable != null && !fMemberTable.isDisposed()) {
ITypedElement te= (ITypedElement)item;
String name= te.getName();
@@ -942,7 +939,7 @@ public class EditionSelectionDialog extends ResizableDialog {
if (!fAddMode || editions == fCurrentEditions)
addEdition(pair);
}
-
+
/**
* Returns the number of s since Jan 1st, 1970.
* The given date is converted to GMT and daylight saving is taken into account too.
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
index dfb3b51d1..f3dc4ae31 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
@@ -252,7 +252,7 @@ public class TextMergeViewer extends ContentMergeViewer {
private Canvas fScrollCanvas;
private ScrollBar fVScrollBar;
private Canvas fBirdsEyeCanvas;
- private Label fSummaryLabel;
+ private Canvas fSummaryCanvas;
// SWT resources to be disposed
private Map fColors;
@@ -827,7 +827,7 @@ public class TextMergeViewer extends ContentMergeViewer {
fRightCanvas= null;
fVScrollBar= null;
fBirdsEyeCanvas= null;
- fSummaryLabel= null;
+ fSummaryCanvas= null;
unsetDocument(fAncestor);
unsetDocument(fLeft);
@@ -884,7 +884,15 @@ public class TextMergeViewer extends ContentMergeViewer {
fAncestor= createPart(composite);
fAncestor.setEditable(false);
- fSummaryLabel= new Label(composite, SWT.NONE);
+ fSummaryCanvas= new Canvas(composite, SWT.NONE);
+ fSummaryCanvas.addPaintListener(
+ new PaintListener() {
+ public void paintControl(PaintEvent e) {
+ // TODO Auto-generated method stub
+
+ }
+ }
+ );
updateResolveStatus();
// 2nd row
@@ -1963,8 +1971,8 @@ public class TextMergeViewer extends ContentMergeViewer {
}
if (fBirdsEyeCanvas != null) {
- if (fSummaryLabel != null)
- fSummaryLabel.setBounds(x+scrollbarWidth, y, BIRDS_EYE_VIEW_WIDTH, BIRDS_EYE_VIEW_WIDTH);
+ if (fSummaryCanvas != null)
+ fSummaryCanvas.setBounds(x+scrollbarWidth, y, BIRDS_EYE_VIEW_WIDTH, BIRDS_EYE_VIEW_WIDTH);
y+= scrollbarHeight;
fBirdsEyeCanvas.setBounds(x+scrollbarWidth, y, BIRDS_EYE_VIEW_WIDTH, height-(3*scrollbarHeight));
}
@@ -2556,14 +2564,14 @@ public class TextMergeViewer extends ContentMergeViewer {
}
}
if (hasIncoming) {
- Display d= fSummaryLabel.getDisplay();
+ Display d= fSummaryCanvas.getDisplay();
if (unresolved)
c= d.getSystemColor(SWT.COLOR_RED);
else
c= d.getSystemColor(SWT.COLOR_GREEN);
}
}
- fSummaryLabel.setBackground(c);
+ fSummaryCanvas.setBackground(c);
}
private void updateStatus(Diff diff) {

Back to the top