Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathias Kinzler2010-05-21 08:08:41 +0000
committerMatthias Sohn2010-05-22 21:43:19 +0000
commit14cae3d9a9f1035fe0fa5c97ac0d8814c9ae61e8 (patch)
tree372cce81ec6e512750d3bc2af8561eae856f826b
parent66f36df9dbf5b66ec895f6e7666d3c2ac765b805 (diff)
downloadegit-14cae3d9a9f1035fe0fa5c97ac0d8814c9ae61e8.tar.gz
egit-14cae3d9a9f1035fe0fa5c97ac0d8814c9ae61e8.tar.xz
egit-14cae3d9a9f1035fe0fa5c97ac0d8814c9ae61e8.zip
Git Repostiories View: add context menu for fetch and push wizards
This makes the fetch and push wizards available from the Git Repositories View. Change-Id: If8fb891ca4d4a79c00e4774ba0ef0382fee58654 Signed-off-by: Mathias Kinzler <mathias.kinzler@sap.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIText.java6
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java41
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/uitext.properties4
3 files changed, 48 insertions, 3 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIText.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIText.java
index 371bfcdcb4..7f3f2fb96a 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIText.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIText.java
@@ -1579,6 +1579,9 @@ public class UIText extends NLS {
public static String RepositoriesView_DeleteRepoDeterminProjectsMessage;
/** */
+ public static String RepositoriesView_DoFetchMenu;
+
+ /** */
public static String RepositoriesView_DoPushMenuItem;
/** */
@@ -1630,6 +1633,9 @@ public class UIText extends NLS {
public static String RepositoriesView_PasteRepoAlreadyThere;
/** */
+ public static String RepositoriesView_PushMenu;
+
+ /** */
public static String RepositoriesView_Refresh_Button;
/** */
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java
index aeab43a024..7f919a595b 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java
@@ -51,7 +51,9 @@ import org.eclipse.egit.ui.UIText;
import org.eclipse.egit.ui.internal.clone.GitCloneWizard;
import org.eclipse.egit.ui.internal.clone.GitCreateProjectViaWizardWizard;
import org.eclipse.egit.ui.internal.fetch.FetchConfiguredRemoteAction;
+import org.eclipse.egit.ui.internal.fetch.FetchWizard;
import org.eclipse.egit.ui.internal.push.PushConfiguredRemoteAction;
+import org.eclipse.egit.ui.internal.push.PushWizard;
import org.eclipse.egit.ui.internal.repository.RepositoryTreeNode.RepositoryTreeNodeType;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
@@ -595,6 +597,42 @@ public class RepositoriesView extends ViewPart implements ISelectionProvider,
}
});
+ new MenuItem(men, SWT.SEPARATOR);
+
+ MenuItem fetchItem = new MenuItem(men, SWT.PUSH);
+ fetchItem.setText(UIText.RepositoriesView_FetchMenu);
+ fetchItem.setImage(UIIcons.FETCH.createImage());
+ fetchItem.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ try {
+ new WizardDialog(getSite().getShell(), new FetchWizard(
+ repo)).open();
+ } catch (URISyntaxException e1) {
+ Activator.handleError(e1.getMessage(), e1, true);
+ }
+ }
+
+ });
+
+ MenuItem pushItem = new MenuItem(men, SWT.PUSH);
+ pushItem.setText(UIText.RepositoriesView_PushMenu);
+ pushItem.setImage(UIIcons.PUSH.createImage());
+ pushItem.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ try {
+ new WizardDialog(getSite().getShell(), new PushWizard(
+ repo)).open();
+ } catch (URISyntaxException e1) {
+ Activator.handleError(e1.getMessage(), e1, true);
+ }
+ }
+
+ });
+
// TODO delete does not work because of file locks on .pack-files
// Shawn Pearce has added the following thoughts:
@@ -869,7 +907,7 @@ public class RepositoriesView extends ViewPart implements ISelectionProvider,
final String configName = (String) node.getParent().getObject();
MenuItem doFetch = new MenuItem(men, SWT.PUSH);
- doFetch.setText(UIText.RepositoriesView_FetchMenu);
+ doFetch.setText(UIText.RepositoriesView_DoFetchMenu);
doFetch.addSelectionListener(new SelectionAdapter() {
@Override
@@ -1491,7 +1529,6 @@ public class RepositoriesView extends ViewPart implements ISelectionProvider,
// we must dispose ourselves
clip.dispose();
if (errorMessage != null)
- // TODO String ext
MessageDialog.openWarning(getSite().getShell(),
UIText.RepositoriesView_PasteFailureTitle,
errorMessage);
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 e13ba27d8c..53a465ec8f 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
@@ -563,7 +563,8 @@ RepositoriesView_CreateFetch_menu=Create Fetch...
RepositoriesView_CreatePush_menu=Create Push...
RepositoriesView_DeleteBranchMenu=Delete Branch...
RepositoriesView_DeleteRepoDeterminProjectsMessage=Determining projects that must be deleted
-RepositoriesView_DoPushMenuItem=Push...
+RepositoriesView_DoFetchMenu=Fetch
+RepositoriesView_DoPushMenuItem=Push
RepositoriesView_Error_WindowTitle=Error
RepositoriesView_ErrorHeader=Error
RepositoriesView_FetchMenu=Fetch...
@@ -580,6 +581,7 @@ RepositoriesView_OpenPropertiesMenu=Open Properties view
RepositoriesView_PasteFailureTitle=Paste failure
RepositoriesView_PasteMenu=Paste a Git Repository Location
RepositoriesView_PasteRepoAlreadyThere=Repository at location {0} is already in the list
+RepositoriesView_PushMenu=Push...
RepositoriesView_Refresh_Button=Refresh
RepositoriesView_RemotesNodeText=Remotes
RepositoriesView_Remove_MenuItem=Remove

Back to the top