Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Aniszczyk2010-05-24 16:48:54 +0000
committerChris Aniszczyk2010-05-24 16:48:54 +0000
commit055dec2839120054cf2d09c280c141b751e8dee1 (patch)
tree315eb137642ae644285ab66c0b9b0ca6b37c8667
parentf8c5aa5fb0f5fbd6d256025ca796df28307eb72f (diff)
downloadegit-055dec2839120054cf2d09c280c141b751e8dee1.tar.gz
egit-055dec2839120054cf2d09c280c141b751e8dee1.tar.xz
egit-055dec2839120054cf2d09c280c141b751e8dee1.zip
Dialog improvements with TitleAreaDialog
A few of the dialogs were improved by extending TitleAreaDialog instead of the vanilla JFace Dialog class. Change-Id: Iec1cf7668e687c0e0e86072bc2eb933d06709667 Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchSelectionDialog.java18
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/MergeTargetSelectionDialog.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/ResetTargetSelectionDialog.java6
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/uitext.properties2
4 files changed, 14 insertions, 14 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchSelectionDialog.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchSelectionDialog.java
index 9a1f8eb067..615aa70e61 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchSelectionDialog.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchSelectionDialog.java
@@ -22,9 +22,9 @@ import org.eclipse.egit.ui.internal.repository.RepositoriesViewContentProvider;
import org.eclipse.egit.ui.internal.repository.RepositoriesViewLabelProvider;
import org.eclipse.egit.ui.internal.repository.RepositoryTreeNode;
import org.eclipse.egit.ui.internal.repository.RepositoryTreeNode.RepositoryTreeNodeType;
-import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.InputDialog;
+import org.eclipse.jface.dialogs.TitleAreaDialog;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.jface.resource.JFaceResources;
@@ -50,7 +50,6 @@ import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.dialogs.FilteredTree;
import org.eclipse.ui.dialogs.PatternFilter;
@@ -58,7 +57,7 @@ import org.eclipse.ui.dialogs.PatternFilter;
/**
* The branch and reset selection dialog
*/
-public class BranchSelectionDialog extends Dialog {
+public class BranchSelectionDialog extends TitleAreaDialog {
private final Repository repo;
@@ -100,8 +99,7 @@ public class BranchSelectionDialog extends Dialog {
@Override
protected Composite createDialogArea(Composite base) {
Composite parent = (Composite) super.createDialogArea(base);
- parent.setLayout(GridLayoutFactory.swtDefaults().create());
- new Label(parent, SWT.NONE).setText(getRefsLabel());
+ parent.setLayout(GridLayoutFactory.fillDefaults().create());
// TODO deprecated constructor for now
FilteredTree tree = new FilteredTree(parent, SWT.SINGLE | SWT.BORDER, new PatternFilter());
@@ -162,9 +160,11 @@ public class BranchSelectionDialog extends Dialog {
createCustomArea(parent);
String rawTitle = getTitle();
+ String title = NLS.bind(rawTitle, new Object[] { repo.getDirectory() });
- getShell().setText(
- NLS.bind(rawTitle, new Object[] { repo.getDirectory() }));
+ setTitle(title);
+ setMessage(getMessageText());
+ getShell().setText(title);
return parent;
}
@@ -380,9 +380,9 @@ public class BranchSelectionDialog extends Dialog {
}
/**
- * @return the label shown above the refs tree
+ * @return the message shown above the refs tree
*/
- protected String getRefsLabel() {
+ protected String getMessageText() {
return UIText.BranchSelectionDialog_Refs;
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/MergeTargetSelectionDialog.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/MergeTargetSelectionDialog.java
index 0c9fcd4d94..6f675c6532 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/MergeTargetSelectionDialog.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/MergeTargetSelectionDialog.java
@@ -41,7 +41,7 @@ public class MergeTargetSelectionDialog extends BranchSelectionDialog {
}
@Override
- protected String getRefsLabel() {
+ protected String getMessageText() {
return UIText.MergeTargetSelectionDialog_SelectRef
+ " " + UIText.MergeTargetSelectionDialog_OnlyFastForward; //$NON-NLS-1$
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/ResetTargetSelectionDialog.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/ResetTargetSelectionDialog.java
index f469daeeaa..94f78c2750 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/ResetTargetSelectionDialog.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/ResetTargetSelectionDialog.java
@@ -17,7 +17,7 @@ import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.RowLayout;
+import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Event;
@@ -45,8 +45,8 @@ public class ResetTargetSelectionDialog extends BranchSelectionDialog {
protected void createCustomArea(Composite parent) {
Group g = new Group(parent, SWT.NONE);
g.setText(UIText.BranchSelectionDialog_ResetType);
- g.setLayoutData(GridDataFactory.swtDefaults().align(SWT.CENTER, SWT.CENTER).create());
- g.setLayout(new RowLayout(SWT.VERTICAL));
+ g.setLayoutData(GridDataFactory.fillDefaults().align(SWT.CENTER, SWT.CENTER).create());
+ g.setLayout(new GridLayout(1, false));
Button soft = new Button(g, SWT.RADIO);
soft.setText(UIText.BranchSelectionDialog_ResetTypeSoft);
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/uitext.properties b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/uitext.properties
index 0aadbcc311..c4c43f6694 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/uitext.properties
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/uitext.properties
@@ -500,7 +500,7 @@ BranchSelectionDialog_ResetType=Reset Type
BranchSelectionDialog_ResetTypeHard=&Hard
BranchSelectionDialog_ResetTypeMixed=&Mixed (working directory unmodified)
BranchSelectionDialog_ResetTypeSoft=&Soft (Index and working directory unmodified)
-BranchSelectionDialog_Refs=Re&fs
+BranchSelectionDialog_Refs=Select a branch or tag to checkout.
BranchSelectionDialog_Rename=&Rename
MergeAction_CannotMerge=Cannot merge now

Back to the top