Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 62460 Details for
Bug 179719
[CommonNavigator] Duplicate projects and menu items in Project Explorer
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Splits the Refactor actions into their action provider to properly override the Resource Refactor actions.
org.eclipse.ui.navigator_bug179719.txt (text/plain), 7.83 KB, created by
Michael D. Elder
on 2007-03-30 00:34:22 EDT
(
hide
)
Description:
Splits the Refactor actions into their action provider to properly override the Resource Refactor actions.
Filename:
MIME Type:
Creator:
Michael D. Elder
Created:
2007-03-30 00:34:22 EDT
Size:
7.83 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.ui >Index: ui/org/eclipse/jdt/internal/ui/navigator/PackageExplorerActionProvider.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/navigator/PackageExplorerActionProvider.java,v >retrieving revision 1.6 >diff -u -r1.6 PackageExplorerActionProvider.java >--- ui/org/eclipse/jdt/internal/ui/navigator/PackageExplorerActionProvider.java 25 Jul 2006 14:19:53 -0000 1.6 >+++ ui/org/eclipse/jdt/internal/ui/navigator/PackageExplorerActionProvider.java 30 Mar 2007 04:33:13 -0000 >@@ -24,7 +24,6 @@ > import org.eclipse.jdt.ui.actions.GenerateActionGroup; > import org.eclipse.jdt.ui.actions.JavaSearchActionGroup; > import org.eclipse.jdt.ui.actions.OpenViewActionGroup; >-import org.eclipse.jdt.ui.actions.RefactorActionGroup; > > import org.eclipse.jdt.internal.ui.JavaPlugin; > import org.eclipse.jdt.internal.ui.navigator.IExtensionStateConstants.Values; >@@ -47,9 +46,7 @@ > private OpenViewActionGroup fOpenViewGroup; > > private CCPActionGroup fCCPGroup; >- >- private RefactorActionGroup fRefactorGroup; >- >+ > private JavaSearchActionGroup fSearchGroup; > > private GenerateBuildPathActionGroup fBuildPathGroup; >@@ -67,9 +64,7 @@ > fOpenViewGroup.fillActionBars(actionBars); > fCCPGroup.fillActionBars(actionBars); > fBuildPathGroup.fillActionBars(actionBars); >- fGenerateGroup.fillActionBars(actionBars); >- fRefactorGroup.fillActionBars(actionBars); >- fRefactorGroup.retargetFileMenuActions(actionBars); >+ fGenerateGroup.fillActionBars(actionBars); > fSearchGroup.fillActionBars(actionBars); > } > >@@ -81,8 +76,7 @@ > fOpenViewGroup.fillContextMenu(menu); > fCCPGroup.fillContextMenu(menu); > fBuildPathGroup.fillContextMenu(menu); >- fGenerateGroup.fillContextMenu(menu); >- fRefactorGroup.fillContextMenu(menu); >+ fGenerateGroup.fillContextMenu(menu); > fSearchGroup.fillContextMenu(menu); > } > } >@@ -103,8 +97,7 @@ > > fOpenViewGroup = new OpenViewActionGroup(viewPart, site.getStructuredViewer()); > fOpenViewGroup.containsOpenPropertiesAction(false); >- fCCPGroup = new CCPActionGroup(viewPart); >- fRefactorGroup = new RefactorActionGroup(viewPart); >+ fCCPGroup = new CCPActionGroup(viewPart); > fGenerateGroup = new GenerateActionGroup(viewPart); > fSearchGroup = new JavaSearchActionGroup(viewPart); > fBuildPathGroup = new GenerateBuildPathActionGroup(viewPart); >@@ -120,8 +113,7 @@ > super.setContext(context); > if (fInViewPart) { > fOpenViewGroup.setContext(context); >- fCCPGroup.setContext(context); >- fRefactorGroup.setContext(context); >+ fCCPGroup.setContext(context); > fGenerateGroup.setContext(context); > fSearchGroup.setContext(context); > fBuildPathGroup.setContext(context); >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/plugin.xml,v >retrieving revision 1.730 >diff -u -r1.730 plugin.xml >--- plugin.xml 26 Mar 2007 10:34:11 -0000 1.730 >+++ plugin.xml 30 Mar 2007 04:33:13 -0000 >@@ -5272,6 +5272,40 @@ > <actionProvider > class="org.eclipse.jdt.internal.ui.navigator.PackageExplorerActionProvider" > id="org.eclipse.jdt.internal.ui.navigator.PackageExplorerActionProvider" >+ overrides="org.eclipse.ui.navigator.resources.actions.EditActions"> >+ <enablement> >+ <or> >+ <adapt >+ type="org.eclipse.core.resources.IProject" > >+ </adapt> >+ <instanceof >+ value="org.eclipse.core.resources.IWorkspaceRoot" /> >+ <instanceof >+ value="org.eclipse.core.resources.IFolder" /> >+ <instanceof >+ value="org.eclipse.core.resources.IFile" /> >+ <instanceof >+ value="org.eclipse.core.resources.IStorage" /> >+ <instanceof >+ value="org.eclipse.jdt.core.IJavaProject" /> >+ <instanceof >+ value="org.eclipse.jdt.core.IJavaElement" /> >+ <instanceof >+ value="org.eclipse.jdt.core.IJarEntryResource" /> >+ <instanceof >+ value="org.eclipse.jdt.core.IClassFile" /> >+ <instanceof >+ value="org.eclipse.jdt.internal.ui.packageview.PackageFragmentRootContainer" /> >+ <adapt type="java.util.Collection"> >+ <count value="0" /> >+ </adapt> >+ </or> >+ </enablement> >+ </actionProvider> >+ >+ <actionProvider >+ class="org.eclipse.jdt.internal.ui.navigator.PackageExplorerRefactorActionProvider" >+ id="org.eclipse.jdt.internal.ui.navigator.PackageExplorerRefactorActionProvider" > overrides="org.eclipse.ui.navigator.resources.actions.RefactorActions"> > <enablement> > <or> >Index: ui/org/eclipse/jdt/internal/ui/navigator/PackageExplorerRefactorActionProvider.java >=================================================================== >RCS file: ui/org/eclipse/jdt/internal/ui/navigator/PackageExplorerRefactorActionProvider.java >diff -N ui/org/eclipse/jdt/internal/ui/navigator/PackageExplorerRefactorActionProvider.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ ui/org/eclipse/jdt/internal/ui/navigator/PackageExplorerRefactorActionProvider.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,88 @@ >+/*************************************************************************************************** >+ * Copyright (c) 2003, 2006 IBM Corporation 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 >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: IBM Corporation - initial API and implementation >+ **************************************************************************************************/ >+package org.eclipse.jdt.internal.ui.navigator; >+ >+import org.eclipse.jface.action.IMenuManager; >+ >+import org.eclipse.ui.IActionBars; >+import org.eclipse.ui.IMemento; >+import org.eclipse.ui.IViewPart; >+import org.eclipse.ui.actions.ActionContext; >+import org.eclipse.ui.navigator.CommonActionProvider; >+import org.eclipse.ui.navigator.ICommonActionExtensionSite; >+import org.eclipse.ui.navigator.ICommonViewerWorkbenchSite; >+import org.eclipse.ui.navigator.IExtensionStateModel; >+ >+import org.eclipse.jdt.ui.actions.RefactorActionGroup; >+ >+public class PackageExplorerRefactorActionProvider extends CommonActionProvider { >+ >+ private IExtensionStateModel fStateModel; >+ >+ private RefactorActionGroup fRefactorGroup; >+ >+ private boolean fInViewPart = false; >+ >+ public void fillActionBars(IActionBars actionBars) { >+ if (fInViewPart) { >+ fRefactorGroup.fillActionBars(actionBars); >+ fRefactorGroup.retargetFileMenuActions(actionBars); >+ } >+ >+ } >+ >+ public void fillContextMenu(IMenuManager menu) { >+ >+ if (fInViewPart) { >+ fRefactorGroup.fillContextMenu(menu); >+ } >+ } >+ >+ public void init(ICommonActionExtensionSite site) { >+ >+ ICommonViewerWorkbenchSite workbenchSite = null; >+ if (site.getViewSite() instanceof ICommonViewerWorkbenchSite) >+ workbenchSite = (ICommonViewerWorkbenchSite) site.getViewSite(); >+ >+ fStateModel = site.getExtensionStateModel(); >+ >+ >+ if (workbenchSite != null) { >+ if (workbenchSite.getPart() != null && workbenchSite.getPart() instanceof IViewPart) { >+ IViewPart viewPart = (IViewPart) workbenchSite.getPart(); >+ >+ fRefactorGroup = new RefactorActionGroup(viewPart); >+ >+ fInViewPart = true; >+ } >+ >+ } >+ >+ } >+ >+ public void setContext(ActionContext context) { >+ super.setContext(context); >+ if (fInViewPart) { >+ fRefactorGroup.setContext(context); >+ } >+ } >+ >+ public void restoreState(IMemento memento) { >+ super.restoreState(memento); >+ restoreLayoutState(memento); >+ } >+ >+ private void restoreLayoutState(IMemento memento) { >+ } >+ >+ public void saveState(IMemento aMemento) { >+ >+ } >+ >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 179719
:
62218
|
62219
|
62220
|
62244
| 62460