From 185617a9bfec436f4d818d316fb60338c3dc72f9 Mon Sep 17 00:00:00 2001 From: lonnen Date: Mon, 14 Jun 2010 19:04:23 +0000 Subject: [PATCH] Added an Eclipse editor plugin for Processing --- editor/org.processing.editor/.classpath | 7 + editor/org.processing.editor/.project | 28 ++ .../.settings/org.eclipse.jdt.core.prefs | 8 + .../META-INF/MANIFEST.MF | 13 + .../editor/PresentationAction.class | Bin 0 -> 1304 bytes .../editor/ProcessingActionContributor.class | Bin 0 -> 3150 bytes .../editor/ProcessingAnnotationHover.class | Bin 0 -> 1252 bytes ...ngContentOutlinePage$ContentProvider.class | Bin 0 -> 4257 bytes ...ProcessingContentOutlinePage$Segment.class | Bin 0 -> 771 bytes .../editor/ProcessingContentOutlinePage.class | Bin 0 -> 3560 bytes .../ProcessingDocumentSetupParticipant.class | Bin 0 -> 1552 bytes ...singEditor$DefineFoldingRegionAction.class | Bin 0 -> 3196 bytes .../processing/editor/ProcessingEditor.class | Bin 0 -> 7036 bytes .../editor/ProcessingEditorMessages.class | Bin 0 -> 1280 bytes .../ProcessingEditorMessages.properties | 46 +++ .../editor/ProcessingEditorPlugin.class | Bin 0 -> 2378 bytes ...artitionScanner$EmptyCommentDetector.class | Bin 0 -> 781 bytes ...ngPartitionScanner$WordPredicateRule.class | Bin 0 -> 1472 bytes .../editor/ProcessingPartitionScanner.class | Bin 0 -> 2123 bytes ...ewerConfiguration$SingleTokenScanner.class | Bin 0 -> 842 bytes .../ProcessingSourceViewerConfiguration.class | Bin 0 -> 5681 bytes .../editor/ProcessingTextHover.class | Bin 0 -> 1720 bytes .../javadoc/JavaDocCompletionProcessor.class | Bin 0 -> 2161 bytes .../JavaDocScanner$JavaDocWordDetector.class | Bin 0 -> 780 bytes .../editor/javadoc/JavaDocScanner.class | Bin 0 -> 2877 bytes .../ProcessingAutoIndentStrategy.class | Bin 0 -> 5455 bytes .../language/ProcessingCodeScanner.class | Bin 0 -> 4795 bytes ...cessingCompletionProcessor$Validator.class | Bin 0 -> 1431 bytes .../ProcessingCompletionProcessor.class | Bin 0 -> 4227 bytes .../ProcessingDoubleClickSelector.class | Bin 0 -> 3678 bytes .../language/ProcessingEditorMessages.class | Bin 0 -> 1197 bytes .../editor/util/ProcessingColorProvider.class | Bin 0 -> 2442 bytes .../util/ProcessingWhitespaceDetector.class | Bin 0 -> 563 bytes .../editor/util/ProcessingWordDetector.class | Bin 0 -> 679 bytes editor/org.processing.editor/build.properties | 6 + .../icons/processing.gif | Bin 0 -> 144 bytes editor/org.processing.editor/plugin.xml | 34 +++ .../processing/editor/PresentationAction.java | 52 ++++ .../editor/ProcessingActionContributor.java | 90 ++++++ .../editor/ProcessingAnnotationHover.java | 42 +++ .../editor/ProcessingContentOutlinePage.java | 242 +++++++++++++++ .../ProcessingDocumentSetupParticipant.java | 35 +++ .../processing/editor/ProcessingEditor.java | 270 +++++++++++++++++ .../editor/ProcessingEditorMessages.java | 44 +++ .../ProcessingEditorMessages.properties | 46 +++ .../editor/ProcessingEditorPlugin.java | 130 ++++++++ .../editor/ProcessingPartitionScanner.java | 110 +++++++ .../ProcessingSourceViewerConfiguration.java | 172 +++++++++++ .../editor/ProcessingTextHover.java | 46 +++ .../javadoc/JavaDocCompletionProcessor.java | 68 +++++ .../editor/javadoc/JavaDocScanner.java | 82 +++++ .../ProcessingAutoIndentStrategy.java | 280 ++++++++++++++++++ .../language/ProcessingCodeScanner.java | 97 ++++++ .../ProcessingCompletionProcessor.java | 111 +++++++ .../ProcessingDoubleClickSelector.java | 246 +++++++++++++++ .../language/ProcessingEditorMessages.java | 32 ++ .../editor/util/ProcessingColorProvider.java | 70 +++++ .../util/ProcessingWhitespaceDetector.java | 27 ++ .../editor/util/ProcessingWordDetector.java | 34 +++ 59 files changed, 2468 insertions(+) create mode 100644 editor/org.processing.editor/.classpath create mode 100644 editor/org.processing.editor/.project create mode 100644 editor/org.processing.editor/.settings/org.eclipse.jdt.core.prefs create mode 100644 editor/org.processing.editor/META-INF/MANIFEST.MF create mode 100644 editor/org.processing.editor/bin/org/processing/editor/PresentationAction.class create mode 100644 editor/org.processing.editor/bin/org/processing/editor/ProcessingActionContributor.class create mode 100644 editor/org.processing.editor/bin/org/processing/editor/ProcessingAnnotationHover.class create mode 100644 editor/org.processing.editor/bin/org/processing/editor/ProcessingContentOutlinePage$ContentProvider.class create mode 100644 editor/org.processing.editor/bin/org/processing/editor/ProcessingContentOutlinePage$Segment.class create mode 100644 editor/org.processing.editor/bin/org/processing/editor/ProcessingContentOutlinePage.class create mode 100644 editor/org.processing.editor/bin/org/processing/editor/ProcessingDocumentSetupParticipant.class create mode 100644 editor/org.processing.editor/bin/org/processing/editor/ProcessingEditor$DefineFoldingRegionAction.class create mode 100644 editor/org.processing.editor/bin/org/processing/editor/ProcessingEditor.class create mode 100644 editor/org.processing.editor/bin/org/processing/editor/ProcessingEditorMessages.class create mode 100644 editor/org.processing.editor/bin/org/processing/editor/ProcessingEditorMessages.properties create mode 100644 editor/org.processing.editor/bin/org/processing/editor/ProcessingEditorPlugin.class create mode 100644 editor/org.processing.editor/bin/org/processing/editor/ProcessingPartitionScanner$EmptyCommentDetector.class create mode 100644 editor/org.processing.editor/bin/org/processing/editor/ProcessingPartitionScanner$WordPredicateRule.class create mode 100644 editor/org.processing.editor/bin/org/processing/editor/ProcessingPartitionScanner.class create mode 100644 editor/org.processing.editor/bin/org/processing/editor/ProcessingSourceViewerConfiguration$SingleTokenScanner.class create mode 100644 editor/org.processing.editor/bin/org/processing/editor/ProcessingSourceViewerConfiguration.class create mode 100644 editor/org.processing.editor/bin/org/processing/editor/ProcessingTextHover.class create mode 100644 editor/org.processing.editor/bin/org/processing/editor/javadoc/JavaDocCompletionProcessor.class create mode 100644 editor/org.processing.editor/bin/org/processing/editor/javadoc/JavaDocScanner$JavaDocWordDetector.class create mode 100644 editor/org.processing.editor/bin/org/processing/editor/javadoc/JavaDocScanner.class create mode 100644 editor/org.processing.editor/bin/org/processing/editor/language/ProcessingAutoIndentStrategy.class create mode 100644 editor/org.processing.editor/bin/org/processing/editor/language/ProcessingCodeScanner.class create mode 100644 editor/org.processing.editor/bin/org/processing/editor/language/ProcessingCompletionProcessor$Validator.class create mode 100644 editor/org.processing.editor/bin/org/processing/editor/language/ProcessingCompletionProcessor.class create mode 100644 editor/org.processing.editor/bin/org/processing/editor/language/ProcessingDoubleClickSelector.class create mode 100644 editor/org.processing.editor/bin/org/processing/editor/language/ProcessingEditorMessages.class create mode 100644 editor/org.processing.editor/bin/org/processing/editor/util/ProcessingColorProvider.class create mode 100644 editor/org.processing.editor/bin/org/processing/editor/util/ProcessingWhitespaceDetector.class create mode 100644 editor/org.processing.editor/bin/org/processing/editor/util/ProcessingWordDetector.class create mode 100644 editor/org.processing.editor/build.properties create mode 100644 editor/org.processing.editor/icons/processing.gif create mode 100644 editor/org.processing.editor/plugin.xml create mode 100644 editor/org.processing.editor/src/org/processing/editor/PresentationAction.java create mode 100644 editor/org.processing.editor/src/org/processing/editor/ProcessingActionContributor.java create mode 100644 editor/org.processing.editor/src/org/processing/editor/ProcessingAnnotationHover.java create mode 100644 editor/org.processing.editor/src/org/processing/editor/ProcessingContentOutlinePage.java create mode 100644 editor/org.processing.editor/src/org/processing/editor/ProcessingDocumentSetupParticipant.java create mode 100644 editor/org.processing.editor/src/org/processing/editor/ProcessingEditor.java create mode 100644 editor/org.processing.editor/src/org/processing/editor/ProcessingEditorMessages.java create mode 100644 editor/org.processing.editor/src/org/processing/editor/ProcessingEditorMessages.properties create mode 100644 editor/org.processing.editor/src/org/processing/editor/ProcessingEditorPlugin.java create mode 100644 editor/org.processing.editor/src/org/processing/editor/ProcessingPartitionScanner.java create mode 100644 editor/org.processing.editor/src/org/processing/editor/ProcessingSourceViewerConfiguration.java create mode 100644 editor/org.processing.editor/src/org/processing/editor/ProcessingTextHover.java create mode 100644 editor/org.processing.editor/src/org/processing/editor/javadoc/JavaDocCompletionProcessor.java create mode 100644 editor/org.processing.editor/src/org/processing/editor/javadoc/JavaDocScanner.java create mode 100644 editor/org.processing.editor/src/org/processing/editor/language/ProcessingAutoIndentStrategy.java create mode 100644 editor/org.processing.editor/src/org/processing/editor/language/ProcessingCodeScanner.java create mode 100644 editor/org.processing.editor/src/org/processing/editor/language/ProcessingCompletionProcessor.java create mode 100644 editor/org.processing.editor/src/org/processing/editor/language/ProcessingDoubleClickSelector.java create mode 100644 editor/org.processing.editor/src/org/processing/editor/language/ProcessingEditorMessages.java create mode 100644 editor/org.processing.editor/src/org/processing/editor/util/ProcessingColorProvider.java create mode 100644 editor/org.processing.editor/src/org/processing/editor/util/ProcessingWhitespaceDetector.java create mode 100644 editor/org.processing.editor/src/org/processing/editor/util/ProcessingWordDetector.java diff --git a/editor/org.processing.editor/.classpath b/editor/org.processing.editor/.classpath new file mode 100644 index 000000000..ad32c83a7 --- /dev/null +++ b/editor/org.processing.editor/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/editor/org.processing.editor/.project b/editor/org.processing.editor/.project new file mode 100644 index 000000000..84b6287cf --- /dev/null +++ b/editor/org.processing.editor/.project @@ -0,0 +1,28 @@ + + + org.processing.editor + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/editor/org.processing.editor/.settings/org.eclipse.jdt.core.prefs b/editor/org.processing.editor/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..9b97d40c2 --- /dev/null +++ b/editor/org.processing.editor/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,8 @@ +#Tue Jun 08 10:20:47 EDT 2010 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/editor/org.processing.editor/META-INF/MANIFEST.MF b/editor/org.processing.editor/META-INF/MANIFEST.MF new file mode 100644 index 000000000..03c2870f6 --- /dev/null +++ b/editor/org.processing.editor/META-INF/MANIFEST.MF @@ -0,0 +1,13 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: org.processing.editor +Bundle-SymbolicName: org.processing.editor;singleton:=true +Bundle-Version: 0.0.0 +Bundle-Activator: org.processing.editor.ProcessingEditorPlugin +Require-Bundle: org.eclipse.core.runtime, + org.eclipse.ui, + org.eclipse.jface.text, + org.eclipse.ui.editors +Bundle-ActivationPolicy: lazy +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 +Import-Package: org.eclipse.ui.views.contentoutline diff --git a/editor/org.processing.editor/bin/org/processing/editor/PresentationAction.class b/editor/org.processing.editor/bin/org/processing/editor/PresentationAction.class new file mode 100644 index 0000000000000000000000000000000000000000..579f01781bc1af9da54b674a44a92285cac284d1 GIT binary patch literal 1304 zcma)6T~pIg5IwgE4Tb>HBB)fp6iJIV;bR8!#{|Fy_i+UB+Q2a^&Mq(DbE1$t>63*zats zlX$*$+*=#Os6cTubX{K_Evl+R!I*&o6a*UP$pD$hw@I6gBqE7w^^-+-)>ENYZs-sg zH*f}d5~I^@+6l28t$Trd(RsTqqfL98`4{S;WBUy|@_64pRFjq$li+Exe)>}*ouf{` zIZFmEU|L|9#Oe_eD3ehAaUa4g<~7U-Ec6v%;35}U0D*R=L4AR}ECzJHa^rgUM&ZD6rUP zp#;uY0%D8w+DL3?XU%S>JzzSw4BS4Tvl?)Fh>pIIj^7iHn>TrMsItkg@-SkK!WH_^ zKvvM0<;iNadjyqMz-Z+g1`8wND^6E-QT#$jIZTipNyAFesfi<)#w48?SqRSJ9PI?o zAHw~lC{AM$$W(o44>JN}F9|%Tls-XIK0{S^VJ;nR_HZQ!PN$^l7z$V*hKm@2i2}-) zp(c>fY3kVwzMFc0JQl7Ig#yuArr$^oHz>XabstkuGzbl|BquHQImf|4juzrM`TjlS z%lwIuWqASuWO?Q*T+lBR`IXi~#i&$_Ld8_5qMN-EGR2lrB06(Kr>EF_mo`%zNA7i( P6|+Oih~9U|m&4t^>%lFt literal 0 HcmV?d00001 diff --git a/editor/org.processing.editor/bin/org/processing/editor/ProcessingActionContributor.class b/editor/org.processing.editor/bin/org/processing/editor/ProcessingActionContributor.class new file mode 100644 index 0000000000000000000000000000000000000000..2e89a14f1fb105623d8db3fc6149b67c8ddd9fce GIT binary patch literal 3150 zcmb7GYgZFj6x}yOCnO_EP+Kf2K0pY0;G@1`MNq`FL{T0}TU&=@h@)X9otaqsv=93u z`WyPGYgH(9t*-WqANqs($#!+$nIU8lD6W+?nVEafIs2Tw&$;v0zrXzs-~@h95D_?T z*_B+)wo1C=7-l7>mkrmla}$j>!zI_S%*&SP+QwX+YYL(QXQY{4sv0#%&()2<%*na> zV>dU&%c$q)6=Q+D^U{}Yy2A|UxC~UY9IYyFYJ81P=_`P9OLsN9qPuH7=LOos{-%tY zK*#))RjE|<30rp^>TV*|t7PP5|BcWiIz=_vK z97htn6?6z>|F80X35z5~tLTo3J=n{1S%q7=W7X}FK2kT!Rb8N~uYdf3_DIXsU89-{ zujXTTlSN;*=Gi!QVxLUsErDF$#ykP^jet$WK(QtTaXI$W};N9t1qzN(nC>txX!#cv-N56EY4y=#ZBDu zdwa^Vs${QG`}C%@5AV(=FolAG=|H|KEQk3D+enilIh&(mI7ve3a;`V2gR)C3G|S>x zXmdD7vnT{&QW5eM#pSL^Ftv%7FjNBAG3jchhefRxG*Nrmn)FAo$eIG@;pU z&=hkjO1Q^f4F=DOwF0(lNU*Fy(>YXFJttzQa6pBo(8^gB=QJ=>JitSNRyLDQw!q!6 zA~tlLUuWKKQl&ska-c4#Fs1fd8v`{4o`<_aFgYyau;D5oPJvf$0OhO zO082{%}CB78;@0dhJ?WOdabOvEOnIa$2s<@?3x(kcHR4!;CK&JA&j<(n!F_7iHeUU z#Y)+5c;a|R_jfA3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bin/org/processing/editor/ProcessingContentOutlinePage$ContentProvider.class b/editor/org.processing.editor/bin/org/processing/editor/ProcessingContentOutlinePage$ContentProvider.class new file mode 100644 index 0000000000000000000000000000000000000000..48305b988ac9626e57cde2d4556adbed7bf231cb GIT binary patch literal 4257 zcmbVO`F9i775<(y(%9nxFH}zKn8m3>yn#YOO=1V9c!4O`*p0!&Kx)R)lRY3y>S$!3 zO_MH3+N3mT8`73GU9vQEp)K@;8kf_a(_i?Z|4`4#=}G#%nUO5Zc6-RdXx?()cklh~ z^4`Bb`P)ALJc_^Q2nh`3ocVa($t7i>U}xv!GG)6tCq7wT8O~*0nRO?MZpO~aNo!tq z1WS}zvQyI0p$RmcvzDxQ#v;VT+&P(abwmaBDs-95*!hBtpG#Xw8DFyH1?d#xiQ|rx zRY(FgQ=>=5M~@w!5@;G*g`9F78aE)Yg(nKGm361BOi|XLPN05vRte4)^W9koRiLRYc3;Id~-=FGi^Dxng@%TVpm|~Gf-2VmgG8;x10i1J>*lp zHWB^skK~d?l{N!i({+erpALq0*Cym8O426l=P{q zT}|O}%Uv+>IG&(cPOg|uDUuHR!UHCr#6ccjv@UYHGm+>@C~KZF@kJbB)>DtdpGc<* z()HO*=ol8*xrwEv_!=0(sEWzq0N3;KX%h)NBT#3hQYA@&z6}DuS=p3Mkv1J;0{zO4 zd#i`RqQC47DtWJKyBRr~w_KKR*1#m5)$ygEsr)Zpqh1diXGdeVDwvqU zae-QL=(iDp-5Yq?wLa^0u-F<`LzrMEoR^M)6X-B7gVQ=r3Ebxic-a)FJe+eDE!V^u zJkNShdozJ2Hc)!HLaE<22R5+7z){SqAU;zE3rQVwrOYZfCKD+z(ZdXARRxz|PwAK! zcx;n=8M4ZWFwBlQpK~saUQEioYN9%9fu79|sybG3}=AJswSD}YMmTrWOm+N;2;-NKv=2*5_x9MX87e4W&KRKR`UF~l@Gd%X=n3A zcX)xfl_X4JqxMj`r>4F8YG8e!)~~3JcL`t9@l}CG@4X;QynwGW;nJlpQ@UW;&DS_t zwBst>f~&gBV@Z6V4lm)GI=)dAwf}R>#JBKm_5{{R$$+Y!P)emW#`w2-RWnu1>lG8P zs{5pw!OShmQaDQKr9{4K;x)X^gk39AzO{Qd3XHF+1Q*D9?c2g-6W>?YU?iE5mZMa> zY2pXUift9GuF`}bnRrW?&{VM>U>dyg-Zs&TJxn}59X3wqs#Ib6=Q62;O0l)Cn1Da- zXXOQNU&lKe-ZpCy1@x3%$mi5mR%;hVWJWUhT;;&86BV>kf5IwyxU$ofg0?}cQQhQy z6CdC=#By`qMXtI>*9Njoj0LMOykKWij?Ah&|E-DN;i_tIfvc*+PFmch+iN;($%OS4 z9%1c6ZT>&$Z%}QrDV-*Ujf7GvgQ0l=ggLXzU z%>NN+XoHR#j%)c44#D6G-!&X->a7AaG^l44=e1mE!Zu2Njzl$@Ih{QoRdid2;iupRk zYqUmL^?uI^_6i(qYcMje-p2k0<2L#S!+qK{yu7_H64SPyZTkSVZ80s?7wL&dF+CRL?i~!x#Gaj-uDU?=&Evg zi1dLk8XX4_!&7(whp>aIyD?13Bk04^9PtIhenGiAtKbXgbP7fdZ;T(`NiJ5c!bQwKElP`6}%Wizt*DN zMO%y3WUS!j5EM<37L77HSMZ&XNAn84#}Cg{(s73oLuH2;Z z`*44B~2~GzS(d{jA{_A%96% zeHDHDD#JtJ>+09bz^JG6MGvCc-z_^G!msEc9}oC7-sP_{bC6$!VfgmFCvc+*>y-*D zql{&gu|6!@Ge#tZRo~->``U+yXxBaCd|!RzE>{57mjUYoz`)ZjwCnfyLty1}U}a;^ zKXLRb>H_>5LK*90``zX(@_2=v?ClC2jb$B;YjxBU^?I3!*}(eNRqMB`k`iX0s8;q4 r>KO1CBccN4v)x)&*1A?%jPQT-sQnZE%x@Ftf|tn+#{Ve4H(~x4r;RTr literal 0 HcmV?d00001 diff --git a/editor/org.processing.editor/bin/org/processing/editor/ProcessingContentOutlinePage$Segment.class b/editor/org.processing.editor/bin/org/processing/editor/ProcessingContentOutlinePage$Segment.class new file mode 100644 index 0000000000000000000000000000000000000000..7900c2699d9e542ea9c6ea30f22e8cd5bbf84f35 GIT binary patch literal 771 zcmbVKTWb?R6#h<$hej?H@>4=>VKeQt zHH7xSm*zOpi;Sb$2NiSV__K?K1w`Q0Gi|hcML6!|j?cA;`;6uK7Z~@ICAmWg?M2w${5s^NT1Yc=BrQJj@Bh6`&w2;eL*KfQKS|w}eM{ Gg75}I#JSc0 literal 0 HcmV?d00001 diff --git a/editor/org.processing.editor/bin/org/processing/editor/ProcessingContentOutlinePage.class b/editor/org.processing.editor/bin/org/processing/editor/ProcessingContentOutlinePage.class new file mode 100644 index 0000000000000000000000000000000000000000..372df74e0c04113c880c2ea4794393d370ada05b GIT binary patch literal 3560 zcmbVOS#T6p6g@AQq{*ZqKm-L;mO#idWB?&7K@>ue(S!sNg9$2jW?m)@otd$_CkgKR zzVA?$zkaz;1)%~K@`WXqT56S_>X+qS<)0svdR|XwmTVS&B>j5&F6Z8R?!E8g-)GJN zSdZfxiUigt?RYq4C!^AF%tSmaW2T$5!yVaQnv)4vCfxS4YnchzVZ^0|fIy?tlTph| zIWn9!!$YPVcEZt&a55tto~$cS+8;@z(yqY#*2Bh-5w;9^ZSOlQqi&PHy#8IuXnK$i ziD1Z#Nn2n|>jYn}9C3Y|k%{88QQqH0ffg?ifz>l<=LD%&y3I_O?skC#H8bf<@;H-l zo`c$Mfk1OICW9zOg^qH}6)3K$?Jfh8p+mzgb-F@F8G-^8txWgc^kAQ~yNo_ds)Qw@ zhShD@rh4~(47dZPBe1~(ad~xQ$g`;7XSp6!Ky_g@oMAUSY{uf! zby(lQRMIhB*;L!DqPkYc5?mc*6w7oh#|j#wT$e3nH|e2jSyNM6kgmi1MpSy_k+u`g zNj7O%DX{bM$+^9FevVGYaWNOuAl zfpB3m3r$2Oh%>7i!ldx@UR#YmY2{*VK!pOkUdMIVATXB@3M2&9%?Mzp;m867uduaf z)UgSh1(q1GSf{kut7bCMJiykKu~yUJfKbKVJfrRD^yotIeyffW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da+U1C}uZa<&oDydy6l361uuJ> z(Lep|$iEf@qGAXOSd{RPA<>3kjRtH{l(B>X21&E1j2e-o=dj-Q3{xFFpneHbOVr6t z6z!fj}pJLyG=I<8T#Vv%a|Ns9 z$W+Bjx$=P1WpGZ|I zGcO(}dpxwmnDW$50fBe6h%e|41Ym!hG1m^viZy`Q)dRCUqob*yL<%d6I zG>Fb_HHjwA*Iwo(0Nb_*mE z$vOaAnx9er4(S-iae+OQG9wEl$VS4uvgv6|Igr-0*W*L3w3q$&vIinlO@vhIxA1Lc(;>u~d_Z z<0d{;9sDza_Jm<1=QMmSaJmIs&`Ms@72>#!1ts)Y7y7WMBZoYVH1qk*&LJ>W-`GO# z1zI+V>qk_Ga>ES{Ck;ytAq&xE&Agf!%H#0|IayK*flgO*CWqpiBggw327kQi|iK801DL z**EeeRtnNU;BYG;HHhi@jBDoZO`0Wdu*k!X4F{jGu{>Cf~CfH4=X#karuRJ zT#Zk*48yi%*=zpN(eQ{tQPP=gueqNI^tQaA;Sk$X8}EE##}0L6;i`>08e)8R^6wU+ z+y}Y`27g0*U}(5Ex(@vrcOux%cbs3~3~5ed2Ui26CpC6r7r$z?8+$yOZuDTUr>h%p z;7!s+R96i2oaLXAqz~?TtBU;*yg=Wt{P(qVkO~;{H0<^1Y8rG;8iS9cIOaXiCKJ$r;r3gL74U2x=51^I(3QAT*iJ((3we2(J5ZXr;)~0(#_&J zp9OZcRouWMHm9eU$M?A7NhtX)2f(!By8xJ-_y)_kOW5|K0t+kDJ525OP+$ppy9rTQ4M{9 e0ns2|(%ZJ$5y>NX=)J$hSNy8sDDX8NBk~__nT`qo literal 0 HcmV?d00001 diff --git a/editor/org.processing.editor/bin/org/processing/editor/ProcessingEditor.class b/editor/org.processing.editor/bin/org/processing/editor/ProcessingEditor.class new file mode 100644 index 0000000000000000000000000000000000000000..94acddea3d07cbfbb4df409645f426c1098b8195 GIT binary patch literal 7036 zcmcIp33wc38GiqC+fBEVHr=Gv(iRFWkZ#&6l$J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Ul0)tD%`B~g7q}3-ZP}eb3DI(f&RbfDqrm> zDEhhv58!*Q6Kn7wF%w3tA#M-R@H*Dahw(#~pKMxuBd;PV63Qk){wK8MynPsKrS}(g zigl0jbJH+>HpoaZTJc{D;aBd>Z~dDgJh`H}W(dC@Md=W?K)*!OUZ%=dSj1mN0?_|k2 q$c1bg^M5Y>jsMUhAx|aL%UBx4OC0kGe^=1M*LW2s9SypOivI%W&i$PL literal 0 HcmV?d00001 diff --git a/editor/org.processing.editor/bin/org/processing/editor/ProcessingEditorMessages.class b/editor/org.processing.editor/bin/org/processing/editor/ProcessingEditorMessages.class new file mode 100644 index 0000000000000000000000000000000000000000..20078f27df8135f8bee01d4cc884628ae74e9656 GIT binary patch literal 1280 zcmb7DU31b<5Iwih1~C1?LM!$|T3P`m)Yk8Id?@1h0IgFjGd?*XTrq7-m=GNOSEw_s zqci>hf0X0in^0;C55kbk?%myUcK77>pC7*fY+*;i7=z}xtzz4C4BqLOcB{ynrsufD zSLdFxbX4hDZ}EZLh9dT^>QyC!h@oXg&dL6ahki*E-}Kr|TMguWL6g&XDr4x}Iqj|Ggv3 z$gW|Tw&^`%2xW71hH%Mg@)%|iS1`-4AbAeSRdF424AB<%`aoLtYFD|@;88FnRm5@aLr{%=*(x}fgQ zo?&A&b-Br4M`A8%70Xyru*NWdd5L>n(`s@zf^`O#j$swI1t7lraZS)i znzR$57j+CNjAMcgz#@e& z&{ufHkF*t}Zqq4}$Ma`MT~1pjoE4d-`ax7^iGrg-BS8U&n2Mq+Uy;b4;#RNn6RU6H znKNvVnTu!Waf(7u7Ep-CJxUPFreuq2r)d~7{;H&#lX5^#TG9vusY{;+oCu#rmo3 zpVS*=rk(MtGyS7FeadzYOCz+6YP4mn9r=N0TEX*l?X19XHuHQt zy<1491V%H*=4;b%Oq$3C9xbg1T-tCeeqdID1JeoR5QYVA5=`X@ znU#w41QyPP#P1L^Qrd7G*Q2o4c2Q9tcA523ZbXAaHjklH>Yi+bDVFEBU?ay)@RtO3{%l znn1n@R+Kqy^Nl5|D#d;R9}8S-J2|T1* z=hb)|pkWb{?8|&$S}&iO)p~NSwfWjscJp;N&)$RMl4(gp<;UO)VZqT3BD4z9&^rV?X9J*QS8}W8dk8b3V1_cxmJqJXXWgP z>`9nCP`TLDaRs9ZY%?vLb@qa2*izXTZxh&TK4su*9UovUfoEMG^3IK`A%k@mao!C* zOK#b!FDIMj*!t$rDFSZMSU>+Z5}3dsE^wCMtPew+Yc2DOoUy;6J(giKG6d1clt&{y z<~T$KUkH9DI9uc>I1VOHas8L**oXXTGy%+E0L!?+UwZ8jK8j56?*daiaf>?x+_@d0 zwz#5hX~}!1xRd-1(@ow;Bx02ko?sYj5p%3|y3SNKXD}PN!$$8;7X&K{_u}-Y^d(LD zPEYzUKBcaj_&bp*YWNk?KhyI*DD5i9KrW&vJpu+E)NkadL+y?yf5-egj3ocU;^8Si zJHfnKQIP%!QWN|wv-KUbP-qF_cwO*PbXJU#w~Wv0{DUZ-z$9sp-eHvdmBZv8`0^BM zCwQb*<2GK jrXh2v$fwvn!47}z#BKaQ8$VLRPc1e&XxL-O`jGt>g>Faq literal 0 HcmV?d00001 diff --git a/editor/org.processing.editor/bin/org/processing/editor/ProcessingPartitionScanner$EmptyCommentDetector.class b/editor/org.processing.editor/bin/org/processing/editor/ProcessingPartitionScanner$EmptyCommentDetector.class new file mode 100644 index 0000000000000000000000000000000000000000..c54e70a3f5e302df058bbc7b2420d6d202e2d2aa GIT binary patch literal 781 zcmb`E&u$Yj5XQgBZn9;Qw%bz5pCEw*hb9MHaRqT%N>wR^NN^o!0~^c;$q3E*I~P z81~NJZG8~TBeaf!$9XB8Q!c?R!v4R$fw1$ZFT!20t-R{| z`w=fTl(Q=w2|kI>diOKZPaM?H;=M61-orY_t%U#^*yN1=8e6=F%ZIG4@tL+W@e%cS z7R@+|E)hC&!tO$~B(NUaxXO&3xthW(*H+NuB{XYi-3v4seSvy3i+@M&UqWXqboMKH VgJHYerH1Rc5hmqUgqvt%?FaQ2v48*o literal 0 HcmV?d00001 diff --git a/editor/org.processing.editor/bin/org/processing/editor/ProcessingPartitionScanner$WordPredicateRule.class b/editor/org.processing.editor/bin/org/processing/editor/ProcessingPartitionScanner$WordPredicateRule.class new file mode 100644 index 0000000000000000000000000000000000000000..7eb7b3608692d4c99f9ef2f85e7f744a5796e28d GIT binary patch literal 1472 zcmbtUZBG+H5Pr5Tee(LA;GX{aHQk8-B9v_J>f{M<$KK)8HC*U z^i7itiXmPsHM58#Z{$l1d{|nhW`BSxrDg^Umo21_ zPU8xt%59rxNq5b{b<8rPM5|?77@ibs2jWn0Pf$M_T2WgoBbOjobA9=;*V&b7OYC}* zAzup|;WdSFjXY2$^u8N1tVg)#qYw4U3Qx2+Ef0m)BX%*o9#*C5zEHx^QVr-?*(r^5 zSJR3G3%9YzuswE=(PB_j!v4@OtPIKO)IEs7N`}1-6@l$Ag|E2!iH>8qL2DifT35;ODWI@!eOENPdIaQ7qq^)Zul4s1j?^L>kBoFwjHDLPN0 wh!S})*eDMWIqk-G!sPikU@Zc)`UV5Q816@5A7GjGJi%Guco?P1>D5mE2CavdQvd(} literal 0 HcmV?d00001 diff --git a/editor/org.processing.editor/bin/org/processing/editor/ProcessingPartitionScanner.class b/editor/org.processing.editor/bin/org/processing/editor/ProcessingPartitionScanner.class new file mode 100644 index 0000000000000000000000000000000000000000..10f805a3ebecb938de6e5616d3b33c8962970964 GIT binary patch literal 2123 zcmb_dTT|Os5dMzsAfbo^l!TDBxzVK9=AuB_GzHqk7}GlSt=O2Fq;-URNJM0bk>pO( zP9J&fOZ!XG&eTJh^au1uWwJ-6+(I0f>5HWOe0I;byWg(=ef9T00H)B85Mj9GdQbEX z&o#O4Th0@mH>|+*^wKU;GQ7YFEY~TUhU0KgLX6>#@ZzRzZTMVYUo%Xu2mHrC_gXgh z^+kHl89r|u_GK7+kgBHY`K4SXo68n5^>i_x&lD;QT5jF=!O(4kIFtjAsLU|*rCrAl z3@4}>c8kmCWf-d0#ld>BWe1jRIlOMV%_esOhVxSY z@;u{t&hi5VmvK?Tb%tcudooU=xF*sNeUkAZLqykm>E4?vKEen??^0ntvq0^cXSkW` z8Y>%;o>6cO3BfwaFukAkPAiWUBvCz$F-%ApXE?K$pGZxGj$70zqtSRvSym)WF^qO4 zTP9W6d@u8l8Q8FbN!$_CKV`@tMg6cEW{#CiI#HGJ8C@_Ufs{Nah@E82ZY;ZAqvX*z znnnORTP|Z(s8hLiP-5R_y$=ZTLR-B@mK1v63^*jo^8@v!&;GKwHf9 zXj>l*54@p!T&E62=`SmSOE`rdvZTzs%df?@8z~}xz@(j{Ma_G)wJP1 zaHEa*7DgjjCTOyz-PUds*#D@FPxixiwYzV?)3wnyW_M5Bt7$1MJsOR*k=X&a@D;;L zO8kYW=LXh?Hyv163cSBG?t7uvY0V3w^wsoow$KbIZLq>fiFk zf`UK5A0#V*FlTad=6wD3=?j1zY=#I3U1P_|i8U!Zr;BmIBkhe%Uj6L! zOleadXnx1GV~R|VORKy##hsqa=iE21x#*>;DA|Af$vYf-;h(U(0>y|;Q;dfsgh2+fWeafAluTDX9S z(1_cE5G}&(zsjgpN0`TA#akk*#odW|tCC!a2``5ePQ82}0%4_vRa}$_$Nm{-s?7Z% z`_dNm4nq7#xzj)1ujgvDOI=;?LHTCLwy%ac6IQz>Rrx?!UE#B4(;sU`IQXx(*(J=W zAKnqR&gU^9ng-yxuH?q&$i=0O?Zq+SsubX>(X VSsCEEpa3_pF11Po;U+dP`yCJc_HO_H literal 0 HcmV?d00001 diff --git a/editor/org.processing.editor/bin/org/processing/editor/ProcessingSourceViewerConfiguration.class b/editor/org.processing.editor/bin/org/processing/editor/ProcessingSourceViewerConfiguration.class new file mode 100644 index 0000000000000000000000000000000000000000..5bba5e7047983130edf0372354725dddb7e84db6 GIT binary patch literal 5681 zcmbtYYj+#f72VfXkgO>9k&q{ZgcxEQ8RcmMa!dS3h>BlWj;WJ^7)xVi?6F3SMowHx z>r(on(2}+RLg|yXv@~sjt|fQXi~fNAh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Z5cI=80z#_aQ}KZ9XPX_lz(lwPIN3l$C1UQD3n*$^&yV zAA!fqyVmg_ zO&X0LYTL#Je8u?b)}zI8B}w}W1Hid^u*I#LuszXa{?z_Bg6DW8fo3}84k`ickD~g zhB{8!u6q+S>oM3`GuT=)cm`)(gP+h@$zggOeayz=WAUCxD|n)UWPBY@@teVpeH9GF zLlsn$DNwfY1iopp5clDqZcqxbltzg&(i(2D!-AA zmpsWDZj*(31e3i_vN;1DzN9L;@)AeL>d(HIM@eSAXzX`a5rt=OzW9wL@ z*RPKEy6k>y9k0#WzkO#7uRj^;JrI&Szv*6Y$e-77lYj5b#y`a^Qo4qpui=-q)u-Im zyx!>D$VQLdK(Di^-k@V|Vn65palC~DZlE9U@_cd&&*MF)c;61|jN@i4V|ka7FkZxO z@By>l%3HPH;&;r{ah${NL3$bFAMi&v)IMHiOEiUV%U2uU;p77w!I6ok8bVX83qHc1 nTpJ#CZ!=GS*@(xn^pS^xt=MhCUu_>ghLk<|K;b6;K1Jkz$*W}G literal 0 HcmV?d00001 diff --git a/editor/org.processing.editor/bin/org/processing/editor/ProcessingTextHover.class b/editor/org.processing.editor/bin/org/processing/editor/ProcessingTextHover.class new file mode 100644 index 0000000000000000000000000000000000000000..5fc3b27f41e5d9884e72af3886a50b304e01f77a GIT binary patch literal 1720 zcma)6TTc@~6#j-57TQG=5fLjEL}`7{A$VAp#psvoq&R=bZD+H{YC}zrTJ5a0#;-8U(VATQaJyV@c1mDbHg;sCU?#*txC(+&?L~Sl1Qs;S3PO07EMbUKEsUs zZm>YpExTg-cLZXY?4m$?!daFH#E{gXp;@4s#e(mWyj&8; zaY93fKu;7SVX%%)oD^swu7a$T{FQ)~d=jT{T0^%$UsSweGz6$4g);(4=9qM>^)*@X z1^P4DNZj>Z0nD>H(sc;4#iA$uB>K>=;haD^s(3wvj`J8GWR@1_%;fWjaM6qmk8y~O z#^hSnf3qOVR1bMfU%x>N!_ zAXnbJSJ%*fb`QefK@$tkx@*aYw(2cihY3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v5OLW)bHr~Vg#D52V#YH}q)5iDsfKLI+ zU&e>{hy`(lyY^#z!aV$lb@&vYu{7?`zt8anpT4BV4Jf-uH~5VtH0;!HsrZ-Bz}bkE VwDC3h%J2=o<*jDUD1Vos{|gTLCJ_Jt literal 0 HcmV?d00001 diff --git a/editor/org.processing.editor/bin/org/processing/editor/language/ProcessingAutoIndentStrategy.class b/editor/org.processing.editor/bin/org/processing/editor/language/ProcessingAutoIndentStrategy.class new file mode 100644 index 0000000000000000000000000000000000000000..cd91f0935024efb0f4817b6132c7c2d83b1c9abe GIT binary patch literal 5455 zcmbtYeQ*@z8UMX^d$)JVrU?lfOiZeRLcSmv>Zu7vA%I5nK}ADFTe#e9lEcg0ad$yP zp`}f=t)li*K!u35X)7vN2%w`g)z;Q@TJeug>y%DwJDq+w(`l#wDK`B*yLX$AkTx@g z*}Zq)ec$Kn_j{h_-HiYH<<|f-;gk-KLQ68;-K{Y)|QM~1@Izhzz4rVv25!a8tk>ww}pG-mO^Pq zG7^sWgwrv3&P{6BfmlZ2x{m+Dl@^7IB14&Maxk{jT9b?n4bsoHc6pj-=vu271-Mw3_ zNVdh%RcD}ns;-Qc&f2JP^yByQwwXKU}A;;swWHE7mxt-|HAD7cMS-=2-d zW7(LMG0=jQ3V}SdbgkwBQfKO^ZD-D9g*64yJRN9M*#$Q1xSk;Q#S+oZa5gePT6L$a zgd6ypS%c|@qNTmPT@)6q-4U@;*;q1>(Xm#ceij#3hoh3^ve4Zjk-yQvO`x12i7CU` z-Pe~9?6n$-7fRk@paY#O8(fexuq`>1;F7snxv92Y^mH3oKUGghF6#o(Tvk$Locb9; z2A&v4;z=o;IhE~+NZJZ#_}Z7rGBxOUuh29irilDc8Mp(R6m*)|HV|eWiU)1t!CeME zjn6nPO1)qWS}Q7+%qhxF6t)-$qgTP8c!yTDh`EKJO@Jzk^(T^PtBr11Ij2YtMU#EK zR(~u(*|tYk*7k|^M~2dLL$z_3u!~V3#gGVsL_=QEk@b@^w9IJ>-F*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A%-l@zt`9t4x+HaUlJU{S2s3P_{Z>#6DS`=NwfA6_LUwy zg^@9Q=NNsRkDuWe>@^OfZsjxZE5iC~!tgGi&hpd!w`{GyV}JNPKYZRJ$NxY={}J2p zCzh2zvy}V=`|wvhhri)vypPxMcS`&R3&%h48~n?LEoI-&y0D#fVLQux(vo%j5=U$% z*0Xp&Z)en1%t`4dKI(oLFOcPaYOf^IO|E~4nJ3)UslCo-Y=AlonFB8oN#X8F1ka(2 z2i7(#Cqn5Ps6!wUES#UJ8^3GUJ+U&^XA24(P%77iQK+c`FjOZZ6x!(m09 z3(nJYLbTRbpN7!EA%@$$^ANHZ%WwqS37jTFrn^IhL+B;A+9BL2Ov>>=$P}mu)H~Zu z|0M7g0q*8WY464c5o7wICs5L0`c7bXLq#ADesPyz|AR^FONrO3F7`L0lrj5|f0;VR z(FB$a+vSIwQOcDvbnsLL)tk; h@gO!2rog-x`XrLX8T7;huRCXhTS!>P=&T1P{{z9f*yaEL literal 0 HcmV?d00001 diff --git a/editor/org.processing.editor/bin/org/processing/editor/language/ProcessingCodeScanner.class b/editor/org.processing.editor/bin/org/processing/editor/language/ProcessingCodeScanner.class new file mode 100644 index 0000000000000000000000000000000000000000..2322c22868d9ccc3b49ae5d236f475328aec0229 GIT binary patch literal 4795 zcmb7I3wRt=75?ug*_mu6+jL4wQ%YY@o3@mtDNtyklC~j~Zkv(~ZI?b^vOCF6yV;4e zvq=jGK2S=VIaF?1s`%l6>c$Ij?)} zx#ymHZti*g_B#PIsTmqV3dg%%cdXZQQ+7V@BbtLz>9u9wa) zP?)eWzSZipf{9`Y-{ag%M#(gd`dS!##U0=FtgPtM+VB@8b$(f$b~Ya{+IlI)Rq#tc zg%0K%f2l%6*<(JeWy!DOd;a*^k(fIJLgl8F$nY9^*9Hk6LE5R-^!(I zm$D})R69AwN_IuZB8uiL-{~WMGVSK0~^8W+>E9=DLUH|TgTCHtMU&#Zbs$-T~YrizXaFc@8))nm5@8*?dH8Qba31T$Y| zAcC-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; zlU7{b7FphTvb;`N-dwWMb>SkfOL!UKZ53WtmY$QP_fpE!i$cB#^@$K22%FnQ=zQ`o z9O7Rj{Pzg|eZs#)_#Y&HX9e|d!LA{(%SG%XBK9#6`-F&niekHO3byF8gfqEOz+^mu zsd$a=n;Dp{n)$S`FjHmtwAqPCxFV3|{;_0!zPP28%b5_|+R%o%1GsV!S0@K?O>*AN z_~IUXbpYQOz_(VHQEwiht|_D5IznAsSw_CCM6N0$50=Q`GV+}zvQ|d^L5ZxFk$+qw zSC^50S|Ufv$oG`UHG{Y>Ie=d-HX4jU+@Cam)esrLgM0B%2~v4U12~zT$P&DWrK*ze+as_{HSs-r2F_6D z@Bw=s&Qw{B+p$Vrgt*$paW|i?S7MF2f#a=Ms|NXMy_@5MXjhN$)%py_m-t+L1?xg# zoEBHGx4yMHuGN^lT-tu>VgsM3QQTI-8OWhpyMQ$gHH(hk>QhQP-!0kfZqjN*ut;c6?0GsUB5 zuhq(gVqgJ-yD4L-UNYFFa-G4cB~4L)jj1B8pvW+_En~6U>oi1q$QzMhnB7i79@Tj& z^*L8M>R4tBZ?^wWL#qt)G8@qp%CZ!ck0!uyvxo^43Yf=&huc)*#SC`1IxgZ47O6De zpxm^RE;z}npFB`Je7D29c?q8EcZZ=-GG+YB)T*OAgF_l`U5fW2tp=vkl4i~DVwA%l z2|_(`PYoc$$|#iKur#_}m-s4jP8gaote1jO-a6-D<7)Ycc-~CHUWYifpJY-qm7&<} zvn)p}|1};%;UMXyq1cj|TFbwEZyS2J6fB5ik=7!5IwJGnGi+XlbPN-Nr-u8)DH|5X z;L*;}kaR1H zpD}llS;2s;Q9kPiw9>a4fVx=5147a@tYFnxyC#rL+J|^VtHyst(k5w{WQVJMZg7|S ew*y=YC6lb~P#G0kEj-r#Sffl}?ie=k1jS#-Zgf5X literal 0 HcmV?d00001 diff --git a/editor/org.processing.editor/bin/org/processing/editor/language/ProcessingCompletionProcessor.class b/editor/org.processing.editor/bin/org/processing/editor/language/ProcessingCompletionProcessor.class new file mode 100644 index 0000000000000000000000000000000000000000..c3869a6e1a5da96c923b39187a4b5f63e42341c4 GIT binary patch literal 4227 zcmb_f>32V0a}#HKXHHLV(Rqyjf8ZDA#?q&4eZb+wYP zd!)4KeYa`a^iG>Ly-QBhIHu>P{zLuH^O@BmTeAI&lN5eDnw^>VnfHC>op*-6|L4`4 z0FL5sQFI6#cidvK>^eE4QZemf(#V^h<0dWLE>`uTkv!KNnsVmLmf@L>9rQVF6d{4W zIlZR)2FbJ8IV0yq5eayWoMo0PMslv8=ZvIhT=kMU$My`{)45v3OQxn8pOgM)lUJa- zP~=zHspwWkV8_Lo)kV^tOGhUJVue}VGV?n96_}b)foyTXt6s`3IPSczqG^(lQaetM zZPPm;&^er#6$ni^c_WJ6mM|M0XxL5zJzMcyJ?ClIArQ?vj%Db!hJJx?);07i8V1Oc zUGNMIyV%O<6}Il+a8CDfB@K6~&XVqG*sD4%Dx+Z^nUzweUFGckWX>A}y=rlpy9GM( zj)p@5k-SsQTAYv|hhZt=dpMOc8+M*7qa-X)K=vn9)3kLJ#C&<8t!b)tFuJbUSA_ocj(Mn>Gg~1-jTUT(#vI zrs$dF*hLM~w6-aDjlJ*UY}=@7NO9P%TJ-7>dR5kQSD14ePOA^stm#U%vt%s0j>pV0 z@){l`PnltxISpyHUBj!oRQv)Xsg!)@-p6jb=BX(e)m<$cjO(K6uA9E<9~6jJ7VKQf zb!>A{@m``UUdd#fI!!zd(7zl_{3g2%`oXQXD<wLK=I@mz{|gn|grC8iL#@XS` z4r%HV`X!N?hD*+PdPgrXu-^OhoYsfn!@O1?}chd{W@SEm`}8tEG-;ctYSv zOW;aH#~r&>$;Q?gjg@ter^JroGx%H-pAFXClJwJljXq6so|Z}+pT`%Nn?=KG6efX# z!|Us1VtrQ(U&2?S__Dx&UtawJ9ndnvSRUi}D!#@u&?uGy4{boawl+5|fQb#)x`uD4 z1pcPLp$%BpdzYAv;#*taj`qEbp$FfN<2!ho{#%A!^h!LZ!-MlKrA1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qcFXxS ZmK}j*2ma(o_h;pLqZP literal 0 HcmV?d00001 diff --git a/editor/org.processing.editor/bin/org/processing/editor/language/ProcessingDoubleClickSelector.class b/editor/org.processing.editor/bin/org/processing/editor/language/ProcessingDoubleClickSelector.class new file mode 100644 index 0000000000000000000000000000000000000000..bb61d059099b4e18c7aa1efa436a159260e22334 GIT binary patch literal 3678 zcmbVOYiwI*8Gep^F1B;hxLKVpt<#OP+Z?CVy<~2d8*AKlb(*$W+GI<+v78(qJ8lv? zvz<1;&|m}v+W-koNG(Hj6H-8gOSh(@2*xi!DljGi{}AFb1_Cq<5P#4%^L*bqak92- zK&+heUEc3~pZ9q$-?{qMcU}ar8*>JH3VMpATw=CVw4HJ}U&tk#OukYqC8n)HZqCX% ziJ{uo{^H!kw3C|7+f&D#X~(9R0aZcxv~|Xk2NK67PIKLWt{@@wI`(vaw(KNMXD!=F zRGj%rB7K6-wW=y5tK#H7pg_xtEd|>K-|6UR-Z|@(x)rF|p<-Eql2#DR9xX>#zm48n{J4>$}ru;yq|( zqPk7=pjSa13D{q>=VqLONW5!&Uz@cnQr&fUANCozTfwbsy}yyHiGDEa3>ryIS|y^6 zrQ1@%rvoMq;vNMX%Z^pDCl3}&sp+C9KM%TsSS+1Ny)6NIcHqRiYS``$@Zpsl0M;9Rl1OI=678) z-_5{fiZ&DJ-NCbPWxPa4L%0uP2JUAmuC^0l)3Pg0$;3&VqJR1F0DDb3!*J!Zd8ahQ zsu#4T+D?kNJZR$mc!+Ar_@GnBRVHN`u|xQ0Wv?JEecIay)f{Ho)|b5ol6M)XE3Oi# zz_b}1rxu$49rRL0<2jqjS}!HocD(b3IM1nw&a{a;kq~KDFj2%T>#lrV-D$COx@}a5 z)7cSG6rtnAxsvT1%!@A6`i^aQhoFolO+Wds@u!LsW0zM&(aAS!K)zW4e9LyncaTyI z2=ml>&PFLO{&t50-_^$a;SY_Bso@WgjA`N6$e12(8yPdgr$)vC;Ri>?!g{!sPlM0r z(Rh)keAvKeh;Pu>UD$|-Tm`kWMS3>&@U3uNi@$)4*B;wO0Jq6wrYnSIY@)D&&4}_T zKt4hP!o=}jYM_?oCu==}S0XnZlL%BL3hEh8x& zorDy>f-VJJdb2L@shKP2^P$I`$#Jj0ZxPYWJlfK60pYkSMhz`Vb;0jz5jvl#{!XRT zrl=>iPD;^0OHx~vd4)%lzAs}>M2%?AVtZUjC57gQs*ZOw>zA?L1=UF@Okvqr}hspL4@^=*7xEFV07-<~m?*votURdk_S=`SW8N*pt{0BMzI4k-oJcO@d zoc1hQo51&A;|Iv#S8!-Mi&v4O<KW!pBgUUfOuCHwPMB3fH4G^7&tRiL#An{*+iS$sDz)j{qO%GU+rVM= zBT>L^jwlavU*o1j9^Gsh7o#7CI)AEk?r@fQCW zFX%_nj!$4GKFP%X6p49)zCMXV_%x~d3<>!xop}PM@Hy&zikd%9^3O@FeI$>Lc{GP8 zBLc~9D89#O(ML=54B1g)IaC|y>}O=dZFjH4-Y;1g%x3 z&dQt&b526n>}yrR@VN_;e`@C4N-3M@RH`^E+J>^3D?zS|s7Y>OXE=_NY!b=-n)kmzr+=X?u$nSEV&j$|(}|CdS7Wm5KnB=rFoWUT{@ zFwe!UK;WcW_e-MrO~`gE@;)FbZ-o99HZYan zKvW5k^12{3@cZF9%J|jHGr)kPER$r4u3^fE804iPVnkP&GRU3FR5hZ1!R6`Y6`sb| z@|0vk06!%1AJN8Dexm)D{oyBQW$nfA5_|N|$koe4d=-88IlIU&m_)yn91XjuY8(yJ zI2x#NG*IJcpvKWXHIDk(Ed)nR9y5kyWWHWNvi;C!h38;C^v9RL6T literal 0 HcmV?d00001 diff --git a/editor/org.processing.editor/bin/org/processing/editor/language/ProcessingEditorMessages.class b/editor/org.processing.editor/bin/org/processing/editor/language/ProcessingEditorMessages.class new file mode 100644 index 0000000000000000000000000000000000000000..621418f9138d61a28287b46c5c75023dfeb4c6af GIT binary patch literal 1197 zcmbVM+fvg|6kVq+O&bH$N(&Y$wjvgkM8O*a;{&CR4=p&YbjBwqq{kYFNhcRa{|a>m z9G&q4{3yqL($pffFXka9`|QhFd#~O8`u+VUfOTw2h%r2I+^*Jh9fNzGX?Hc=F@49? zEZyz~dY5Z2|GH|Sr$KRa?@357WRCO?dKjziA0BbTXP9o*TKfmhYVFO=!QO7Y#*nQK zqguX8AX^NRRmb*x-S*qM74Q_&3@R~EhfLHy6LlN`LVw$Ba?c4|gYN`($KniyK33qH zmiDiYFjL!xW!k3yj3HiGX)`3MPKV3LAS>Z2!(7O7M6QBsm|;kFxjz6>E0?=k84sQY zLtcT5D>R|HY4g3{{ULW>>4$=Kw(c0Z)z)28*wJNjJLD=Oj(G*wF-d&=cc#a%S^rPX zXa=H(z6cD<<9iVDYmr!DKqUn?uqfdc!|X*hcLLMua5sh946G!hj5~sFg&{Wzpe-U+ z72L%=hNRx>al6B?HY)Veh$E;iQ9@Oq;XbMAJA;O1Dv<=|=}TB=C=aD=nBk%iwxjmZ z;62}TY+8zA{)t*3L6*)bIWAr-am&|@1^s7roSThnT!}_=`GU<%usj+bK$M<(8ffm z8+3}~iPbX{E~e#?pduno=?7r}MY7UD@Th=8Tm;187vxq?ar3191LfD*r86v(xsqL? z*D2Oc!U7WUct8n)*;Lr#Jl!l%!D0xL@0Y>`H7#KBc!)=o`Isyk!wZSB>2Haw7@qzC D4813J literal 0 HcmV?d00001 diff --git a/editor/org.processing.editor/bin/org/processing/editor/util/ProcessingColorProvider.class b/editor/org.processing.editor/bin/org/processing/editor/util/ProcessingColorProvider.class new file mode 100644 index 0000000000000000000000000000000000000000..9f9d50fcc3e33912e7fe5bd87d4a8b4b81a2a77e GIT binary patch literal 2442 zcmb7FTT@$A7+srC4unlf5NWZrrT2tl(*o5hwIz_y210_6rlQsM5Dsu?n#7X?s?}OA z4?g$@bbR;07acDYnQ?s6ar^=P1fP7?nU1>lKA}mYppqHB%ijCDto`kEe*EK`ZvhP8 zJp&B_19@jDRB-Yct5~#iOCf8)F6Et2xnyTU(+}Na`E1^yxoR(1j)6u2--@|vhO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tJ=gvh1>kifkmBqrXfi%*$%6KTEM9BMdfs z?j=o82XD_O%b$~C=36S7Rm&SCUA_r`j5yzZbLa(xim-%D)HMBos{Q zn>y0gNe7GNrSk%c7!5E&D1MDtzSLGnj%|oB3=u|5x-awZ)wtE<|T*@$X#SdxqY literal 0 HcmV?d00001 diff --git a/editor/org.processing.editor/build.properties b/editor/org.processing.editor/build.properties new file mode 100644 index 000000000..0d3d3a745 --- /dev/null +++ b/editor/org.processing.editor/build.properties @@ -0,0 +1,6 @@ +source.. = src/ +output.. = bin/ +bin.includes = plugin.xml,\ + META-INF/,\ + .,\ + icons/ diff --git a/editor/org.processing.editor/icons/processing.gif b/editor/org.processing.editor/icons/processing.gif new file mode 100644 index 0000000000000000000000000000000000000000..6745233f10a8e2d337bac5dacf0984659c6809ed GIT binary patch literal 144 zcmZ?wbhEHb6krfwSj5Kg|NnpEv@`}|ATnlP03whGkW~E1!pOkD#-Iaa162wzFffN^ z?7G9PcuMk~fKtkt#a!ZQg?HSUGz`|v=;YN}v$k3LfP@RTnT^1N+h@NvvnaGUElgur r+n~Ahi!-y@(#y}dSFnhLc)fbHdrAd&(i*EZ0x{QP+viMVV6X-N`$jM- literal 0 HcmV?d00001 diff --git a/editor/org.processing.editor/plugin.xml b/editor/org.processing.editor/plugin.xml new file mode 100644 index 000000000..1ae123912 --- /dev/null +++ b/editor/org.processing.editor/plugin.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + diff --git a/editor/org.processing.editor/src/org/processing/editor/PresentationAction.java b/editor/org.processing.editor/src/org/processing/editor/PresentationAction.java new file mode 100644 index 000000000..f5785a5dc --- /dev/null +++ b/editor/org.processing.editor/src/org/processing/editor/PresentationAction.java @@ -0,0 +1,52 @@ +/******************************************************************************* + * Copyright (c) 2000, 2005 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.processing.editor; + + +import org.eclipse.ui.texteditor.ITextEditor; +import org.eclipse.ui.texteditor.TextEditorAction; + +/** + * A toolbar action which toggles the presentation model of the + * connected text editor. The editor shows either the highlight range + * only or always the whole document. + */ +public class PresentationAction extends TextEditorAction { + + /** + * Constructs and updates the action. + */ + public PresentationAction() { + super(ProcessingEditorMessages.getResourceBundle(), "TogglePresentation.", null); //$NON-NLS-1$ + update(); + } + + /* (non-Javadoc) + * Method declared on IAction + */ + public void run() { + + ITextEditor editor= getTextEditor(); + + editor.resetHighlightRange(); + boolean show= editor.showsHighlightRangeOnly(); + setChecked(!show); + editor.showHighlightRangeOnly(!show); + } + + /* (non-Javadoc) + * Method declared on TextEditorAction + */ + public void update() { + setChecked(getTextEditor() != null && getTextEditor().showsHighlightRangeOnly()); + setEnabled(true); + } +} diff --git a/editor/org.processing.editor/src/org/processing/editor/ProcessingActionContributor.java b/editor/org.processing.editor/src/org/processing/editor/ProcessingActionContributor.java new file mode 100644 index 000000000..d787c0818 --- /dev/null +++ b/editor/org.processing.editor/src/org/processing/editor/ProcessingActionContributor.java @@ -0,0 +1,90 @@ +/******************************************************************************* + * Copyright (c) 2000, 2005 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.processing.editor; + + +import org.eclipse.jface.action.*; +import org.eclipse.ui.*; +import org.eclipse.ui.editors.text.TextEditorActionContributor; +import org.eclipse.ui.texteditor.*; + +/** + * Contributes interesting Java actions to the desktop's Edit menu and the toolbar. + */ +public class ProcessingActionContributor extends TextEditorActionContributor { + + protected RetargetTextEditorAction fContentAssistProposal; + protected RetargetTextEditorAction fContentAssistTip; + protected TextEditorAction fTogglePresentation; + + /** + * Default constructor. + */ + public ProcessingActionContributor() { + super(); + fContentAssistProposal= new RetargetTextEditorAction(ProcessingEditorMessages.getResourceBundle(), "ContentAssistProposal."); //$NON-NLS-1$ + fContentAssistProposal.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS); + fContentAssistTip= new RetargetTextEditorAction(ProcessingEditorMessages.getResourceBundle(), "ContentAssistTip."); //$NON-NLS-1$ + fContentAssistTip.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_CONTEXT_INFORMATION); + fTogglePresentation= new PresentationAction(); + } + + /* + * @see IEditorActionBarContributor#init(IActionBars) + */ + public void init(IActionBars bars) { + super.init(bars); + + IMenuManager menuManager= bars.getMenuManager(); + IMenuManager editMenu= menuManager.findMenuUsingPath(IWorkbenchActionConstants.M_EDIT); + if (editMenu != null) { + editMenu.add(new Separator()); + editMenu.add(fContentAssistProposal); + editMenu.add(fContentAssistTip); + } + + IToolBarManager toolBarManager= bars.getToolBarManager(); + if (toolBarManager != null) { + toolBarManager.add(new Separator()); + toolBarManager.add(fTogglePresentation); + } + } + + private void doSetActiveEditor(IEditorPart part) { + super.setActiveEditor(part); + + ITextEditor editor= null; + if (part instanceof ITextEditor) + editor= (ITextEditor) part; + + fContentAssistProposal.setAction(getAction(editor, "ContentAssistProposal")); //$NON-NLS-1$ + fContentAssistTip.setAction(getAction(editor, "ContentAssistTip")); //$NON-NLS-1$ + + fTogglePresentation.setEditor(editor); + fTogglePresentation.update(); + } + + /* + * @see IEditorActionBarContributor#setActiveEditor(IEditorPart) + */ + public void setActiveEditor(IEditorPart part) { + super.setActiveEditor(part); + doSetActiveEditor(part); + } + + /* + * @see IEditorActionBarContributor#dispose() + */ + public void dispose() { + doSetActiveEditor(null); + super.dispose(); + } +} diff --git a/editor/org.processing.editor/src/org/processing/editor/ProcessingAnnotationHover.java b/editor/org.processing.editor/src/org/processing/editor/ProcessingAnnotationHover.java new file mode 100644 index 000000000..189beb379 --- /dev/null +++ b/editor/org.processing.editor/src/org/processing/editor/ProcessingAnnotationHover.java @@ -0,0 +1,42 @@ +/******************************************************************************* + * Copyright (c) 2000, 2005 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.processing.editor; + + +import org.eclipse.jface.text.*; +import org.eclipse.jface.text.source.IAnnotationHover; +import org.eclipse.jface.text.source.ISourceViewer; + +/** + * Provides the information thats displayed in the presentation area of hover popup windows. + * Right now this doesn't provide anything useful. It just hands back the contents of the line + * the mouse is hovering on. + * + * @see org.eclipse.jface.text.source.IAnnotationHover + */ + +public class ProcessingAnnotationHover implements IAnnotationHover { + + /* (non-Javadoc) + * Method declared on IAnnotationHover + */ + public String getHoverInfo(ISourceViewer sourceViewer, int lineNumber) { + IDocument document= sourceViewer.getDocument(); + + try { + IRegion info= document.getLineInformation(lineNumber); + return document.get(info.getOffset(), info.getLength()); + } catch (BadLocationException x) { + } + + return null; + } +} diff --git a/editor/org.processing.editor/src/org/processing/editor/ProcessingContentOutlinePage.java b/editor/org.processing.editor/src/org/processing/editor/ProcessingContentOutlinePage.java new file mode 100644 index 000000000..cecf2cb13 --- /dev/null +++ b/editor/org.processing.editor/src/org/processing/editor/ProcessingContentOutlinePage.java @@ -0,0 +1,242 @@ +/******************************************************************************* + * Copyright (c) 2000, 2005 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.processing.editor; + + +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.jface.text.*; +import org.eclipse.jface.viewers.*; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.ui.texteditor.IDocumentProvider; +import org.eclipse.ui.texteditor.ITextEditor; +import org.eclipse.ui.views.contentoutline.ContentOutlinePage; + +/** + * A content outline page which always represents the content of the + * connected editor in 10 segments. + */ +public class ProcessingContentOutlinePage extends ContentOutlinePage { + + /** + * A segment element. + */ + protected static class Segment { + public String name; + public Position position; + + public Segment(String name, Position position) { + this.name= name; + this.position= position; + } + + public String toString() { + return name; + } + } + + /** + * Divides the editor's document into ten segments and provides elements for them. + */ + protected class ContentProvider implements ITreeContentProvider { + + protected final static String SEGMENTS= "__java_segments"; //$NON-NLS-1$ + protected IPositionUpdater fPositionUpdater= new DefaultPositionUpdater(SEGMENTS); + protected List fContent= new ArrayList(10); + + protected void parse(IDocument document) { + + int lines= document.getNumberOfLines(); + int increment= Math.max(Math.round(lines / 10), 10); + + for (int line= 0; line < lines; line += increment) { + + int length= increment; + if (line + increment > lines) + length= lines - line; + + try { + + int offset= document.getLineOffset(line); + int end= document.getLineOffset(line + length); + length= end - offset; + Position p= new Position(offset, length); + document.addPosition(SEGMENTS, p); + fContent.add(new Segment(MessageFormat.format(ProcessingEditorMessages.getString("OutlinePage.segment.title_pattern"), new Object[] { new Integer(offset) }), p)); //$NON-NLS-1$ + + } catch (BadPositionCategoryException x) { + } catch (BadLocationException x) { + } + } + } + + /* + * @see IContentProvider#inputChanged(Viewer, Object, Object) + */ + public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { + if (oldInput != null) { + IDocument document= fDocumentProvider.getDocument(oldInput); + if (document != null) { + try { + document.removePositionCategory(SEGMENTS); + } catch (BadPositionCategoryException x) { + } + document.removePositionUpdater(fPositionUpdater); + } + } + + fContent.clear(); + + if (newInput != null) { + IDocument document= fDocumentProvider.getDocument(newInput); + if (document != null) { + document.addPositionCategory(SEGMENTS); + document.addPositionUpdater(fPositionUpdater); + + parse(document); + } + } + } + + /* + * @see IContentProvider#dispose + */ + public void dispose() { + if (fContent != null) { + fContent.clear(); + fContent= null; + } + } + + /* + * @see IContentProvider#isDeleted(Object) + */ + public boolean isDeleted(Object element) { + return false; + } + + /* + * @see IStructuredContentProvider#getElements(Object) + */ + public Object[] getElements(Object element) { + return fContent.toArray(); + } + + /* + * @see ITreeContentProvider#hasChildren(Object) + */ + public boolean hasChildren(Object element) { + return element == fInput; + } + + /* + * @see ITreeContentProvider#getParent(Object) + */ + public Object getParent(Object element) { + if (element instanceof Segment) + return fInput; + return null; + } + + /* + * @see ITreeContentProvider#getChildren(Object) + */ + public Object[] getChildren(Object element) { + if (element == fInput) + return fContent.toArray(); + return new Object[0]; + } + } + + protected Object fInput; + protected IDocumentProvider fDocumentProvider; + protected ITextEditor fTextEditor; + + /** + * Creates a content outline page using the given provider and the given editor. + * + * @param provider the document provider + * @param editor the editor + */ + public ProcessingContentOutlinePage(IDocumentProvider provider, ITextEditor editor) { + super(); + fDocumentProvider= provider; + fTextEditor= editor; + } + + /* (non-Javadoc) + * Method declared on ContentOutlinePage + */ + public void createControl(Composite parent) { + + super.createControl(parent); + + TreeViewer viewer= getTreeViewer(); + viewer.setContentProvider(new ContentProvider()); + viewer.setLabelProvider(new LabelProvider()); + viewer.addSelectionChangedListener(this); + + if (fInput != null) + viewer.setInput(fInput); + } + + /* (non-Javadoc) + * Method declared on ContentOutlinePage + */ + public void selectionChanged(SelectionChangedEvent event) { + + super.selectionChanged(event); + + ISelection selection= event.getSelection(); + if (selection.isEmpty()) + fTextEditor.resetHighlightRange(); + else { + Segment segment= (Segment) ((IStructuredSelection) selection).getFirstElement(); + int start= segment.position.getOffset(); + int length= segment.position.getLength(); + try { + fTextEditor.setHighlightRange(start, length, true); + } catch (IllegalArgumentException x) { + fTextEditor.resetHighlightRange(); + } + } + } + + /** + * Sets the input of the outline page + * + * @param input the input of this outline page + */ + public void setInput(Object input) { + fInput= input; + update(); + } + + /** + * Updates the outline page. + */ + public void update() { + TreeViewer viewer= getTreeViewer(); + + if (viewer != null) { + Control control= viewer.getControl(); + if (control != null && !control.isDisposed()) { + control.setRedraw(false); + viewer.setInput(fInput); + viewer.expandAll(); + control.setRedraw(true); + } + } + } +} diff --git a/editor/org.processing.editor/src/org/processing/editor/ProcessingDocumentSetupParticipant.java b/editor/org.processing.editor/src/org/processing/editor/ProcessingDocumentSetupParticipant.java new file mode 100644 index 000000000..b72e5e133 --- /dev/null +++ b/editor/org.processing.editor/src/org/processing/editor/ProcessingDocumentSetupParticipant.java @@ -0,0 +1,35 @@ +package org.processing.editor; + +import org.eclipse.core.filebuffers.IDocumentSetupParticipant; + +import org.eclipse.jface.text.IDocument; +import org.eclipse.jface.text.IDocumentExtension3; +import org.eclipse.jface.text.IDocumentPartitioner; +import org.eclipse.jface.text.rules.FastPartitioner; + +/** + * Participates in the setup of a text file buffer document. + *

