Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CommitCommentArea.java24
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ListSelectionArea.java19
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/WorkingSetSelectionArea.java13
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/DialogArea.java27
4 files changed, 32 insertions, 51 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CommitCommentArea.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CommitCommentArea.java
index 9fb2e0fe5..d49b2de1e 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CommitCommentArea.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CommitCommentArea.java
@@ -11,26 +11,14 @@
package org.eclipse.team.internal.ccvs.ui;
import org.eclipse.core.resources.IProject;
+import org.eclipse.jface.dialogs.*;
import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.TraverseEvent;
-import org.eclipse.swt.events.TraverseListener;
+import org.eclipse.swt.events.*;
import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.*;
import org.eclipse.team.core.RepositoryProvider;
-import org.eclipse.team.internal.ccvs.core.CVSException;
-import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin;
-import org.eclipse.team.internal.ccvs.core.CVSTeamProvider;
+import org.eclipse.team.internal.ccvs.core.*;
import org.eclipse.team.internal.ui.dialogs.DialogArea;
/**
@@ -62,7 +50,7 @@ public class CommitCommentArea extends DialogArea {
/**
* @see org.eclipse.team.internal.ccvs.ui.DialogArea#createArea(org.eclipse.swt.widgets.Composite)
*/
- public Control createArea(Composite parent) {
+ public void createArea(Composite parent) {
Dialog.applyDialogFont(parent);
Composite composite = createGrabbingComposite(parent, 1);
initializeDialogUnits(composite);
@@ -114,8 +102,6 @@ public class CommitCommentArea extends DialogArea {
text.setText(comments[index]);
}
});
-
- return composite;
}
/**
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ListSelectionArea.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ListSelectionArea.java
index 5fe2e8595..a3df9f619 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ListSelectionArea.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ListSelectionArea.java
@@ -10,25 +10,16 @@
*******************************************************************************/
package org.eclipse.team.internal.ccvs.ui;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
+import java.util.*;
import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.CheckboxTableViewer;
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.*;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.events.*;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
import org.eclipse.team.internal.ui.dialogs.DialogArea;
/**
@@ -75,7 +66,7 @@ public class ListSelectionArea extends DialogArea {
/**
* @see org.eclipse.team.internal.ccvs.ui.DialogArea#createArea(org.eclipse.swt.widgets.Composite)
*/
- public Control createArea(Composite parent) {
+ public void createArea(Composite parent) {
Dialog.applyDialogFont(parent);
Composite composite = createComposite(parent, 1);
initializeDialogUnits(composite);
@@ -107,8 +98,6 @@ public class ListSelectionArea extends DialogArea {
// initialize page
if (!getInitialElementSelections().isEmpty())
checkInitialSelections();
-
- return composite;
}
/**
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/WorkingSetSelectionArea.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/WorkingSetSelectionArea.java
index 1dbfb0f8a..b2a507901 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/WorkingSetSelectionArea.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/WorkingSetSelectionArea.java
@@ -20,14 +20,9 @@ import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.*;
import org.eclipse.team.internal.ui.dialogs.DialogArea;
-import org.eclipse.ui.IWorkingSet;
-import org.eclipse.ui.IWorkingSetManager;
-import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.*;
import org.eclipse.ui.dialogs.IWorkingSetSelectionDialog;
/**
@@ -98,7 +93,7 @@ public class WorkingSetSelectionArea extends DialogArea {
*
* @see org.eclipse.jface.dialogs.Dialog#createDialogArea(Composite)
*/
- public Control createArea(Composite parent) {
+ public void createArea(Composite parent) {
Dialog.applyDialogFont(parent);
Composite composite = createComposite(parent, 2);
initializeDialogUnits(composite);
@@ -146,8 +141,6 @@ public class WorkingSetSelectionArea extends DialogArea {
handleMruSelection();
}
});
-
- return composite;
}
/**
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/DialogArea.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/DialogArea.java
index 1275112a2..df4b19af6 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/DialogArea.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/DialogArea.java
@@ -37,7 +37,12 @@ public abstract class DialogArea {
protected List listeners;
- public DialogArea(Dialog parentDialog, IDialogSettings settings) {
+ /**
+ * Create a dialog area
+ * @param parentDialog the parent dialog or <code>null</code>
+ * @param settings the dialog settings stroe or <code>null</code>
+ */
+ protected DialogArea(Dialog parentDialog, IDialogSettings settings) {
this.listeners = new ArrayList();
this.parentDialog = parentDialog;
this.settings = settings;
@@ -87,13 +92,21 @@ public abstract class DialogArea {
gc.dispose();
}
- public abstract Control createArea(Composite parent);
+ /**
+ * Create the area using the given parent as the containing composite
+ * @param parent
+ */
+ public abstract void createArea(Composite parent);
/**
- * Returns the shell.
- * @return Shell
+ * Returns a shell that can be used to show error conditions, etc.
+ * This method will return <code>null</code> if there is no parent dialog.
+ * @return a shell or <code>null</code>
*/
protected Shell getShell() {
+ if (parentDialog == null) {
+ return null;
+ }
return parentDialog.getShell();
}
@@ -116,7 +129,7 @@ public abstract class DialogArea {
data.heightHint = Dialog.convertVerticalDLUsToPixels(fontMetrics, IDialogConstants.BUTTON_HEIGHT);
int widthHint = Dialog.convertHorizontalDLUsToPixels(fontMetrics, IDialogConstants.BUTTON_WIDTH);
data.widthHint = Math.max(widthHint, button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
- button.setLayoutData(data);;
+ button.setLayoutData(data);
return button;
}
@@ -159,7 +172,7 @@ public abstract class DialogArea {
protected Composite createComposite(Composite parent, int numColumns) {
Composite composite = new Composite(parent, SWT.NULL);
Font font = parent.getFont();
- composite.setFont(parent.getFont());
+ composite.setFont(font);
// GridLayout
GridLayout layout = new GridLayout();
@@ -184,7 +197,7 @@ public abstract class DialogArea {
protected Composite createGrabbingComposite(Composite parent, int numColumns) {
Composite composite = new Composite(parent, SWT.NULL);
Font font = parent.getFont();
- composite.setFont(parent.getFont());
+ composite.setFont(font);
// GridLayout
GridLayout layout = new GridLayout();

Back to the top