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 2335 Details for
Bug 25826
[Navigator] Navigator View should have a "Collapse All" button
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]
Implements the "Collapse All" feature
25826.txt (text/plain), 5.21 KB, created by
Sebastian Davids
on 2002-11-07 09:27:49 EST
(
hide
)
Description:
Implements the "Collapse All" feature
Filename:
MIME Type:
Creator:
Sebastian Davids
Created:
2002-11-07 09:27:49 EST
Size:
5.21 KB
patch
obsolete
>Index: CollapseAllAction.java >=================================================================== >RCS file: CollapseAllAction.java >diff -N CollapseAllAction.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ CollapseAllAction.java 7 Nov 2002 14:06:10 -0000 >@@ -0,0 +1,59 @@ >+/* >+ * (c) Copyright IBM Corp. 2000, 2001. >+ * All Rights Reserved. >+ */ >+package org.eclipse.ui.views.navigator; >+ >+import java.net.MalformedURLException; >+import java.net.URL; >+ >+import org.eclipse.core.runtime.Platform; >+import org.eclipse.jface.resource.ImageDescriptor; >+import org.eclipse.ui.PlatformUI; >+import org.eclipse.ui.help.WorkbenchHelp; >+import org.eclipse.ui.plugin.AbstractUIPlugin; >+ >+/** >+ * Collapse all project nodes. >+ */ >+public class CollapseAllAction extends ResourceNavigatorAction { >+ private static final String COLLAPSE_ALL_TOOL_TIP = ResourceNavigatorMessages.getString("CollapseAllAction.toolTip"); //$NON-NLS-1$ >+ >+ >+/** >+ * Creates the action. >+ * >+ * @param navigator the resource navigator >+ * @param label the label for the action >+ */ >+public CollapseAllAction(IResourceNavigator navigator, String label) { >+ super(navigator, label); >+ setToolTipText(COLLAPSE_ALL_TOOL_TIP); >+ setImageDescriptor(getImageDescriptor("elcl16/collapseall.gif")); //$NON-NLS-1$ >+ WorkbenchHelp.setHelp(this, INavigatorHelpContextIds.COLLAPSE_ALL_ACTION); >+ setEnabled(true); >+} >+ >+/** >+ * Returns the image descriptor with the given relative path. >+ */ >+private ImageDescriptor getImageDescriptor(String relativePath) { >+ String iconPath = "icons/full/"; //$NON-NLS-1$ >+ try { >+ AbstractUIPlugin plugin = (AbstractUIPlugin) Platform.getPlugin(PlatformUI.PLUGIN_ID); >+ URL installURL = plugin.getDescriptor().getInstallURL(); >+ URL url = new URL(installURL, iconPath + relativePath); >+ return ImageDescriptor.createFromURL(url); >+ } catch (MalformedURLException e) { >+ // should not happen >+ return ImageDescriptor.getMissingImageDescriptor(); >+ } >+} >+ >+/* >+ * Implementation of method defined on <code>IAction</code>. >+ */ >+public void run() { >+ getNavigator().getViewer().collapseAll(); >+} >+} >\ No newline at end of file >Index: INavigatorHelpContextIds.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.views/src/org/eclipse/ui/views/navigator/INavigatorHelpContextIds.java,v >retrieving revision 1.1 >diff -u -r1.1 INavigatorHelpContextIds.java >--- INavigatorHelpContextIds.java 24 Sep 2002 16:40:06 -0000 1.1 >+++ INavigatorHelpContextIds.java 7 Nov 2002 14:06:10 -0000 >@@ -26,6 +26,7 @@ > public static final String SORT_VIEW_ACTION = PREFIX + "sort_view_action_context"; //$NON-NLS-1$ > public static final String COPY_ACTION = PREFIX + "resource_navigator_copy_action_context"; //$NON-NLS-1$ > public static final String PASTE_ACTION = PREFIX + "resource_navigator_paste_action_context"; //$NON-NLS-1$ >+ public static final String COLLAPSE_ALL_ACTION = PREFIX + "collapse_all_action_context"; //$NON-NLS-1$ > > > // Dialogs >Index: MainActionGroup.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.views/src/org/eclipse/ui/views/navigator/MainActionGroup.java,v >retrieving revision 1.3 >diff -u -r1.3 MainActionGroup.java >--- MainActionGroup.java 6 Nov 2002 21:20:22 -0000 1.3 >+++ MainActionGroup.java 7 Nov 2002 14:06:10 -0000 >@@ -31,6 +31,7 @@ > protected PropertyDialogAction propertyDialogAction; > protected ImportResourcesAction importAction; > protected ExportResourcesAction exportAction; >+ protected CollapseAllAction collapseAllAction; > > protected GotoActionGroup gotoGroup; > protected OpenActionGroup openGroup; >@@ -59,6 +60,7 @@ > new PropertyDialogAction(shell, navigator.getViewer()); > importAction = new ImportResourcesAction(workbench); > exportAction = new ExportResourcesAction(workbench); >+ collapseAllAction = new CollapseAllAction(navigator , ResourceNavigatorMessages.getString("ResourceNavigator.collapseAll")); //$NON-NLS-1$ > } > > /** >@@ -152,6 +154,11 @@ > refactorGroup.fillActionBars(actionBars); > sortAndFilterGroup.fillActionBars(actionBars); > workspaceGroup.fillActionBars(actionBars); >+ >+ IToolBarManager toolBar = actionBars.getToolBarManager(); >+ >+ toolBar.add(new Separator()); >+ toolBar.add(collapseAllAction); > } > > /** >Index: messages.properties >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.views/src/org/eclipse/ui/views/navigator/messages.properties,v >retrieving revision 1.3 >diff -u -r1.3 messages.properties >--- messages.properties 6 Nov 2002 21:14:31 -0000 1.3 >+++ messages.properties 7 Nov 2002 14:06:10 -0000 >@@ -30,6 +30,7 @@ > ResourceNavigator.resourceText = &Resource... > ResourceNavigator.openPerspective = Open &Perspective > ResourceNavigator.openWith = Open Wit&h >+ResourceNavigator.collapseAll = Co&llapse All > > ShowInNavigator.text = Show in &Navigator > ShowInNavigator.toolTip = Show Selected Objects in Navigator View >@@ -39,6 +40,8 @@ > > PasteAction.title=&Paste > PasteAction.toolTip = Paste >+ >+CollapseAllAction.toolTip = Collapse All > > GoToResource.showNavError=Could not open resource navigator view. > # --- Dialogs ---
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 25826
:
2334
| 2335