diff options
author | Marc-Andre Laperle | 2015-04-29 05:54:18 +0000 |
---|---|---|
committer | Marc-Andre Laperle | 2017-03-22 05:22:52 +0000 |
commit | 7eaabfe5576529b9b503f51cf4550c44bba0c18b (patch) | |
tree | d65bcd15a6d56b90f76624e0b64e864b46590cf7 /core/org.eclipse.cdt.ui | |
parent | e44a300af7ccae051fd48be2c4e43425198b5e7e (diff) | |
download | org.eclipse.cdt-7eaabfe5576529b9b503f51cf4550c44bba0c18b.tar.gz org.eclipse.cdt-7eaabfe5576529b9b503f51cf4550c44bba0c18b.tar.xz org.eclipse.cdt-7eaabfe5576529b9b503f51cf4550c44bba0c18b.zip |
Bug 463480 - [Include Browser] Add Expand all, Collapse all
Change-Id: I00d6ca764fa1ecb408d8786f6a49d8d81a735ea7
Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Diffstat (limited to 'core/org.eclipse.cdt.ui')
16 files changed, 71 insertions, 5 deletions
diff --git a/core/org.eclipse.cdt.ui/icons/dlcl16/collapseall.gif b/core/org.eclipse.cdt.ui/icons/dlcl16/collapseall.gif Binary files differdeleted file mode 100644 index a2d80a9044f..00000000000 --- a/core/org.eclipse.cdt.ui/icons/dlcl16/collapseall.gif +++ /dev/null diff --git a/core/org.eclipse.cdt.ui/icons/dlcl16/collapseall.png b/core/org.eclipse.cdt.ui/icons/dlcl16/collapseall.png Binary files differnew file mode 100644 index 00000000000..a40ba4e199a --- /dev/null +++ b/core/org.eclipse.cdt.ui/icons/dlcl16/collapseall.png diff --git a/core/org.eclipse.cdt.ui/icons/dlcl16/collapseall@2x.png b/core/org.eclipse.cdt.ui/icons/dlcl16/collapseall@2x.png Binary files differnew file mode 100644 index 00000000000..f6921e99e1a --- /dev/null +++ b/core/org.eclipse.cdt.ui/icons/dlcl16/collapseall@2x.png diff --git a/core/org.eclipse.cdt.ui/icons/dlcl16/expandall.png b/core/org.eclipse.cdt.ui/icons/dlcl16/expandall.png Binary files differnew file mode 100644 index 00000000000..fcdfcbd6365 --- /dev/null +++ b/core/org.eclipse.cdt.ui/icons/dlcl16/expandall.png diff --git a/core/org.eclipse.cdt.ui/icons/dlcl16/expandall@2x.png b/core/org.eclipse.cdt.ui/icons/dlcl16/expandall@2x.png Binary files differnew file mode 100644 index 00000000000..5795bb4ef3c --- /dev/null +++ b/core/org.eclipse.cdt.ui/icons/dlcl16/expandall@2x.png diff --git a/core/org.eclipse.cdt.ui/icons/elcl16/collapseall.gif b/core/org.eclipse.cdt.ui/icons/elcl16/collapseall.gif Binary files differdeleted file mode 100644 index a2d80a9044f..00000000000 --- a/core/org.eclipse.cdt.ui/icons/elcl16/collapseall.gif +++ /dev/null diff --git a/core/org.eclipse.cdt.ui/icons/elcl16/collapseall.png b/core/org.eclipse.cdt.ui/icons/elcl16/collapseall.png Binary files differnew file mode 100644 index 00000000000..000891dc5e0 --- /dev/null +++ b/core/org.eclipse.cdt.ui/icons/elcl16/collapseall.png diff --git a/core/org.eclipse.cdt.ui/icons/elcl16/collapseall@2x.png b/core/org.eclipse.cdt.ui/icons/elcl16/collapseall@2x.png Binary files differnew file mode 100644 index 00000000000..b1080524909 --- /dev/null +++ b/core/org.eclipse.cdt.ui/icons/elcl16/collapseall@2x.png diff --git a/core/org.eclipse.cdt.ui/icons/elcl16/expandall.png b/core/org.eclipse.cdt.ui/icons/elcl16/expandall.png Binary files differnew file mode 100644 index 00000000000..354ac37cf23 --- /dev/null +++ b/core/org.eclipse.cdt.ui/icons/elcl16/expandall.png diff --git a/core/org.eclipse.cdt.ui/icons/elcl16/expandall@2x.png b/core/org.eclipse.cdt.ui/icons/elcl16/expandall@2x.png Binary files differnew file mode 100644 index 00000000000..f7df654f0b4 --- /dev/null +++ b/core/org.eclipse.cdt.ui/icons/elcl16/expandall@2x.png diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginImages.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginImages.java index 68dc03f2e84..b69624affb1 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginImages.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginImages.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2013 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -14,6 +14,7 @@ * Dmitry Kozlov (CodeSourcery) * Tomasz Wesolowski * Andrew Gvozdev (Quoin Inc.) - moved usage involving registry to CDTSharedImages + * Marc-Andre Laperle (Ericsson) *******************************************************************************/ package org.eclipse.cdt.internal.ui; @@ -298,7 +299,8 @@ public class CPluginImages { public static final String IMG_MENU_GROUP_INCLUDE= NAME_PREFIX + "group_include.gif"; //$NON-NLS-1$ public static final String IMG_MENU_SEGMENT_EDIT= NAME_PREFIX + "segment_edit.gif"; //$NON-NLS-1$ public static final String IMG_MENU_CODE_ASSIST= NAME_PREFIX + "metharg_obj.gif"; //$NON-NLS-1$ - public static final String IMG_MENU_COLLAPSE_ALL= NAME_PREFIX + "collapseall.gif"; //$NON-NLS-1$ + public static final String IMG_MENU_COLLAPSE_ALL= NAME_PREFIX + "collapseall.png"; //$NON-NLS-1$ + public static final String IMG_MENU_EXPAND_ALL= NAME_PREFIX + "expandall.png"; //$NON-NLS-1$ public static final String IMG_CLEAR_CONSOLE= NAME_PREFIX + "clear_co.gif"; //$NON-NLS-1$ public static final String IMG_SCROLL_LOCK= NAME_PREFIX + "lock_co.gif"; //$NON-NLS-1$ public static final String IMG_ALPHA_SORTING= NAME_PREFIX + "alphab_sort_co.gif"; //$NON-NLS-1$ diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/ICHelpContextIds.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/ICHelpContextIds.java index a8ed36a6449..9e0d7868f99 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/ICHelpContextIds.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/ICHelpContextIds.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2013 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -10,6 +10,7 @@ * QNX Software System * Anton Leherbauer (Wind River Systems) * Sergey Prigogin (Google) + * Marc-Andre Laperle (Ericsson) *******************************************************************************/ package org.eclipse.cdt.internal.ui; @@ -104,6 +105,7 @@ public interface ICHelpContextIds { public static final String TOGGLE_TEXTHOVER_ACTION = PREFIX + "toggle_texthover_action_context"; //$NON-NLS-1$ public static final String COLLAPSE_ALL_ACTION = PREFIX + "collapse_all_action"; //$NON-NLS-1$ + public static final String EXPAND_ALL_ACTION = PREFIX + "expand_all_action"; //$NON-NLS-1$ public static final String C_SEARCH_PAGE = PREFIX + "cdt_u_search"; //$NON-NLS-1$ diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/ActionMessages.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/ActionMessages.java index c01f45a3c99..82c5a11fa5a 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/ActionMessages.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/ActionMessages.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2001, 2013 IBM Corporation and others. + * Copyright (c) 2001, 2015 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 @@ -8,6 +8,7 @@ * Contributors: * Rational Software - initial implementation * Sergey Prigogin (Google) + * Marc-Andre Laperle (Ericsson) *******************************************************************************/ package org.eclipse.cdt.internal.ui.actions; @@ -95,6 +96,9 @@ public class ActionMessages extends NLS { public static String CollapseAllAction_label; public static String CollapseAllAction_tooltip; public static String CollapseAllAction_description; + public static String ExpandAllAction_label; + public static String ExpandAllAction_tooltip; + public static String ExpandAllAction_description; static { // Initialize resource bundle. diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/ActionMessages.properties b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/ActionMessages.properties index 60cc631ac0c..fa2808c76ce 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/ActionMessages.properties +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/ActionMessages.properties @@ -1,5 +1,5 @@ ############################################################################### -# Copyright (c) 2000, 2013 IBM Corporation and others. +# Copyright (c) 2000, 2015 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 @@ -10,6 +10,7 @@ # Anton Leherbauer (Wind River Systems) # Axel Mueller - [289339] Surround with # Sergey Prigogin (Google) +# Marc-Andre Laperle (Ericsson) ############################################################################### SourceMenu_label=Source @@ -115,3 +116,7 @@ FormatAllAction_noundo_message='Undo' is not supported by this operation. Do you CollapseAllAction_label=Collapse All CollapseAllAction_tooltip=Collapse All CollapseAllAction_description=Collapse All + +ExpandAllAction_label=Expand All +ExpandAllAction_tooltip=Expand All +ExpandAllAction_description=Expand All diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/ExpandAllAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/ExpandAllAction.java new file mode 100644 index 00000000000..a34d6ed21fa --- /dev/null +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/ExpandAllAction.java @@ -0,0 +1,45 @@ +/******************************************************************************* + * Copyright (c) 2015 Ericsson 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: + * Marc-Andre Laperle (Ericsson) - initial API and implementation + *******************************************************************************/ +package org.eclipse.cdt.internal.ui.actions; + +import org.eclipse.jface.action.Action; +import org.eclipse.jface.viewers.TreeViewer; +import org.eclipse.ui.PlatformUI; + +import org.eclipse.cdt.internal.ui.CPluginImages; +import org.eclipse.cdt.internal.ui.ICHelpContextIds; + +/** + * Expand all nodes. + */ +public class ExpandAllAction extends Action { + + private final TreeViewer fViewer; + + public ExpandAllAction(TreeViewer viewer) { + super(ActionMessages.ExpandAllAction_label); + setDescription(ActionMessages.ExpandAllAction_description); + setToolTipText(ActionMessages.ExpandAllAction_tooltip); + CPluginImages.setImageDescriptors(this, CPluginImages.T_LCL, CPluginImages.IMG_MENU_EXPAND_ALL); + fViewer = viewer; + PlatformUI.getWorkbench().getHelpSystem().setHelp(this, ICHelpContextIds.EXPAND_ALL_ACTION); + } + + @Override + public void run() { + try { + fViewer.getControl().setRedraw(false); + fViewer.expandAll(); + } finally { + fViewer.getControl().setRedraw(true); + } + } +} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/includebrowser/IBViewPart.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/includebrowser/IBViewPart.java index 03f993550e0..f89ca3e3b1f 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/includebrowser/IBViewPart.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/includebrowser/IBViewPart.java @@ -9,6 +9,7 @@ * Markus Schorn - initial API and implementation * Ed Swartz (Nokia) * Martin Oberhuber (Wind River) - bug 398195: consider external API in IB + * Marc-Andre Laperle (Ericsson) *******************************************************************************/ package org.eclipse.cdt.internal.ui.includebrowser; @@ -101,7 +102,9 @@ import org.eclipse.cdt.ui.CUIPlugin; import org.eclipse.cdt.internal.ui.CPluginImages; import org.eclipse.cdt.internal.ui.ICHelpContextIds; +import org.eclipse.cdt.internal.ui.actions.CollapseAllAction; import org.eclipse.cdt.internal.ui.actions.CopyTreeAction; +import org.eclipse.cdt.internal.ui.actions.ExpandAllAction; import org.eclipse.cdt.internal.ui.navigator.OpenCElementAction; import org.eclipse.cdt.internal.ui.util.Messages; import org.eclipse.cdt.internal.ui.viewsupport.EditorOpener; @@ -627,6 +630,8 @@ public class IBViewPart extends ViewPart implements IShowInSource, IShowInTarget CPluginImages.setImageDescriptors(fRefreshAction, CPluginImages.T_LCL, CPluginImages.IMG_REFRESH); fHistoryAction= new IBHistoryDropDownAction(this); + ExpandAllAction expandAll = new ExpandAllAction(getTreeViewer()); + CollapseAllAction collapseAll = new CollapseAllAction(getTreeViewer()); fCopyAction= new CopyCallHierarchyAction(this, fTreeViewer); fRemoveFromViewAction= new IBRemoveFromView(this); @@ -647,6 +652,9 @@ public class IBViewPart extends ViewPart implements IShowInSource, IShowInTarget tm.add(fNextAction); tm.add(fPreviousAction); tm.add(new Separator()); + tm.add(expandAll); + tm.add(collapseAll); + tm.add(new Separator()); tm.add(fFilterSystemAction); tm.add(fFilterInactiveAction); tm.add(new Separator()); |