diff options
| author | Stephen Elsemore | 2013-05-10 16:31:08 +0000 |
|---|---|---|
| committer | Stephen Elsemore | 2013-05-10 16:31:08 +0000 |
| commit | bacca11f85974cf4764fbdd79a6ccbdacdd4888f (patch) | |
| tree | c4c2acb812c6a5db4e67838bf62ec45840e47f01 | |
| parent | 94188f68395fa4bdd7055e90d85377dc832e4c5e (diff) | |
| download | egit-bacca11f85974cf4764fbdd79a6ccbdacdd4888f.tar.gz egit-bacca11f85974cf4764fbdd79a6ccbdacdd4888f.tar.xz egit-bacca11f85974cf4764fbdd79a6ccbdacdd4888f.zip | |
Move commit-related buttons to "Commit Message" section of Staging View.
Bug: 407760
Change-Id: Ic62087e7220eb6b490d5e31ef9f563fd77cbc4e9
Signed-off-by: Stephen Elsemore <selsemore@collab.net>
| -rw-r--r-- | org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java | 84 |
1 files changed, 51 insertions, 33 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java index a845bb6dad..5d588d8b1c 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java @@ -74,6 +74,7 @@ import org.eclipse.jface.action.IMenuManager; import org.eclipse.jface.action.IToolBarManager; import org.eclipse.jface.action.MenuManager; import org.eclipse.jface.action.Separator; +import org.eclipse.jface.action.ToolBarManager; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.layout.GridDataFactory; import org.eclipse.jface.layout.GridLayoutFactory; @@ -131,6 +132,7 @@ import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.VerifyEvent; import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.layout.RowLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; @@ -396,6 +398,55 @@ public class StagingView extends ViewPart implements IShowInSource { horizontalSashForm, ExpandableComposite.TITLE_BAR); commitMessageSection.setText(UIText.StagingView_CommitMessage); + Composite commitMessageToolbarComposite = toolkit + .createComposite(commitMessageSection); + commitMessageToolbarComposite.setBackground(null); + RowLayout commitMessageRowLayout = new RowLayout(); + commitMessageRowLayout.marginHeight = 0; + commitMessageRowLayout.marginWidth = 0; + commitMessageRowLayout.marginTop = 0; + commitMessageRowLayout.marginBottom = 0; + commitMessageRowLayout.marginLeft = 0; + commitMessageRowLayout.marginRight = 0; + commitMessageToolbarComposite.setLayout(commitMessageRowLayout); + commitMessageSection.setTextClient(commitMessageToolbarComposite); + ToolBarManager commitMessageToolBarManager = new ToolBarManager( + SWT.FLAT | SWT.HORIZONTAL); + + amendPreviousCommitAction = new Action( + UIText.StagingView_Ammend_Previous_Commit, IAction.AS_CHECK_BOX) { + + public void run() { + commitMessageComponent.setAmendingButtonSelection(isChecked()); + updateMessage(); + } + }; + amendPreviousCommitAction.setImageDescriptor(UIIcons.AMEND_COMMIT); + commitMessageToolBarManager.add(amendPreviousCommitAction); + + signedOffByAction = new Action(UIText.StagingView_Add_Signed_Off_By, + IAction.AS_CHECK_BOX) { + + public void run() { + commitMessageComponent.setSignedOffButtonSelection(isChecked()); + } + }; + signedOffByAction.setImageDescriptor(UIIcons.SIGNED_OFF); + commitMessageToolBarManager.add(signedOffByAction); + + addChangeIdAction = new Action(UIText.StagingView_Add_Change_ID, + IAction.AS_CHECK_BOX) { + + public void run() { + commitMessageComponent.setChangeIdButtonSelection(isChecked()); + } + }; + addChangeIdAction.setImageDescriptor(UIIcons.GERRIT); + commitMessageToolBarManager.add(addChangeIdAction); + + commitMessageToolBarManager + .createControl(commitMessageToolbarComposite); + Composite commitMessageComposite = toolkit .createComposite(commitMessageSection); commitMessageSection.setClient(commitMessageComposite); @@ -732,39 +783,6 @@ public class StagingView extends ViewPart implements IShowInSource { toolbar.add(new Separator()); - amendPreviousCommitAction = new Action( - UIText.StagingView_Ammend_Previous_Commit, IAction.AS_CHECK_BOX) { - - public void run() { - commitMessageComponent.setAmendingButtonSelection(isChecked()); - updateMessage(); - } - }; - amendPreviousCommitAction.setImageDescriptor(UIIcons.AMEND_COMMIT); - toolbar.add(amendPreviousCommitAction); - - signedOffByAction = new Action(UIText.StagingView_Add_Signed_Off_By, - IAction.AS_CHECK_BOX) { - - public void run() { - commitMessageComponent.setSignedOffButtonSelection(isChecked()); - } - }; - signedOffByAction.setImageDescriptor(UIIcons.SIGNED_OFF); - toolbar.add(signedOffByAction); - - addChangeIdAction = new Action(UIText.StagingView_Add_Change_ID, - IAction.AS_CHECK_BOX) { - - public void run() { - commitMessageComponent.setChangeIdButtonSelection(isChecked()); - } - }; - addChangeIdAction.setImageDescriptor(UIIcons.GERRIT); - toolbar.add(addChangeIdAction); - - toolbar.add(new Separator()); - openNewCommitsAction = new Action(UIText.StagingView_OpenNewCommits, IAction.AS_CHECK_BOX) { |
