From 7eaabfe5576529b9b503f51cf4550c44bba0c18b Mon Sep 17 00:00:00 2001 From: Marc-Andre Laperle Date: Wed, 29 Apr 2015 01:54:18 -0400 Subject: [PATCH] Bug 463480 - [Include Browser] Add Expand all, Collapse all Change-Id: I00d6ca764fa1ecb408d8786f6a49d8d81a735ea7 Signed-off-by: Marc-Andre Laperle --- .../icons/dlcl16/collapseall.gif | Bin 157 -> 0 bytes .../icons/dlcl16/collapseall.png | Bin 0 -> 183 bytes .../icons/dlcl16/collapseall@2x.png | Bin 0 -> 255 bytes .../icons/dlcl16/expandall.png | Bin 0 -> 210 bytes .../icons/dlcl16/expandall@2x.png | Bin 0 -> 321 bytes .../icons/elcl16/collapseall.gif | Bin 157 -> 0 bytes .../icons/elcl16/collapseall.png | Bin 0 -> 201 bytes .../icons/elcl16/collapseall@2x.png | Bin 0 -> 334 bytes .../icons/elcl16/expandall.png | Bin 0 -> 229 bytes .../icons/elcl16/expandall@2x.png | Bin 0 -> 422 bytes .../cdt/internal/ui/CPluginImages.java | 6 ++- .../cdt/internal/ui/ICHelpContextIds.java | 4 +- .../internal/ui/actions/ActionMessages.java | 6 ++- .../ui/actions/ActionMessages.properties | 7 ++- .../internal/ui/actions/ExpandAllAction.java | 45 ++++++++++++++++++ .../ui/includebrowser/IBViewPart.java | 8 ++++ 16 files changed, 71 insertions(+), 5 deletions(-) delete mode 100644 core/org.eclipse.cdt.ui/icons/dlcl16/collapseall.gif create mode 100644 core/org.eclipse.cdt.ui/icons/dlcl16/collapseall.png create mode 100644 core/org.eclipse.cdt.ui/icons/dlcl16/collapseall@2x.png create mode 100644 core/org.eclipse.cdt.ui/icons/dlcl16/expandall.png create mode 100644 core/org.eclipse.cdt.ui/icons/dlcl16/expandall@2x.png delete mode 100644 core/org.eclipse.cdt.ui/icons/elcl16/collapseall.gif create mode 100644 core/org.eclipse.cdt.ui/icons/elcl16/collapseall.png create mode 100644 core/org.eclipse.cdt.ui/icons/elcl16/collapseall@2x.png create mode 100644 core/org.eclipse.cdt.ui/icons/elcl16/expandall.png create mode 100644 core/org.eclipse.cdt.ui/icons/elcl16/expandall@2x.png create mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/ExpandAllAction.java diff --git a/core/org.eclipse.cdt.ui/icons/dlcl16/collapseall.gif b/core/org.eclipse.cdt.ui/icons/dlcl16/collapseall.gif deleted file mode 100644 index a2d80a9044f38833cb728a69c88294ce3fd007c7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 157 zcmZ?wbhEHb6krfw*v!DtJ#F>UjfWZCs($|cfA#bKkH7!F`St(Z@BiQa{{Qv=|DXRL zz<>l4f3h$#FmN;IfW$y%FtB(Pob+71*X+evXI>YLE;&}Fj8#mRE%&W?B30shyu13% zpT6C#3k-fJGjKF52@24V6I?%GvcZa|)%y<^9(-F=IB9W`k6g3(YLhfsMh0sDZC^x! diff --git a/core/org.eclipse.cdt.ui/icons/dlcl16/collapseall.png b/core/org.eclipse.cdt.ui/icons/dlcl16/collapseall.png new file mode 100644 index 0000000000000000000000000000000000000000..a40ba4e199ae9ffa17d9877bd029ec0b3f5e796b GIT binary patch literal 183 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`b)GJcAr-gQUb5yopup3R=>OW+ zW~%uIAz4;-`2hLoRn7|+Y;=^ZGm@|~I$`lVN4<CpT#Nb%NwW?bp8Qei$MH&t} zQ@FOg+{^y_&W2xQlN%(IuWe;rGUXqmB8wDfhWHiN4cE#hHV801nX~bj!)xv-K^v+b hyye*NML4{gVVmX3@Rw`%X8~Qp;OXk;vd$@?2>_kGLQntz literal 0 HcmV?d00001 diff --git a/core/org.eclipse.cdt.ui/icons/dlcl16/collapseall@2x.png b/core/org.eclipse.cdt.ui/icons/dlcl16/collapseall@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..f6921e99e1aebd0f3f519e4ee7b9857f62b4b4ad GIT binary patch literal 255 zcmV!OW;sF!~Xxlbl zQGEboOzygl9T|Xwt+l!DdsZv}PN0;!r1}77y%S^r*3LQhJHY~A9YV<7dva{RFbp}y zNbWR1N{Q41s0)Bmyaz}rNzL=TRX+faU>wKoc48aD=}6djnkGH~g9remwLUz8vG3P& zU=P3=09?tkETrlIy!!-L*OgTHfPD|(_D{0n0Du2)_yXR7tYyR~ozDOO002ovPDHLk FV1nV@XTSge literal 0 HcmV?d00001 diff --git a/core/org.eclipse.cdt.ui/icons/dlcl16/expandall.png b/core/org.eclipse.cdt.ui/icons/dlcl16/expandall.png new file mode 100644 index 0000000000000000000000000000000000000000..fcdfcbd6365307f83b484e77a16a4d27fb0dcae7 GIT binary patch literal 210 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Gd*1#Ln>~qofOT*tjOaUyVkle zRBze*rY8Os{r1^T##62pUU_-^Aj{*AN=D}_cQgNgz zQ&nOa*WCO4YL0V@fIIJ&z0ap89P4OkcxB$7+PL-Gi(s$oOco`_rZ5O?aoi)xCz-r~ zZ5fMV%dBFz7lJGEzp%1!dTDZSuE_txwQq6_msJmIw0+@p@%j35jX7GUR|6f%;OXk; Jvd$@?2>=j@O`QM$ literal 0 HcmV?d00001 diff --git a/core/org.eclipse.cdt.ui/icons/dlcl16/expandall@2x.png b/core/org.eclipse.cdt.ui/icons/dlcl16/expandall@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..5795bb4ef3cae63903ed874724f3768b9879c857 GIT binary patch literal 321 zcmV-H0lxl;P)x5H z$5^1MD%mv63=&w1>6|9e_x%JC=(UjfWZCs($|cfA#bKkH7!F`St(Z@BiQa{{Qv=|DXRL zz<>l4f3h$#FmN;IfW$y%FtB(Pob+71*X+evXI>YLE;&}Fj8#mRE%&W?B30shyu13% zpT6C#3k-fJGjKF52@24V6I?%GvcZa|)%y<^9(-F=IB9W`k6g3(YLhfsMh0sDZC^x! diff --git a/core/org.eclipse.cdt.ui/icons/elcl16/collapseall.png b/core/org.eclipse.cdt.ui/icons/elcl16/collapseall.png new file mode 100644 index 0000000000000000000000000000000000000000..000891dc5e083ec786835501e26b91112f0639d9 GIT binary patch literal 201 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`6FglULn>}1CrFqi-2A2dzw@XC zuf^|g|NkG>|CqdotwE&3Kib#iSSEv^-ob2!j=B#||NpO^U-&@(|9%0J2X+@4zV9!1 z^t*-k$FKkYkKecWAg{!eP_p_^=YE0Y1I!D!8@T@8|Jl;nY4kwxLPLIiVbUA627@yV z?)U%w|NoI+{g?>@+XUVpUxBQAhDgncF$@g(hh;t%-`w;N=r#sVS3j3^P6&O>oB9&7=68(u7cSfEm^zoh&DWSxmjfc_02IujQEOt1iA zf$<(-w4=ucjBJ3JLoXY^ya%WVnBzhlpB4)s{t*?oKu3TX(2@q&2DI1!4FL-TSOKj} z03`{)&&5)i)b0pT9|PF<^P)vPb&?@4>Lf#epP2>rwKSQ|-t%V`HV7C3POZd%&R>}@a0be&#K5NN z*X1n&;Fnz47$Bn)&_--4!PbS$xhNnfpt(y7?CO3^eFiiJ4h?YWB)tV)QzrO9G0=9- f{J>BD#JA%C6dee?TMagl00000NkvXXu0mjfTA^Fh literal 0 HcmV?d00001 diff --git a/core/org.eclipse.cdt.ui/icons/elcl16/expandall@2x.png b/core/org.eclipse.cdt.ui/icons/elcl16/expandall@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..f7df654f0b402ee30552013e1194bdef89cdfe01 GIT binary patch literal 422 zcmV;X0a^ZuP)f;?a?Na-JFsdSueJF+`lh;`Q@hE2W~e(mg+ z?sRCUb6AJP*6Ghu!$?3b(AtswS%KDiLKe7}1d5&r zTIh*w0;0em2Iz%4N5>}xb(xH@KraFqEp$krE|X~{;Ohbo3cO;W=~9IRycA#<>p5X0 zAfAYW#a$HeGZhkeM!`!@&k1V+vrL5q9)q&mc}^G$^ikjq1%gb43-Fw1B+%so{(7UP zgdb3_Gl2*4qx;x!PeBQ7bX!eK`kioa2E3;h1O}CWi(HS_BbEdt<807*qoM6N<$f=$M?asU7T literal 0 HcmV?d00001 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());