From 7a1f792fe6a4780bc309b94ddba65d9b41a96fd7 Mon Sep 17 00:00:00 2001 From: Bogdan Gheorghe Date: Tue, 29 Mar 2005 21:40:34 +0000 Subject: [PATCH] Patch for Devin Steffler: Initial IndexViewer patch --- .../icons/dom_view/brkpd_obj.gif | Bin 0 -> 136 bytes .../icons/dom_view/cdeclaration_obj.gif | Bin 0 -> 146 bytes .../icons/dom_view/clear.gif | Bin 0 -> 851 bytes .../icons/dom_view/collapseall.gif | Bin 0 -> 157 bytes .../icons/dom_view/define_obj.gif | Bin 0 -> 109 bytes .../icons/dom_view/disassembly.gif | Bin 0 -> 158 bytes .../icons/dom_view/enumerator_obj.gif | Bin 0 -> 853 bytes .../icons/dom_view/expandall.gif | Bin 0 -> 165 bytes .../icons/dom_view/expression_obj.gif | Bin 0 -> 909 bytes .../icons/dom_view/jump_co.gif | Bin 0 -> 92 bytes .../icons/dom_view/method_public_obj.gif | Bin 0 -> 97 bytes .../icons/dom_view/output_obj.gif | Bin 0 -> 161 bytes .../icons/dom_view/search_ref_obj.gif | Bin 0 -> 151 bytes .../icons/dom_view/showasarray_co.gif | Bin 0 -> 117 bytes .../icons/dom_view/source_attach_attrib.gif | Bin 0 -> 157 bytes .../icons/dom_view/statement_obj.gif | Bin 0 -> 891 bytes .../icons/dom_view/tnames_co.gif | Bin 0 -> 101 bytes .../icons/dom_view/types.gif | Bin 0 -> 364 bytes .../icons/dom_view/var_declaration_obj.gif | Bin 0 -> 895 bytes .../icons/dom_view/var_pointer.gif | Bin 0 -> 130 bytes .../icons/dom_view/var_simple.gif | Bin 0 -> 132 bytes .../icons/dom_view/variable_local_obj.gif | Bin 0 -> 94 bytes .../icons/dom_view/variable_obj.gif | Bin 0 -> 78 bytes .../icons/dom_view/warning_obj.gif | Bin 0 -> 139 bytes .../icons/dom_view/watch_globals.gif | Bin 0 -> 105 bytes .../icons/indexer_view/class_obj.gif | Bin 0 -> 160 bytes .../icons/indexer_view/constructor_obj.gif | Bin 0 -> 92 bytes .../indexer_view/constructor_ref_obj.GIF | Bin 0 -> 838 bytes .../icons/indexer_view/derived.gif | Bin 0 -> 868 bytes .../icons/indexer_view/enum_obj.gif | Bin 0 -> 174 bytes .../icons/indexer_view/enumerator_obj.gif | Bin 0 -> 853 bytes .../icons/indexer_view/enumerator_ref_obj.GIF | Bin 0 -> 836 bytes .../icons/indexer_view/field_obj.gif | Bin 0 -> 76 bytes .../icons/indexer_view/field_ref_obj.GIF | Bin 0 -> 837 bytes .../icons/indexer_view/filterbutton.gif | Bin 0 -> 960 bytes .../icons/indexer_view/friend.gif | Bin 0 -> 172 bytes .../icons/indexer_view/function_obj.gif | Bin 0 -> 849 bytes .../icons/indexer_view/function_ref_obj.GIF | Bin 0 -> 838 bytes .../icons/indexer_view/fwd_class.gif | Bin 0 -> 888 bytes .../icons/indexer_view/fwd_struct.GIF | Bin 0 -> 896 bytes .../icons/indexer_view/fwd_union.GIF | Bin 0 -> 906 bytes .../icons/indexer_view/include_obj.gif | Bin 0 -> 114 bytes .../icons/indexer_view/macroDecl_obj.gif | Bin 0 -> 109 bytes .../icons/indexer_view/method_public_obj.gif | Bin 0 -> 97 bytes .../indexer_view/method_public_ref_obj.GIF | Bin 0 -> 846 bytes .../icons/indexer_view/namespace_obj.gif | Bin 0 -> 173 bytes .../icons/indexer_view/namespace_ref_obj.GIF | Bin 0 -> 889 bytes .../icons/indexer_view/ngback.gif | Bin 0 -> 222 bytes .../icons/indexer_view/ngnext.gif | Bin 0 -> 223 bytes .../icons/indexer_view/ref_obj.gif | Bin 0 -> 88 bytes .../icons/indexer_view/struct_obj.gif | Bin 0 -> 133 bytes .../icons/indexer_view/super_co.gif | Bin 0 -> 208 bytes .../icons/indexer_view/typedecl_obj.gif | Bin 0 -> 910 bytes .../icons/indexer_view/typedecl_ref_obj.GIF | Bin 0 -> 871 bytes .../icons/indexer_view/typedef_obj.gif | Bin 0 -> 159 bytes .../icons/indexer_view/union_obj.gif | Bin 0 -> 173 bytes .../icons/indexer_view/variable_obj.gif | Bin 0 -> 132 bytes .../icons/indexer_view/warning_icon.gif | Bin 0 -> 139 bytes core/org.eclipse.cdt.ui.tests/plugin.xml | 39 +- .../DOMAST/CPPPopulateASTViewAction.java | 20 +- .../tests/DOMAST/CPopulateASTViewAction.java | 20 +- .../eclipse/cdt/ui/tests/DOMAST/DOMAST.java | 121 +-- .../{TreeObject.java => DOMASTNodeLeaf.java} | 16 +- ...{TreeParent.java => DOMASTNodeParent.java} | 76 +- .../ui/tests/DOMAST/DOMASTPluginImages.java | 2 +- .../ui/tests/DOMAST/FindIASTNameTarget.java | 26 +- .../tests/DOMAST/IPopulateDOMASTAction.java | 2 +- .../tests/DOMAST/IncludeStatementFilter.java | 6 +- .../ui/tests/DOMAST/OpenDOMViewAction.java | 3 +- .../ui/tests/DOMAST/PreprocessorFilter.java | 6 +- .../ui/tests/DOMAST/ProblemHolderFilter.java | 6 +- .../ui/tests/DOMAST/ShowInDOMViewAction.java | 2 +- .../IndexerView/FilterIndexerViewDialog.java | 846 ++++++++++++++++++ .../IndexerView/IndexerFilterManager.java | 51 ++ .../ui/tests/IndexerView/IndexerNodeLeaf.java | 278 ++++++ .../tests/IndexerView/IndexerNodeParent.java | 177 ++++ .../cdt/ui/tests/IndexerView/IndexerView.java | 525 +++++++++++ .../IndexerView/IndexerViewPluginImages.java | 149 +++ .../IndexerView/OpenIndexerViewAction.java | 82 ++ 79 files changed, 2291 insertions(+), 162 deletions(-) create mode 100644 core/org.eclipse.cdt.ui.tests/icons/dom_view/brkpd_obj.gif create mode 100644 core/org.eclipse.cdt.ui.tests/icons/dom_view/cdeclaration_obj.gif create mode 100644 core/org.eclipse.cdt.ui.tests/icons/dom_view/clear.gif create mode 100644 core/org.eclipse.cdt.ui.tests/icons/dom_view/collapseall.gif create mode 100644 core/org.eclipse.cdt.ui.tests/icons/dom_view/define_obj.gif create mode 100644 core/org.eclipse.cdt.ui.tests/icons/dom_view/disassembly.gif create mode 100644 core/org.eclipse.cdt.ui.tests/icons/dom_view/enumerator_obj.gif create mode 100644 core/org.eclipse.cdt.ui.tests/icons/dom_view/expandall.gif create mode 100644 core/org.eclipse.cdt.ui.tests/icons/dom_view/expression_obj.gif create mode 100644 core/org.eclipse.cdt.ui.tests/icons/dom_view/jump_co.gif create mode 100644 core/org.eclipse.cdt.ui.tests/icons/dom_view/method_public_obj.gif create mode 100644 core/org.eclipse.cdt.ui.tests/icons/dom_view/output_obj.gif create mode 100644 core/org.eclipse.cdt.ui.tests/icons/dom_view/search_ref_obj.gif create mode 100644 core/org.eclipse.cdt.ui.tests/icons/dom_view/showasarray_co.gif create mode 100644 core/org.eclipse.cdt.ui.tests/icons/dom_view/source_attach_attrib.gif create mode 100644 core/org.eclipse.cdt.ui.tests/icons/dom_view/statement_obj.gif create mode 100644 core/org.eclipse.cdt.ui.tests/icons/dom_view/tnames_co.gif create mode 100644 core/org.eclipse.cdt.ui.tests/icons/dom_view/types.gif create mode 100644 core/org.eclipse.cdt.ui.tests/icons/dom_view/var_declaration_obj.gif create mode 100644 core/org.eclipse.cdt.ui.tests/icons/dom_view/var_pointer.gif create mode 100644 core/org.eclipse.cdt.ui.tests/icons/dom_view/var_simple.gif create mode 100644 core/org.eclipse.cdt.ui.tests/icons/dom_view/variable_local_obj.gif create mode 100644 core/org.eclipse.cdt.ui.tests/icons/dom_view/variable_obj.gif create mode 100644 core/org.eclipse.cdt.ui.tests/icons/dom_view/warning_obj.gif create mode 100644 core/org.eclipse.cdt.ui.tests/icons/dom_view/watch_globals.gif create mode 100644 core/org.eclipse.cdt.ui.tests/icons/indexer_view/class_obj.gif create mode 100644 core/org.eclipse.cdt.ui.tests/icons/indexer_view/constructor_obj.gif create mode 100644 core/org.eclipse.cdt.ui.tests/icons/indexer_view/constructor_ref_obj.GIF create mode 100644 core/org.eclipse.cdt.ui.tests/icons/indexer_view/derived.gif create mode 100644 core/org.eclipse.cdt.ui.tests/icons/indexer_view/enum_obj.gif create mode 100644 core/org.eclipse.cdt.ui.tests/icons/indexer_view/enumerator_obj.gif create mode 100644 core/org.eclipse.cdt.ui.tests/icons/indexer_view/enumerator_ref_obj.GIF create mode 100644 core/org.eclipse.cdt.ui.tests/icons/indexer_view/field_obj.gif create mode 100644 core/org.eclipse.cdt.ui.tests/icons/indexer_view/field_ref_obj.GIF create mode 100644 core/org.eclipse.cdt.ui.tests/icons/indexer_view/filterbutton.gif create mode 100644 core/org.eclipse.cdt.ui.tests/icons/indexer_view/friend.gif create mode 100644 core/org.eclipse.cdt.ui.tests/icons/indexer_view/function_obj.gif create mode 100644 core/org.eclipse.cdt.ui.tests/icons/indexer_view/function_ref_obj.GIF create mode 100644 core/org.eclipse.cdt.ui.tests/icons/indexer_view/fwd_class.gif create mode 100644 core/org.eclipse.cdt.ui.tests/icons/indexer_view/fwd_struct.GIF create mode 100644 core/org.eclipse.cdt.ui.tests/icons/indexer_view/fwd_union.GIF create mode 100644 core/org.eclipse.cdt.ui.tests/icons/indexer_view/include_obj.gif create mode 100644 core/org.eclipse.cdt.ui.tests/icons/indexer_view/macroDecl_obj.gif create mode 100644 core/org.eclipse.cdt.ui.tests/icons/indexer_view/method_public_obj.gif create mode 100644 core/org.eclipse.cdt.ui.tests/icons/indexer_view/method_public_ref_obj.GIF create mode 100644 core/org.eclipse.cdt.ui.tests/icons/indexer_view/namespace_obj.gif create mode 100644 core/org.eclipse.cdt.ui.tests/icons/indexer_view/namespace_ref_obj.GIF create mode 100644 core/org.eclipse.cdt.ui.tests/icons/indexer_view/ngback.gif create mode 100644 core/org.eclipse.cdt.ui.tests/icons/indexer_view/ngnext.gif create mode 100644 core/org.eclipse.cdt.ui.tests/icons/indexer_view/ref_obj.gif create mode 100644 core/org.eclipse.cdt.ui.tests/icons/indexer_view/struct_obj.gif create mode 100644 core/org.eclipse.cdt.ui.tests/icons/indexer_view/super_co.gif create mode 100644 core/org.eclipse.cdt.ui.tests/icons/indexer_view/typedecl_obj.gif create mode 100644 core/org.eclipse.cdt.ui.tests/icons/indexer_view/typedecl_ref_obj.GIF create mode 100644 core/org.eclipse.cdt.ui.tests/icons/indexer_view/typedef_obj.gif create mode 100644 core/org.eclipse.cdt.ui.tests/icons/indexer_view/union_obj.gif create mode 100644 core/org.eclipse.cdt.ui.tests/icons/indexer_view/variable_obj.gif create mode 100644 core/org.eclipse.cdt.ui.tests/icons/indexer_view/warning_icon.gif rename core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/{TreeObject.java => DOMASTNodeLeaf.java} (98%) rename core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/{TreeParent.java => DOMASTNodeParent.java} (72%) create mode 100644 core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/IndexerView/FilterIndexerViewDialog.java create mode 100644 core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/IndexerView/IndexerFilterManager.java create mode 100644 core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/IndexerView/IndexerNodeLeaf.java create mode 100644 core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/IndexerView/IndexerNodeParent.java create mode 100644 core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/IndexerView/IndexerView.java create mode 100644 core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/IndexerView/IndexerViewPluginImages.java create mode 100644 core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/IndexerView/OpenIndexerViewAction.java diff --git a/core/org.eclipse.cdt.ui.tests/icons/dom_view/brkpd_obj.gif b/core/org.eclipse.cdt.ui.tests/icons/dom_view/brkpd_obj.gif new file mode 100644 index 0000000000000000000000000000000000000000..8e8cac5a9d73096ef89b348f0db1a46dfc3758ab GIT binary patch literal 136 zcmZ?wbhEHb6krfw*!-X2z<~n`7A%=RzkdJz`SyN z{$ycfVBliV0SSZ5U|_KiIO(~1uSK%aFNMf(8TX5^GL;f6iVD{Z*5#@nQ8~@))bM&+ j+?s&LoDAE!($y{45)2y!1w2w>8V`6Mep{t4$Y2cs5SBFV literal 0 HcmV?d00001 diff --git a/core/org.eclipse.cdt.ui.tests/icons/dom_view/clear.gif b/core/org.eclipse.cdt.ui.tests/icons/dom_view/clear.gif new file mode 100644 index 0000000000000000000000000000000000000000..ffb59e4ebec0271cd86feaf3b8a62cb13f3ea2a1 GIT binary patch literal 851 zcmZ?wbhEHb6krfw_|Cv^;J|?e3zp2EU%!9<{QLL!|Ns5r|NsB<=g)6wXo!!GXBY*e zAuy~%KnLVIP+nl*uwY>1knz~?z=4@VSj(lNV4-sxgPfg+#zn=WU0nJ}EjtVs9_y7i ZY+GXylytIF&{`@(mu% zfq~g5W7nO325t^*3&q-$&b+%2z|!Vn<+^I!IfY&8f6sXOV@<`yV}F!y?7zH*VTGvb Mi6xgNGB8*J0C!U>{{R30 literal 0 HcmV?d00001 diff --git a/core/org.eclipse.cdt.ui.tests/icons/dom_view/disassembly.gif b/core/org.eclipse.cdt.ui.tests/icons/dom_view/disassembly.gif new file mode 100644 index 0000000000000000000000000000000000000000..dbde1a090aa5f9a31893f9e805250b461735fb18 GIT binary patch literal 158 zcmZ?wbhEHb6krfw_{_j?|Ni~cr%zwJc=71bqsNaQZ*6V8bLY;aNt5#O@_g z%qb`+V1NO|pDc_Zwho8@nc>XhEpWo~waqaem5tAYniY8}?5XMiaQXxZd3y9!Sb%vZdHK+*Ioa zXr)V$jyGiJn!R=rQH;O)AA~oTyL;|=o_n+RZg=PP`@Zz$msE7^)3rxO)^(S}?d6vr zcT_}F#6(;qM6xnfQ4@915X~x@ikX;;g;-XvtGJ1~c!+0>hDw-(ON2y%B&m`n>5?Hy z0yfZKF-&*Xo(fZS)lkh^OJ=6#YN3|Jf})$ctA~0PDSE>+Tq86Rj*M!WrfY^KTVV|t zq+tmyYAgmDXs{U05>z?iW?`14kF{j(=3$;C7Zw!5Ey5yE4=H*r-7+kZhab>n8avPr z2^7K_Fi69aR(P-&Y@or)a<0ncM7U=ei9XhnMR+8>A{Q1EJ;M_paT){QMLR~L7Ax@s znoMH{oDhscSOW%WCZPon7K06R)`_Z{GC7f43?tFUTC&Kj1Ge)Qi+0hvXFF1nYQEQb zo0Y|}xl`9}f{Sv~P{(hyNUjfWZCs($|cfA#bKkH7!F`St(Z@BiQa{{Qv=|DXTp zK=CIFBLf3JgAM}_fXrZE3Hor-bM;=c7iXP$T{ODnSeY_bFP3^5CaqQ2aIt@?jB`H& GgEas@e^x^P literal 0 HcmV?d00001 diff --git a/core/org.eclipse.cdt.ui.tests/icons/dom_view/expression_obj.gif b/core/org.eclipse.cdt.ui.tests/icons/dom_view/expression_obj.gif new file mode 100644 index 0000000000000000000000000000000000000000..870df5c473a5a04c8c019ca86d621a28c2236c0f GIT binary patch literal 909 zcmZ8gT}V@57=HG1bdE6H+!z&gj9rYX) zbRi+mi-_)$5|VCO{y^kSH^I6{D@-LLOkufItoQwNYQ1p2_vd-u@4V0Vol{+V(o=TP zjy(JX(&_Z<>`Ss}G^%M@AP^`o4;W$8K?jM_y4_k3f*WmUN9$&}5M`2G;am{Wd>>95 zEQlD)Fl;awAN*y(=v)?Wis15}oAbKeP$(WgaUS3GX4!8Xv*W5ETXr!~?^zI$;zcoY zJ0S{Wb!#a~THr#?W}%Mqj%+J_%&iH)DiO}(16DW*V;f0Z@Ni#Jc;iVyy3=_n3v#Oy zf_Y(z*)-{`sH8ZI>uC1b$eZ->al6EM$@Ke)+fkPgHHsDe6t9uSj9u8+Z%7ZRExvRP z4!2Fhthbt?OpPdT5WoHSqBy0_h)IfzClVrdEhXIKy^)kyo?L%_&zCjfAza(BrPWFO zoU^f}cl8P3p;@+T{Y~}Etb7k9;_?{`Q~ki}WqD@Y&+p0H6X!lO!H)*=XQd9eoE*4J zeGcrBXIk}qRk+@)$}{DA8#Md=*+-?Cf90s_)=EtGzb6PoypVmQg9wH@I)hzZ?VPuS z+-)jtSWZv>!39x6nx47VXEnhH2i1Aj$DK7y$DygMJ2Kv@lzF7YCTBTJ*b?zrGjp{K zyf8_hI?O2IBL5R!QwX*_>aZ5mDW?3rjRPZ}x_ixvsVP3Pe_WSclG}Xetyc+o?|X7ATIq*waVT4{}OdtD3xpukNe$cI|zaI(66Go%j|Wou4!uQ9fT8 SJM*=%&;KO!;YF#6V}AkPPywv~ literal 0 HcmV?d00001 diff --git a/core/org.eclipse.cdt.ui.tests/icons/dom_view/jump_co.gif b/core/org.eclipse.cdt.ui.tests/icons/dom_view/jump_co.gif new file mode 100644 index 0000000000000000000000000000000000000000..0107e2ecc6c52dc341e7023e00f567702a04f215 GIT binary patch literal 92 zcmZ?wbhEHb6krfw_{hNU|NsB}`}fbEKc9htLGdRGBamXy0TCd1Mkd{seoo^v+;y!{D^0dnbH&uXw<`X$wKFkT0{~MoAm0E0 literal 0 HcmV?d00001 diff --git a/core/org.eclipse.cdt.ui.tests/icons/dom_view/method_public_obj.gif b/core/org.eclipse.cdt.ui.tests/icons/dom_view/method_public_obj.gif new file mode 100644 index 0000000000000000000000000000000000000000..18103b11fc7ea74276adbc2cad5252b670854661 GIT binary patch literal 97 zcmZ?wbhEHb6krfwSj50!UvF<8Z(lz@e*XUW|Ns9pz<}aU7DfgJ76u)V07xwZvzo`Q sJO2z$oorwg?y+^caz~+p|3vSEoeNVnHu!(omm+eF&jq`afn{e6nZ5n-= zVOobRa-9}j3ezw?t6?T{pupin4VO!!fgn$ZTjVB#jDR^8o-}5yO%UwJ6>SzRKgqbx NU5R7P^%)!t)&LQoKra9Q literal 0 HcmV?d00001 diff --git a/core/org.eclipse.cdt.ui.tests/icons/dom_view/search_ref_obj.gif b/core/org.eclipse.cdt.ui.tests/icons/dom_view/search_ref_obj.gif new file mode 100644 index 0000000000000000000000000000000000000000..1b0c43bc1ee15f1379b5534101a8dbf6770e007d GIT binary patch literal 151 zcmZ?wbhEHb6krfw*v!CSZy$gE{{H{>=l}oz|G&=4OV4-^G*L6R6i@h1x-0|N(x z4oC)M1_O(iz)4SSU5jMxZV815i5S5)xyYH!4N@O&H63SUd*yQGc|$mh_}XWuJ4e5Crl#P!$3L~WW0y%fhuW6GLV?;B7T~ODAGt{6a!F$XA9EB09P9{j1;N!b!N2xvtel{hYJ0 zrVsTo;iOqMYF(y!YF2&+9dUUFgH$hm6_q>Ve*RACojCX4B)n)Oe@yCd$jO0L>N6ux z?$rHwQP^KE%ANAN_3J(V++(4dccI*VWno zzW`k`RHOH_N@G5B*#*b@Myx}7He0Q??B1^v-C5SHO~Io@FM9F{AHCC^`||QyL4Eb| zaPQ#Lo{X{w{U6^Jz3D63cDL0Pu)6P*AK8^z?6);sckldEclxH~{eAcCgO~CQ*!veZ C$NWM7 literal 0 HcmV?d00001 diff --git a/core/org.eclipse.cdt.ui.tests/icons/dom_view/tnames_co.gif b/core/org.eclipse.cdt.ui.tests/icons/dom_view/tnames_co.gif new file mode 100644 index 0000000000000000000000000000000000000000..764201b3783df9638e21fffc6ef74fa7b8b96c5c GIT binary patch literal 101 zcmZ?wbhEHb6krfwn8?7efB*jZ^XLEn|DS<@LGdRGBLf2ygAR}llobH7&8GBs3M@F~ zB=AO3b7r;V`{ynWEs2LjBA;i4aYoI0f3qUS%~Wia(q;Z77gg3Md@O${sK4>qLIwtF E0D<}>KL7v# literal 0 HcmV?d00001 diff --git a/core/org.eclipse.cdt.ui.tests/icons/dom_view/types.gif b/core/org.eclipse.cdt.ui.tests/icons/dom_view/types.gif new file mode 100644 index 0000000000000000000000000000000000000000..5ba5b91c5bb2b2a14f7610128ee4b3daf27dea13 GIT binary patch literal 364 zcmZ?wbhEHb6krfwxXQq=Z~MNs%GJdwODeLL^)#&w^O%|$v#`2gLu&N=y0SG(=ACgU zS>alyXdyNuDP_;d1|QtocIZcXFGQK zx=#;qpC0G|MAHKO=ZE^w3$0pPP_+h#3Rj-!`Tzev1NDI7PZmZ71~mp9kdYuiF|c(y zOfK-y;nSD&erCiXz{b+>AxSe**XMx4L0Jz&3`}a}nm@U(K^@ rxf-v~rcJ!-)p!JU?&R6VBe;M6p7p}qe8;%g9p>R)yX~BlBZD;ng)eNk literal 0 HcmV?d00001 diff --git a/core/org.eclipse.cdt.ui.tests/icons/dom_view/var_declaration_obj.gif b/core/org.eclipse.cdt.ui.tests/icons/dom_view/var_declaration_obj.gif new file mode 100644 index 0000000000000000000000000000000000000000..74a3d222c700233db61a466ee8c7e313384d1a20 GIT binary patch literal 895 zcmW-gu}jqf5XbL@q=wNG8ZsJsMiNJxOW~klRK^=xZV*}|kfsPBaJwHwv>4cEG&rQg z(GdOvN;HHx)eR1_eMMbmzo_R)|v z%^vY%Z+rikiinDsh>L_sR;DUyqAnVuSw&MZ6LYZ;%j$I%H*psa@vPBM36pS%kVudu zRnjC~G9*dB1{y4e>CW0yVXCegs#$Bv%+y>h)UsGmbW?ZrP|qSoZ#b5&s7QcmdxEe%(LXef?~KuSS0EpMX#k>h9&aw z1DZ@@2l^p_LRbR^X;{(<4;F(BG+0^ARhgU!_bemP$6B%okHlBx!h)h_c;X{YV*tEp z$7s}IC4NAYY3zU#f>8)-z#z>ewBW&Fuz}7xQFT)$Cz6X{B>GrO7MXRx_WZ@7y=dLD zJyMZseXsMjRu;$Bow{}_xG1+8>i8|KQqXP!n%99VVIG>=RWddbJ_u$~*@bK{H=;-9+Wbo&BbMr&fGy~q{ zfehLQPrebo)1glNe6!y4`cKS_JeI-el?R`$-dP>|?9IvOx27{U_V4BJh4*vMFJ3=) zSH{0KtC!~=e!TIhH~;$V_}2Ol$RF8}}l literal 0 HcmV?d00001 diff --git a/core/org.eclipse.cdt.ui.tests/icons/dom_view/var_pointer.gif b/core/org.eclipse.cdt.ui.tests/icons/dom_view/var_pointer.gif new file mode 100644 index 0000000000000000000000000000000000000000..ca17bd232f6a62b6165aea4fa991d043477cefa6 GIT binary patch literal 130 zcmZ?wbhEHb6krfw*v!E2|NsA!Cr@tLv}yI~)e|R9?CI$#EG*2=&(F)ti;s`@_4W1k z_BJ#$R99DL04rAf$->CMz|Wuq+Z^fq|1j2P6(MgMr1+;H2m3y%y1js`aB4*iIDkI8;bDb;r3J*rh46`Y literal 0 HcmV?d00001 diff --git a/core/org.eclipse.cdt.ui.tests/icons/dom_view/variable_local_obj.gif b/core/org.eclipse.cdt.ui.tests/icons/dom_view/variable_local_obj.gif new file mode 100644 index 0000000000000000000000000000000000000000..461c4e79feb00ab7c2bab383f9aeec420965a8c7 GIT binary patch literal 94 zcmZ?wbhEHb6krfwSj50!AHP4oe*gUa`}g19{~rt(z(DaQ3nK#qD}xS*2U5$xtQfKD o&Od`wo~kQYJFMLm4jM4JoOEn<%TZ$4^P%%>Nv=32gEcP~02SsRhyVZp literal 0 HcmV?d00001 diff --git a/core/org.eclipse.cdt.ui.tests/icons/dom_view/variable_obj.gif b/core/org.eclipse.cdt.ui.tests/icons/dom_view/variable_obj.gif new file mode 100644 index 0000000000000000000000000000000000000000..9fa6383efc9643aedb381e95db802a0f0b40e8f6 GIT binary patch literal 78 zcmZ?wbhEHb6krfwn8?6jAHUx|zTSTR{{R2~EB<6*WME)s&|v@qkURsE?416Ur{D5R ga|m)c&OiF=-kF^FPbw3HmSjn7efL^~!J3x~0I2L55dZ)H literal 0 HcmV?d00001 diff --git a/core/org.eclipse.cdt.ui.tests/icons/dom_view/warning_obj.gif b/core/org.eclipse.cdt.ui.tests/icons/dom_view/warning_obj.gif new file mode 100644 index 0000000000000000000000000000000000000000..cf8d571833dcf0457fad44f638d981f28d43eee2 GIT binary patch literal 139 zcmZ?wbhEHb6krfw*v!E2|9|}b`}_ajx4*yN{{Q{>{qybr@3)^{Zyz5Y&j6DB4E wv%!(en n?))=2b+cuG3q!%udof=c9~$Q!RA_p+Wb2d#NhP_#oD9|gRY@QJ literal 0 HcmV?d00001 diff --git a/core/org.eclipse.cdt.ui.tests/icons/indexer_view/constructor_ref_obj.GIF b/core/org.eclipse.cdt.ui.tests/icons/indexer_view/constructor_ref_obj.GIF new file mode 100644 index 0000000000000000000000000000000000000000..9d9ff7347481f2441fd54cbfae35cda188831d41 GIT binary patch literal 838 zcmZ?wbhEHb6krfw_|Cxa|9<`d{r3Co?d#+1|NsBbFbYOPU?hcr4#=~hyuiSr&A`ba vT6o0MVhcr9ER2YfLNHj|8Szfj2th2;Y3$M{X@pclP{fqsut;%N zq+GBGR)N0?Hm0x$*rXD+T)Phod47L0JO<`5ZyxjL(}(Y~FEPUCf)D^K%Yrdp*LB-A zN-1NEb1sCCQfjS@G1gk=TnHh?m{Q6)mr`o2t+n3!obx!2J?GiGRjQ|CIge8AN_r{0 z;8}7`wxFfm(9B_H2#SvkU0Ob~ok8xJR{ht4Ozv{tYO!e zB&wym-m2Mlg?EW&uO-^-b<{Me_3)eJxZ5>KT=fzKI(NNW>gC#NF3Clwf|ZIb&d6R< zj@B6gUBlUe*GevBm!qqkFu=t*OUMS$&$CL&TJr!YMwOBRxW+;##UT&?(He`9ltN=% z0f=+hd)zxNWdT5auz8qyh?MDZ#=NT#sZFbi*wv+gwS}cq@8DdM1(MEJEXbn<^SoTz z81r%&R}*6x@7oF5c@y*PB4b_JvGRF<3yEh4F^$A?4kjF-t_KoS%#}NwslEeIvSiV?*cFPXP& z1UWn(&IHA+B{lL9*|aPLRwPwr?N-<-YFleI*SGi}o#k2*-byXXR}-Rf&Bnm42lKG; zQEH+hQjQS1xw+Z?efBya^!6>>cH+6^L-gPCuYB_BlLu&d>8;Pd`{wCK{)N}x32)Nv zOA6~uBU;gXGzkmPnjnBUL`j>lOwa53~YyPJ{pZxLtojd4*{{aCC BoudE% literal 0 HcmV?d00001 diff --git a/core/org.eclipse.cdt.ui.tests/icons/indexer_view/enum_obj.gif b/core/org.eclipse.cdt.ui.tests/icons/indexer_view/enum_obj.gif new file mode 100644 index 0000000000000000000000000000000000000000..4a77d8cf1157b55b32c6710c4fbd968c1d6ef020 GIT binary patch literal 174 zcmV;f08#%(Nk%w1VGsZi0J8u9e}6x}zhB?qf1jUU|No!Q&w;4 z14FDVVN%VoCP%%j11JS5p&$lBVfB&>1S`d%MGycc$E0IAY(9-h-?HVL@REmMwWyK# crj8o{pfmQEWN3;cU;qY~7+{~v_#Y7fJ21jW6#xJL literal 0 HcmV?d00001 diff --git a/core/org.eclipse.cdt.ui.tests/icons/indexer_view/enumerator_obj.gif b/core/org.eclipse.cdt.ui.tests/icons/indexer_view/enumerator_obj.gif new file mode 100644 index 0000000000000000000000000000000000000000..a73f31a81f672296f6ad81b7a7a376ccaeb02e28 GIT binary patch literal 853 zcmW-gF>8}?5XMiaQXxZd3y9!Sb%vZdHK+*Ioa zXr)V$jyGiJn!R=rQH;O)AA~oTyL;|=o_n+RZg=PP`@Zz$msE7^)3rxO)^(S}?d6vr zcT_}F#6(;qM6xnfQ4@915X~x@ikX;;g;-XvtGJ1~c!+0>hDw-(ON2y%B&m`n>5?Hy z0yfZKF-&*Xo(fZS)lkh^OJ=6#YN3|Jf})$ctA~0PDSE>+Tq86Rj*M!WrfY^KTVV|t zq+tmyYAgmDXs{U05>z?iW?`14kF{j(=3$;C7Zw!5Ey5yE4=H*r-7+kZhab>n8avPr z2^7K_Fi69aR(P-&Y@or)a<0ncM7U=ei9XhnMR+8>A{Q1EJ;M_paT){QMLR~L7Ax@s znoMH{oDhscSOW%WCZPon7K06R)`_Z{GC7f43?tFUTC&Kj1Ge)Qi+0hvXFF1nYQEQb zo0Y|}xl`9}f{Sv~P{(hyNSg2s#xEF49GDC@A;?x@LIb@|OMqox~*gNw}RFoQ|Uj@ zC;0Fo9W%Va#i8Klql<$>{p1@cw;{>NIVbnNeEs6_lkZ+ldwU*3G&DBCJiv>kDbypAdEK>A_X}CscBpeylG)>nGO}4@s zFi67^TGUt!Hqc-(oF%Ao!p*`gOCM{=+|9#0OD-%ZhFgS1q8?K8TDoOeA`d^H$uxGL z9}*~pHDHj2C9UvaG1x$ZmE~NO$%$~!G7^2PC5!M#d_^uSD0+q`KH@Y6z>9W_MlDw2 z2Q-<+4mcqgg|G$;(o8}N9xMhM=&Tb}H)V1nxfn*GkF{ixSqE(AFBa{hbT;+wFF@+wJ%J>+9>o;cz@2PycRKtIu86op_f|a%vBr{39OL8(!an y^d89R*4`MZ8kp8f~My<6)5 literal 0 HcmV?d00001 diff --git a/core/org.eclipse.cdt.ui.tests/icons/indexer_view/field_obj.gif b/core/org.eclipse.cdt.ui.tests/icons/indexer_view/field_obj.gif new file mode 100644 index 0000000000000000000000000000000000000000..19d27defb62cf45d09873991e38e339a4acb11f6 GIT binary patch literal 76 zcmZ?wbhEHb6krfwn8?6jAHUx|zTSTR{{R2~EB<6*WME)s&|v@qkURsE?416Ur{D5R ea|m)c&OiF=-kF^FPbw3HmSjn7efL^~!5RQ`)EW8! literal 0 HcmV?d00001 diff --git a/core/org.eclipse.cdt.ui.tests/icons/indexer_view/field_ref_obj.GIF b/core/org.eclipse.cdt.ui.tests/icons/indexer_view/field_ref_obj.GIF new file mode 100644 index 0000000000000000000000000000000000000000..cec8a3646e44feeffed543eb81d068c3f41b5a02 GIT binary patch literal 837 zcmZ?wbhEHb6krfw_|Cv!AHUx|zTSTR{{R2~GmL`K5Ex-0pab$RC@(N@Xfd#J$arj6 raIl#}SS#j)fnoy#FC&KlL*YV~E-`h#H8(aaKHjh3+$AF+z+epk!C@D@ literal 0 HcmV?d00001 diff --git a/core/org.eclipse.cdt.ui.tests/icons/indexer_view/filterbutton.gif b/core/org.eclipse.cdt.ui.tests/icons/indexer_view/filterbutton.gif new file mode 100644 index 0000000000000000000000000000000000000000..c3a89302e5e627955b378ab4520be8baef4ecbab GIT binary patch literal 960 zcmb`G%}bSG5XGmE2sefyLAXfTRJf_fg%T7&n1Pj1K}b-k%t8u+AgG{j8eu^Y3c)Nw z;Zg}LqK&jPNcvzRB_Y~Iv?}NW`XIW~Z{EM5fy;a6&dix}&b)We-rnw>ldaM!KP979 zeQMRCMpnz1pPvtY4~go*lWzpS{l6$8DqP1||P29zksYH=b36pSWCvZZ8#W3BGdor{XE5%ERTuY`})QWo1NEQ@Li&-%* z7DgqL6|tO0{GETKh>#b5&s7Q>N(GAB&cRU`GWmds4e)gtA> zf})$cs|V^KMX!cwxCZj@1DZ@@2l^p_LRbR^X;{(<4;F(BG+2?&Wtp6Cvq&S+$67LX z^T1c+!h)iOTi_#3V*tEp$7s}IC4NAYY3zU#f>8)-z#z>ewBW&Fuz`*|QFc=%CxVM% zB>GrO=G9A*^x)66edzdI&V_(NZ<;Z*MTcx9-3Iy z@w;h-$QtR)w>tk5vigqvJ-D{-%*>Oqm0$nXe;nv&9&Ntgb*y{o_?FRihxVQCJNh|q`7TkTife;@6E=a zw^Jv4W}rTI_3`5D^n;@h=MGPN8D6Y!h`S@tmp<&@IlQ2!UTpo?KmMz4vg_iTdxN*v d_gwgNV{+)-)XyN z{$ycfVBliV0SSZ5U|@+1@HBd*VDviboaWSNf%g&xS{gb|U6`4nx}mu|s9E5Gf!+(z zo+F~CIT@P#JsdyEGIz|*(lB6R>YSakgnPx7opV>P{p&PueZ+q<>(o5$sM6llLgsrr LYS(u#FjxZs>|{i4 literal 0 HcmV?d00001 diff --git a/core/org.eclipse.cdt.ui.tests/icons/indexer_view/function_obj.gif b/core/org.eclipse.cdt.ui.tests/icons/indexer_view/function_obj.gif new file mode 100644 index 0000000000000000000000000000000000000000..e44ceee9c04e2538a1a27045013efc4c8b590131 GIT binary patch literal 849 zcmZ?wbhEHb6krfw_|Cv!UvF<8Z(lz@e*XUW|Ns9pjDpb+7)c?Z1M(~=FEDVJF>rFo zcx+g3u$eI9# HV6X-NNJAgO literal 0 HcmV?d00001 diff --git a/core/org.eclipse.cdt.ui.tests/icons/indexer_view/function_ref_obj.GIF b/core/org.eclipse.cdt.ui.tests/icons/indexer_view/function_ref_obj.GIF new file mode 100644 index 0000000000000000000000000000000000000000..c644c3e3d6823359faa1f4ec1e1259ad95b422df GIT binary patch literal 838 zcmZ?wbhEHb6krfw_|Cv!UvF<8Z(lz@e*XUW|Ns9pjDpb+7)c?Z1M(~=FEDUuGjMXq vcx+g3u$e literal 0 HcmV?d00001 diff --git a/core/org.eclipse.cdt.ui.tests/icons/indexer_view/fwd_class.gif b/core/org.eclipse.cdt.ui.tests/icons/indexer_view/fwd_class.gif new file mode 100644 index 0000000000000000000000000000000000000000..51396ef61145494bf75d06df87f07744be8c5061 GIT binary patch literal 888 zcmZ?wbhEHb6krfw_|Cv!Kfm6-KE8hceEa$K_VM=n@9(eQAHRS9{QLL!{|5txQ7{?; z!#4zUKwbmo1qO~-24M~vj|~eBHggCoa2%MR$kf8a?lI-Wg@lGq2~9PbjD|;yEv#%D z9tMUCP7IRl0v0oio;psEjFsZCoV3WZkzJ3^;6R{KV?T50vNaI~NuEsRyw6k)m@r)E KRZakq`npAWwqw z0s}`X122b+$A$$5n>lzHI1Cmf0>z~HI2-~OIkxi{nyGLkBr!0tIti`d_^8mxsG!Z~ zU@>WtHxq}mSjJC5Mb`;(iL+cH6Bad0WwO3E<>n*@&qgW3e|tI%8yY5aSPRXtdXVAN J!pO*A4FJ#YFN6R9 literal 0 HcmV?d00001 diff --git a/core/org.eclipse.cdt.ui.tests/icons/indexer_view/fwd_union.GIF b/core/org.eclipse.cdt.ui.tests/icons/indexer_view/fwd_union.GIF new file mode 100644 index 0000000000000000000000000000000000000000..8396e8eeb89548fe916bddb5fcbad88b68f00a05 GIT binary patch literal 906 zcmZ?wbhEHb6krfw_|CvkUvIyEfBgOX_4DV)|NlRK|Ni>=dLVZ{0|UeV|NnvHC>RZa zVH^TFAisg~0s}`rgD{7T$A$$5n>mDKI1CmfHZXHYiwQVvbZ~BF<`TGZVq$}93mcOF zM?%75h7LAC9t8u2gU9+c!?)ehU^w77RVP+xMP=|Zzj=m|uUaAv7@8Ic0Mwc|;{X5v literal 0 HcmV?d00001 diff --git a/core/org.eclipse.cdt.ui.tests/icons/indexer_view/include_obj.gif b/core/org.eclipse.cdt.ui.tests/icons/indexer_view/include_obj.gif new file mode 100644 index 0000000000000000000000000000000000000000..2cc5866a64c44cb52ae86c926573f6230a9a0c17 GIT binary patch literal 114 zcmZ?wbhEHb6krfwSj50!Z(na8Ki|H7fBpRZ_Vf4u|Nox>3>1H|FfuT(GU$MKAhit4 z<`KK@{4?0)a5$j3NvuVk%aKD`xFgA8+Ud?!DaH#D6pu~XYh_%!S@(YaBTcc!E{24Y NDbMCz$Y5fy1_1PFCjbBd literal 0 HcmV?d00001 diff --git a/core/org.eclipse.cdt.ui.tests/icons/indexer_view/macroDecl_obj.gif b/core/org.eclipse.cdt.ui.tests/icons/indexer_view/macroDecl_obj.gif new file mode 100644 index 0000000000000000000000000000000000000000..b3ddb5deebc87204a0bce5e530ddb3378e8fa772 GIT binary patch literal 109 zcmZ?wbhEHb6krfwSj50^|Ned;m_L7hLqkJ+d^`gK!~g&Pfu!P37DfgJHU=Fa8>mu% zfq~g5W7nO325t^*3&q-$&b+%2z|!Vn<+^I!IfY&8f6sXOV@<`yV}F!y?7zH*VTGvb Mi6xgNGB8*J0C!U>{{R30 literal 0 HcmV?d00001 diff --git a/core/org.eclipse.cdt.ui.tests/icons/indexer_view/method_public_obj.gif b/core/org.eclipse.cdt.ui.tests/icons/indexer_view/method_public_obj.gif new file mode 100644 index 0000000000000000000000000000000000000000..18103b11fc7ea74276adbc2cad5252b670854661 GIT binary patch literal 97 zcmZ?wbhEHb6krfwSj50!UvF<8Z(lz@e*XUW|Ns9pz<}aU7DfgJ76u)V07xwZvzo`Q sJO2z$oorwg?y+^caz~+p|3vSEoeNVnHu!(omm+eR>hjfT*3xL;wIg02xM} literal 0 HcmV?d00001 diff --git a/core/org.eclipse.cdt.ui.tests/icons/indexer_view/namespace_ref_obj.GIF b/core/org.eclipse.cdt.ui.tests/icons/indexer_view/namespace_ref_obj.GIF new file mode 100644 index 0000000000000000000000000000000000000000..dbda5b32a7c2970ecb581197207a2911b01596ab GIT binary patch literal 889 zcmZ?wbhEHb6krfw_|CvkZW7jQQn504+Cr1*lS~#Y@LjVueaE5RQzvGgzqa}Ik54~e z-F&-Y>dyaQz%U9%LtuD?fDXtzpuE7q5yv3SA>*-O!NFz@X#)v?1rHh6IGA}P92Pt} z!obGNvEszWMGQU6;zAk?4-R;+uyWYQSWIkSY-Ed*3b0H_Xz0=x)tL|}n9@93Pg)^k Z!h(Z7ObkL=v8T4Iyu3VMHX93rH2|UvKm-5) literal 0 HcmV?d00001 diff --git a/core/org.eclipse.cdt.ui.tests/icons/indexer_view/ngback.gif b/core/org.eclipse.cdt.ui.tests/icons/indexer_view/ngback.gif new file mode 100644 index 0000000000000000000000000000000000000000..86f437113b7c5dbc0273fa298ab4a088177f8247 GIT binary patch literal 222 zcmZ?wbhEHb6krfwI3mDs=hkBm4h{(!2_P^wHa>Ia3Owb~3O=E2ucN3eIT^?0HnA!K-lEbAe2E z2TQR%JIBO>?ko}>8?PjwVx6RXh d(Ia3Owb~3QWD5yBK3eIT^?0HnA;mCBRc(F`( z2TO@RJIBO>?ko}>J&V={YH`WgvG>mq5U6U_bU5&~C^J$j(dXZ}Lm}E_9yM;Nv8vpnfS7=*SIG>gKvu&AcQ?#%KJ)hZ-o>lt_m^wU l;OGulFf(RjF>~!?zA`t8OOWFiqiyO0p+uVlZVH?X)&QA$FWUeB literal 0 HcmV?d00001 diff --git a/core/org.eclipse.cdt.ui.tests/icons/indexer_view/super_co.gif b/core/org.eclipse.cdt.ui.tests/icons/indexer_view/super_co.gif new file mode 100644 index 0000000000000000000000000000000000000000..59ac11633f229ec67ea5da51c4e203c5bebff74d GIT binary patch literal 208 zcmV;>05AVXNk%w1VGsZi0K@JScfahC|1S)G*H)N) zBSV&DBgEe5)rTo6L`)<^N@PSH88fjEE3pxK6opBIL`jUqqgR^qR0Ko3S}K zVw7FjmEG8}6|4aU(qIW%s9`a%0Szn+dkBggp&};Yp$}`3sfwDYhg`5g(NxUD9O^*| zz2Yiv;*bYFKoirj1NuP%3c(s+APtsi1rIC+HlTs!;arrFBTUu9Na({_WM*m(Um+JP zP*gW{_z0(A0C=GtMnf&Egdd=ZY1jcy5DbN24KR?#Bxr#L76Tj59w&-!l#wGG7lV<| zhqcJeJr0=8A1u;E%GjfY>sz%PV@A@6WzBhTHe09weZ;{ z&HC#nORG0>_dk6tH@DW>x!cVbYqWBmf356(f7?EKYAM&74- m+}ob+S2m8+dE>#EZ`U4I9~H0u*xh`$enH#*{`buao&OKsi+uV3 literal 0 HcmV?d00001 diff --git a/core/org.eclipse.cdt.ui.tests/icons/indexer_view/typedecl_ref_obj.GIF b/core/org.eclipse.cdt.ui.tests/icons/indexer_view/typedecl_ref_obj.GIF new file mode 100644 index 0000000000000000000000000000000000000000..fd9a7989f42ba06d503084c80ee70c9763d66d90 GIT binary patch literal 871 zcmW-gF=$i)42Cllso0@ImuiQCP$9VJEf$A5wH9v8&~6SEbgUq5c_40e5EpOq2CEPh z(#BMj@;LgEW)Sf(MJi20H6R)lHe4NG^tv=wmHeWYz)O^B0TuqIJ*q zNJXmkz0TWOSsYt;>e{W~qTFhzw70j{>-F~c_XmT)a5x-|M&t4L?CfkZnN0tk_xo>}rkV0CPi5LZ zc=C_9UT=7P3o_f4>BXhHANxm7XOB*{KhG~6KRfuc`TpR?@`vqTHy_Syyyzc4Uw*K< s@Z`qT=H<1{8P`{>W<*H7=hzrJ(n!i?Ph57VM;IRF3v literal 0 HcmV?d00001 diff --git a/core/org.eclipse.cdt.ui.tests/icons/indexer_view/typedef_obj.gif b/core/org.eclipse.cdt.ui.tests/icons/indexer_view/typedef_obj.gif new file mode 100644 index 0000000000000000000000000000000000000000..34bcaf71351ceb9008750d283a3c20f943b60c9e GIT binary patch literal 159 zcmZ?wbhEHb6krfw*v!CiY)L|Lg!8u(`L7P-+}oCMX>H2d36TrhL%*(w`L?Ox*Om3A zrl$Y@{|Ax~p!k!8k%57SL5BedKxQzo_)IwIxq9!6l`U045|dP%ES083tW&efbrL+Y zS+VA_1`opq8HPi;hK?IpxEW3#HP|%i^drGtNw31LJnU`>o#o*AZsO!!d^4x|y0e^1 IQDU$L0P*}koB#j- literal 0 HcmV?d00001 diff --git a/core/org.eclipse.cdt.ui.tests/icons/indexer_view/union_obj.gif b/core/org.eclipse.cdt.ui.tests/icons/indexer_view/union_obj.gif new file mode 100644 index 0000000000000000000000000000000000000000..b8405d54bb46f990c6aa2760ff8a038be2732d95 GIT binary patch literal 173 zcmZ?wbhEHb6krfw*v!CCUvIyEfBgOX_4DV)|NlRK|Ni>=dLVZ{0|UeV|Nns`8c_Vn z!pOkD$)E!g2bsaZ5@m4GbM;<}xdv4h5#byu7bBe=*XSe$9p50uC@Aro!K=|rVH0E0 z*GW7q+6s<4gc#J0rxbV;I8EH2`T68$M$0RU+|rz9WV0MN_ab{I+X@lS0EPqlh7EDk KU#crHSOWlF6gvd~ literal 0 HcmV?d00001 diff --git a/core/org.eclipse.cdt.ui.tests/icons/indexer_view/variable_obj.gif b/core/org.eclipse.cdt.ui.tests/icons/indexer_view/variable_obj.gif new file mode 100644 index 0000000000000000000000000000000000000000..600d968f7cf55fa79a44d75715a6187f1da7d536 GIT binary patch literal 132 zcmZ?wbhEHb6krfw*v!Dd5Yc?$?H`8uuNj&S8gF`UJmsMOo{y+Z^fq|1j2P6(MgMr1+;H2m3y%y1js`aB4*iIDkI8;bDb;r3J*rh46`Y literal 0 HcmV?d00001 diff --git a/core/org.eclipse.cdt.ui.tests/icons/indexer_view/warning_icon.gif b/core/org.eclipse.cdt.ui.tests/icons/indexer_view/warning_icon.gif new file mode 100644 index 0000000000000000000000000000000000000000..cf8d571833dcf0457fad44f638d981f28d43eee2 GIT binary patch literal 139 zcmZ?wbhEHb6krfw*v!E2|9|}b`}_ajx4*yN{{Q{>{qybr@3)^{Zyz5Y&j6DB4 + @@ -72,8 +80,17 @@ + targetID="#CEditorContext" + id="org.eclipse.cdt.ui.tests.cEditorContribution"> + + + + id="org.eclipse.cdt.ui.CView2" + targetID="org.eclipse.cdt.ui.CView"> + class="org.eclipse.cdt.ui.tests.IndexerView.OpenIndexerViewAction" + id="org.eclipse.cdt.ui.tests.IndexerView.OpenIndexerViewAction" + label="Show in Indexer View" + menubarPath="additions"/> + + + + + - diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/CPPPopulateASTViewAction.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/CPPPopulateASTViewAction.java index 56129ed6691..fb20aa131b8 100644 --- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/CPPPopulateASTViewAction.java +++ b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/CPPPopulateASTViewAction.java @@ -65,12 +65,12 @@ public class CPPPopulateASTViewAction extends CPPASTVisitor implements IPopulate shouldVisitNamespaces = true; } - TreeParent root = null; + DOMASTNodeParent root = null; IProgressMonitor monitor = null; IASTProblem[] astProblems = new IASTProblem[INITIAL_PROBLEM_SIZE]; public CPPPopulateASTViewAction(IASTTranslationUnit tu, IProgressMonitor monitor) { - root = new TreeParent(tu); + root = new DOMASTNodeParent(tu); this.monitor = monitor; } @@ -85,17 +85,17 @@ public class CPPPopulateASTViewAction extends CPPASTVisitor implements IPopulate nodeLocations[0].getNodeLength() > 0)) return PROCESS_CONTINUE; - TreeParent parent = root.findTreeParentForNode(node); + DOMASTNodeParent parent = root.findTreeParentForNode(node); if (parent == null) parent = root; - TreeParent tree = new TreeParent(node); + DOMASTNodeParent tree = new DOMASTNodeParent(node); parent.addChild(tree); // set filter flags if (node instanceof IASTProblemHolder || node instanceof IASTProblem) { - tree.setFiltersFlag(TreeObject.FLAG_PROBLEM); + tree.setFiltersFlag(DOMASTNodeLeaf.FLAG_PROBLEM); if (node instanceof IASTProblemHolder) astProblems = (IASTProblem[])ArrayUtil.append(IASTProblem.class, astProblems, ((IASTProblemHolder)node).getProblem()); @@ -103,9 +103,9 @@ public class CPPPopulateASTViewAction extends CPPASTVisitor implements IPopulate astProblems = (IASTProblem[])ArrayUtil.append(IASTProblem.class, astProblems, node); } if (node instanceof IASTPreprocessorStatement) - tree.setFiltersFlag(TreeObject.FLAG_PREPROCESSOR); + tree.setFiltersFlag(DOMASTNodeLeaf.FLAG_PREPROCESSOR); if (node instanceof IASTPreprocessorIncludeStatement) - tree.setFiltersFlag(TreeObject.FLAG_INCLUDE_STATEMENTS); + tree.setFiltersFlag(DOMASTNodeLeaf.FLAG_INCLUDE_STATEMENTS); return PROCESS_CONTINUE; } @@ -248,7 +248,7 @@ public class CPPPopulateASTViewAction extends CPPASTVisitor implements IPopulate } } - public TreeParent getTree() { + public DOMASTNodeParent getTree() { return root; } @@ -269,7 +269,7 @@ public class CPPPopulateASTViewAction extends CPPASTVisitor implements IPopulate } // get the tree model elements corresponding to the includes - TreeParent[] treeIncludes = new TreeParent[index]; + DOMASTNodeParent[] treeIncludes = new DOMASTNodeParent[index]; for (int i=0; i=0; i--) { if (treeIncludes[i] == null) continue; diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/CPopulateASTViewAction.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/CPopulateASTViewAction.java index f97398222eb..efd0765eb39 100644 --- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/CPopulateASTViewAction.java +++ b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/CPopulateASTViewAction.java @@ -58,12 +58,12 @@ public class CPopulateASTViewAction extends CASTVisitor implements IPopulateDOMA shouldVisitEnumerators = true; } - TreeParent root = null; + DOMASTNodeParent root = null; IProgressMonitor monitor = null; IASTProblem[] astProblems = new IASTProblem[INITIAL_PROBLEM_SIZE]; public CPopulateASTViewAction(IASTTranslationUnit tu, IProgressMonitor monitor) { - root = new TreeParent(tu); + root = new DOMASTNodeParent(tu); this.monitor = monitor; } @@ -77,17 +77,17 @@ public class CPopulateASTViewAction extends CASTVisitor implements IPopulateDOMA nodeLocations[0].getNodeLength() > 0)) return PROCESS_CONTINUE; - TreeParent parent = root.findTreeParentForNode(node); + DOMASTNodeParent parent = root.findTreeParentForNode(node); if (parent == null) parent = root; - TreeParent tree = new TreeParent(node); + DOMASTNodeParent tree = new DOMASTNodeParent(node); parent.addChild(tree); // set filter flags if (node instanceof IASTProblemHolder || node instanceof IASTProblem) { - tree.setFiltersFlag(TreeObject.FLAG_PROBLEM); + tree.setFiltersFlag(DOMASTNodeLeaf.FLAG_PROBLEM); if (node instanceof IASTProblemHolder) astProblems = (IASTProblem[])ArrayUtil.append(IASTProblem.class, astProblems, ((IASTProblemHolder)node).getProblem()); @@ -95,9 +95,9 @@ public class CPopulateASTViewAction extends CASTVisitor implements IPopulateDOMA astProblems = (IASTProblem[])ArrayUtil.append(IASTProblem.class, astProblems, node); } if (node instanceof IASTPreprocessorStatement) - tree.setFiltersFlag(TreeObject.FLAG_PREPROCESSOR); + tree.setFiltersFlag(DOMASTNodeLeaf.FLAG_PREPROCESSOR); if (node instanceof IASTPreprocessorIncludeStatement) - tree.setFiltersFlag(TreeObject.FLAG_INCLUDE_STATEMENTS); + tree.setFiltersFlag(DOMASTNodeLeaf.FLAG_INCLUDE_STATEMENTS); @@ -221,7 +221,7 @@ public class CPopulateASTViewAction extends CASTVisitor implements IPopulateDOMA } } - public TreeParent getTree() { + public DOMASTNodeParent getTree() { return root; } @@ -242,7 +242,7 @@ public class CPopulateASTViewAction extends CASTVisitor implements IPopulateDOMA } // get the tree model elements corresponding to the includes - TreeParent[] treeIncludes = new TreeParent[index]; + DOMASTNodeParent[] treeIncludes = new DOMASTNodeParent[index]; for (int i=0; i=0; i--) { if (treeIncludes[i] == null) continue; diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/DOMAST.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/DOMAST.java index 5bd0097bf95..0d8883384ad 100644 --- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/DOMAST.java +++ b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/DOMAST.java @@ -110,6 +110,7 @@ import org.eclipse.ui.views.properties.PropertySheet; */ public class DOMAST extends ViewPart { + public static final String VIEW_ID = "org.eclipse.cdt.ui.tests.DOMAST.DOMAST"; //$NON-NLS-1$ private static final String PROPERTIES_VIEW = "org.eclipse.ui.views.PropertySheet"; //$NON-NLS-1$ private static final String ASTUTIL_MENU_LABEL = "ASTUtil#"; //$NON-NLS-1$ private static final String DISPLAY_TYPE = "getNodeType(IASTNode)"; //$NON-NLS-1$ @@ -168,8 +169,8 @@ public class DOMAST extends ViewPart { public class ViewContentProvider implements IStructuredContentProvider, ITreeContentProvider { private static final String POPULATING_AST_VIEW = "Populating AST View"; //$NON-NLS-1$ - private TreeParent invisibleRoot; - private TreeParent tuTreeParent = null; + private DOMASTNodeParent invisibleRoot; + private DOMASTNodeParent tuTreeParent = null; private IASTTranslationUnit tu = null; private IASTProblem[] astProblems = null; @@ -186,11 +187,11 @@ public class DOMAST extends ViewPart { } - public TreeParent getTUTreeParent() { + public DOMASTNodeParent getTUTreeParent() { if (tuTreeParent == null && invisibleRoot != null) { for(int i=0; i=0; i--) { if (nodeChain[i] != null) { parentToFind = nodeChain[i]; - for(; j>=0; j--) { // use the TreeParent's index to start searching at the end of it's children (performance optimization) - if (j=0; j--) { // use the DOMASTNodeParent's index to start searching at the end of it's children (performance optimization) + if (j=0; i--) { if (nodeChain[i] != null) { nodeToFind = nodeChain[i]; for(int j=0; j 0) { - IASTNode node = ((TreeObject)element).getNode(); + IASTNode node = ((DOMASTNodeLeaf)element).getNode(); if (node instanceof IASTPreprocessorIncludeStatement) return false; diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/OpenDOMViewAction.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/OpenDOMViewAction.java index 58328a8bf04..5a6a225ade6 100644 --- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/OpenDOMViewAction.java +++ b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/OpenDOMViewAction.java @@ -35,7 +35,6 @@ import org.eclipse.ui.PartInitException; */ public class OpenDOMViewAction implements IViewActionDelegate, IEditorActionDelegate, IObjectActionDelegate { - public static final String VIEW_ID = "org.eclipse.cdt.ui.tests.DOMAST.DOMAST"; //$NON-NLS-1$ IViewPart viewPart = null; ISelection selection = null; IFile file = null; @@ -76,7 +75,7 @@ public class OpenDOMViewAction implements IViewActionDelegate, IEditorActionDele IViewPart tempView = null; try { - tempView = viewPart.getSite().getPage().showView(VIEW_ID); + tempView = viewPart.getSite().getPage().showView(DOMAST.VIEW_ID); } catch (PartInitException pie) {} if (tempView != null) { diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/PreprocessorFilter.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/PreprocessorFilter.java index 07e9fbad91d..c77fc1db41d 100644 --- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/PreprocessorFilter.java +++ b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/PreprocessorFilter.java @@ -23,10 +23,10 @@ public class PreprocessorFilter extends ViewerFilter { * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object) */ public boolean select(Viewer viewer, Object parentElement, Object element) { - if (element instanceof TreeObject) { - int flag = ((TreeObject)element).getFiltersFlag() & TreeObject.FLAG_PREPROCESSOR; + if (element instanceof DOMASTNodeLeaf) { + int flag = ((DOMASTNodeLeaf)element).getFiltersFlag() & DOMASTNodeLeaf.FLAG_PREPROCESSOR; if (flag > 0) { - if (((TreeObject)element).getNode() instanceof IASTPreprocessorStatement) + if (((DOMASTNodeLeaf)element).getNode() instanceof IASTPreprocessorStatement) return false; return true; diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/ProblemHolderFilter.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/ProblemHolderFilter.java index 0ebd2742d5e..e10fd9e8a6a 100644 --- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/ProblemHolderFilter.java +++ b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/ProblemHolderFilter.java @@ -25,10 +25,10 @@ public class ProblemHolderFilter extends ViewerFilter { * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object) */ public boolean select(Viewer viewer, Object parentElement, Object element) { - if (element instanceof TreeObject) { - int flag = ((TreeObject)element).getFiltersFlag() & TreeObject.FLAG_PROBLEM; + if (element instanceof DOMASTNodeLeaf) { + int flag = ((DOMASTNodeLeaf)element).getFiltersFlag() & DOMASTNodeLeaf.FLAG_PROBLEM; if (flag > 0) { - IASTNode node = ((TreeObject)element).getNode(); + IASTNode node = ((DOMASTNodeLeaf)element).getNode(); if (node instanceof IASTProblem || node instanceof IASTProblemHolder) return false; diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/ShowInDOMViewAction.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/ShowInDOMViewAction.java index 1769991a880..c69eb4a6e15 100644 --- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/ShowInDOMViewAction.java +++ b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/ShowInDOMViewAction.java @@ -84,7 +84,7 @@ public class ShowInDOMViewAction extends ActionDelegate implements if (file == null) return false; try { - view = editor.getSite().getPage().showView(OpenDOMViewAction.VIEW_ID); + view = editor.getSite().getPage().showView(DOMAST.VIEW_ID); } catch (PartInitException pie) {} if (view instanceof DOMAST) { diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/IndexerView/FilterIndexerViewDialog.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/IndexerView/FilterIndexerViewDialog.java new file mode 100644 index 00000000000..9593d3f90fb --- /dev/null +++ b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/IndexerView/FilterIndexerViewDialog.java @@ -0,0 +1,846 @@ +/********************************************************************** + * Copyright (c) 2005 IBM Canada and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Common Public License v0.5 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/cpl-v05.html + * + * Contributors: + * IBM Rational Software - Initial API and implementation + **********************************************************************/ +package org.eclipse.cdt.ui.tests.IndexerView; + +import java.util.Collection; +import java.util.HashSet; +import java.util.Set; + +import org.eclipse.cdt.internal.core.search.indexing.IIndexConstants; +import org.eclipse.cdt.ui.CUIPlugin; +import org.eclipse.cdt.ui.browser.typeinfo.TypeInfoMessages; +import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.jface.dialogs.IDialogSettings; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.graphics.Rectangle; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Text; + +/** + * @author dsteffle + */ +public class FilterIndexerViewDialog extends Dialog { + + private static final String BLANK_STRING = ""; //$NON-NLS-1$ + private static final String PAGE_SIZE_ = "Page Size:"; //$NON-NLS-1$ + private static final String TYPESELECTIONDIALOG_FILTERLABEL = "TypeSelectionDialog.filterLabel"; //$NON-NLS-1$ + private static final String FILTER_INDEXER_RESULTS = "Filter Indexer Results"; //$NON-NLS-1$ + private static final String SETTINGS = "Settings"; //$NON-NLS-1$ + private static final String PAGE_SIZE = "PAGE_SIZE"; //$NON-NLS-1$ + private String fFilter = BLANK_STRING; //$NON-NLS-1$ + Text filterText = null; + private String pageSize = BLANK_STRING; //$NON-NLS-1$ + Text pageSizeText = null; + protected Collection fFilterMatcher = new HashSet(); + + private String message = "Filter Indexer Results (. = any character, .* = any string):"; //$NON-NLS-1$ + + public static final int ENTRY_REF = 1; + public static final String ENTRY_REF_STRING = String.valueOf(IIndexConstants.REF); + public static final int ENTRY_TYPE_REF = 2; + public static final String ENTRY_TYPE_REF_STRING = String.valueOf(IIndexConstants.TYPE_REF); + public static final String ENTRY_TYPE_DECL_STRING = String.valueOf(IIndexConstants.TYPE_DECL); + public static final int ENTRY_FUNCTION_REF = 4; + public static final String ENTRY_FUNCTION_REF_STRING = String.valueOf(IIndexConstants.FUNCTION_REF); + public static final int ENTRY_FUNCTION_DECL = 5; + public static final String ENTRY_FUNCTION_DECL_STRING = String.valueOf(IIndexConstants.FUNCTION_DECL); + public static final int ENTRY_CONSTRUCTOR_REF = 6; + public static final String ENTRY_CONSTRUCTOR_REF_STRING = String.valueOf(IIndexConstants.CONSTRUCTOR_REF); + public static final int ENTRY_CONSTRUCTOR_DECL = 7; + public static final String ENTRY_CONSTRUCTOR_DECL_STRING = String.valueOf(IIndexConstants.CONSTRUCTOR_DECL); + public static final int ENTRY_NAMESPACE_REF = 8; + public static final String ENTRY_NAMESPACE_REF_STRING = String.valueOf(IIndexConstants.NAMESPACE_REF); + public static final int ENTRY_NAMESPACE_DECL = 9; + public static final String ENTRY_NAMESPACE_DECL_STRING = String.valueOf(IIndexConstants.NAMESPACE_DECL); + public static final int ENTRY_FIELD_REF = 10; + public static final String ENTRY_FIELD_REF_STRING = String.valueOf(IIndexConstants.FIELD_REF); + public static final int ENTRY_FIELD_DECL = 11; + public static final String ENTRY_FIELD_DECL_STRING = String.valueOf(IIndexConstants.FIELD_DECL); + public static final int ENTRY_ENUMTOR_REF = 12; + public static final String ENTRY_ENUMTOR_REF_STRING = String.valueOf(IIndexConstants.ENUMTOR_REF); + public static final int ENTRY_ENUMTOR_DECL = 13; + public static final String ENTRY_ENUMTOR_DECL_STRING = String.valueOf(IIndexConstants.ENUMTOR_DECL); + public static final int ENTRY_METHOD_REF = 14; + public static final String ENTRY_METHOD_REF_STRING = String.valueOf(IIndexConstants.METHOD_REF); + public static final int ENTRY_METHOD_DECL = 15; + public static final String ENTRY_METHOD_DECL_STRING = String.valueOf(IIndexConstants.METHOD_DECL); + public static final int ENTRY_MACRO_DECL = 16; + public static final String ENTRY_MACRO_DECL_STRING = String.valueOf(IIndexConstants.MACRO_DECL); + public static final int ENTRY_INCLUDE_REF = 17; + public static final String ENTRY_INCLUDE_REF_STRING = String.valueOf(IIndexConstants.INCLUDE_REF); + public static final int ENTRY_SUPER_REF = 18; + public static final String ENTRY_SUPER_REF_STRING = String.valueOf(IIndexConstants.SUPER_REF); + public static final int ENTRY_TYPE_DECL_T = 19; + public static final String ENTRY_TYPE_DECL_T_STRING = String.valueOf(IIndexConstants.TYPEDEF_DECL); + public static final int ENTRY_TYPE_DECL_C = 20; + public static final String ENTRY_TYPE_DECL_C_STRING = String.valueOf(IIndexConstants.CLASS_DECL); + public static final int ENTRY_TYPE_DECL_V = 21; + public static final String ENTRY_TYPE_DECL_V_STRING = String.valueOf(IIndexConstants.VAR_DECL); + public static final int ENTRY_TYPE_DECL_S = 22; + public static final String ENTRY_TYPE_DECL_S_STRING = String.valueOf(IIndexConstants.STRUCT_DECL); + public static final int ENTRY_TYPE_DECL_E = 23; + public static final String ENTRY_TYPE_DECL_E_STRING = String.valueOf(IIndexConstants.ENUM_DECL); + public static final int ENTRY_TYPE_DECL_U = 24; + public static final String ENTRY_TYPE_DECL_U_STRING = String.valueOf(IIndexConstants.UNION_DECL); + public static final int ENTRY_TYPE_DECL_D = 25; + public static final String ENTRY_TYPE_DECL_D_STRING = String.valueOf(IIndexConstants.TYPE_DECL) + String.valueOf(IIndexConstants.DERIVED_SUFFIX) + String.valueOf(IIndexConstants.SEPARATOR); + public static final int ENTRY_TYPE_DECL_F = 26; + public static final String ENTRY_TYPE_DECL_F_STRING = String.valueOf(IIndexConstants.TYPE_DECL) + String.valueOf(IIndexConstants.FRIEND_SUFFIX) + String.valueOf(IIndexConstants.SEPARATOR); + public static final int ENTRY_TYPE_DECL_G = 27; + public static final String ENTRY_TYPE_DECL_G_STRING = String.valueOf(IIndexConstants.TYPE_DECL) + String.valueOf(IIndexConstants.FWD_CLASS_SUFFIX) + String.valueOf(IIndexConstants.SEPARATOR); + public static final int ENTRY_TYPE_DECL_H = 28; + public static final String ENTRY_TYPE_DECL_H_STRING = String.valueOf(IIndexConstants.TYPE_DECL) + String.valueOf(IIndexConstants.FWD_STRUCT_SUFFIX) + String.valueOf(IIndexConstants.SEPARATOR); + public static final int ENTRY_TYPE_DECL_I = 29; + public static final String ENTRY_TYPE_DECL_I_STRING = String.valueOf(IIndexConstants.TYPE_DECL) + String.valueOf(IIndexConstants.FWD_UNION_SUFFIX) + String.valueOf(IIndexConstants.SEPARATOR); + + private String fDialogSection; + + private static final String DIALOG_SETTINGS = FilterIndexerViewDialog.class.getName(); + private static final String SETTINGS_X_POS = "x"; //$NON-NLS-1$ + private static final String SETTINGS_Y_POS = "y"; //$NON-NLS-1$ + private static final String SETTINGS_WIDTH = "width"; //$NON-NLS-1$ + private static final String SETTINGS_HEIGHT = "height"; //$NON-NLS-1$ + + private Point fLocation; + private Point fSize; + + IndexerNodeParent root = null; + + private String projName = null; + + private static final int[] fAllTypes = { ENTRY_REF, ENTRY_TYPE_REF, + ENTRY_FUNCTION_REF, ENTRY_FUNCTION_DECL, // ENTRY_TYPE_DECL, + ENTRY_CONSTRUCTOR_REF, ENTRY_CONSTRUCTOR_DECL, ENTRY_NAMESPACE_REF, + ENTRY_NAMESPACE_DECL, ENTRY_FIELD_REF, ENTRY_FIELD_DECL, + ENTRY_ENUMTOR_REF, ENTRY_ENUMTOR_DECL, ENTRY_METHOD_REF, + ENTRY_METHOD_DECL, ENTRY_MACRO_DECL, ENTRY_INCLUDE_REF, + ENTRY_SUPER_REF, ENTRY_TYPE_DECL_T, ENTRY_TYPE_DECL_C, + ENTRY_TYPE_DECL_V, ENTRY_TYPE_DECL_S, ENTRY_TYPE_DECL_E, + ENTRY_TYPE_DECL_U, ENTRY_TYPE_DECL_D, ENTRY_TYPE_DECL_F, + ENTRY_TYPE_DECL_G, ENTRY_TYPE_DECL_H, ENTRY_TYPE_DECL_I }; + + private Set fKnownTypes = new HashSet(fAllTypes.length); + + protected FilterIndexerViewDialog(Shell parentShell, IndexerNodeParent root, String projName) { + super(parentShell); + + this.root = root; + this.projName = projName; + + setVisibleTypes(fAllTypes); + setDialogSettings(DIALOG_SETTINGS); + } + + /** + * Sets section name to use when storing the dialog settings. + * + * @param section Name of section. + */ + public void setDialogSettings(String section) { + fDialogSection = section + SETTINGS + projName; + } + + public boolean close() { + return super.close(); + } + + /* + * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell) + */ + protected void configureShell(Shell newShell) { + super.configureShell(newShell); + newShell.setText(FILTER_INDEXER_RESULTS); + } + + /* + * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite) + */ + protected Control createDialogArea(Composite parent) { + readSettings(getDialogSettings()); + + Composite composite = new Composite(parent, SWT.NONE); + GridLayout layout = new GridLayout(); + layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN); + layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); + layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); + layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); + composite.setLayout(layout); + composite.setLayoutData(new GridData(GridData.FILL_BOTH)); + applyDialogFont(composite); + + createMessageArea(composite); + createFilterText(composite); + createTypeFilterArea(composite); + createPageSizeArea(composite); + + return composite; + } + + /** + * Creates a label if name was not null. + * + * @param parent + * the parent composite. + * @param name + * the name of the label. + * @return returns a label if a name was given, null + * otherwise. + */ + protected Label createLabel(Composite parent, String name) { + if (name == null) + return null; + Label label = new Label(parent, SWT.NONE); + label.setText(name); + label.setFont(parent.getFont()); + return label; + } + + /** + * Sets which CElement types are visible in the dialog. + * + * @param types + * Array of CElement types. + */ + public void setVisibleTypes(int[] types) { + fKnownTypes.clear(); + for (int i = 0; i < types.length; ++i) { + fKnownTypes.add(new Integer(types[i])); + } + } + + /** + * Creates a type filter checkbox. + */ + private void createTypeCheckbox(Composite parent, Integer typeObject) { + String name; + int type = typeObject.intValue(); + switch (type) { + case ENTRY_REF: + name = ENTRY_REF_STRING; + break; + case ENTRY_TYPE_REF: + name = ENTRY_TYPE_REF_STRING; + break; +// case ENTRY_TYPE_DECL: +// name = ENTRY_TYPE_DECL_STRING; +// break; + case ENTRY_FUNCTION_REF: + name = ENTRY_FUNCTION_REF_STRING; + break; + case ENTRY_FUNCTION_DECL: + name = ENTRY_FUNCTION_DECL_STRING; + break; + case ENTRY_CONSTRUCTOR_REF: + name = ENTRY_CONSTRUCTOR_REF_STRING; + break; + case ENTRY_CONSTRUCTOR_DECL: + name = ENTRY_CONSTRUCTOR_DECL_STRING; + break; + case ENTRY_NAMESPACE_REF: + name = ENTRY_NAMESPACE_REF_STRING; + break; + case ENTRY_NAMESPACE_DECL: + name = ENTRY_NAMESPACE_DECL_STRING; + break; + case ENTRY_FIELD_REF: + name = ENTRY_FIELD_REF_STRING; + break; + case ENTRY_FIELD_DECL: + name = ENTRY_FIELD_DECL_STRING; + break; + case ENTRY_ENUMTOR_REF: + name = ENTRY_ENUMTOR_REF_STRING; + break; + case ENTRY_ENUMTOR_DECL: + name = ENTRY_ENUMTOR_DECL_STRING; + break; + case ENTRY_METHOD_REF: + name = ENTRY_METHOD_REF_STRING; + break; + case ENTRY_METHOD_DECL: + name = ENTRY_METHOD_DECL_STRING; + break; + case ENTRY_MACRO_DECL: + name = ENTRY_MACRO_DECL_STRING; + break; + case ENTRY_INCLUDE_REF: + name = ENTRY_INCLUDE_REF_STRING; + break; + case ENTRY_SUPER_REF: + name = ENTRY_SUPER_REF_STRING; + break; + case ENTRY_TYPE_DECL_T: + name = ENTRY_TYPE_DECL_T_STRING; + break; + case ENTRY_TYPE_DECL_C: + name = ENTRY_TYPE_DECL_C_STRING; + break; + case ENTRY_TYPE_DECL_V: + name = ENTRY_TYPE_DECL_V_STRING; + break; + case ENTRY_TYPE_DECL_S: + name = ENTRY_TYPE_DECL_S_STRING; + break; + case ENTRY_TYPE_DECL_E: + name = ENTRY_TYPE_DECL_E_STRING; + break; + case ENTRY_TYPE_DECL_U: + name = ENTRY_TYPE_DECL_U_STRING; + break; + case ENTRY_TYPE_DECL_D: + name = ENTRY_TYPE_DECL_D_STRING; + break; + case ENTRY_TYPE_DECL_F: + name = ENTRY_TYPE_DECL_F_STRING; + break; + case ENTRY_TYPE_DECL_G: + name = ENTRY_TYPE_DECL_G_STRING; + break; + case ENTRY_TYPE_DECL_H: + name = ENTRY_TYPE_DECL_H_STRING; + break; + case ENTRY_TYPE_DECL_I: + name = ENTRY_TYPE_DECL_I_STRING; + break; + default: + return; + } + Image icon = getTypeIcon(type); + + Composite composite = new Composite(parent, SWT.NONE); + GridLayout layout = new GridLayout(2, false); + layout.marginHeight = 0; + composite.setLayout(layout); + + final Integer fTypeObject = typeObject; + Button checkbox = new Button(composite, SWT.CHECK); + checkbox.setFont(composite.getFont()); + checkbox.setImage(icon); + checkbox.setSelection(fFilterMatcher.contains(fTypeObject)); + checkbox.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + if (e.widget instanceof Button) { + Button aCheckbox = (Button) e.widget; + if (aCheckbox.getSelection()) + fFilterMatcher.add(fTypeObject); + else + fFilterMatcher.remove(fTypeObject); + } + } + }); + + Label label = new Label(composite, SWT.LEFT); + label.setFont(composite.getFont()); + label.setText(name); + } + + private Image getTypeIcon(int type) + { + switch (type) + { + case ENTRY_REF: + return IndexerViewPluginImages.get(IndexerViewPluginImages.IMG_REF); + case ENTRY_TYPE_REF: + return IndexerViewPluginImages.get(IndexerViewPluginImages.IMG_TYPE_REF); +// case ENTRY_TYPE_DECL: +// return IndexerViewPluginImages.get(IndexerViewPluginImages.IMG_TYPE_DECL); + case ENTRY_FUNCTION_REF: + return IndexerViewPluginImages.get(IndexerViewPluginImages.IMG_FUNCTION_REF); + case ENTRY_FUNCTION_DECL: + return IndexerViewPluginImages.get(IndexerViewPluginImages.IMG_FUNCTION_DECL); + case ENTRY_CONSTRUCTOR_REF: + return IndexerViewPluginImages.get(IndexerViewPluginImages.IMG_CONSTRUCTOR_REF); + case ENTRY_CONSTRUCTOR_DECL: + return IndexerViewPluginImages.get(IndexerViewPluginImages.IMG_CONSTRUCTOR_DECL); + case ENTRY_NAMESPACE_REF: + return IndexerViewPluginImages.get(IndexerViewPluginImages.IMG_NAMESPACE_REF); + case ENTRY_NAMESPACE_DECL: + return IndexerViewPluginImages.get(IndexerViewPluginImages.IMG_NAMESPACE_DECL); + case ENTRY_FIELD_REF: + return IndexerViewPluginImages.get(IndexerViewPluginImages.IMG_FIELD_REF); + case ENTRY_FIELD_DECL: + return IndexerViewPluginImages.get(IndexerViewPluginImages.IMG_FIELD_DECL); + case ENTRY_ENUMTOR_REF: + return IndexerViewPluginImages.get(IndexerViewPluginImages.IMG_ENUMTOR_REF); + case ENTRY_ENUMTOR_DECL: + return IndexerViewPluginImages.get(IndexerViewPluginImages.IMG_ENUMTOR_DECL); + case ENTRY_METHOD_REF: + return IndexerViewPluginImages.get(IndexerViewPluginImages.IMG_METHOD_REF); + case ENTRY_METHOD_DECL: + return IndexerViewPluginImages.get(IndexerViewPluginImages.IMG_METHOD_DECL); + case ENTRY_MACRO_DECL: + return IndexerViewPluginImages.get(IndexerViewPluginImages.IMG_MACRO_DECL); + case ENTRY_INCLUDE_REF: + return IndexerViewPluginImages.get(IndexerViewPluginImages.IMG_INCLUDE_REF); + case ENTRY_SUPER_REF: + return IndexerViewPluginImages.get(IndexerViewPluginImages.IMG_SUPER_REF); + case ENTRY_TYPE_DECL_T: + return IndexerViewPluginImages.get(IndexerViewPluginImages.IMG_TYPEDEF); + case ENTRY_TYPE_DECL_C: + return IndexerViewPluginImages.get(IndexerViewPluginImages.IMG_CLASS); + case ENTRY_TYPE_DECL_V: + return IndexerViewPluginImages.get(IndexerViewPluginImages.IMG_VARIABLE); + case ENTRY_TYPE_DECL_S: + return IndexerViewPluginImages.get(IndexerViewPluginImages.IMG_STRUCT); + case ENTRY_TYPE_DECL_E: + return IndexerViewPluginImages.get(IndexerViewPluginImages.IMG_ENUM); + case ENTRY_TYPE_DECL_U: + return IndexerViewPluginImages.get(IndexerViewPluginImages.IMG_UNION); + case ENTRY_TYPE_DECL_D: + return IndexerViewPluginImages.get(IndexerViewPluginImages.IMG_DERIVED); + case ENTRY_TYPE_DECL_F: + return IndexerViewPluginImages.get(IndexerViewPluginImages.IMG_FRIEND); + case ENTRY_TYPE_DECL_G: + return IndexerViewPluginImages.get(IndexerViewPluginImages.IMG_FWD_CLASS); + case ENTRY_TYPE_DECL_H: + return IndexerViewPluginImages.get(IndexerViewPluginImages.IMG_FWD_STRUCT); + case ENTRY_TYPE_DECL_I: + return IndexerViewPluginImages.get(IndexerViewPluginImages.IMG_FWD_UNION); + default: + return IndexerViewPluginImages.get(IndexerViewPluginImages.IMG_WARNING); + } + } + + /** + * Creates an area to filter types. + * + * @param parent + * area to create controls in + */ + private void createTypeFilterArea(Composite parent) { + createLabel(parent, TypeInfoMessages + .getString(TYPESELECTIONDIALOG_FILTERLABEL)); + + Composite upperRow = new Composite(parent, SWT.NONE); + GridLayout upperLayout = new GridLayout(3, true); + upperLayout.verticalSpacing = 2; + upperLayout.marginHeight = 0; + upperLayout.marginWidth = 0; + upperRow.setLayout(upperLayout); + + // the for loop is here to guarantee we always + // create the checkboxes in the same order + for (int i = 0; i < fAllTypes.length; ++i) { + Integer typeObject = new Integer(fAllTypes[i]); + if (fKnownTypes.contains(typeObject)) + createTypeCheckbox(upperRow, typeObject); + } + + Composite lowerRow = new Composite(parent, SWT.NONE); + GridLayout lowerLayout = new GridLayout(1, true); + lowerLayout.verticalSpacing = 2; + lowerLayout.marginHeight = 0; + upperLayout.marginWidth = 0; + lowerRow.setLayout(lowerLayout); + + Composite composite = new Composite(lowerRow, SWT.NONE); + GridLayout layout = new GridLayout(2, false); + layout.marginHeight = 0; + layout.marginWidth = 0; + composite.setLayout(layout); + } + + /** + * Creates an area to filter types. + * + * @param parent + * area to create controls in + */ + private void createPageSizeArea(Composite parent) { + createLabel(parent, PAGE_SIZE_); + + pageSizeText = new Text(parent, SWT.BORDER); + + GridData data = new GridData(); + data.grabExcessVerticalSpace = false; + data.grabExcessHorizontalSpace = true; + data.horizontalAlignment = GridData.FILL; + data.verticalAlignment = GridData.BEGINNING; + pageSizeText.setLayoutData(data); + pageSizeText.setFont(parent.getFont()); + + pageSizeText.setText((pageSize == null ? BLANK_STRING : pageSize)); + } + + /** + * Creates the message text widget and sets layout data. + * + * @param composite + * the parent composite of the message area. + */ + protected Label createMessageArea(Composite composite) { + Label label = new Label(composite, SWT.NONE); + if (message != null) { + label.setText(message); + } + label.setFont(composite.getFont()); + + GridData data = new GridData(); + data.grabExcessVerticalSpace = false; + data.grabExcessHorizontalSpace = true; + data.horizontalAlignment = GridData.FILL; + data.verticalAlignment = GridData.BEGINNING; + label.setLayoutData(data); + + return label; + } + + protected Text createFilterText(Composite parent) { + filterText = new Text(parent, SWT.BORDER); + + GridData data = new GridData(); + data.grabExcessVerticalSpace = false; + data.grabExcessHorizontalSpace = true; + data.horizontalAlignment = GridData.FILL; + data.verticalAlignment = GridData.BEGINNING; + filterText.setLayoutData(data); + filterText.setFont(parent.getFont()); + + filterText.setText((fFilter == null ? BLANK_STRING : fFilter)); + + return filterText; + } + + /* + * @see org.eclipse.jface.dialogs.Dialog#buttonPressed(int) + */ + protected void buttonPressed(int buttonId) { + if (buttonId == IDialogConstants.OK_ID) { + apply(); + } + + super.buttonPressed(buttonId); + } + + public IDialogSettings getDialogSettings() { + IDialogSettings allSettings = CUIPlugin.getDefault().getDialogSettings(); + IDialogSettings section = allSettings.getSection(fDialogSection); + if (section == null) { + section = allSettings.addNewSection(fDialogSection); + writeDefaultSettings(section); + } + return section; + } + + /** + * Stores current configuration in the dialog store. + */ + protected void writeSettings(IDialogSettings section) { + Point location = getShell().getLocation(); + section.put(SETTINGS_X_POS, location.x); + section.put(SETTINGS_Y_POS, location.y); + + Point size = getShell().getSize(); + section.put(SETTINGS_WIDTH, size.x); + section.put(SETTINGS_HEIGHT, size.y); + + section.put(ENTRY_REF_STRING, fFilterMatcher.contains(new Integer(ENTRY_REF))); + section.put(ENTRY_TYPE_REF_STRING, fFilterMatcher.contains(new Integer(ENTRY_TYPE_REF))); +// section.put(ENTRY_TYPE_DECL_STRING, fFilterMatcher.contains(new Integer(ENTRY_TYPE_DECL))); + section.put(ENTRY_FUNCTION_REF_STRING, fFilterMatcher.contains(new Integer(ENTRY_FUNCTION_REF))); + section.put(ENTRY_FUNCTION_DECL_STRING, fFilterMatcher.contains(new Integer(ENTRY_FUNCTION_DECL))); + section.put(ENTRY_CONSTRUCTOR_REF_STRING, fFilterMatcher.contains(new Integer(ENTRY_CONSTRUCTOR_REF))); + section.put(ENTRY_CONSTRUCTOR_DECL_STRING, fFilterMatcher.contains(new Integer(ENTRY_CONSTRUCTOR_DECL))); + section.put(ENTRY_NAMESPACE_REF_STRING, fFilterMatcher.contains(new Integer(ENTRY_NAMESPACE_REF))); + section.put(ENTRY_NAMESPACE_DECL_STRING, fFilterMatcher.contains(new Integer(ENTRY_NAMESPACE_DECL))); + section.put(ENTRY_FIELD_REF_STRING, fFilterMatcher.contains(new Integer(ENTRY_FIELD_REF))); + section.put(ENTRY_FIELD_DECL_STRING, fFilterMatcher.contains(new Integer(ENTRY_FIELD_DECL))); + section.put(ENTRY_ENUMTOR_REF_STRING, fFilterMatcher.contains(new Integer(ENTRY_ENUMTOR_REF))); + section.put(ENTRY_ENUMTOR_DECL_STRING, fFilterMatcher.contains(new Integer(ENTRY_ENUMTOR_DECL))); + section.put(ENTRY_METHOD_REF_STRING, fFilterMatcher.contains(new Integer(ENTRY_METHOD_REF))); + section.put(ENTRY_METHOD_DECL_STRING, fFilterMatcher.contains(new Integer(ENTRY_METHOD_DECL))); + section.put(ENTRY_MACRO_DECL_STRING, fFilterMatcher.contains(new Integer(ENTRY_MACRO_DECL))); + section.put(ENTRY_INCLUDE_REF_STRING, fFilterMatcher.contains(new Integer(ENTRY_INCLUDE_REF))); + section.put(ENTRY_SUPER_REF_STRING, fFilterMatcher.contains(new Integer(ENTRY_SUPER_REF))); + section.put(ENTRY_TYPE_DECL_T_STRING, fFilterMatcher.contains(new Integer(ENTRY_TYPE_DECL_T))); + section.put(ENTRY_TYPE_DECL_C_STRING, fFilterMatcher.contains(new Integer(ENTRY_TYPE_DECL_C))); + section.put(ENTRY_TYPE_DECL_V_STRING, fFilterMatcher.contains(new Integer(ENTRY_TYPE_DECL_V))); + section.put(ENTRY_TYPE_DECL_S_STRING, fFilterMatcher.contains(new Integer(ENTRY_TYPE_DECL_S))); + section.put(ENTRY_TYPE_DECL_E_STRING, fFilterMatcher.contains(new Integer(ENTRY_TYPE_DECL_E))); + section.put(ENTRY_TYPE_DECL_U_STRING, fFilterMatcher.contains(new Integer(ENTRY_TYPE_DECL_U))); + section.put(ENTRY_TYPE_DECL_D_STRING, fFilterMatcher.contains(new Integer(ENTRY_TYPE_DECL_D))); + section.put(ENTRY_TYPE_DECL_F_STRING, fFilterMatcher.contains(new Integer(ENTRY_TYPE_DECL_F))); + section.put(ENTRY_TYPE_DECL_G_STRING, fFilterMatcher.contains(new Integer(ENTRY_TYPE_DECL_G))); + section.put(ENTRY_TYPE_DECL_H_STRING, fFilterMatcher.contains(new Integer(ENTRY_TYPE_DECL_H))); + section.put(ENTRY_TYPE_DECL_I_STRING, fFilterMatcher.contains(new Integer(ENTRY_TYPE_DECL_I))); + + section.put(PAGE_SIZE, pageSize); + } + + /** + * Stores default dialog settings. + */ + protected void writeDefaultSettings(IDialogSettings section) { + section.put(ENTRY_REF_STRING, true); + section.put(ENTRY_TYPE_REF_STRING, true); +// section.put(ENTRY_TYPE_DECL_STRING, true); + section.put(ENTRY_FUNCTION_REF_STRING, true); + section.put(ENTRY_FUNCTION_DECL_STRING, true); + section.put(ENTRY_CONSTRUCTOR_REF_STRING, true); + section.put(ENTRY_CONSTRUCTOR_DECL_STRING, true); + section.put(ENTRY_NAMESPACE_REF_STRING, true); + section.put(ENTRY_NAMESPACE_DECL_STRING, true); + section.put(ENTRY_FIELD_REF_STRING, true); + section.put(ENTRY_FIELD_DECL_STRING, true); + section.put(ENTRY_ENUMTOR_REF_STRING, true); + section.put(ENTRY_ENUMTOR_DECL_STRING, true); + section.put(ENTRY_METHOD_REF_STRING, true); + section.put(ENTRY_METHOD_DECL_STRING, true); + section.put(ENTRY_MACRO_DECL_STRING, true); + section.put(ENTRY_INCLUDE_REF_STRING, true); + section.put(ENTRY_SUPER_REF_STRING, true); + section.put(ENTRY_TYPE_DECL_T_STRING, true); + section.put(ENTRY_TYPE_DECL_C_STRING, true); + section.put(ENTRY_TYPE_DECL_V_STRING, true); + section.put(ENTRY_TYPE_DECL_S_STRING, true); + section.put(ENTRY_TYPE_DECL_E_STRING, true); + section.put(ENTRY_TYPE_DECL_U_STRING, true); + section.put(ENTRY_TYPE_DECL_D_STRING, true); + section.put(ENTRY_TYPE_DECL_F_STRING, true); + section.put(ENTRY_TYPE_DECL_G_STRING, true); + section.put(ENTRY_TYPE_DECL_H_STRING, true); + section.put(ENTRY_TYPE_DECL_I_STRING, true); + + section.put(PAGE_SIZE, IndexerNodeParent.PAGE_SIZE); + } + + protected Point getInitialLocation(Point initialSize) { + Point result = super.getInitialLocation(initialSize); + if (fLocation != null) { + result.x = fLocation.x; + result.y = fLocation.y; + Rectangle display = getShell().getDisplay().getClientArea(); + int xe = result.x + initialSize.x; + if (xe > display.width) { + result.x -= xe - display.width; + } + int ye = result.y + initialSize.y; + if (ye > display.height) { + result.y -= ye - display.height; + } + } + return result; + } + + protected Point getInitialSize() { + Point result = super.getInitialSize(); + if (fSize != null) { + result.x = Math.max(result.x, fSize.x); + result.y = Math.max(result.y, fSize.y); + Rectangle display = getShell().getDisplay().getClientArea(); + result.x = Math.min(result.x, display.width); + result.y = Math.min(result.y, display.height); + } + return result; + } + + /** + * Initializes itself from the dialog settings with the same state + * as at the previous invocation. + */ + public void readSettings(IDialogSettings section) { + try { + int x = section.getInt(SETTINGS_X_POS); + int y = section.getInt(SETTINGS_Y_POS); + fLocation = new Point(x, y); + int width = section.getInt(SETTINGS_WIDTH); + int height = section.getInt(SETTINGS_HEIGHT); + fSize = new Point(width, height); + + pageSize = String.valueOf(section.getInt(PAGE_SIZE)); + } catch (NumberFormatException e) { + fLocation = null; + fSize = null; + } + + if (section.getBoolean(ENTRY_REF_STRING)) { + Integer typeObject = new Integer(ENTRY_REF); + if (fKnownTypes.contains(typeObject)) + fFilterMatcher.add(typeObject); + } + if (section.getBoolean(ENTRY_TYPE_REF_STRING)) { + Integer typeObject = new Integer(ENTRY_TYPE_REF); + if (fKnownTypes.contains(typeObject)) + fFilterMatcher.add(typeObject); + } +// if (section.getBoolean(ENTRY_TYPE_DECL_STRING)) { +// Integer typeObject = new Integer(ENTRY_TYPE_DECL); +// if (fKnownTypes.contains(typeObject)) +// fFilterMatcher.add(typeObject); +// } + if (section.getBoolean(ENTRY_FUNCTION_REF_STRING)) { + Integer typeObject = new Integer(ENTRY_FUNCTION_REF); + if (fKnownTypes.contains(typeObject)) + fFilterMatcher.add(typeObject); + } + if (section.getBoolean(ENTRY_FUNCTION_DECL_STRING)) { + Integer typeObject = new Integer(ENTRY_FUNCTION_DECL); + if (fKnownTypes.contains(typeObject)) + fFilterMatcher.add(typeObject); + } + if (section.getBoolean(ENTRY_CONSTRUCTOR_REF_STRING)) { + Integer typeObject = new Integer(ENTRY_CONSTRUCTOR_REF); + if (fKnownTypes.contains(typeObject)) + fFilterMatcher.add(typeObject); + } + if (section.getBoolean(ENTRY_CONSTRUCTOR_DECL_STRING)) { + Integer typeObject = new Integer(ENTRY_CONSTRUCTOR_DECL); + if (fKnownTypes.contains(typeObject)) + fFilterMatcher.add(typeObject); + } + if (section.getBoolean(ENTRY_NAMESPACE_REF_STRING)) { + Integer typeObject = new Integer(ENTRY_NAMESPACE_REF); + if (fKnownTypes.contains(typeObject)) + fFilterMatcher.add(typeObject); + } + if (section.getBoolean(ENTRY_NAMESPACE_DECL_STRING)) { + Integer typeObject = new Integer(ENTRY_NAMESPACE_DECL); + if (fKnownTypes.contains(typeObject)) + fFilterMatcher.add(typeObject); + } + if (section.getBoolean(ENTRY_FIELD_REF_STRING)) { + Integer typeObject = new Integer(ENTRY_FIELD_REF); + if (fKnownTypes.contains(typeObject)) + fFilterMatcher.add(typeObject); + } + if (section.getBoolean(ENTRY_FIELD_DECL_STRING)) { + Integer typeObject = new Integer(ENTRY_FIELD_DECL); + if (fKnownTypes.contains(typeObject)) + fFilterMatcher.add(typeObject); + } + if (section.getBoolean(ENTRY_ENUMTOR_REF_STRING)) { + Integer typeObject = new Integer(ENTRY_ENUMTOR_REF); + if (fKnownTypes.contains(typeObject)) + fFilterMatcher.add(typeObject); + } + if (section.getBoolean(ENTRY_ENUMTOR_DECL_STRING)) { + Integer typeObject = new Integer(ENTRY_ENUMTOR_DECL); + if (fKnownTypes.contains(typeObject)) + fFilterMatcher.add(typeObject); + } + if (section.getBoolean(ENTRY_METHOD_REF_STRING)) { + Integer typeObject = new Integer(ENTRY_METHOD_REF); + if (fKnownTypes.contains(typeObject)) + fFilterMatcher.add(typeObject); + } + if (section.getBoolean(ENTRY_METHOD_DECL_STRING)) { + Integer typeObject = new Integer(ENTRY_METHOD_DECL); + if (fKnownTypes.contains(typeObject)) + fFilterMatcher.add(typeObject); + } + if (section.getBoolean(ENTRY_MACRO_DECL_STRING)) { + Integer typeObject = new Integer(ENTRY_MACRO_DECL); + if (fKnownTypes.contains(typeObject)) + fFilterMatcher.add(typeObject); + } + if (section.getBoolean(ENTRY_INCLUDE_REF_STRING)) { + Integer typeObject = new Integer(ENTRY_INCLUDE_REF); + if (fKnownTypes.contains(typeObject)) + fFilterMatcher.add(typeObject); + } + if (section.getBoolean(ENTRY_SUPER_REF_STRING)) { + Integer typeObject = new Integer(ENTRY_SUPER_REF); + if (fKnownTypes.contains(typeObject)) + fFilterMatcher.add(typeObject); + } + if (section.getBoolean(ENTRY_TYPE_DECL_T_STRING)) { + Integer typeObject = new Integer(ENTRY_TYPE_DECL_T); + if (fKnownTypes.contains(typeObject)) + fFilterMatcher.add(typeObject); + } + if (section.getBoolean(ENTRY_TYPE_DECL_C_STRING)) { + Integer typeObject = new Integer(ENTRY_TYPE_DECL_C); + if (fKnownTypes.contains(typeObject)) + fFilterMatcher.add(typeObject); + } + if (section.getBoolean(ENTRY_TYPE_DECL_V_STRING)) { + Integer typeObject = new Integer(ENTRY_TYPE_DECL_V); + if (fKnownTypes.contains(typeObject)) + fFilterMatcher.add(typeObject); + } + if (section.getBoolean(ENTRY_TYPE_DECL_S_STRING)) { + Integer typeObject = new Integer(ENTRY_TYPE_DECL_S); + if (fKnownTypes.contains(typeObject)) + fFilterMatcher.add(typeObject); + } + if (section.getBoolean(ENTRY_TYPE_DECL_E_STRING)) { + Integer typeObject = new Integer(ENTRY_TYPE_DECL_E); + if (fKnownTypes.contains(typeObject)) + fFilterMatcher.add(typeObject); + } + if (section.getBoolean(ENTRY_TYPE_DECL_U_STRING)) { + Integer typeObject = new Integer(ENTRY_TYPE_DECL_U); + if (fKnownTypes.contains(typeObject)) + fFilterMatcher.add(typeObject); + } + if (section.getBoolean(ENTRY_TYPE_DECL_D_STRING)) { + Integer typeObject = new Integer(ENTRY_TYPE_DECL_D); + if (fKnownTypes.contains(typeObject)) + fFilterMatcher.add(typeObject); + } + if (section.getBoolean(ENTRY_TYPE_DECL_F_STRING)) { + Integer typeObject = new Integer(ENTRY_TYPE_DECL_F); + if (fKnownTypes.contains(typeObject)) + fFilterMatcher.add(typeObject); + } + if (section.getBoolean(ENTRY_TYPE_DECL_G_STRING)) { + Integer typeObject = new Integer(ENTRY_TYPE_DECL_G); + if (fKnownTypes.contains(typeObject)) + fFilterMatcher.add(typeObject); + } + if (section.getBoolean(ENTRY_TYPE_DECL_H_STRING)) { + Integer typeObject = new Integer(ENTRY_TYPE_DECL_H); + if (fKnownTypes.contains(typeObject)) + fFilterMatcher.add(typeObject); + } + if (section.getBoolean(ENTRY_TYPE_DECL_I_STRING)) { + Integer typeObject = new Integer(ENTRY_TYPE_DECL_I); + if (fKnownTypes.contains(typeObject)) + fFilterMatcher.add(typeObject); + } + } + + public IndexerFilterManager createFilterManager() { + return new IndexerFilterManager(fFilterMatcher, fFilter); + } + + private void apply() { + fFilter = filterText.getText(); + pageSize = pageSizeText.getText(); + writeSettings(getDialogSettings()); + root.setFilterManager(fFilterMatcher, fFilter); + + int size=IndexerNodeParent.PAGE_SIZE; + try { + size = Integer.valueOf(pageSize).intValue(); + if (size<=0) size=IndexerNodeParent.PAGE_SIZE; + } catch (NumberFormatException e) {} + + root.setPageSize(size); + root.reset(); + } + + public String getPageSize() { + return pageSize; + } + +} diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/IndexerView/IndexerFilterManager.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/IndexerView/IndexerFilterManager.java new file mode 100644 index 00000000000..2a7cf120409 --- /dev/null +++ b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/IndexerView/IndexerFilterManager.java @@ -0,0 +1,51 @@ +/********************************************************************** + * Copyright (c) 2005 IBM Canada and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Common Public License v0.5 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/cpl-v05.html + * + * Contributors: + * IBM Rational Software - Initial API and implementation + **********************************************************************/ +package org.eclipse.cdt.ui.tests.IndexerView; + +import java.util.Collection; + +/** + * @author dsteffle + */ +public class IndexerFilterManager { + private static final String BLANK_STRING = ""; //$NON-NLS-1$ + private static final String COMMA_SEPARATOR = ","; //$NON-NLS-1$ + Collection filters = null; + String nameFilter = null; + + public IndexerFilterManager(Collection filters, String nameFilter) { + this.filters = filters; + this.nameFilter = nameFilter; + } + + public boolean isFiltered(IndexerNodeLeaf leaf) { + String[] nameFilters = nameFilter.split(COMMA_SEPARATOR); + for(int i=0; i 0) { + boolean matchesPattern=false; + for(int l=0; l 0) end = word.indexOf(IIndexConstants.SEPARATOR, word.indexOf(stringBeforeName) + stringBeforeName.length() ); + name = word.substring(word.indexOf(stringBeforeName) + stringBeforeName.length(), end); + + } + + public IndexerNodeParent getParent() { + return parent; + } + + public void setParent(IndexerNodeParent parent) { + this.parent = parent; + } + + public Object getAdapter(Class adapter) { + if (adapter == IPropertySource.class) + return new IndexerPropertySource(result); + + return null; + } + + private class IndexerPropertySource implements IPropertySource { + + private static final String IENTRYRESULT = "IEntryResult"; //$NON-NLS-1$ + private static final String IENTRYRESULT_GETWORD__ = "IEntryResult#getWord()"; //$NON-NLS-1$ + private static final String REFERENCES = "References"; //$NON-NLS-1$ + private static final String REFERENCE_NUMBER_ = "reference# "; //$NON-NLS-1$ + private static final int DEFAULT_DESCRIPTOR_SIZE = 4; + IEntryResult entryResult = null; + + public IndexerPropertySource(IEntryResult result) { + this.entryResult = result; + } + + public Object getEditableValue() { + return null; + } + + public IPropertyDescriptor[] getPropertyDescriptors() { + IPropertyDescriptor[] descriptors = new IPropertyDescriptor[DEFAULT_DESCRIPTOR_SIZE]; + + TextPropertyDescriptor text = null; + + IndexInput input = new BlocksIndexInput(indexFile); + try { + input.open(); + + // get the reference descriptors + int[] references = entryResult.getFileReferences(); + if (references != null) { + for (int j = 0; j < references.length; ++j) { + IndexedFile file = input.getIndexedFile(references[j]); + if (file != null && file.getPath() != null) { + String id = REFERENCE_NUMBER_ + String.valueOf(j); + text = new TextPropertyDescriptor(new TextDescriptorId(id, PathUtil.getWorkspaceRelativePath(file.getPath()).toOSString()), id); + text.setCategory(REFERENCES); + descriptors = (IPropertyDescriptor[])ArrayUtil.append(IPropertyDescriptor.class, descriptors, text); + } + } + } + + // add a word descriptor + text = new TextPropertyDescriptor(new TextDescriptorId(IENTRYRESULT_GETWORD__, String.valueOf(entryResult.getWord())), IENTRYRESULT_GETWORD__); + text.setCategory(IENTRYRESULT); + descriptors = (IPropertyDescriptor[])ArrayUtil.append(IPropertyDescriptor.class, descriptors, text); + + } catch (IOException e) { + } + + return (IPropertyDescriptor[])ArrayUtil.trim(IPropertyDescriptor.class, descriptors); + } + + private class TextDescriptorId { + String id = null; + String file = null; + + public TextDescriptorId(String id, String file) { + this.id=id; + this.file=file; + } + + public String getFile() { + return file; + } + + } + + public Object getPropertyValue(Object id) { + if (id instanceof TextDescriptorId) { + return ((TextDescriptorId)id).getFile(); + } + + return null; + } + + public boolean isPropertySet(Object id) { + return false; + } + + public void resetPropertyValue(Object id) { } + + public void setPropertyValue(Object id, Object value) { } + + } + + public IEntryResult getResult() { + return result; + } + + public void setResult(IEntryResult result) { + this.result = result; + } + + public String toString() { + return name; + } + + public int getFiltersType() { + return filtersType; + } + + public char getType() { + return type; + } + + public String getName() { + return name; + } +} diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/IndexerView/IndexerNodeParent.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/IndexerView/IndexerNodeParent.java new file mode 100644 index 00000000000..7cdf9a9d0ad --- /dev/null +++ b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/IndexerView/IndexerNodeParent.java @@ -0,0 +1,177 @@ +/********************************************************************** + * Copyright (c) 2005 IBM Canada and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Common Public License v0.5 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/cpl-v05.html + * + * Contributors: + * IBM Rational Software - Initial API and implementation + **********************************************************************/ +package org.eclipse.cdt.ui.tests.IndexerView; + +import java.io.File; +import java.util.Collection; + +import org.eclipse.cdt.core.parser.util.ArrayUtil; +import org.eclipse.cdt.internal.core.index.IEntryResult; +import org.eclipse.cdt.ui.testplugin.CTestPlugin; + +/** + * @author dsteffle + */ +public class IndexerNodeParent extends IndexerNodeLeaf { + public static final int PAGE_SIZE = 40; + private int pageSize=PAGE_SIZE; + private static final IndexerNodeLeaf[] EMPTY_INDEXER_NODE_LEAVES = new IndexerNodeLeaf[0]; + private IndexerNodeLeaf[] children = EMPTY_INDEXER_NODE_LEAVES; + private IndexerNodeLeaf[] childrenToDisplay = new IndexerNodeLeaf[PAGE_SIZE]; + private int lastBackwardDisplayed = 0; + private int lastForwardDisplayed=0; + private boolean isForward=true; + private boolean firstDisplay=true; + private IndexerFilterManager filterManager = null; + private IndexerView.ViewContentProvider view=null; + + public IndexerNodeParent(IEntryResult result, File indexerFile, IndexerView.ViewContentProvider view) { + super(result, indexerFile); + + // create an IndexerFilterManager using the FilterIndexerViewDialog (since all of the work is done there anyways) + FilterIndexerViewDialog dialog = new FilterIndexerViewDialog(CTestPlugin.getStandardDisplay().getActiveShell(), this, view.getProjectName()); + dialog.readSettings(dialog.getDialogSettings()); + filterManager = dialog.createFilterManager(); + + try { + pageSize = Integer.valueOf(dialog.getPageSize()).intValue(); + } catch (NumberFormatException e) {} + + this.view = view; + } + + public IndexerNodeLeaf[] getChildren() { + // if there is nothing to display return an empty list + if (children.length == 0) return EMPTY_INDEXER_NODE_LEAVES; + // obey the bounds of the list! + if (!firstDisplay && (!isForward && lastBackwardDisplayed==0 || + isForward && lastForwardDisplayed==children.length-1)) { + if (isForward) + view.setDisplayForwards(false); + else + view.setDisplayBackwards(false); + + return (IndexerNodeLeaf[])ArrayUtil.removeNulls(IndexerNodeLeaf.class, childrenToDisplay); + } + + int start=0; + if (isForward) { + if (lastForwardDisplayed==0) start=0; + else start=lastForwardDisplayed+1; + } else { + if (lastBackwardDisplayed==0) start=0; + else start=lastBackwardDisplayed-1; + } + boolean shouldDisplay=true; + int numAdded=0; + + int i=start, j=(isForward?0:pageSize-1); + IndexerNodeLeaf[] temp = new IndexerNodeLeaf[pageSize]; + boolean tempIsUseful=false; + while(numAdded=0) { + // only add the child to the children to display if it matches the current filters set on the view + shouldDisplay = filterManager.isFiltered(children[i]); + + if (shouldDisplay) { + tempIsUseful=true; + + temp[j] = children[i]; + numAdded++; + if (isForward) lastForwardDisplayed=i; + else if (j==pageSize-1) lastForwardDisplayed=i; + if (j==0) lastBackwardDisplayed=i; + + // move the index to the next entry in the array to store the next valid child to display + if (isForward) { + if (j+1=0) j--; + } + } + + shouldDisplay=true; // reset this value + + // move the index to the next child to analyze + if (isForward) { + i++; + } else { + i--; + } + } + + // if there is useful content on the next page, return it, otherwise just return what is being displayed + if (tempIsUseful) { + childrenToDisplay = new IndexerNodeLeaf[pageSize]; // blank the old array being displayed + // copy the temp array into the actual array + for(int k=0, l=0; k 0); + } + + public int getFullLength() { + return children.length; + } + + public void setIsForward(boolean direction) { + isForward = direction; + } + + public void setFilterManager(Collection filters, String filterName) { + this.filterManager = new IndexerFilterManager(filters, filterName); + } + + public void reset() { + lastBackwardDisplayed = 0; + lastForwardDisplayed=0; + isForward=true; + firstDisplay=true; + childrenToDisplay = EMPTY_INDEXER_NODE_LEAVES; + } + + public void setPageSize(int size) { + pageSize = size; + } + + public void setView(IndexerView.ViewContentProvider view) { + this.view = view; + } + +} diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/IndexerView/IndexerView.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/IndexerView/IndexerView.java new file mode 100644 index 00000000000..6877e8352c8 --- /dev/null +++ b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/IndexerView/IndexerView.java @@ -0,0 +1,525 @@ +/********************************************************************** + * Copyright (c) 2005 IBM Canada and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Common Public License v0.5 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/cpl-v05.html + * + * Contributors: + * IBM Rational Software - Initial API and implementation + **********************************************************************/ +package org.eclipse.cdt.ui.tests.IndexerView; + +import java.io.IOException; + +import org.eclipse.cdt.core.index.ICDTIndexer; +import org.eclipse.cdt.core.parser.util.ArrayUtil; +import org.eclipse.cdt.core.search.ICSearchConstants; +import org.eclipse.cdt.internal.core.index.IEntryResult; +import org.eclipse.cdt.internal.core.index.IIndex; +import org.eclipse.cdt.internal.core.index.IIndexer; +import org.eclipse.cdt.internal.core.index.sourceindexer.AbstractIndexer; +import org.eclipse.cdt.ui.testplugin.CTestPlugin; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.jface.action.Action; +import org.eclipse.jface.action.IMenuListener; +import org.eclipse.jface.action.IMenuManager; +import org.eclipse.jface.action.IToolBarManager; +import org.eclipse.jface.action.MenuManager; +import org.eclipse.jface.action.Separator; +import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.ISelectionChangedListener; +import org.eclipse.jface.viewers.IStructuredContentProvider; +import org.eclipse.jface.viewers.ITreeContentProvider; +import org.eclipse.jface.viewers.LabelProvider; +import org.eclipse.jface.viewers.SelectionChangedEvent; +import org.eclipse.jface.viewers.TableViewer; +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.jface.viewers.ViewerFilter; +import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Menu; +import org.eclipse.swt.widgets.TableItem; +import org.eclipse.ui.IActionBars; +import org.eclipse.ui.IViewPart; +import org.eclipse.ui.IWorkbenchActionConstants; +import org.eclipse.ui.part.ViewPart; +import org.eclipse.ui.views.properties.PropertySheet; + +/** + * @author dsteffle + */ +public class IndexerView extends ViewPart { + private static final String INDEXER_VIEW___ = "Indexer View - "; //$NON-NLS-1$ + private static final String _INDEXER_MENU_MANAGER = "#Indexer_Menu_Manager"; //$NON-NLS-1$ + private static final String SET_FILTERS = "Set Filters"; //$NON-NLS-1$ + private static final String NEXT_PAGE = "Next Page"; //$NON-NLS-1$ + private static final String PREVIOUS_PAGE = "Previous Page"; //$NON-NLS-1$ + public static final String VIEW_ID = "org.eclipse.cdt.ui.tests.IndexerView"; //$NON-NLS-1$ + private static final String PROPERTIES_VIEW = "org.eclipse.ui.views.PropertySheet"; //$NON-NLS-1$ + protected static final String BLANK_STRING = ""; //$NON-NLS-1$ + static TableViewer viewer; + protected Action previousPageAction; + protected Action nextPageAction; + protected Action singleClickAction; + protected Action setFiltersAction; + protected IIndexer[] indexers = new IIndexer[CTestPlugin.getWorkspace().getRoot().getProjects().length]; + protected IProject project = null; + + protected static ViewContentProvider.StartInitializingIndexerView initializeIndexerViewJob = null; + + public class ViewContentProvider implements IStructuredContentProvider, + ITreeContentProvider { + + private static final String POPULATING_INDEXER_VIEW = "populating indexer view"; //$NON-NLS-1$ + protected IndexerNodeParent invisibleRoot; + + protected boolean displayForwards=false; + protected boolean displayBackwards=false; + + private class InitializeView extends Job { + private static final String ALL_NAME_SEARCH = "*"; //$NON-NLS-1$ + private static final String INDEXER_VIEW = "Indexer View"; //$NON-NLS-1$ + TableViewer theViewer = null; + + public InitializeView(String name, TableViewer viewer) { + super(name); + this.theViewer = viewer; + } + + protected IStatus run(IProgressMonitor monitor) { + + for(int i=0; i 0) { + TableItem[] selection = new TableItem[1]; + selection[0] = view.getTable().getItems()[0]; + + // select the first item to prevent it from being selected accidentally (and possibly switching editors accidentally) + view.getTable().setSelection(selection); + } + + previousPageAction.setEnabled(displayBackwards); + nextPageAction.setEnabled(displayForwards); + } + } + + private class StartInitializingIndexerView extends Job { + private static final String INITIALIZE_INDEXER_VIEW = "initialize Indexer View"; //$NON-NLS-1$ + InitializeView job = null; + boolean updateView=true; + + public StartInitializingIndexerView(InitializeView job, boolean updateView) { + super(INITIALIZE_INDEXER_VIEW); + this.job = job; + this.updateView = updateView; + } + + protected IStatus run(IProgressMonitor monitor) { + job.schedule(); + + try { + job.join(); + } catch (InterruptedException ie) { + return Status.CANCEL_STATUS; + } + + CTestPlugin.getStandardDisplay().asyncExec(new InitializeRunnable(viewer, updateView)); // update the view from the Display thread + + updateView=true; + + return job.getResult(); + } + } + + public ViewContentProvider() { + this(null, false, false); + } + + public void setDisplayForwards(boolean displayForwards) { + this.displayForwards = displayForwards; + } + + public void setDisplayBackwards(boolean displayBackwards) { + this.displayBackwards = displayBackwards; + } + + public ViewContentProvider(IndexerNodeParent parent, boolean displayForwards, boolean displayBackwards) { + if (parent == null) { + invisibleRoot = new IndexerNodeParent(null, null, this); + initializeIndexerViewJob = new StartInitializingIndexerView(new InitializeView(POPULATING_INDEXER_VIEW, viewer), true); + initializeIndexerViewJob.schedule(); + } else { + invisibleRoot = parent; + initializeIndexerViewJob = new StartInitializingIndexerView(new InitializeView(POPULATING_INDEXER_VIEW, viewer), false); + initializeIndexerViewJob.schedule(); + } + + this.displayForwards=displayForwards; + this.displayBackwards=displayBackwards; + } + + public Object[] getElements(Object inputElement) { + if (inputElement.equals(getViewSite())) { + return getChildren(invisibleRoot); + } + return getChildren(inputElement); + } + + public void dispose() {} + + public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { + // TODO Auto-generated method stub + } + + public Object[] getChildren(Object parentElement) { + if (parentElement instanceof IndexerNodeParent) { + return ((IndexerNodeParent) parentElement).getChildren(); + } + return new Object[0]; + } + + public Object getParent(Object element) { + if (element instanceof IndexerNodeLeaf) { + return ((IndexerNodeLeaf) element).getParent(); + } + return null; + } + + public boolean hasChildren(Object element) { + if (element instanceof IndexerNodeParent) + return ((IndexerNodeParent) element).hasChildren(); + return false; + } + + public IndexerNodeParent getInvisibleRoot() { + return invisibleRoot; + } + + public boolean isDisplayForwards() { + return displayForwards; + } + + public boolean isDisplayBackwards() { + return displayBackwards; + } + + public String getProjectName() { + if (project == null) return BLANK_STRING; + + return project.getName(); + } + } + + class ViewLabelProvider extends LabelProvider { + + public String getText(Object obj) { + if (obj == null) return BLANK_STRING; + return obj.toString(); + } + + public Image getImage(Object obj) { + String imageKey = IndexerViewPluginImages.IMG_WARNING; + + if (obj instanceof IndexerNodeLeaf) { + String word = String.valueOf(((IndexerNodeLeaf)obj).getResult().getWord()); + + if (word.startsWith(FilterIndexerViewDialog.ENTRY_REF_STRING)) { + imageKey = IndexerViewPluginImages.IMG_REF; + } else if (word.startsWith(FilterIndexerViewDialog.ENTRY_FUNCTION_REF_STRING)) { + imageKey = IndexerViewPluginImages.IMG_FUNCTION_REF; + } else if (word.startsWith(FilterIndexerViewDialog.ENTRY_FUNCTION_DECL_STRING)) { + imageKey = IndexerViewPluginImages.IMG_FUNCTION_DECL; + } else if (word.startsWith(FilterIndexerViewDialog.ENTRY_CONSTRUCTOR_REF_STRING)) { + imageKey = IndexerViewPluginImages.IMG_CONSTRUCTOR_REF; + } else if (word.startsWith(FilterIndexerViewDialog.ENTRY_CONSTRUCTOR_DECL_STRING)) { + imageKey = IndexerViewPluginImages.IMG_CONSTRUCTOR_DECL; + } else if (word.startsWith(FilterIndexerViewDialog.ENTRY_NAMESPACE_REF_STRING)) { + imageKey = IndexerViewPluginImages.IMG_NAMESPACE_REF; + } else if (word.startsWith(FilterIndexerViewDialog.ENTRY_NAMESPACE_DECL_STRING)) { + imageKey = IndexerViewPluginImages.IMG_NAMESPACE_DECL; + } else if (word.startsWith(FilterIndexerViewDialog.ENTRY_FIELD_REF_STRING)) { + imageKey = IndexerViewPluginImages.IMG_FIELD_REF; + } else if (word.startsWith(FilterIndexerViewDialog.ENTRY_FIELD_DECL_STRING)) { + imageKey = IndexerViewPluginImages.IMG_FIELD_DECL; + } else if (word.startsWith(FilterIndexerViewDialog.ENTRY_ENUMTOR_REF_STRING)) { + imageKey = IndexerViewPluginImages.IMG_ENUMTOR_REF; + } else if (word.startsWith(FilterIndexerViewDialog.ENTRY_ENUMTOR_DECL_STRING)) { + imageKey = IndexerViewPluginImages.IMG_ENUMTOR_DECL; + } else if (word.startsWith(FilterIndexerViewDialog.ENTRY_METHOD_REF_STRING)) { + imageKey = IndexerViewPluginImages.IMG_METHOD_REF; + } else if (word.startsWith(FilterIndexerViewDialog.ENTRY_METHOD_DECL_STRING)) { + imageKey = IndexerViewPluginImages.IMG_METHOD_DECL; + } else if (word.startsWith(FilterIndexerViewDialog.ENTRY_MACRO_DECL_STRING)) { + imageKey = IndexerViewPluginImages.IMG_MACRO_DECL; + } else if (word.startsWith(FilterIndexerViewDialog.ENTRY_INCLUDE_REF_STRING)) { + imageKey = IndexerViewPluginImages.IMG_INCLUDE_REF; + } else if (word.startsWith(FilterIndexerViewDialog.ENTRY_SUPER_REF_STRING)) { + imageKey = IndexerViewPluginImages.IMG_SUPER_REF; + } else if (word.startsWith(FilterIndexerViewDialog.ENTRY_TYPE_DECL_T_STRING)) { + imageKey = IndexerViewPluginImages.IMG_TYPEDEF; + } else if (word.startsWith(FilterIndexerViewDialog.ENTRY_TYPE_DECL_C_STRING)) { + imageKey = IndexerViewPluginImages.IMG_CLASS; + } else if (word.startsWith(FilterIndexerViewDialog.ENTRY_TYPE_DECL_V_STRING)) { + imageKey = IndexerViewPluginImages.IMG_VARIABLE; + } else if (word.startsWith(FilterIndexerViewDialog.ENTRY_TYPE_DECL_S_STRING)) { + imageKey = IndexerViewPluginImages.IMG_STRUCT; + } else if (word.startsWith(FilterIndexerViewDialog.ENTRY_TYPE_DECL_E_STRING)) { + imageKey = IndexerViewPluginImages.IMG_ENUM; + } else if (word.startsWith(FilterIndexerViewDialog.ENTRY_TYPE_DECL_U_STRING)) { + imageKey = IndexerViewPluginImages.IMG_UNION; + } else if (word.startsWith(FilterIndexerViewDialog.ENTRY_TYPE_REF_STRING)) { + imageKey = IndexerViewPluginImages.IMG_TYPE_REF; + } else if (word.startsWith(FilterIndexerViewDialog.ENTRY_TYPE_DECL_D_STRING)) { + imageKey = IndexerViewPluginImages.IMG_DERIVED; + } else if (word.startsWith(FilterIndexerViewDialog.ENTRY_TYPE_DECL_F_STRING)) { + imageKey = IndexerViewPluginImages.IMG_FRIEND; + } else if (word.startsWith(FilterIndexerViewDialog.ENTRY_TYPE_DECL_G_STRING)) { + imageKey = IndexerViewPluginImages.IMG_FWD_CLASS; + } else if (word.startsWith(FilterIndexerViewDialog.ENTRY_TYPE_DECL_H_STRING)) { + imageKey = IndexerViewPluginImages.IMG_FWD_STRUCT; + } else if (word.startsWith(FilterIndexerViewDialog.ENTRY_TYPE_DECL_I_STRING)) { + imageKey = IndexerViewPluginImages.IMG_FWD_UNION; + } + } + + return IndexerViewPluginImages.get(imageKey); + } + } + + public void createPartControl(Composite parent) { + viewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL); + + viewer.setContentProvider(new ViewContentProvider()); + + viewer.setLabelProvider(new ViewLabelProvider()); + viewer.setInput(getViewSite()); + + makeActions(); + hookContextMenu(); + hookSingleClickAction(); + + contributeToActionBars(); + } + + private void makeActions() { + previousPageAction = new Action() { + public void run() { + if (viewer.getContentProvider() instanceof ViewContentProvider) { + IndexerNodeParent root = ((ViewContentProvider)viewer.getContentProvider()).getInvisibleRoot(); + root.setIsForward(false); + } + viewer.refresh(); + + setEnabled(((ViewContentProvider)viewer.getContentProvider()).isDisplayBackwards()); + nextPageAction.setEnabled(((ViewContentProvider)viewer.getContentProvider()).isDisplayForwards()); + } + }; + previousPageAction.setText(PREVIOUS_PAGE); + previousPageAction.setToolTipText(PREVIOUS_PAGE); + previousPageAction.setImageDescriptor(IndexerViewPluginImages.DESC_BACK); + + nextPageAction = new Action() { + public void run() { + if (viewer.getContentProvider() instanceof ViewContentProvider) { + IndexerNodeParent root = ((ViewContentProvider)viewer.getContentProvider()).getInvisibleRoot(); + root.setIsForward(true); + } + viewer.refresh(); + + previousPageAction.setEnabled(((ViewContentProvider)viewer.getContentProvider()).isDisplayBackwards()); + setEnabled(((ViewContentProvider)viewer.getContentProvider()).isDisplayForwards()); + } + }; + nextPageAction.setText(NEXT_PAGE); + nextPageAction.setToolTipText(NEXT_PAGE); + nextPageAction.setImageDescriptor(IndexerViewPluginImages.DESC_NEXT); + + setFiltersAction = new Action() { + public void run() { + if (!(viewer.getContentProvider() instanceof ViewContentProvider)) return; + + FilterIndexerViewDialog dialog = new FilterIndexerViewDialog(getSite().getShell(), ((ViewContentProvider)viewer.getContentProvider()).getInvisibleRoot(), project.getName()); + int result = dialog.open(); + + if (result == IDialogConstants.OK_ID) { + viewer.setContentProvider(new ViewContentProvider(((ViewContentProvider)viewer.getContentProvider()).getInvisibleRoot(), true, true)); + ((ViewContentProvider)viewer.getContentProvider()).getInvisibleRoot().setView((ViewContentProvider)viewer.getContentProvider()); // update the root's content provider + + previousPageAction.setEnabled(((ViewContentProvider)viewer.getContentProvider()).isDisplayBackwards()); + nextPageAction.setEnabled(((ViewContentProvider)viewer.getContentProvider()).isDisplayForwards()); + } + } + }; + setFiltersAction.setText(SET_FILTERS); + setFiltersAction.setToolTipText(SET_FILTERS); + setFiltersAction.setImageDescriptor(IndexerViewPluginImages.DESC_FILTER_BUTTON); + + singleClickAction = new IndexerHighlighterAction(); + } + + private void hookContextMenu() { + MenuManager menuMgr = new MenuManager(_INDEXER_MENU_MANAGER); + menuMgr.setRemoveAllWhenShown(true); + menuMgr.addMenuListener(new IMenuListener() { + private void hideMenuItems(IMenuManager manager) { + } + + public void menuAboutToShow(IMenuManager manager) { + IndexerView.this.fillContextMenu(manager); + hideMenuItems(manager); + } + }); + Menu menu = menuMgr.createContextMenu(viewer.getControl()); + viewer.getControl().setMenu(menu); + getSite().registerContextMenu(menuMgr, viewer); + } + + void fillContextMenu(IMenuManager manager) { + // Other plug-ins can contribute there actions here + manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS)); + } + + private class IndexerHighlighterAction extends Action { + public void run() { + ISelection selection = viewer.getSelection(); + + IViewPart part = getSite().getPage().findView(PROPERTIES_VIEW); + if (part instanceof PropertySheet) { + ((PropertySheet)part).selectionChanged(getSite().getPart(), selection); // TODO Devin need to instead get the part that this action belongs to... + } + } + } + + private void hookSingleClickAction() { + viewer.addSelectionChangedListener(new ISelectionChangedListener() { + public void selectionChanged(SelectionChangedEvent event) { + singleClickAction.run(); + } + }); + } + + private void contributeToActionBars() { + IActionBars bars = getViewSite().getActionBars(); + fillLocalPullDown(bars.getMenuManager()); + fillLocalToolBar(bars.getToolBarManager()); + } + + private void fillLocalPullDown(IMenuManager manager) { + } + + private void fillLocalToolBar(IToolBarManager manager) { + manager.add(previousPageAction); + manager.add(nextPageAction); + manager.add(new Separator()); + manager.add(setFiltersAction); + manager.add(new Separator()); + } + + public void setFocus() { + IViewPart part = getSite().getPage().findView(PROPERTIES_VIEW); + if (part instanceof PropertySheet) { + ((PropertySheet)part).selectionChanged(getSite().getPart(), viewer.getSelection()); + } + } + + public void appendIndexer(IIndexer indexer) { + indexers = (IIndexer[])ArrayUtil.append(IIndexer.class, indexers, indexer); + } + + public void clearIndexers() { + indexers = new IIndexer[CTestPlugin.getWorkspace().getRoot().getProjects().length]; + } + + public void setContentProvider(ViewContentProvider provider) { + viewer.setContentProvider(provider); + } + + public void setProject(IProject project) { + this.setPartName(INDEXER_VIEW___ + project.getName()); + this.project=project; + } + + public static ViewerFilter[] getViewerFilters() { + return viewer.getFilters(); + } + + public String getProjectName() { + if (project == null) return BLANK_STRING; + + return project.getName(); + } +} diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/IndexerView/IndexerViewPluginImages.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/IndexerView/IndexerViewPluginImages.java new file mode 100644 index 00000000000..c5c8d5042ed --- /dev/null +++ b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/IndexerView/IndexerViewPluginImages.java @@ -0,0 +1,149 @@ +/********************************************************************** + * Copyright (c) 2005 IBM Canada and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Common Public License v0.5 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/cpl-v05.html + * + * Contributors: + * IBM Rational Software - Initial API and implementation + **********************************************************************/ +package org.eclipse.cdt.ui.tests.IndexerView; + +import java.net.MalformedURLException; +import java.net.URL; + +import org.eclipse.cdt.ui.CUIPlugin; +import org.eclipse.cdt.ui.testplugin.CTestPlugin; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.jface.resource.ImageRegistry; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.widgets.Display; + +/** + * @author dsteffle + */ +public class IndexerViewPluginImages { + private static ImageRegistry imageRegistry = new ImageRegistry(CUIPlugin.getStandardDisplay()); + + /** + * Returns the standard display to be used. The method first checks, if + * the thread calling this method has an associated display. If so, this + * display is returned. Otherwise the method returns the default display. + */ + public static Display getStandardDisplay() { + Display display= Display.getCurrent(); + if (display == null) { + display= Display.getDefault(); + } + return display; + } + + // Subdirectory (under the package containing this class) where 16 color images are + private static URL fgIconBaseURL; + + static { + try { + fgIconBaseURL= new URL(CTestPlugin.getDefault().getBundle().getEntry("/"), "icons/" ); //$NON-NLS-1$ //$NON-NLS-2$ + } catch (MalformedURLException e) {} + } + public static final String PLUGIN_ID = "org.eclipse.cdt.testplugin.CTestPlugin"; //$NON-NLS-1$ + private static final String NAME_PREFIX= PLUGIN_ID + '.'; + private static final int NAME_PREFIX_LENGTH= NAME_PREFIX.length(); + public static final String ICON_PREFIX= "indexer_view/"; //$NON-NLS-1$ + + public static final String IMG_REF= NAME_PREFIX + "ref_obj.gif"; //$NON-NLS-1$ + public static final String IMG_TYPE_REF= NAME_PREFIX + "typedecl_ref_obj.gif"; //$NON-NLS-1$ + public static final String IMG_TYPE_DECL= NAME_PREFIX + "typedecl_obj.gif"; //$NON-NLS-1$ + public static final String IMG_FUNCTION_REF= NAME_PREFIX + "function_ref_obj.gif"; //$NON-NLS-1$ + public static final String IMG_FUNCTION_DECL= NAME_PREFIX + "function_obj.gif"; //$NON-NLS-1$ + public static final String IMG_CONSTRUCTOR_REF= NAME_PREFIX + "constructor_ref_obj.gif"; //$NON-NLS-1$ + public static final String IMG_CONSTRUCTOR_DECL= NAME_PREFIX + "constructor_obj.gif"; //$NON-NLS-1$ + public static final String IMG_NAMESPACE_REF= NAME_PREFIX + "namespace_ref_obj.gif"; //$NON-NLS-1$ + public static final String IMG_NAMESPACE_DECL= NAME_PREFIX + "namespace_obj.gif"; //$NON-NLS-1$ + public static final String IMG_FIELD_REF= NAME_PREFIX + "field_ref_obj.gif"; //$NON-NLS-1$ + public static final String IMG_FIELD_DECL= NAME_PREFIX + "field_obj.gif"; //$NON-NLS-1$ + public static final String IMG_ENUMTOR_REF= NAME_PREFIX + "enumerator_ref_obj.gif"; //$NON-NLS-1$ + public static final String IMG_ENUMTOR_DECL= NAME_PREFIX + "enumerator_obj.gif"; //$NON-NLS-1$ + public static final String IMG_METHOD_REF= NAME_PREFIX + "method_public_ref_obj.gif"; //$NON-NLS-1$ + public static final String IMG_METHOD_DECL= NAME_PREFIX + "method_public_obj.gif"; //$NON-NLS-1$ + public static final String IMG_MACRO_DECL= NAME_PREFIX + "macroDecl_obj.gif"; //$NON-NLS-1$ + public static final String IMG_INCLUDE_REF= NAME_PREFIX + "include_obj.gif"; //$NON-NLS-1$ + public static final String IMG_SUPER_REF= NAME_PREFIX + "super_co.gif"; //$NON-NLS-1$ + public static final String IMG_VARIABLE= NAME_PREFIX + "variable_obj.gif"; //$NON-NLS-1$ + public static final String IMG_CLASS= NAME_PREFIX + "class_obj.gif"; //$NON-NLS-1$ + public static final String IMG_ENUM= NAME_PREFIX + "enum_obj.gif"; //$NON-NLS-1$ + public static final String IMG_BACK= NAME_PREFIX + "ngback.gif"; //$NON-NLS-1$ + public static final String IMG_NEXT= NAME_PREFIX + "ngnext.gif"; //$NON-NLS-1$ + public static final String IMG_STRUCT= NAME_PREFIX + "struct_obj.gif"; //$NON-NLS-1$ + public static final String IMG_TYPEDEF= NAME_PREFIX + "typedef_obj.gif"; //$NON-NLS-1$ + public static final String IMG_UNION= NAME_PREFIX + "union_obj.gif"; //$NON-NLS-1$ + public static final String IMG_DERIVED= NAME_PREFIX + "derived.gif"; //$NON-NLS-1$ + public static final String IMG_FRIEND= NAME_PREFIX + "friend.gif"; //$NON-NLS-1$ + public static final String IMG_FWD_CLASS= NAME_PREFIX + "fwd_class.gif"; //$NON-NLS-1$ + public static final String IMG_FWD_STRUCT= NAME_PREFIX + "fwd_struct.gif"; //$NON-NLS-1$ + public static final String IMG_FWD_UNION= NAME_PREFIX + "fwd_union.gif"; //$NON-NLS-1$ + public static final String IMG_WARNING= NAME_PREFIX + "warning_icon.gif"; //$NON-NLS-1$ + public static final String IMG_FILTER_BUTTON= NAME_PREFIX + "filterbutton.gif"; //$NON-NLS-1$ + + public static final ImageDescriptor DESC_REF= createManaged(ICON_PREFIX, IMG_REF); + public static final ImageDescriptor DESC_TYPE_REF= createManaged(ICON_PREFIX, IMG_TYPE_REF); + public static final ImageDescriptor DESC_TYPE_DECL= createManaged(ICON_PREFIX, IMG_TYPE_DECL); + public static final ImageDescriptor DESC_FUNCTION_REF= createManaged(ICON_PREFIX, IMG_FUNCTION_REF); + public static final ImageDescriptor DESC_FUNCTION_DECL= createManaged(ICON_PREFIX, IMG_FUNCTION_DECL); + public static final ImageDescriptor DESC_CONSTRUCTOR_REF= createManaged(ICON_PREFIX, IMG_CONSTRUCTOR_REF); + public static final ImageDescriptor DESC_CONSTRUCTOR_DECL= createManaged(ICON_PREFIX, IMG_CONSTRUCTOR_DECL); + public static final ImageDescriptor DESC_NAMESPACE_REF= createManaged(ICON_PREFIX, IMG_NAMESPACE_REF); + public static final ImageDescriptor DESC_NAMESPACE_DECL= createManaged(ICON_PREFIX, IMG_NAMESPACE_DECL); + public static final ImageDescriptor DESC_FIELD_REF= createManaged(ICON_PREFIX, IMG_FIELD_REF); + public static final ImageDescriptor DESC_FIELD_DECL= createManaged(ICON_PREFIX, IMG_FIELD_DECL); + public static final ImageDescriptor DESC_ENUMTOR_REF= createManaged(ICON_PREFIX, IMG_ENUMTOR_REF); + public static final ImageDescriptor DESC_ENUMTOR_DECL= createManaged(ICON_PREFIX, IMG_ENUMTOR_DECL); + public static final ImageDescriptor DESC_METHOD_REF= createManaged(ICON_PREFIX, IMG_METHOD_REF); + public static final ImageDescriptor DESC_METHOD_DECL= createManaged(ICON_PREFIX, IMG_METHOD_DECL); + public static final ImageDescriptor DESC_MACRO_DECL= createManaged(ICON_PREFIX, IMG_MACRO_DECL); + public static final ImageDescriptor DESC_INCLUDE_REF= createManaged(ICON_PREFIX, IMG_INCLUDE_REF); + public static final ImageDescriptor DESC_SUPER_REF= createManaged(ICON_PREFIX, IMG_SUPER_REF); + public static final ImageDescriptor DESC_VARIABLE= createManaged(ICON_PREFIX, IMG_VARIABLE); + public static final ImageDescriptor DESC_CLASS= createManaged(ICON_PREFIX, IMG_CLASS); + public static final ImageDescriptor DESC_ENUM= createManaged(ICON_PREFIX, IMG_ENUM); + public static final ImageDescriptor DESC_BACK= createManaged(ICON_PREFIX, IMG_BACK); + public static final ImageDescriptor DESC_NEXT= createManaged(ICON_PREFIX, IMG_NEXT); + public static final ImageDescriptor DESC_STRUCT= createManaged(ICON_PREFIX, IMG_STRUCT); + public static final ImageDescriptor DESC_TYPEDEF= createManaged(ICON_PREFIX, IMG_TYPEDEF); + public static final ImageDescriptor DESC_UNION= createManaged(ICON_PREFIX, IMG_UNION); + public static final ImageDescriptor DESC_DERIVED= createManaged(ICON_PREFIX, IMG_DERIVED); + public static final ImageDescriptor DESC_FRIEND= createManaged(ICON_PREFIX, IMG_FRIEND); + public static final ImageDescriptor DESC_FWD_CLASS= createManaged(ICON_PREFIX, IMG_FWD_CLASS); + public static final ImageDescriptor DESC_FWD_STRUCT= createManaged(ICON_PREFIX, IMG_FWD_STRUCT); + public static final ImageDescriptor DESC_FWD_UNION= createManaged(ICON_PREFIX, IMG_FWD_UNION); + public static final ImageDescriptor DESC_WARNING= createManaged(ICON_PREFIX, IMG_WARNING); + public static final ImageDescriptor DESC_FILTER_BUTTON= createManaged(ICON_PREFIX, IMG_FILTER_BUTTON); + + private static ImageDescriptor createManaged(String prefix, String name) { + return createManaged(imageRegistry, prefix, name); + } + + private static ImageDescriptor createManaged(ImageRegistry registry, String prefix, String name) { + ImageDescriptor result= ImageDescriptor.createFromURL(makeIconFileURL(prefix, name.substring(NAME_PREFIX_LENGTH))); + registry.put(name, result); + return result; + } + + private static URL makeIconFileURL(String prefix, String name) { + StringBuffer buffer= new StringBuffer(prefix); + buffer.append(name); + try { + return new URL(fgIconBaseURL, buffer.toString()); + } catch (MalformedURLException e) { + CUIPlugin.getDefault().log(e); + return null; + } + } + + public static Image get(String key) { + return imageRegistry.get(key); + } + + +} diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/IndexerView/OpenIndexerViewAction.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/IndexerView/OpenIndexerViewAction.java new file mode 100644 index 00000000000..1101a1529dd --- /dev/null +++ b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/IndexerView/OpenIndexerViewAction.java @@ -0,0 +1,82 @@ +/********************************************************************** + * Copyright (c) 2005 IBM Canada and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Common Public License v0.5 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/cpl-v05.html + * + * Contributors: + * IBM Rational Software - Initial API and implementation + **********************************************************************/ +package org.eclipse.cdt.ui.tests.IndexerView; + +import org.eclipse.cdt.core.CCorePlugin; +import org.eclipse.cdt.internal.core.index.IIndexer; +import org.eclipse.cdt.internal.core.model.CProject; +import org.eclipse.core.resources.IProject; +import org.eclipse.jface.action.IAction; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.ui.IEditorActionDelegate; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IObjectActionDelegate; +import org.eclipse.ui.IViewActionDelegate; +import org.eclipse.ui.IViewPart; +import org.eclipse.ui.IWorkbenchPart; +import org.eclipse.ui.PartInitException; + +/** + * @author dsteffle + */ +public class OpenIndexerViewAction implements IViewActionDelegate, + IEditorActionDelegate, IObjectActionDelegate { + + IViewPart viewPart = null; + IProject proj = null; + public static int numViewsOpen=0; + + public void init(IViewPart view) { + this.viewPart = view; + } + + public void run(IAction action) { + IViewPart tempView = null; + + try { + // TODO Devin add support for multiple views +// tempView = viewPart.getSite().getPage().showView(IndexerView.VIEW_ID, proj.getName(), IWorkbenchPage.VIEW_ACTIVATE); + tempView = viewPart.getSite().getPage().showView(IndexerView.VIEW_ID); + if (tempView instanceof IndexerView) + ((IndexerView)tempView).setProject(proj); + + OpenIndexerViewAction.numViewsOpen++; + } catch (PartInitException pie) {} + + if (tempView != null) { + if (tempView instanceof IndexerView) { + ((IndexerView)tempView).clearIndexers(); + IIndexer indexer = CCorePlugin.getDefault().getCoreModel().getIndexManager().getIndexerForProject(proj); + ((IndexerView)tempView).appendIndexer(indexer); + ((IndexerView)tempView).setContentProvider(((IndexerView)tempView).new ViewContentProvider()); + } + } + + viewPart.getSite().getPage().activate(tempView); + } + + public void selectionChanged(IAction action, ISelection selection) { + if (selection instanceof IStructuredSelection && + ((IStructuredSelection)selection).getFirstElement() instanceof CProject) { + proj = ((CProject)((IStructuredSelection)selection).getFirstElement()).getProject(); + } + } + + public void setActiveEditor(IAction action, IEditorPart targetEditor) { + // TODO Auto-generated method stub + } + + public void setActivePart(IAction action, IWorkbenchPart targetPart) { + // TODO Auto-generated method stub + } + +}