+ * Requires the "org.eclipse.core.filebuffers.documentSetup" extension point. + * + * @see org.eclipse.core.filebuffers.IDocumentSetupParticipant + */ +public class ProcessingDocumentSetupParticipant implements IDocumentSetupParticipant { + + /** + */ + public ProcessingDocumentSetupParticipant() { + } + + /* + * @see org.eclipse.core.filebuffers.IDocumentSetupParticipant#setup(org.eclipse.jface.text.IDocument) + */ + public void setup(IDocument document) { + if (document instanceof IDocumentExtension3) { + IDocumentExtension3 extension3= (IDocumentExtension3) document; + IDocumentPartitioner partitioner= new FastPartitioner(ProcessingEditorPlugin.getDefault().getProcessingPartitionScanner(), ProcessingPartitionScanner.JAVA_PARTITION_TYPES); + extension3.setDocumentPartitioner(ProcessingEditorPlugin.PROCESSING_PARTITIONING, partitioner); + partitioner.connect(document); + } + } +} diff --git a/editor/org.processing.editor/src/org/processing/editor/ProcessingEditor.java b/editor/org.processing.editor/src/org/processing/editor/ProcessingEditor.java new file mode 100644 index 000000000..adcacf695 --- /dev/null +++ b/editor/org.processing.editor/src/org/processing/editor/ProcessingEditor.java @@ -0,0 +1,270 @@ +/******************************************************************************* + * Copyright (c) 2000, 2005 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.processing.editor; + + +import java.util.ResourceBundle; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IProgressMonitor; + +import org.eclipse.swt.widgets.Composite; + +import org.eclipse.jface.action.IAction; +import org.eclipse.jface.action.IMenuManager; +import org.eclipse.jface.viewers.ISelection; + +import org.eclipse.jface.text.BadLocationException; +import org.eclipse.jface.text.IDocument; +import org.eclipse.jface.text.ITextSelection; +import org.eclipse.jface.text.ITextViewerExtension5; +import org.eclipse.jface.text.Position; +import org.eclipse.jface.text.Region; +//import org.eclipse.jface.text.source.IAnnotationAccess; +import org.eclipse.jface.text.source.IAnnotationModel; +import org.eclipse.jface.text.source.ISourceViewer; +import org.eclipse.jface.text.source.IVerticalRuler; +import org.eclipse.jface.text.source.projection.ProjectionAnnotation; +import org.eclipse.jface.text.source.projection.ProjectionAnnotationModel; +import org.eclipse.jface.text.source.projection.ProjectionSupport; +import org.eclipse.jface.text.source.projection.ProjectionViewer; + +import org.eclipse.ui.IEditorInput; +import org.eclipse.ui.editors.text.TextEditor; +//import org.eclipse.ui.texteditor.DefaultMarkerAnnotationAccess; +import org.eclipse.ui.texteditor.ITextEditor; +import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds; +import org.eclipse.ui.texteditor.TextEditorAction; +import org.eclipse.ui.texteditor.TextOperationAction; +import org.eclipse.ui.views.contentoutline.IContentOutlinePage; +//import org.eclipse.ui.texteditor.SourceViewerDecorationSupport; // error checking annotations + +/** + * Sets up a Processing specific text editor. + * + * @see org.eclipse.ui.editors.text.TextEditor + */ +public class ProcessingEditor extends TextEditor { + + + private class DefineFoldingRegionAction extends TextEditorAction { + + public DefineFoldingRegionAction(ResourceBundle bundle, String prefix, ITextEditor editor) { + super(bundle, prefix, editor); + } + + private IAnnotationModel getAnnotationModel(ITextEditor editor) { + return (IAnnotationModel) editor.getAdapter(ProjectionAnnotationModel.class); + } + + /* + * @see org.eclipse.jface.action.Action#run() + */ + public void run() { + ITextEditor editor= getTextEditor(); + ISelection selection= editor.getSelectionProvider().getSelection(); + if (selection instanceof ITextSelection) { + ITextSelection textSelection= (ITextSelection) selection; + if (!textSelection.isEmpty()) { + IAnnotationModel model= getAnnotationModel(editor); + if (model != null) { + + int start= textSelection.getStartLine(); + int end= textSelection.getEndLine(); + + try { + IDocument document= editor.getDocumentProvider().getDocument(editor.getEditorInput()); + int offset= document.getLineOffset(start); + int endOffset= document.getLineOffset(end + 1); + Position position= new Position(offset, endOffset - offset); + model.addAnnotation(new ProjectionAnnotation(), position); + } catch (BadLocationException x) { + // ignore + } + } + } + } + } + } + + /** The outline page */ + private ProcessingContentOutlinePage fOutlinePage; + /** The projection support */ + private ProjectionSupport fProjectionSupport; + + /** + * Default constructor. + */ + public ProcessingEditor() { + super(); + } + + /** The ProcessingEditor implementation of this + * AbstractTextEditor method extend the + * actions to add those specific to the receiver + */ + protected void createActions() { + super.createActions(); + // accessing the ResourceBundle was causing an ExceptionInInitializerError, not sure what I changed to fix it [lonnen] June 10 2010 + IAction a= new TextOperationAction(ProcessingEditorMessages.getResourceBundle(), "ContentAssistProposal.", this, ISourceViewer.CONTENTASSIST_PROPOSALS); //$NON-NLS-1$ + a.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS); + setAction("ContentAssistProposal", a); //$NON-NLS-1$ + + a= new TextOperationAction(ProcessingEditorMessages.getResourceBundle(), "ContentAssistTip.", this, ISourceViewer.CONTENTASSIST_CONTEXT_INFORMATION); //$NON-NLS-1$ + a.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_CONTEXT_INFORMATION); + setAction("ContentAssistTip", a); //$NON-NLS-1$ + + a= new DefineFoldingRegionAction(ProcessingEditorMessages.getResourceBundle(), "DefineFoldingRegion.", this); //$NON-NLS-1$ + setAction("DefineFoldingRegion", a); //$NON-NLS-1$ + } + + /** The ProcessingEditor implementation of this + * AbstractTextEditor method performs any extra + * disposal actions required by the java editor. + */ + public void dispose() { + if (fOutlinePage != null) + fOutlinePage.setInput(null); + super.dispose(); + } + + /** The ProcessingEditor implementation of this + * AbstractTextEditor method performs any extra + * revert behavior required by the java editor. + */ + public void doRevertToSaved() { + super.doRevertToSaved(); + if (fOutlinePage != null) + fOutlinePage.update(); + } + + /** The ProcessingEditor implementation of this + * AbstractTextEditor method performs any extra + * save behavior required by the java editor. + * + * @param monitor the progress monitor + */ + public void doSave(IProgressMonitor monitor) { + super.doSave(monitor); + if (fOutlinePage != null) + fOutlinePage.update(); + } + + /** The ProcessingEditor implementation of this + * AbstractTextEditor method performs any extra + * save as behavior required by the java editor. + */ + public void doSaveAs() { + super.doSaveAs(); + if (fOutlinePage != null) + fOutlinePage.update(); + } + + /** The ProcessingEditor implementation of this + * AbstractTextEditor method performs sets the + * input of the outline page after AbstractTextEditor has set input. + * + * @param input the editor input + * @throws CoreException in case the input can not be set + */ + public void doSetInput(IEditorInput input) throws CoreException { + super.doSetInput(input); + if (fOutlinePage != null) + fOutlinePage.setInput(input); + } + + /* + * @see org.eclipse.ui.texteditor.ExtendedTextEditor#editorContextMenuAboutToShow(org.eclipse.jface.action.IMenuManager) + */ + protected void editorContextMenuAboutToShow(IMenuManager menu) { + super.editorContextMenuAboutToShow(menu); + addAction(menu, "ContentAssistProposal"); //$NON-NLS-1$ + addAction(menu, "ContentAssistTip"); //$NON-NLS-1$ + addAction(menu, "DefineFoldingRegion"); //$NON-NLS-1$ + } + + /** The ProcessingEditor implementation of this + * AbstractTextEditor method performs gets + * the java content outline page if request is for a an + * outline page. + * + * @param required the required type + * @return an adapter for the required type or null + */ + public Object getAdapter(Class required) { + + if (IContentOutlinePage.class.equals(required)) { + if (fOutlinePage == null) { + fOutlinePage= new ProcessingContentOutlinePage(getDocumentProvider(), this); + if (getEditorInput() != null) + fOutlinePage.setInput(getEditorInput()); + } + return fOutlinePage; + } + + if (fProjectionSupport != null) { + Object adapter= fProjectionSupport.getAdapter(getSourceViewer(), required); + if (adapter != null) + return adapter; + } + + return super.getAdapter(required); + } + + /* (non-Javadoc) + * Method declared on AbstractTextEditor + */ + protected void initializeEditor() { + super.initializeEditor(); + setSourceViewerConfiguration(new ProcessingSourceViewerConfiguration()); + } + + /* + * @see org.eclipse.ui.texteditor.ExtendedTextEditor#createSourceViewer(org.eclipse.swt.widgets.Composite, org.eclipse.jface.text.source.IVerticalRuler, int) + */ + protected ISourceViewer createSourceViewer(Composite parent, IVerticalRuler ruler, int styles) { + + fAnnotationAccess= createAnnotationAccess(); + fOverviewRuler= createOverviewRuler(getSharedColors()); + + ISourceViewer viewer= new ProjectionViewer(parent, ruler, getOverviewRuler(), isOverviewRulerVisible(), styles); + + // ensure decoration support has been created and configured. + // preferred over SourceViewerDecorationSupport due to impending API changes [lonnen] june 11, 2010 + fSourceViewerDecorationSupport = getSourceViewerDecorationSupport(viewer); + + return viewer; + } + + /* + * @see org.eclipse.ui.texteditor.ExtendedTextEditor#createPartControl(org.eclipse.swt.widgets.Composite) + */ + public void createPartControl(Composite parent) { + super.createPartControl(parent); + ProjectionViewer viewer= (ProjectionViewer) getSourceViewer(); + fProjectionSupport= new ProjectionSupport(viewer, getAnnotationAccess(), getSharedColors()); + fProjectionSupport.addSummarizableAnnotationType("org.eclipse.ui.workbench.texteditor.error"); //$NON-NLS-1$ + fProjectionSupport.addSummarizableAnnotationType("org.eclipse.ui.workbench.texteditor.warning"); //$NON-NLS-1$ + fProjectionSupport.install(); + viewer.doOperation(ProjectionViewer.TOGGLE); + } + + /* + * @see org.eclipse.ui.texteditor.AbstractTextEditor#adjustHighlightRange(int, int) + */ + protected void adjustHighlightRange(int offset, int length) { + ISourceViewer viewer= getSourceViewer(); + if (viewer instanceof ITextViewerExtension5) { + ITextViewerExtension5 extension= (ITextViewerExtension5) viewer; + extension.exposeModelRange(new Region(offset, length)); + } + } +} diff --git a/editor/org.processing.editor/src/org/processing/editor/ProcessingEditorMessages.java b/editor/org.processing.editor/src/org/processing/editor/ProcessingEditorMessages.java new file mode 100644 index 000000000..a2ff97029 --- /dev/null +++ b/editor/org.processing.editor/src/org/processing/editor/ProcessingEditorMessages.java @@ -0,0 +1,44 @@ +/******************************************************************************* + * Copyright (c) 2000, 2005 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.processing.editor; + +import java.util.MissingResourceException; +import java.util.ResourceBundle; + +/** + * Processing Editor Messages object handles localization stuff + * using the ProcessingEditorMessages.preferences file. This class + * is never instantiated, and all of its variables and methods are + * static. + * + * @author lonnen + */ +public class ProcessingEditorMessages { + + private static final String RESOURCE_BUNDLE= "org.processing.editor.ProcessingEditorMessages";//$NON-NLS-1$ + + private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE); + + private ProcessingEditorMessages() { + } + + public static String getString(String key) { + try { + return fgResourceBundle.getString(key); + } catch (MissingResourceException e) { + return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$ + } + } + + public static ResourceBundle getResourceBundle() { + return fgResourceBundle; + } +} diff --git a/editor/org.processing.editor/src/org/processing/editor/ProcessingEditorMessages.properties b/editor/org.processing.editor/src/org/processing/editor/ProcessingEditorMessages.properties new file mode 100644 index 000000000..840497670 --- /dev/null +++ b/editor/org.processing.editor/src/org/processing/editor/ProcessingEditorMessages.properties @@ -0,0 +1,46 @@ +############################################################################### +# Copyright (c) 2000, 2005 IBM Corporation and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# IBM Corporation - initial API and implementation +############################################################################### + +# Essentially the same as JavaEditorMessage.properties from the Java example [lonnen] June 10 2010 + +## Actions ## + +ContentAssistProposal.label=Content Assist@Ctrl+SPACE +ContentAssistProposal.tooltip=Content Assist +ContentAssistProposal.image= +ContentAssistProposal.description=Content Assist + +ContentAssistTip.label=Content Tip@Ctrl+SHIFT+SPACE +ContentAssistTip.tooltip=Content Tip +ContentAssistTip.image= +ContentAssistTip.description=Content Tip + +DefineFoldingRegion.label=Define Folding Region +DefineFoldingRegion.tooltip=Define Folding Region +DefineFoldingRegion.image= +DefineFoldingRegion.description=Define Folding Region + +TogglePresentation.label=Change Presentation +TogglePresentation.tooltip=Enable/Disable Segmented Source Viewer +TogglePresentation.image=togglepresentation.gif +TogglePresentation.description=Enable/Disable Segmented Source Viewer + +OutlinePage.segment.title_pattern=position {0} + +AutoIndent.error.bad_location_1=JavaAutoIndentStrategy.getAutoIndentString: BadLocationException +AutoIndent.error.bad_location_2=JavaAutoIndentStrategy.calcShiftBackReplace: BadLocationException + +CompletionProcessor.ContextInfo.display.pattern=proposal {0} at position {1} +CompletionProcessor.ContextInfo.value.pattern=proposal {0} valid from {1} to {2} +CompletionProcessor.Proposal.ContextInfo.pattern={0} valid 5 characters around insertion point +CompletionProcessor.Proposal.hoverinfo.pattern=Java keyword: {0} + +JavaTextHover.emptySelection=empty selection diff --git a/editor/org.processing.editor/src/org/processing/editor/ProcessingEditorPlugin.java b/editor/org.processing.editor/src/org/processing/editor/ProcessingEditorPlugin.java new file mode 100644 index 000000000..8bacdddbc --- /dev/null +++ b/editor/org.processing.editor/src/org/processing/editor/ProcessingEditorPlugin.java @@ -0,0 +1,130 @@ +/******************************************************************************* + * Copyright (c) 2000, 2005 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.processing.editor; + +import org.eclipse.jface.text.rules.RuleBasedScanner; +import org.processing.editor.javadoc.JavaDocScanner; +import org.processing.editor.language.ProcessingCodeScanner; +import org.processing.editor.util.ProcessingColorProvider; + +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * Processing editor plug-in class. + * Uses a singleton pattern to controls access to a few objects that need to be shared + * across the plugin. Access these options with ProcessingEditorPlugin.getDefault().method() + * @since 3.0 + */ +public class ProcessingEditorPlugin extends AbstractUIPlugin { + + public static final String PLUGIN_ID = "org.processing.ProcessingEditor"; + //public static final String JAVA_PARTITIONING= "__java_example_partitioning"; //$NON-NLS-1$ + public static final String PROCESSING_PARTITIONING= "__processing_partitioning"; //$NON-NLS-1$ + + // The shared instance + private static ProcessingEditorPlugin fgInstance; + + // Supporting objects that are managed by the singleton + private ProcessingPartitionScanner fPartitionScanner; + private ProcessingColorProvider fColorProvider; + private ProcessingCodeScanner fCodeScanner; + private JavaDocScanner fDocScanner; + + /** + * Creates a new plug-in instance. + * + */ + public ProcessingEditorPlugin() { +// [lonnen] +// Java editor example has "fgInstance= this;" +// while the editor template uses the start method to handle +// that and leaves this empty. Since I've been chasing down +// this null pointer error for going on 12 hours, I'm going +// to try it the template's way and see if it works. +// +// That did the trick! On to debugging other problems. [lonnen] June 10 2010 + } + + /* added from the editor template, not present in the java editor code + * (non-Javadoc) + * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) + */ + public void start(BundleContext context) throws Exception { + super.start(context); + fgInstance = this; + //System.out.println("fgInstance initialized!"); + } + + /* added from the editor template, not present in the java editor code + * (non-Javadoc) + * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) + */ + public void stop(BundleContext context) throws Exception { + fgInstance = null; + super.stop(context); + } + + + /** + * Returns the default plug-in instance. + * + * @return the default plug-in instance + */ + public static ProcessingEditorPlugin getDefault() { return fgInstance; } + + /** + * Return a scanner for creating Processing partitions. + * Processing uses Java's commenting scheme, so our partitioner is almost identical. Unlike + * the Java partitioner, however, this Processing one currently treats the JavaDoc style + * comments as simple multiline comments. + * + * @return a scanner for creating Processing partitions + */ + public ProcessingPartitionScanner getProcessingPartitionScanner() { + if (fPartitionScanner == null) + fPartitionScanner= new ProcessingPartitionScanner(); + return fPartitionScanner; + } + + /** + * Returns the singleton Processing code scanner. + * + * @return the singleton Processing code scanner + */ + public RuleBasedScanner getProcessingCodeScanner() { + if (fCodeScanner == null) + fCodeScanner= new ProcessingCodeScanner(getProcessingColorProvider()); + return fCodeScanner; + } + + /** + * Returns the singleton Processing color provider. + * + * @return the singleton Processing color provider + */ + public ProcessingColorProvider getProcessingColorProvider() { + if (fColorProvider == null) + fColorProvider= new ProcessingColorProvider(); + return fColorProvider; + } + + /** + * Returns the singleton Processingdoc scanner. + * + * @return the singleton Processingdoc scanner + */ + public RuleBasedScanner getProcessingDocScanner() { + if (fDocScanner == null) + fDocScanner= new JavaDocScanner(fColorProvider); + return fDocScanner; + } +} diff --git a/editor/org.processing.editor/src/org/processing/editor/ProcessingPartitionScanner.java b/editor/org.processing.editor/src/org/processing/editor/ProcessingPartitionScanner.java new file mode 100644 index 000000000..70e88efdc --- /dev/null +++ b/editor/org.processing.editor/src/org/processing/editor/ProcessingPartitionScanner.java @@ -0,0 +1,110 @@ +/******************************************************************************* + * Copyright (c) 2000, 2005 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.processing.editor; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.jface.text.rules.*; + +/** + * Processing uses Java comments, so we use the same scanner. The class name is + * changed for consistency. + * + * This scanner recognizes the JavaDoc comments and Java multi line comments. + */ +public class ProcessingPartitionScanner extends RuleBasedPartitionScanner { + + public final static String JAVA_MULTILINE_COMMENT= "__java_multiline_comment"; //$NON-NLS-1$ + //Removing JavaDoc support from sketches, but leave in code +// public final static String JAVA_DOC= "__java_javadoc"; //$NON-NLS-1$ +// public final static String[] JAVA_PARTITION_TYPES= new String[] { JAVA_MULTILINE_COMMENT, JAVA_DOC }; + public final static String[] JAVA_PARTITION_TYPES= new String[] { JAVA_MULTILINE_COMMENT }; + + /** + * Detector for empty comments. + */ + static class EmptyCommentDetector implements IWordDetector { + + /* (non-Javadoc) + * Method declared on IWordDetector + */ + public boolean isWordStart(char c) { + return (c == '/'); + } + + /* (non-Javadoc) + * Method declared on IWordDetector + */ + public boolean isWordPart(char c) { + return (c == '*' || c == '/'); + } + } + + /** + * + */ + static class WordPredicateRule extends WordRule implements IPredicateRule { + + private IToken fSuccessToken; + + public WordPredicateRule(IToken successToken) { + super(new EmptyCommentDetector()); + fSuccessToken= successToken; + addWord("/**/", fSuccessToken); //$NON-NLS-1$ + } + + /* + * @see org.eclipse.jface.text.rules.IPredicateRule#evaluate(ICharacterScanner, boolean) + */ + public IToken evaluate(ICharacterScanner scanner, boolean resume) { + return super.evaluate(scanner); + } + + /* + * @see org.eclipse.jface.text.rules.IPredicateRule#getSuccessToken() + */ + public IToken getSuccessToken() { + return fSuccessToken; + } + } + + /** + * Creates the partitioner and sets up the appropriate rules. + */ + public ProcessingPartitionScanner() { + super(); + //Removing JavaDoc support from sketches, but leave in code +// IToken javaDoc= new Token(JAVA_DOC); + IToken comment= new Token(JAVA_MULTILINE_COMMENT); + + List rules= new ArrayList(); + + // Add rule for single line comments. + rules.add(new EndOfLineRule("//", Token.UNDEFINED)); //$NON-NLS-1$ + + // Add rule for strings and character constants. + rules.add(new SingleLineRule("\"", "\"", Token.UNDEFINED, '\\')); //$NON-NLS-2$ //$NON-NLS-1$ + rules.add(new SingleLineRule("'", "'", Token.UNDEFINED, '\\')); //$NON-NLS-2$ //$NON-NLS-1$ + + // Add special case word rule. + rules.add(new WordPredicateRule(comment)); + + // Add rules for multi-line comments and javadoc. + //Removing JavaDoc support from sketches, but leave in code +// rules.add(new MultiLineRule("/**", "*/", javaDoc, (char) 0, true)); //$NON-NLS-1$ //$NON-NLS-2$ + rules.add(new MultiLineRule("/*", "*/", comment, (char) 0, true)); //$NON-NLS-1$ //$NON-NLS-2$ + + IPredicateRule[] result= new IPredicateRule[rules.size()]; + rules.toArray(result); + setPredicateRules(result); + } +} diff --git a/editor/org.processing.editor/src/org/processing/editor/ProcessingSourceViewerConfiguration.java b/editor/org.processing.editor/src/org/processing/editor/ProcessingSourceViewerConfiguration.java new file mode 100644 index 000000000..7c0d3ae6a --- /dev/null +++ b/editor/org.processing.editor/src/org/processing/editor/ProcessingSourceViewerConfiguration.java @@ -0,0 +1,172 @@ +/******************************************************************************* + * Copyright (c) 2000, 2005 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.processing.editor; + +import org.eclipse.swt.graphics.RGB; + +import org.eclipse.jface.text.DefaultIndentLineAutoEditStrategy; +import org.eclipse.jface.text.IAutoEditStrategy; +import org.eclipse.jface.text.IDocument; +import org.eclipse.jface.text.ITextDoubleClickStrategy; +import org.eclipse.jface.text.ITextHover; +import org.eclipse.jface.text.TextAttribute; +import org.eclipse.jface.text.contentassist.ContentAssistant; +import org.eclipse.jface.text.contentassist.IContentAssistant; +import org.eclipse.jface.text.presentation.IPresentationReconciler; +import org.eclipse.jface.text.presentation.PresentationReconciler; +import org.eclipse.jface.text.rules.BufferedRuleBasedScanner; +import org.eclipse.jface.text.rules.DefaultDamagerRepairer; +import org.eclipse.jface.text.rules.Token; +import org.eclipse.jface.text.source.IAnnotationHover; +import org.eclipse.jface.text.source.ISourceViewer; +import org.eclipse.jface.text.source.SourceViewerConfiguration; + +//TODO implement completion properly for Processing +//Removing JavaDoc support from sketches, but leave in code +//import org.processing.editor.javadoc.JavaDocCompletionProcessor; +import org.processing.editor.language.ProcessingAutoIndentStrategy; +import org.processing.editor.language.ProcessingCompletionProcessor; +import org.processing.editor.language.ProcessingDoubleClickSelector; +import org.processing.editor.util.ProcessingColorProvider; + +/** + * Configuration for the ProcessingSourceViewer. + */ +public class ProcessingSourceViewerConfiguration extends SourceViewerConfiguration { + + + /** + * Single token scanner. + */ + static class SingleTokenScanner extends BufferedRuleBasedScanner { + public SingleTokenScanner(TextAttribute attribute) { + setDefaultReturnToken(new Token(attribute)); + } + } + + + /** + * Default constructor. + */ + public ProcessingSourceViewerConfiguration() { + } + /* (non-Javadoc) + * Method declared on SourceViewerConfiguration + */ + public IAnnotationHover getAnnotationHover(ISourceViewer sourceViewer) { + return new ProcessingAnnotationHover(); + } + + /* + * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getAutoEditStrategies(org.eclipse.jface.text.source.ISourceViewer, java.lang.String) + */ + public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) { + IAutoEditStrategy strategy= (IDocument.DEFAULT_CONTENT_TYPE.equals(contentType) ? new ProcessingAutoIndentStrategy() : new DefaultIndentLineAutoEditStrategy()); + return new IAutoEditStrategy[] { strategy }; + } + + /* + * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getConfiguredDocumentPartitioning(org.eclipse.jface.text.source.ISourceViewer) + */ + public String getConfiguredDocumentPartitioning(ISourceViewer sourceViewer) { + return ProcessingEditorPlugin.PROCESSING_PARTITIONING; + } + + /* (non-Javadoc) + * Method declared on SourceViewerConfiguration + */ + public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) { + //Removing JavaDoc support from sketches, but leave in code + //return new String[] { IDocument.DEFAULT_CONTENT_TYPE, ProcessingPartitionScanner.JAVA_DOC, ProcessingPartitionScanner.JAVA_MULTILINE_COMMENT }; + return new String[] { IDocument.DEFAULT_CONTENT_TYPE, ProcessingPartitionScanner.JAVA_MULTILINE_COMMENT }; + } + + /* (non-Javadoc) + * Method declared on SourceViewerConfiguration + */ + public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) { + + ContentAssistant assistant= new ContentAssistant(); + assistant.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer)); + assistant.setContentAssistProcessor(new ProcessingCompletionProcessor(), IDocument.DEFAULT_CONTENT_TYPE); + // Disabling JavaDoc support [lonnen] june 12 2010 + //assistant.setContentAssistProcessor(new JavaDocCompletionProcessor(), ProcessingPartitionScanner.JAVA_DOC); + + assistant.enableAutoActivation(true); + assistant.setAutoActivationDelay(500); + assistant.setProposalPopupOrientation(IContentAssistant.PROPOSAL_OVERLAY); + assistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE); + assistant.setContextInformationPopupBackground(ProcessingEditorPlugin.getDefault().getProcessingColorProvider().getColor(new RGB(150, 150, 0))); + + return assistant; + } + + /* (non-Javadoc) + * Method declared on SourceViewerConfiguration + */ + public String getDefaultPrefix(ISourceViewer sourceViewer, String contentType) { + return (IDocument.DEFAULT_CONTENT_TYPE.equals(contentType) ? "//" : null); //$NON-NLS-1$ + } + + /* (non-Javadoc) + * Method declared on SourceViewerConfiguration + */ + public ITextDoubleClickStrategy getDoubleClickStrategy(ISourceViewer sourceViewer, String contentType) { + return new ProcessingDoubleClickSelector(); + } + + /* (non-Javadoc) + * Method declared on SourceViewerConfiguration + */ + public String[] getIndentPrefixes(ISourceViewer sourceViewer, String contentType) { + return new String[] { "\t", " " }; //$NON-NLS-1$ //$NON-NLS-2$ + } + + /* (non-Javadoc) + * Method declared on SourceViewerConfiguration + */ + public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) { + + ProcessingColorProvider provider= ProcessingEditorPlugin.getDefault().getProcessingColorProvider(); + + PresentationReconciler reconciler= new PresentationReconciler(); + reconciler.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer)); + + DefaultDamagerRepairer dr= new DefaultDamagerRepairer(ProcessingEditorPlugin.getDefault().getProcessingCodeScanner()); + reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE); + reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE); + + //Removing JavaDoc support from sketches, but leave in code +// dr= new DefaultDamagerRepairer(ProcessingEditorPlugin.getDefault().getProcessingDocScanner()); +// reconciler.setDamager(dr, ProcessingPartitionScanner.JAVA_DOC); +// reconciler.setRepairer(dr, ProcessingPartitionScanner.JAVA_DOC); + + dr= new DefaultDamagerRepairer(new SingleTokenScanner(new TextAttribute(provider.getColor(ProcessingColorProvider.COMMENT1)))); + reconciler.setDamager(dr, ProcessingPartitionScanner.JAVA_MULTILINE_COMMENT); + reconciler.setRepairer(dr, ProcessingPartitionScanner.JAVA_MULTILINE_COMMENT); + + return reconciler; + } + + /* (non-Javadoc) + * Method declared on SourceViewerConfiguration + */ + public int getTabWidth(ISourceViewer sourceViewer) { + return 4; + } + + /* (non-Javadoc) + * Method declared on SourceViewerConfiguration + */ + public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) { + return new ProcessingTextHover(); + } +} diff --git a/editor/org.processing.editor/src/org/processing/editor/ProcessingTextHover.java b/editor/org.processing.editor/src/org/processing/editor/ProcessingTextHover.java new file mode 100644 index 000000000..1be66a9e3 --- /dev/null +++ b/editor/org.processing.editor/src/org/processing/editor/ProcessingTextHover.java @@ -0,0 +1,46 @@ +/******************************************************************************* + * Copyright (c) 2000, 2005 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.processing.editor; + + +import org.eclipse.jface.text.*; +import org.eclipse.swt.graphics.Point; + +/** + * Example implementation for an ITextHover which hovers over Java code. + */ +public class ProcessingTextHover implements ITextHover { + + /* (non-Javadoc) + * Method declared on ITextHover + */ + public String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion) { + if (hoverRegion != null) { + try { + if (hoverRegion.getLength() > -1) + //TODO Implement a hover that returns something useful + return textViewer.getDocument().get(hoverRegion.getOffset(), hoverRegion.getLength()); + } catch (BadLocationException x) { + } + } + return ProcessingEditorMessages.getString("ProcessingTextHover.emptySelection"); //$NON-NLS-1$ + } + + /* (non-Javadoc) + * Method declared on ITextHover + */ + public IRegion getHoverRegion(ITextViewer textViewer, int offset) { + Point selection= textViewer.getSelectedRange(); + if (selection.x <= offset && offset < selection.x + selection.y) + return new Region(selection.x, selection.y); + return new Region(offset, 0); + } +} diff --git a/editor/org.processing.editor/src/org/processing/editor/javadoc/JavaDocCompletionProcessor.java b/editor/org.processing.editor/src/org/processing/editor/javadoc/JavaDocCompletionProcessor.java new file mode 100644 index 000000000..94ff44d32 --- /dev/null +++ b/editor/org.processing.editor/src/org/processing/editor/javadoc/JavaDocCompletionProcessor.java @@ -0,0 +1,68 @@ +/******************************************************************************* + * Copyright (c) 2000, 2005 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.processing.editor.javadoc; + + +import org.eclipse.jface.text.ITextViewer; +import org.eclipse.jface.text.contentassist.*; + +/** + * Example Java doc completion processor. Should work for Processing unmodified. Do we even use Javadoc? + */ +public class JavaDocCompletionProcessor implements IContentAssistProcessor { + + protected final static String[] fgProposals= { "@author", "@deprecated", "@exception", "@param", "@return", "@see", "@serial", "@serialData", "@serialField", "@since", "@throws", "@version" }; //$NON-NLS-12$ //$NON-NLS-11$ //$NON-NLS-10$ //$NON-NLS-7$ //$NON-NLS-9$ //$NON-NLS-8$ //$NON-NLS-6$ //$NON-NLS-5$ //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ + + /* (non-Javadoc) + * Method declared on IContentAssistProcessor + */ + public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int documentOffset) { + ICompletionProposal[] result= new ICompletionProposal[fgProposals.length]; + for (int i= 0; i < fgProposals.length; i++) + result[i]= new CompletionProposal(fgProposals[i], documentOffset, 0, fgProposals[i].length()); + return result; + } + + /* (non-Javadoc) + * Method declared on IContentAssistProcessor + */ + public IContextInformation[] computeContextInformation(ITextViewer viewer, int documentOffset) { + return null; + } + + /* (non-Javadoc) + * Method declared on IContentAssistProcessor + */ + public char[] getCompletionProposalAutoActivationCharacters() { + return null; + } + + /* (non-Javadoc) + * Method declared on IContentAssistProcessor + */ + public char[] getContextInformationAutoActivationCharacters() { + return null; + } + + /* (non-Javadoc) + * Method declared on IContentAssistProcessor + */ + public IContextInformationValidator getContextInformationValidator() { + return null; + } + + /* (non-Javadoc) + * Method declared on IContentAssistProcessor + */ + public String getErrorMessage() { + return null; + } +} diff --git a/editor/org.processing.editor/src/org/processing/editor/javadoc/JavaDocScanner.java b/editor/org.processing.editor/src/org/processing/editor/javadoc/JavaDocScanner.java new file mode 100644 index 000000000..3bd97f7b1 --- /dev/null +++ b/editor/org.processing.editor/src/org/processing/editor/javadoc/JavaDocScanner.java @@ -0,0 +1,82 @@ +/******************************************************************************* + * Copyright (c) 2000, 2005 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.processing.editor.javadoc; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.jface.text.TextAttribute; +import org.eclipse.jface.text.rules.*; +import org.processing.editor.util.ProcessingColorProvider; +import org.processing.editor.util.ProcessingWhitespaceDetector; + + +/** + * A rule based JavaDoc scanner. + */ +public class JavaDocScanner extends RuleBasedScanner { + + /** + * A key word detector. + */ + static class JavaDocWordDetector implements IWordDetector { + + /* (non-Javadoc) + * Method declared on IWordDetector + */ + public boolean isWordStart(char c) { + return (c == '@'); + } + + /* (non-Javadoc) + * Method declared on IWordDetector + */ + public boolean isWordPart(char c) { + return Character.isLetter(c); + } + } + + private static String[] fgKeywords= { "@author", "@deprecated", "@exception", "@param", "@return", "@see", "@serial", "@serialData", "@serialField", "@since", "@throws", "@version" }; //$NON-NLS-12$ //$NON-NLS-11$ //$NON-NLS-10$ //$NON-NLS-7$ //$NON-NLS-9$ //$NON-NLS-8$ //$NON-NLS-6$ //$NON-NLS-5$ //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ + + /** + * Create a new javadoc scanner for the given color provider. + * + * @param provider the color provider + */ + public JavaDocScanner(ProcessingColorProvider provider) { + super(); + + IToken keyword= new Token(new TextAttribute(provider.getColor(ProcessingColorProvider.JAVADOC_KEYWORD))); + IToken tag= new Token(new TextAttribute(provider.getColor(ProcessingColorProvider.JAVADOC_TAG))); + IToken link= new Token(new TextAttribute(provider.getColor(ProcessingColorProvider.JAVADOC_LINK))); + + List list= new ArrayList(); + + // Add rule for tags. + list.add(new SingleLineRule("<", ">", tag)); //$NON-NLS-2$ //$NON-NLS-1$ + + // Add rule for links. + list.add(new SingleLineRule("{", "}", link)); //$NON-NLS-2$ //$NON-NLS-1$ + + // Add generic whitespace rule. + list.add(new WhitespaceRule(new ProcessingWhitespaceDetector())); + + // Add word rule for keywords. + WordRule wordRule= new WordRule(new JavaDocWordDetector()); + for (int i= 0; i < fgKeywords.length; i++) + wordRule.addWord(fgKeywords[i], keyword); + list.add(wordRule); + + IRule[] result= new IRule[list.size()]; + list.toArray(result); + setRules(result); + } +} diff --git a/editor/org.processing.editor/src/org/processing/editor/language/ProcessingAutoIndentStrategy.java b/editor/org.processing.editor/src/org/processing/editor/language/ProcessingAutoIndentStrategy.java new file mode 100644 index 000000000..449cef152 --- /dev/null +++ b/editor/org.processing.editor/src/org/processing/editor/language/ProcessingAutoIndentStrategy.java @@ -0,0 +1,280 @@ +/******************************************************************************* + * Copyright (c) 2000, 2005 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.processing.editor.language; + + +import org.eclipse.jface.text.BadLocationException; +import org.eclipse.jface.text.DefaultIndentLineAutoEditStrategy; +import org.eclipse.jface.text.DocumentCommand; +import org.eclipse.jface.text.IDocument; +import org.eclipse.jface.text.TextUtilities; + +/** + * Auto indent line strategy sensitive to brackets. Should work for Processing unmodified. + */ +public class ProcessingAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy { + + public ProcessingAutoIndentStrategy() { + } + + /* (non-Javadoc) + * Method declared on IAutoIndentStrategy + */ + public void customizeDocumentCommand(IDocument d, DocumentCommand c) { + if (c.length == 0 && c.text != null && endsWithDelimiter(d, c.text)) + smartIndentAfterNewLine(d, c); + else if ("}".equals(c.text)) { //$NON-NLS-1$ + smartInsertAfterBracket(d, c); + } + } + + /** + * Returns whether or not the given text ends with one of the documents legal line delimiters. + * + * @param d the document + * @param txt the text + * @return true if txt ends with one of the document's line delimiters, false otherwise + */ + private boolean endsWithDelimiter(IDocument d, String txt) { + String[] delimiters= d.getLegalLineDelimiters(); + if (delimiters != null) + return TextUtilities.endsWith(delimiters, txt) > -1; + return false; + } + + /** + * Returns the line number of the next bracket after end. + * + * @param document - the document being parsed + * @param line - the line to start searching back from + * @param end - the end position to search back from + * @param closingBracketIncrease - the number of brackets to skip + * @return the line number of the next matching bracket after end + * @throws BadLocationException in case the line numbers are invalid in the document + */ + protected int findMatchingOpenBracket(IDocument document, int line, int end, int closingBracketIncrease) throws BadLocationException { + + int start= document.getLineOffset(line); + int brackcount= getBracketCount(document, start, end, false) - closingBracketIncrease; + + // sum up the brackets counts of each line (closing brackets count negative, + // opening positive) until we find a line the brings the count to zero + while (brackcount < 0) { + line--; + if (line < 0) { + return -1; + } + start= document.getLineOffset(line); + end= start + document.getLineLength(line) - 1; + brackcount += getBracketCount(document, start, end, false); + } + return line; + } + + /** + * Returns the bracket value of a section of text. Closing brackets have a value of -1 and + * open brackets have a value of 1. + * + * @param document - the document being parsed + * @param start - the start position for the search + * @param end - the end position for the search + * @param ignoreCloseBrackets - whether or not to ignore closing brackets in the count + * @return the bracket value of a section of text + * @throws BadLocationException in case the positions are invalid in the document + */ + private int getBracketCount(IDocument document, int start, int end, boolean ignoreCloseBrackets) throws BadLocationException { + + int begin = start; + int bracketcount= 0; + while (begin < end) { + char curr= document.getChar(begin); + begin++; + switch (curr) { + case '/' : + if (begin < end) { + char next= document.getChar(begin); + if (next == '*') { + // a comment starts, advance to the comment end + begin= getCommentEnd(document, begin + 1, end); + } else if (next == '/') { + // '//'-comment: nothing to do anymore on this line + begin= end; + } + } + break; + case '*' : + if (begin < end) { + char next= document.getChar(begin); + if (next == '/') { + // we have been in a comment: forget what we read before + bracketcount= 0; + begin++; + } + } + break; + case '{' : + bracketcount++; + ignoreCloseBrackets= false; + break; + case '}' : + if (!ignoreCloseBrackets) { + bracketcount--; + } + break; + case '"' : + case '\'' : + begin= getStringEnd(document, begin, end, curr); + break; + default : + } + } + return bracketcount; + } + + /** + * Returns the end position of a comment starting at the given position. + * + * @param document - the document being parsed + * @param position - the start position for the search + * @param end - the end position for the search + * @return the end position of a comment starting at the given position + * @throws BadLocationException in case position and end are invalid in the document + */ + private int getCommentEnd(IDocument document, int position, int end) throws BadLocationException { + int currentPosition = position; + while (currentPosition < end) { + char curr= document.getChar(currentPosition); + currentPosition++; + if (curr == '*') { + if (currentPosition < end && document.getChar(currentPosition) == '/') { + return currentPosition + 1; + } + } + } + return end; + } + + /** + * Returns the content of the given line without the leading whitespace. + * + * @param document - the document being parsed + * @param line - the line being searched + * @return the content of the given line without the leading whitespace + * @throws BadLocationException in case line is invalid in the document + */ + protected String getIndentOfLine(IDocument document, int line) throws BadLocationException { + if (line > -1) { + int start= document.getLineOffset(line); + int end= start + document.getLineLength(line) - 1; + int whiteend= findEndOfWhiteSpace(document, start, end); + return document.get(start, whiteend - start); + } + return ""; //$NON-NLS-1$ + } + + /** + * Returns the position of the character in the document after position. + * + * @param document - the document being parsed + * @param position - the position to start searching from + * @param end - the end of the document + * @param character - the character you are trying to match + * @return the next location of character + * @throws BadLocationException in case position is invalid in the document + */ + private int getStringEnd(IDocument document, int position, int end, char character) throws BadLocationException { + int currentPosition = position; + while (currentPosition < end) { + char currentCharacter= document.getChar(currentPosition); + currentPosition++; + if (currentCharacter == '\\') { + // ignore escaped characters + currentPosition++; + } else if (currentCharacter == character) { + return currentPosition; + } + } + return end; + } + + /** + * Set the indent of a new line based on the command provided in the supplied document. + * @param document - the document being parsed + * @param command - the command being performed + */ + protected void smartIndentAfterNewLine(IDocument document, DocumentCommand command) { + + int docLength= document.getLength(); + if (command.offset == -1 || docLength == 0) + return; + + try { + int p= (command.offset == docLength ? command.offset - 1 : command.offset); + int line= document.getLineOfOffset(p); + + StringBuffer buf= new StringBuffer(command.text); + if (command.offset < docLength && document.getChar(command.offset) == '}') { + int indLine= findMatchingOpenBracket(document, line, command.offset, 0); + if (indLine == -1) { + indLine= line; + } + buf.append(getIndentOfLine(document, indLine)); + } else { + int start= document.getLineOffset(line); + int whiteend= findEndOfWhiteSpace(document, start, command.offset); + buf.append(document.get(start, whiteend - start)); + if (getBracketCount(document, start, command.offset, true) > 0) { + buf.append('\t'); + } + } + command.text= buf.toString(); + + } catch (BadLocationException excp) { + System.out.println(ProcessingEditorMessages.getString("AutoIndent.error.bad_location_1")); //$NON-NLS-1$ + } + } + + /** + * Set the indent of a bracket based on the command provided in the supplied document. + * @param document - the document being parsed + * @param command - the command being performed + */ + protected void smartInsertAfterBracket(IDocument document, DocumentCommand command) { + if (command.offset == -1 || document.getLength() == 0) + return; + + try { + int p= (command.offset == document.getLength() ? command.offset - 1 : command.offset); + int line= document.getLineOfOffset(p); + int start= document.getLineOffset(line); + int whiteend= findEndOfWhiteSpace(document, start, command.offset); + + // shift only when line does not contain any text up to the closing bracket + if (whiteend == command.offset) { + // evaluate the line with the opening bracket that matches out closing bracket + int indLine= findMatchingOpenBracket(document, line, command.offset, 1); + if (indLine != -1 && indLine != line) { + // take the indent of the found line + StringBuffer replaceText= new StringBuffer(getIndentOfLine(document, indLine)); + // add the rest of the current line including the just added close bracket + replaceText.append(document.get(whiteend, command.offset - whiteend)); + replaceText.append(command.text); + // modify document command + command.length= command.offset - start; + command.offset= start; + command.text= replaceText.toString(); + } + } + } catch (BadLocationException excp) { + System.out.println(ProcessingEditorMessages.getString("AutoIndent.error.bad_location_2")); //$NON-NLS-1$ + } + } +} diff --git a/editor/org.processing.editor/src/org/processing/editor/language/ProcessingCodeScanner.java b/editor/org.processing.editor/src/org/processing/editor/language/ProcessingCodeScanner.java new file mode 100644 index 000000000..7399c78ad --- /dev/null +++ b/editor/org.processing.editor/src/org/processing/editor/language/ProcessingCodeScanner.java @@ -0,0 +1,97 @@ +/******************************************************************************* + * Copyright (c) 2000, 2005 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.processing.editor.language; + + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.jface.text.TextAttribute; +import org.eclipse.jface.text.rules.*; +import org.processing.editor.util.*; + +/** + * A Processing code scanner. + */ +public class ProcessingCodeScanner extends RuleBasedScanner { + + private static String[] fgKeywords1= { "abstract", "break", "case", "catch", "class", "continue", "default", "do", "else", "extends", "final", "finally", "for", "if", "implements", "import", "instanceof", "interface", "native", "new", "package", "private", "protected", "public", "return", "static", "super", "switch", "synchronized", "this", "throw", "throws", "transient", "try", "void", "volatile", "while" }; //$NON-NLS-36$ //$NON-NLS-35$ //$NON-NLS-34$ //$NON-NLS-33$ //$NON-NLS-32$ //$NON-NLS-31$ //$NON-NLS-30$ //$NON-NLS-29$ //$NON-NLS-28$ //$NON-NLS-27$ //$NON-NLS-26$ //$NON-NLS-25$ //$NON-NLS-24$ //$NON-NLS-23$ //$NON-NLS-22$ //$NON-NLS-21$ //$NON-NLS-20$ //$NON-NLS-19$ //$NON-NLS-18$ //$NON-NLS-17$ //$NON-NLS-16$ //$NON-NLS-15$ //$NON-NLS-14$ //$NON-NLS-13$ //$NON-NLS-12$ //$NON-NLS-11$ //$NON-NLS-10$ //$NON-NLS-9$ //$NON-NLS-8$ //$NON-NLS-7$ //$NON-NLS-6$ //$NON-NLS-5$ //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ + //TODO populate rule based scanner [lonnen] June 8 2010 + // at the moment we'll use a few examples, the whole thing will need to be + // loaded with a helper class from keywords.txt + private static String[] fgKeywords2= {"setup","random","size","for"}; // methods + private static String[] fgKeywords3= {"byte","short","color","char","int","float"}; // byte short color char + private static String[] fgLiterals1= {"null", "true", "this", "false", "P2D"}; // + private static String[] fgLiterals2= {"mouseX","width","pixels","frameRate","height"}; + private static String[] fgLabels = {}; //unused? + private static String[] fgOperators = {"+", "-", "=", "/", "*"}; +// private static String[] fgInvalids = {}; // ?? commented out until I figure out what this does + // Deleted the java 'types' and 'constants' + + /** + * Creates a Processing code scanner with the given color provider. + * + * @param provider the color provider + */ + public ProcessingCodeScanner(ProcessingColorProvider provider) { + + IToken keyword1= new Token(new TextAttribute(provider.getColor(ProcessingColorProvider.KEYWORD1))); + IToken keyword2= new Token(new TextAttribute(provider.getColor(ProcessingColorProvider.KEYWORD2))); + IToken keyword3= new Token(new TextAttribute(provider.getColor(ProcessingColorProvider.KEYWORD3))); + IToken literal1= new Token(new TextAttribute(provider.getColor(ProcessingColorProvider.LITERAL1))); + IToken literal2= new Token(new TextAttribute(provider.getColor(ProcessingColorProvider.LITERAL2))); + IToken label= new Token(new TextAttribute(provider.getColor(ProcessingColorProvider.LABEL))); + IToken operator= new Token(new TextAttribute(provider.getColor(ProcessingColorProvider.OPERATOR))); +// IToken invalid= new Token(new TextAttribute(provider.getColor(ProcessingColorProvider.INVALID))); + // leave the rest for now + IToken string= new Token(new TextAttribute(provider.getColor(ProcessingColorProvider.STRING))); + IToken comment= new Token(new TextAttribute(provider.getColor(ProcessingColorProvider.COMMENT2))); + IToken other= new Token(new TextAttribute(provider.getColor(ProcessingColorProvider.DEFAULT))); + + List rules= new ArrayList(); + + // Add rule for single line comments. + rules.add(new EndOfLineRule("//", comment)); //$NON-NLS-1$ + + // Add rule for strings and character constants. + rules.add(new SingleLineRule("\"", "\"", string, '\\')); //$NON-NLS-2$ //$NON-NLS-1$ + rules.add(new SingleLineRule("'", "'", string, '\\')); //$NON-NLS-2$ //$NON-NLS-1$ + + // Add generic whitespace rule. + rules.add(new WhitespaceRule(new ProcessingWhitespaceDetector())); + + // Add word rule for keywords + WordRule wordRule= new WordRule(new ProcessingWordDetector(), other); + for (int i= 0; i < fgKeywords1.length; i++) + wordRule.addWord(fgKeywords1[i], keyword1); + for (int i= 0; i < fgKeywords2.length; i++) + wordRule.addWord(fgKeywords2[i], keyword2); + for (int i= 0; i < fgKeywords3.length; i++) + wordRule.addWord(fgKeywords3[i], keyword3); + // literals + for (int i= 0; i < fgLiterals1.length; i++) + wordRule.addWord(fgLiterals1[i], literal1); + for (int i= 0; i < fgLiterals2.length; i++) + wordRule.addWord(fgLiterals2[i], literal2); + // label + for (int i= 0; i < fgLabels.length; i++) + wordRule.addWord(fgLabels[i], label); + // operator + for (int i= 0; i < fgOperators.length; i++) + wordRule.addWord(fgOperators[i], operator); + + rules.add(wordRule); + + IRule[] result= new IRule[rules.size()]; + rules.toArray(result); + setRules(result); + } +} diff --git a/editor/org.processing.editor/src/org/processing/editor/language/ProcessingCompletionProcessor.java b/editor/org.processing.editor/src/org/processing/editor/language/ProcessingCompletionProcessor.java new file mode 100644 index 000000000..44d66352d --- /dev/null +++ b/editor/org.processing.editor/src/org/processing/editor/language/ProcessingCompletionProcessor.java @@ -0,0 +1,111 @@ +/******************************************************************************* + * Copyright (c) 2000, 2005 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.processing.editor.language; + + +import java.text.MessageFormat; + +import org.eclipse.jface.text.ITextViewer; +import org.eclipse.jface.text.TextPresentation; +import org.eclipse.jface.text.contentassist.*; + +/** + * Example Java completion processor. Should work unmodified for Processing. + */ +public class ProcessingCompletionProcessor implements IContentAssistProcessor { + + /** + * Simple content assist tip closer. The tip is valid in a range + * of 5 characters around its popup location. + */ + protected static class Validator implements IContextInformationValidator, IContextInformationPresenter { + + protected int fInstallOffset; + + /* + * @see IContextInformationValidator#isContextInformationValid(int) + */ + public boolean isContextInformationValid(int offset) { + return Math.abs(fInstallOffset - offset) < 5; + } + + /* + * @see IContextInformationValidator#install(IContextInformation, ITextViewer, int) + */ + public void install(IContextInformation info, ITextViewer viewer, int offset) { + fInstallOffset= offset; + } + + /* + * @see org.eclipse.jface.text.contentassist.IContextInformationPresenter#updatePresentation(int, TextPresentation) + */ + public boolean updatePresentation(int documentPosition, TextPresentation presentation) { + return false; + } + } + + protected final static String[] fgProposals= + { "abstract", "boolean", "break", "byte", "case", "catch", "char", "class", "continue", "default", "do", "double", "else", "extends", "false", "final", "finally", "float", "for", "if", "implements", "import", "instanceof", "int", "interface", "long", "native", "new", "null", "package", "private", "protected", "public", "return", "short", "static", "super", "switch", "synchronized", "this", "throw", "throws", "transient", "true", "try", "void", "volatile", "while" }; //$NON-NLS-48$ //$NON-NLS-47$ //$NON-NLS-46$ //$NON-NLS-45$ //$NON-NLS-44$ //$NON-NLS-43$ //$NON-NLS-42$ //$NON-NLS-41$ //$NON-NLS-40$ //$NON-NLS-39$ //$NON-NLS-38$ //$NON-NLS-37$ //$NON-NLS-36$ //$NON-NLS-35$ //$NON-NLS-34$ //$NON-NLS-33$ //$NON-NLS-32$ //$NON-NLS-31$ //$NON-NLS-30$ //$NON-NLS-29$ //$NON-NLS-28$ //$NON-NLS-27$ //$NON-NLS-26$ //$NON-NLS-25$ //$NON-NLS-24$ //$NON-NLS-23$ //$NON-NLS-22$ //$NON-NLS-21$ //$NON-NLS-20$ //$NON-NLS-19$ //$NON-NLS-18$ //$NON-NLS-17$ //$NON-NLS-16$ //$NON-NLS-15$ //$NON-NLS-14$ //$NON-NLS-13$ //$NON-NLS-12$ //$NON-NLS-11$ //$NON-NLS-10$ //$NON-NLS-9$ //$NON-NLS-8$ //$NON-NLS-7$ //$NON-NLS-6$ //$NON-NLS-5$ //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ + + protected IContextInformationValidator fValidator= new Validator(); + + /* (non-Javadoc) + * Method declared on IContentAssistProcessor + */ + public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int documentOffset) { + ICompletionProposal[] result= new ICompletionProposal[fgProposals.length]; + for (int i= 0; i < fgProposals.length; i++) { + IContextInformation info= new ContextInformation(fgProposals[i], MessageFormat.format(ProcessingEditorMessages.getString("CompletionProcessor.Proposal.ContextInfo.pattern"), new Object[] { fgProposals[i] })); //$NON-NLS-1$ + result[i]= new CompletionProposal(fgProposals[i], documentOffset, 0, fgProposals[i].length(), null, fgProposals[i], info, MessageFormat.format(ProcessingEditorMessages.getString("CompletionProcessor.Proposal.hoverinfo.pattern"), new Object[] { fgProposals[i]})); //$NON-NLS-1$ + } + return result; + } + + /* (non-Javadoc) + * Method declared on IContentAssistProcessor + */ + public IContextInformation[] computeContextInformation(ITextViewer viewer, int documentOffset) { + IContextInformation[] result= new IContextInformation[5]; + for (int i= 0; i < result.length; i++) + result[i]= new ContextInformation( + MessageFormat.format(ProcessingEditorMessages.getString("CompletionProcessor.ContextInfo.display.pattern"), new Object[] { new Integer(i), new Integer(documentOffset) }), //$NON-NLS-1$ + MessageFormat.format(ProcessingEditorMessages.getString("CompletionProcessor.ContextInfo.value.pattern"), new Object[] { new Integer(i), new Integer(documentOffset - 5), new Integer(documentOffset + 5)})); //$NON-NLS-1$ + return result; + } + + /* (non-Javadoc) + * Method declared on IContentAssistProcessor + */ + public char[] getCompletionProposalAutoActivationCharacters() { + return new char[] { '.', '(' }; + } + + /* (non-Javadoc) + * Method declared on IContentAssistProcessor + */ + public char[] getContextInformationAutoActivationCharacters() { + return new char[] { '#' }; + } + + /* (non-Javadoc) + * Method declared on IContentAssistProcessor + */ + public IContextInformationValidator getContextInformationValidator() { + return fValidator; + } + + /* (non-Javadoc) + * Method declared on IContentAssistProcessor + */ + public String getErrorMessage() { + return null; + } +} diff --git a/editor/org.processing.editor/src/org/processing/editor/language/ProcessingDoubleClickSelector.java b/editor/org.processing.editor/src/org/processing/editor/language/ProcessingDoubleClickSelector.java new file mode 100644 index 000000000..653a7dee4 --- /dev/null +++ b/editor/org.processing.editor/src/org/processing/editor/language/ProcessingDoubleClickSelector.java @@ -0,0 +1,246 @@ +/******************************************************************************* + * Copyright (c) 2000, 2005 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.processing.editor.language; + + +import org.eclipse.jface.text.BadLocationException; +import org.eclipse.jface.text.IDocument; +import org.eclipse.jface.text.ITextDoubleClickStrategy; +import org.eclipse.jface.text.ITextViewer; + +/** + * Double click strategy aware of Java identifier syntax rules. These should work + * for Processing without modification. + */ +public class ProcessingDoubleClickSelector implements ITextDoubleClickStrategy { + + protected ITextViewer fText; + protected int fPos; + protected int fStartPos; + protected int fEndPos; + + protected static char[] fgBrackets= { '{', '}', '(', ')', '[', ']', '"', '"' }; + + /* + * Create a JavaDoubleClickSelector. + */ + public ProcessingDoubleClickSelector() { + super(); + } + + /* (non-Javadoc) + * Method declared on ITextDoubleClickStrategy + */ + public void doubleClicked(ITextViewer text) { + + fPos= text.getSelectedRange().x; + + if (fPos < 0) + return; + + fText= text; + + if (!selectBracketBlock()) + selectWord(); + } + + /** + * Match the brackets at the current selection. Return true if successful, + * false otherwise. + * + * @return true if brackets match, false otherwise + */ + protected boolean matchBracketsAt() { + + char prevChar, nextChar; + + int i; + int bracketIndex1= fgBrackets.length; + int bracketIndex2= fgBrackets.length; + + fStartPos= -1; + fEndPos= -1; + + // get the chars preceding and following the start position + try { + + IDocument doc= fText.getDocument(); + + prevChar= doc.getChar(fPos - 1); + nextChar= doc.getChar(fPos); + + // is the char either an open or close bracket? + for (i= 0; i < fgBrackets.length; i= i + 2) { + if (prevChar == fgBrackets[i]) { + fStartPos= fPos - 1; + bracketIndex1= i; + } + } + for (i= 1; i < fgBrackets.length; i= i + 2) { + if (nextChar == fgBrackets[i]) { + fEndPos= fPos; + bracketIndex2= i; + } + } + + if (fStartPos > -1 && bracketIndex1 < bracketIndex2) { + fEndPos= searchForClosingBracket(fStartPos, prevChar, fgBrackets[bracketIndex1 + 1], doc); + if (fEndPos > -1) + return true; + fStartPos= -1; + } else if (fEndPos > -1) { + fStartPos= searchForOpenBracket(fEndPos, fgBrackets[bracketIndex2 - 1], nextChar, doc); + if (fStartPos > -1) + return true; + fEndPos= -1; + } + + } catch (BadLocationException x) { + } + + return false; + } + + /** + * Select the word at the current selection location. Return true if successful, + * false otherwise. + * + * @return true if a word can be found at the current selection location, false otherwise + */ + protected boolean matchWord() { + + IDocument doc= fText.getDocument(); + + try { + + int pos= fPos; + char c; + + while (pos >= 0) { + c= doc.getChar(pos); + if (!Character.isJavaIdentifierPart(c)) + break; + --pos; + } + + fStartPos= pos; + + pos= fPos; + int length= doc.getLength(); + + while (pos < length) { + c= doc.getChar(pos); + if (!Character.isJavaIdentifierPart(c)) + break; + ++pos; + } + + fEndPos= pos; + + return true; + + } catch (BadLocationException x) { + } + + return false; + } + + /** + * Returns the position of the closing bracket after startPosition. + * + * @param startPosition - the beginning position + * @param openBracket - the character that represents the open bracket + * @param closeBracket - the character that represents the close bracket + * @param document - the document being searched + * @return the location of the closing bracket. + * @throws BadLocationException in case startPosition is invalid in the document + */ + protected int searchForClosingBracket(int startPosition, char openBracket, char closeBracket, IDocument document) throws BadLocationException { + int stack= 1; + int closePosition= startPosition + 1; + int length= document.getLength(); + char nextChar; + + while (closePosition < length && stack > 0) { + nextChar= document.getChar(closePosition); + if (nextChar == openBracket && nextChar != closeBracket) + stack++; + else if (nextChar == closeBracket) + stack--; + closePosition++; + } + + if (stack == 0) + return closePosition - 1; + return -1; + + } + + /** + * Returns the position of the open bracket before startPosition. + * + * @param startPosition - the beginning position + * @param openBracket - the character that represents the open bracket + * @param closeBracket - the character that represents the close bracket + * @param document - the document being searched + * @return the location of the starting bracket. + * @throws BadLocationException in case startPosition is invalid in the document + */ + protected int searchForOpenBracket(int startPosition, char openBracket, char closeBracket, IDocument document) throws BadLocationException { + int stack= 1; + int openPos= startPosition - 1; + char nextChar; + + while (openPos >= 0 && stack > 0) { + nextChar= document.getChar(openPos); + if (nextChar == closeBracket && nextChar != openBracket) + stack++; + else if (nextChar == openBracket) + stack--; + openPos--; + } + + if (stack == 0) + return openPos + 1; + return -1; + } + + /** + * Select the area between the selected bracket and the closing bracket. + * + * @return true if selection was successful, false otherwise + */ + protected boolean selectBracketBlock() { + if (matchBracketsAt()) { + + if (fStartPos == fEndPos) + fText.setSelectedRange(fStartPos, 0); + else + fText.setSelectedRange(fStartPos + 1, fEndPos - fStartPos - 1); + + return true; + } + return false; + } + + /** + * Select the word at the current selection. + */ + protected void selectWord() { + if (matchWord()) { + + if (fStartPos == fEndPos) + fText.setSelectedRange(fStartPos, 0); + else + fText.setSelectedRange(fStartPos + 1, fEndPos - fStartPos - 1); + } + } +} diff --git a/editor/org.processing.editor/src/org/processing/editor/language/ProcessingEditorMessages.java b/editor/org.processing.editor/src/org/processing/editor/language/ProcessingEditorMessages.java new file mode 100644 index 000000000..79f7f86b4 --- /dev/null +++ b/editor/org.processing.editor/src/org/processing/editor/language/ProcessingEditorMessages.java @@ -0,0 +1,32 @@ +/******************************************************************************* + * Copyright (c) 2000, 2005 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.processing.editor.language; + +import java.util.MissingResourceException; +import java.util.ResourceBundle; + +public class ProcessingEditorMessages { + + private static final String RESOURCE_BUNDLE= "org.processing.editor.ProcessingEditorMessages";//$NON-NLS-1$ + + private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE); + + private ProcessingEditorMessages() { + } + + public static String getString(String key) { + try { + return fgResourceBundle.getString(key); + } catch (MissingResourceException e) { + return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$ + } + } +} diff --git a/editor/org.processing.editor/src/org/processing/editor/util/ProcessingColorProvider.java b/editor/org.processing.editor/src/org/processing/editor/util/ProcessingColorProvider.java new file mode 100644 index 000000000..ff3df759e --- /dev/null +++ b/editor/org.processing.editor/src/org/processing/editor/util/ProcessingColorProvider.java @@ -0,0 +1,70 @@ +/******************************************************************************* + * Copyright (c) 2000, 2005 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.processing.editor.util; + + +import java.util.*; + +import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.graphics.RGB; +import org.eclipse.swt.widgets.Display; + +/** + * Manager for colors used in the Java editor + */ +public class ProcessingColorProvider { + + public static final RGB COMMENT1= new RGB(126, 126, 126); //comment 1 + public static final RGB COMMENT2= new RGB(126, 126, 126); //comment 2 + public static final RGB KEYWORD1= new RGB(204, 102, 0); + public static final RGB KEYWORD2= new RGB(204, 102, 0); + public static final RGB KEYWORD3= new RGB(204, 102, 0); + public static final RGB LITERAL1= new RGB(0, 102, 153); + public static final RGB LITERAL2= new RGB(0, 102, 153); + public static final RGB LABEL= new RGB(0, 0, 128); // use listed as '?' in p5 doc + public static final RGB OPERATOR= new RGB(0, 0, 0); + public static final RGB INVALID= new RGB(126, 126, 126); + // for the moment we'll leave these + public static final RGB STRING= new RGB(0, 0, 128); + public static final RGB DEFAULT= new RGB(0, 0, 0); + // used to color JavaDoc by org.processing.editor.javadoc.JavaDocScanner, do we still want this? + public static final RGB JAVADOC_KEYWORD= new RGB(126, 126, 126); + public static final RGB JAVADOC_TAG= new RGB(126, 126, 126); + public static final RGB JAVADOC_LINK= new RGB(126, 126, 126); + public static final RGB JAVADOC_DEFAULT= new RGB(126, 126, 126); + + protected Map fColorTable= new HashMap(17); + + /** + * Release all of the color resources held onto by the receiver. + */ + public void dispose() { + Iterator e= fColorTable.values().iterator(); + while (e.hasNext()) + ((Color) e.next()).dispose(); + } + + /** + * Return the color that is stored in the color table under the given RGB + * value. + * + * @param rgb the RGB value + * @return the color stored in the color table for the given RGB value + */ + public Color getColor(RGB rgb) { + Color color= (Color) fColorTable.get(rgb); + if (color == null) { + color= new Color(Display.getCurrent(), rgb); + fColorTable.put(rgb, color); + } + return color; + } +} diff --git a/editor/org.processing.editor/src/org/processing/editor/util/ProcessingWhitespaceDetector.java b/editor/org.processing.editor/src/org/processing/editor/util/ProcessingWhitespaceDetector.java new file mode 100644 index 000000000..93c328433 --- /dev/null +++ b/editor/org.processing.editor/src/org/processing/editor/util/ProcessingWhitespaceDetector.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright (c) 2000, 2005 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.processing.editor.util; + + +import org.eclipse.jface.text.rules.IWhitespaceDetector; + +/** + * A Processing aware white space detector, same as a java aware white space detector. + */ +public class ProcessingWhitespaceDetector implements IWhitespaceDetector { + + /* (non-Javadoc) + * Method declared on IWhitespaceDetector + */ + public boolean isWhitespace(char character) { + return Character.isWhitespace(character); + } +} diff --git a/editor/org.processing.editor/src/org/processing/editor/util/ProcessingWordDetector.java b/editor/org.processing.editor/src/org/processing/editor/util/ProcessingWordDetector.java new file mode 100644 index 000000000..3b42dadea --- /dev/null +++ b/editor/org.processing.editor/src/org/processing/editor/util/ProcessingWordDetector.java @@ -0,0 +1,34 @@ +/******************************************************************************* + * Copyright (c) 2000, 2005 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.processing.editor.util; + + +import org.eclipse.jface.text.rules.IWordDetector; + +/** + * A Processing aware word detector. Same as a java aware word detector. + */ +public class ProcessingWordDetector implements IWordDetector { + + /* (non-Javadoc) + * Method declared on IWordDetector. + */ + public boolean isWordPart(char character) { + return Character.isJavaIdentifierPart(character); + } + + /* (non-Javadoc) + * Method declared on IWordDetector. + */ + public boolean isWordStart(char character) { + return Character.isJavaIdentifierStart(character); + } +}