Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDani Megert2013-05-29 14:17:36 +0000
committerRobin Stocker2013-06-03 14:33:41 +0000
commitd6cf52411377a039fc2906378711091a26e932cb (patch)
tree1abb5814c53563f17c8760763a292cc9d5cce9e2
parenteb6b30da910b8dd6b71c5337b4e7be83286ed7a8 (diff)
downloadegit-d6cf5241.tar.gz
egit-d6cf5241.tar.xz
egit-d6cf5241.zip
Hide unwanted common navigator action bar items
This change hides unwanted 'Link with Editor' and 'Customize View...' items from the local toolbar and the view menu. See bug 409722 for restoring the feature of activating the editor when changing the selection using 'Link with Selection'. Bug: 350686 Change-Id: Ia2bd5091303d1b0a738157effc24e4dac5a7d0c7 Also-by: Robin Stocker <robin@nibor.org> Signed-off-by: Dani Megert <Daniel_Megert@ch.ibm.com>
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewTest.java33
-rw-r--r--org.eclipse.egit.ui/plugin.xml11
2 files changed, 30 insertions, 14 deletions
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewTest.java
index 123b5d4876..c76f346a27 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2012 SAP AG and others.
+ * Copyright (c) 2010, 2013 SAP AG and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -50,6 +50,7 @@ import org.eclipse.ui.IWorkingSet;
import org.eclipse.ui.IWorkingSetManager;
import org.eclipse.ui.PlatformUI;
import org.junit.BeforeClass;
+import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -400,7 +401,7 @@ public class GitRepositoriesViewTest extends GitRepositoriesViewTestBase {
}
@Test
- public void testLinkWithSelection() throws Exception {
+ public void testLinkWithSelectionNavigator() throws Exception {
deleteAllProjects();
shareProjects(repositoryFile);
SWTBotPerspective perspective = null;
@@ -421,9 +422,7 @@ public class GitRepositoriesViewTest extends GitRepositoriesViewTestBase {
assertTrue(tree.selection().get(0, 0).startsWith(REPO1));
// activate the link with selection
- getOrOpenView().toolbarButton(
- myUtil.getPluginLocalizedValue("LinkWithSelectionCommand"))
- .click();
+ toggleLinkWithSelection();
// the selection should be still be root
assertTrue(tree.selection().get(0, 0).startsWith(REPO1));
@@ -437,9 +436,7 @@ public class GitRepositoriesViewTest extends GitRepositoriesViewTestBase {
assertTrue(tree.selection().get(0, 0).equals(PROJ1));
// deactivate the link with selection
- getOrOpenView().toolbarButton(
- myUtil.getPluginLocalizedValue("LinkWithSelectionCommand"))
- .click();
+ toggleLinkWithSelection();
} finally {
if (perspective != null)
@@ -453,7 +450,8 @@ public class GitRepositoriesViewTest extends GitRepositoriesViewTestBase {
* @throws Exception
*/
@Test
- public void testLinkWithEditor() throws Exception {
+ @Ignore("'Link with Selection' does not activate editor on selection change (bug 409722).")
+ public void testLinkWithSelectionEditor() throws Exception {
deleteAllProjects();
shareProjects(repositoryFile);
SWTBotPerspective perspective = null;
@@ -485,7 +483,8 @@ public class GitRepositoriesViewTest extends GitRepositoriesViewTestBase {
assertTrue(tree.selection().get(0, 0).startsWith(REPO1));
// activate the link with selection
- getOrOpenView().toolbarButton("Link with Editor").click();
+ toggleLinkWithSelection();
+
bot.editorByTitle(FILE2).show();
// the selection should have changed to the latest editor
TestUtil.waitUntilTreeHasSelectedNodeWithText(bot, tree, FILE2, 10000);
@@ -495,7 +494,7 @@ public class GitRepositoriesViewTest extends GitRepositoriesViewTestBase {
TestUtil.waitUntilTreeHasSelectedNodeWithText(bot, tree, FILE1, 10000);
// deactivate the link with editor
- getOrOpenView().toolbarButton("Link with Editor").click();
+ toggleLinkWithSelection();
bot.editorByTitle(FILE2).show();
// the selection should be still be test.txt
@@ -511,8 +510,8 @@ public class GitRepositoriesViewTest extends GitRepositoriesViewTestBase {
assertEquals(FILE1, bot.activeEditor().getTitle());
// activate again
- SWTBotView repoView = getOrOpenView();
- repoView.toolbarButton("Link with Editor").click();
+ toggleLinkWithSelection();
+
// make sure focus is here
// tried to remove this waitInUI but failed.
// tried setting focus, waiting for focus, joining RepositoriesView
@@ -529,7 +528,7 @@ public class GitRepositoriesViewTest extends GitRepositoriesViewTestBase {
TestUtil.waitUntilEditorIsActive(bot, bot.editorByTitle(FILE1), 10000);
// deactivate the link with editor
- getOrOpenView().toolbarButton("Link with Editor").click();
+ toggleLinkWithSelection();
myRepoViewUtil.getWorkdirItem(tree, repositoryFile).expand()
.getNode(PROJ1).expand().getNode(FOLDER).expand().getNode(
@@ -663,6 +662,12 @@ public class GitRepositoriesViewTest extends GitRepositoriesViewTestBase {
assertThat(folder.getNodes(), hasItem(FILE2));
}
+ private void toggleLinkWithSelection() throws Exception {
+ getOrOpenView().toolbarButton(
+ myUtil.getPluginLocalizedValue("LinkWithSelectionCommand"))
+ .click();
+ }
+
private SWTBotTreeItem findWorkdirNode(SWTBotTree tree, String... nodes) throws Exception {
SWTBotTreeItem item = myRepoViewUtil.getWorkdirItem(tree, repositoryFile).expand();
for (String node : nodes)
diff --git a/org.eclipse.egit.ui/plugin.xml b/org.eclipse.egit.ui/plugin.xml
index 35b4952972..6e51c322ca 100644
--- a/org.eclipse.egit.ui/plugin.xml
+++ b/org.eclipse.egit.ui/plugin.xml
@@ -1923,6 +1923,17 @@
point="org.eclipse.ui.navigator.viewer">
<viewer
viewerId="org.eclipse.egit.ui.RepositoriesView">
+ <options>
+ <!-- Hide the "Available Customizations" dialog completely. This includes hiding the
+ filters and the available content extensions. -->
+ <property
+ name="org.eclipse.ui.navigator.hideAvailableCustomizationsDialog"
+ value="true"/>
+ <!-- Hide the "Link with Editor" action from the toolbar of the viewer -->
+ <property
+ name="org.eclipse.ui.navigator.hideLinkWithEditorAction"
+ value="true"/>
+ </options>
<popupMenu>
<insertionPoint
name="branch"

Back to the top