Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjames2002-03-01 11:24:50 -0500
committerjames2002-03-01 11:24:50 -0500
commit77fb5de685dd3111af18e44076a45cb8b0a061bd (patch)
treeaa08efbafb68ddb58cb295c29f6f0a097d3ca9c1
parent1be5302dbc670e4f2c560ec8848d695b6528bfaa (diff)
downloadeclipse.platform.team-77fb5de685dd3111af18e44076a45cb8b0a061bd.tar.gz
eclipse.platform.team-77fb5de685dd3111af18e44076a45cb8b0a061bd.tar.xz
eclipse.platform.team-77fb5de685dd3111af18e44076a45cb8b0a061bd.zip
10534: Team ->Merge dialog bugs
10588: Merge wizard: NPE if no versions selected
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizardEndPage.java19
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizardStartPage.java24
2 files changed, 30 insertions, 13 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizardEndPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizardEndPage.java
index 35a1f88f2..cd00add5f 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizardEndPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizardEndPage.java
@@ -6,14 +6,13 @@ package org.eclipse.team.internal.ccvs.ui.merge;
*/
import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerSorter;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
@@ -24,12 +23,8 @@ import org.eclipse.team.ccvs.core.CVSTeamProvider;
import org.eclipse.team.ccvs.core.ICVSRemoteFolder;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.TeamPlugin;
-import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
-import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
import org.eclipse.team.internal.ccvs.ui.Policy;
-import org.eclipse.team.internal.ccvs.ui.model.BranchTag;
import org.eclipse.team.internal.ccvs.ui.wizards.CVSWizardPage;
-import org.eclipse.ui.model.IWorkbenchAdapter;
import org.eclipse.ui.model.WorkbenchContentProvider;
import org.eclipse.ui.model.WorkbenchLabelProvider;
@@ -68,6 +63,15 @@ public class MergeWizardEndPage extends CVSWizardPage {
tree = createTree(composite);
tree.setContentProvider(new WorkbenchContentProvider());
tree.setLabelProvider(new WorkbenchLabelProvider());
+ tree.setSorter(new ViewerSorter() {
+ public int compare(Viewer v, Object o1, Object o2) {
+ int result = super.compare(v, o1, o2);
+ if (o1 instanceof TagElement && o2 instanceof TagElement) {
+ return -result;
+ }
+ return result;
+ }
+ });
tree.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
Object selected = ((IStructuredSelection)tree.getSelection()).getFirstElement();
@@ -82,6 +86,7 @@ public class MergeWizardEndPage extends CVSWizardPage {
});
setControl(composite);
tree.setInput(new ProjectElement(remote));
+ setPageComplete(false);
}
protected TreeViewer createTree(Composite parent) {
Tree tree = new Tree(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER | SWT.SINGLE);
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizardStartPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizardStartPage.java
index 3bfe9f17d..1063f9ed2 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizardStartPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizardStartPage.java
@@ -6,7 +6,6 @@ package org.eclipse.team.internal.ccvs.ui.merge;
*/
import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.ColumnWeightData;
import org.eclipse.jface.viewers.DoubleClickEvent;
@@ -16,6 +15,8 @@ import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.TableLayout;
import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerSorter;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
@@ -25,14 +26,11 @@ import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.team.ccvs.core.CVSTag;
import org.eclipse.team.ccvs.core.CVSTeamProvider;
import org.eclipse.team.ccvs.core.ICVSRemoteFolder;
-import org.eclipse.team.ccvs.core.ICVSRemoteResource;
import org.eclipse.team.core.ITeamProvider;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.TeamPlugin;
-import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
import org.eclipse.team.internal.ccvs.ui.Policy;
-import org.eclipse.team.internal.ccvs.ui.model.RemoteModule;
-import org.eclipse.team.internal.ccvs.ui.wizards.*;
+import org.eclipse.team.internal.ccvs.ui.wizards.CVSWizardPage;
import org.eclipse.ui.model.WorkbenchContentProvider;
import org.eclipse.ui.model.WorkbenchLabelProvider;
@@ -41,6 +39,8 @@ public class MergeWizardStartPage extends CVSWizardPage {
CVSTag result;
IProject project;
+ private static final int TABLE_HEIGHT_HINT = 350;
+
/**
* MergeWizardStartPage constructor.
*
@@ -53,7 +53,9 @@ public class MergeWizardStartPage extends CVSWizardPage {
}
protected TableViewer createTable(Composite parent) {
Table table = new Table(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER | SWT.SINGLE | SWT.FULL_SELECTION);
- table.setLayoutData(new GridData(GridData.FILL_BOTH));
+ GridData data = new GridData(GridData.FILL_BOTH);
+ data.heightHint = TABLE_HEIGHT_HINT;
+ table.setLayoutData(data);
TableLayout layout = new TableLayout();
layout.addColumnData(new ColumnWeightData(100, true));
table.setLayout(layout);
@@ -80,6 +82,15 @@ public class MergeWizardStartPage extends CVSWizardPage {
table = createTable(composite);
table.setContentProvider(new WorkbenchContentProvider());
table.setLabelProvider(new WorkbenchLabelProvider());
+ table.setSorter(new ViewerSorter() {
+ public int compare(Viewer v, Object o1, Object o2) {
+ int result = super.compare(v, o1, o2);
+ if (o1 instanceof TagElement && o2 instanceof TagElement) {
+ return -result;
+ }
+ return result;
+ }
+ });
table.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
TagElement element = (TagElement)((IStructuredSelection)table.getSelection()).getFirstElement();
@@ -96,6 +107,7 @@ public class MergeWizardStartPage extends CVSWizardPage {
setControl(composite);
initialize();
+ setPageComplete(false);
}
private void initialize() {
ITeamProvider provider = TeamPlugin.getManager().getProvider(project);

Back to the top