summaryrefslogtreecommitdiff
path: root/scripting/java
AgeCommit message (Collapse)AuthorFilesLines
2019-11-08Respect DisableMacrosExecution option in javascript editorSamuel Mehrbrodt3-51/+64
Change-Id: I44c2d3a706a99839369bd4aff2abbb675e430926 Reviewed-on: https://gerrit.libreoffice.org/82286 Tested-by: Jenkins Reviewed-by: Serge Krot (CIB) <Serge.Krot@cib.de>
2019-11-08Respect DisableMacrosExecution option in beanshell editorSamuel Mehrbrodt1-0/+29
Change-Id: I0713b3d1ab45519aef25b5bd3d912baf2252d37b Reviewed-on: https://gerrit.libreoffice.org/82262 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2019-09-29Fix typosAndrea Gelmini1-3/+3
Change-Id: I8a93a6ed49661ddfae390a0302fca1fab5c95f14 Reviewed-on: https://gerrit.libreoffice.org/79795 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2019-09-06Fixing "...."Andrea Gelmini1-2/+2
Change-Id: I3424e17cfdfb563fdc5882942031deafae8689fe Reviewed-on: https://gerrit.libreoffice.org/78678 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-08-31Fix typosAndrea Gelmini1-1/+1
Change-Id: Iac08e415f84741ecdb151788776ee15e7364fae1 Reviewed-on: https://gerrit.libreoffice.org/77762 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2019-08-12Fix typosAndrea Gelmini1-1/+1
Change-Id: I3e6b96f4ea341130e98ee54ed8c124209b05d343 Reviewed-on: https://gerrit.libreoffice.org/77291 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-08-08Related tdf#116767: Call URLClassLoader.closeStephan Bergmann2-43/+52
...which required the return type of com.sun.star.script.framework.provider.ClassLoaderFactory.getURLClassLoader to be changed. (In theory, there could be 3rd-party scripting providers that hook into the framework and are affected by that incompatible change, but, practically, chances should be low.) Change-Id: I083c398726aaf62df7286d6da86b9d2056a5a8c1 Reviewed-on: https://gerrit.libreoffice.org/77146 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-08-08Remove unused NoSuitableClassLoaderExceptionStephan Bergmann1-42/+0
It was introduced with 980aa9b06ca521363ae4175f349becd4cdd501aa "#i19331#" (or at least moved to its current place there, with older traces lost to history), but its only actual use in the code has since been removed with 8087d5389f8d1133f119a9e6db88f91229831b61 "Java new cannot return null". (In theory, there could be 3rd-party scripting providers that hook into the framework and use that class, but, practically, chances should be low.) Change-Id: I8586fccf120c93391308ede547bbeec6fabf2743 Reviewed-on: https://gerrit.libreoffice.org/77142 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-08-08Remove odd catch of ArrayStoreExceptionStephan Bergmann1-17/+4
...(which is a RuntimeException) around a call of com.sun.star.script.framework.provider.ClassLoaderFactory.getURLClassLoader. The catch block was introduced in 3076ea9dc6677dcf0f65c53c8f205d870dc27d53 "INTEGRATION: CWS scriptingf2 (1.2.2); FILE MERGED", for no apparent reason. It was introduced along with catch blocks for MalformedURLException and NoSuitableClassLoaderException, but which have already been removed with 616b3ad50404f35d84708b3feeb8c66f2f23f1b1 "java: remove exceptions from throws clauses that are not". Change-Id: I8d2890aed1b0f50fe817002cb6f1610c550568f1 Reviewed-on: https://gerrit.libreoffice.org/77140 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-07-23cid#1448376 SIC: Inner class could be made staticCaolán McNamara1-1/+1
Change-Id: Id9923031c1fe91ba71dfe8d68cbe23b72e9637b5 Reviewed-on: https://gerrit.libreoffice.org/76143 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-07-20cid#1448526 RANGE: Range checksCaolán McNamara1-1/+1
Change-Id: I3b9d9c648151b2a5b9cc6a015b88a59fa7ec4e53 Reviewed-on: https://gerrit.libreoffice.org/76003 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-07-19tdf#123587 Beanshell editor: Show current file name as window titleAndreas Heinisch2-1/+10
Change-Id: I7a817d19cfadc46b1f35a4e42e5a6177c1910a4b Reviewed-on: https://gerrit.libreoffice.org/75869 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-09tdf#125355 Beanshell Editor: Corrected indentation when Enter is pressedAndreas Heinisch1-0/+26
Change-Id: Ife96256da02c4b21e2649040c53b7d16f236e3a0 Reviewed-on: https://gerrit.libreoffice.org/73371 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-03cid#1448470: perf inefficient map iteratorJulien Nabet1-6/+3
Change-Id: If7dd6455ca02d6c78ac997bd9c2924863db1d906 Reviewed-on: https://gerrit.libreoffice.org/75059 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-05-21tdf#97635 Added unindentation using shift-tab (mimicked eclipse behavior)Andreas Heinisch1-2/+2
Restored java 6 compatibility Change-Id: I550920457874b9261bdde07040aad8f7b67773d8 Reviewed-on: https://gerrit.libreoffice.org/72671 Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2019-05-20tdf#97635 Added unindentation using shift-tab (mimicked eclipse's behavior)Andreas Heinisch1-5/+8
Moved shift+tab check to the keyPressed function to provide continuous insertion and compiled tab-pattern only once Change-Id: Iffe847fea07295075dc1a280f0697e8c798e8d6f Reviewed-on: https://gerrit.libreoffice.org/72580 Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2019-05-16tdf#97635 Added unindentation using shift-tab (mimicked eclipse behavior)Andreas Heinisch1-0/+22
Change-Id: Iaf64451c92f3465751032dde9c283141e548b3ca Reviewed-on: https://gerrit.libreoffice.org/72228 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2019-05-10an uno -> a unoCaolán McNamara3-6/+6
Change-Id: I538db88f8477dd2d2ad25c372928fec6c11d979d Reviewed-on: https://gerrit.libreoffice.org/72105 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-03-27Beanshell: Display full exception messageSamuel Mehrbrodt1-1/+1
Useful to see where exactly the error occured Change-Id: I716f54c4b1286d705b52f19a58f36f28a801e1d0 Reviewed-on: https://gerrit.libreoffice.org/69799 Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2019-03-27Beanshell: Wrap long error messagesSamuel Mehrbrodt1-2/+14
Change-Id: I5e607f4b94733700810d37c289f6cc29492da5f2 Reviewed-on: https://gerrit.libreoffice.org/69798 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2019-03-27tdf#123586 Set minimum size for beanshell editorkushagrakasliwal11-0/+2
Change-Id: I49e2ca387de5d520efdda0c964203c530fe016c4 Reviewed-on: https://gerrit.libreoffice.org/69394 Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2019-03-13tdf#123588 Beanshell editor to indicate whether script is savedSainal Shah4-3/+50
Beanshell to enable save button only upon modification of script. Save button disables after script is successfully saved. Also, save button will be disabled when there are no undoable changes. ScriptEditorForBeanShell registers listener for unsaved changes. PlainSourceView triggers listener calls upon modification of script or after a successful save, which lets to enable/ disable the save button accordingly. Change-Id: I32a2fc473924a7c85cdd6004637ab6a0b60acf38 Reviewed-on: https://gerrit.libreoffice.org/69046 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2019-02-24tdf#123589 Removing close button from toolbar in Beanshell editorEL-SHREIF1-3/+1
The Beanshell Editor has a "Close" button in the toolbar.This button can be removed as the window already has a close button.so i remove it from ScriptEditorForBeanShell.java easly . Change-Id: Icf2e56f664df56a01a2cf1935700ebe1888a7156 Reviewed-on: https://gerrit.libreoffice.org/68273 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-18Fix product nameSamuel Mehrbrodt1-1/+1
Change-Id: I35ac8f6ad54c7990bd5fb24dc0a30ebb8e1e8254 Reviewed-on: https://gerrit.libreoffice.org/67949 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2018-11-29Rename Mac OS X to official name macOS in comments and documentationBartosz Kosiorek1-1/+1
Change-Id: I651b7f202fa52ff5f5357a11aa72c43eb7dc7f95 Reviewed-on: https://gerrit.libreoffice.org/64102 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2018-07-05cid#1437407: create class loader in doPrivilegedStephan Bergmann1-3/+8
Change-Id: Iade079e44c8d88a13830258157d9481f4b8b3358 Reviewed-on: https://gerrit.libreoffice.org/57013 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-06-15Restore binary compatibility for ClassLoaderFactoryStephan Bergmann4-9/+6
As discussed in the mail thread starting at <http://mail-archives.apache.org/ mod_mbox/openoffice-dev/201806.mbox/%3c651c8fee-b467-421c-eae1-a8710f41692c @apache.org%3e> "Just a little side note on the scripting framework ...", external code that uses the Java class com.sun.star.script.framework.provider.ClassLoaderFactory stopped working because LO changed that class in binary (and compile-time) incompatible ways over time. The class is not listed at <https://api.libreoffice.org/docs/java/ref/index.html> (and neither at <http://www.openoffice.org/api/docs/java/ref/overview-summary.html>), so it was not considered part of the stable URE interface. But it is apparently used by external code, and it indeed seems to make sense that it is used by external code that implements scripting providers. (A follow-up commit should therefore mark the class as part of the stable URE interface. I keep that separate so that it is easier to backport this functional fix.) With ScriptProviderForooRexx.oxt from https://svn.code.sf.net/p/bsf4oorexx/code@r589 installed in LO, "Tools - Macros - Organize Macros - ooRexx... - My Macros - Create... - Library1 - OK - Create... - Macro1 - OK - Edit" failed due to > warn:cui.dialogs:21768:21768:cui/source/dialogs/scriptdlg.cxx:740: Caught exception trying to invoke N3com3sun4star3uno9ExceptionE msg: [jni_uno bridge error] UNO calling Java method invoke: non-UNO exception occurred: java.lang.NoSuchMethodError: com.sun.star.script.framework.provider.ClassLoaderFactory.getURLClassLoader(Lcom/sun/star/script/framework/container/ScriptMetaData;)Ljava/lang/ClassLoader; > java stack trace: > java.lang.NoSuchMethodError: com.sun.star.script.framework.provider.ClassLoaderFactory.getURLClassLoader(Lcom/sun/star/script/framework/container/ScriptMetaData;)Ljava/lang/ClassLoader; > at com.sun.star.script.framework.provider.oorexx.ScriptEditorForooRexx.edit(ScriptEditorForooRexx.java:305) > at com.sun.star.script.framework.browse.ScriptBrowseNode.invoke(ScriptBrowseNode.java:200) cae57d2e588a4b5a104171e022b00abcc1605775 "ClassLoader->URLClassLoader" (which this commit reverts) had changed the return type of the two getURLClassLoader overloads from ClassLoader to derived URLClassLoader (and ultimately only for cosmetic effect; it was leftover from a previous attempt at fixing a Coverity issue by using URLClassLoader.close(), but which is only available in Java 1.7, so the attempt had been reverted). That caused the above failure. And 68cd011c907d00493bf2bfde531c1e244819596b "java: reduce scope, make some methods private" (which this commit also reverts) had changed the second getURLClassLoader overload (which is not called in the above scenario) from public to private, which is also a binary-incompatible change. Other commits removed throws clauses, which is only a compile-time issue but not a binary-incompatible change. I left those changes in for now, but if need be they could also be reverted. Change-Id: I98f533d88c7c1580956c3c281e72a1c78fa3f56f Reviewed-on: https://gerrit.libreoffice.org/55871 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-04-02use https links for api.libreoffice.org and opengrokdennisroczek2-6/+6
Change-Id: I74dd0142562cb8698f19b2715fa1d514f82bd749 Reviewed-on: https://gerrit.libreoffice.org/52262 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2018-01-27Fix typosAndrea Gelmini1-1/+1
Change-Id: I8d5a8251a01af7cdf9832d98d8a6573b907f8532 Reviewed-on: https://gerrit.libreoffice.org/48683 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jens Carl <j.carl43@gmx.de>
2017-02-23In Java, css.uno.RuntimeException doesn't derive from css.uno.ExceptionStephan Bergmann1-1/+1
Change-Id: I83850db6e3f3ac87d52e75f122ba2b6bba3905b9
2016-10-16tdf#98004 - Enhansment on Editor(Beanshell)nadith1-6/+9
Add a toolbar A little enhasment for the editor has been done. Added a toolbar for set of buttons that was previously in a JPanel and now it is in Jtoolbar in the editor Change-Id: Ie04232e7824c051f272d69cc109eec0e70ccf921 Reviewed-on: https://gerrit.libreoffice.org/29806 Reviewed-by: jan iversen <jani@documentfoundation.org> Tested-by: jan iversen <jani@documentfoundation.org>
2016-10-03ClassLoader->URLClassLoaderCaolán McNamara4-7/+10
Change-Id: I1f46a99025ba33d08842da9b06611dcfa6b1b49c Reviewed-on: https://gerrit.libreoffice.org/29474 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-10-01Fix typosAndrea Gelmini1-1/+1
Change-Id: I9701cc93a9f4315e71c133237fdd96ef6964c8ff Reviewed-on: https://gerrit.libreoffice.org/29438 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-08-19Revert "coverity#1371372 Resource leak on an exceptional path"Caolán McNamara4-30/+8
seeing as it doesn't build universally, java 1.7 onwards apparently This reverts commit 6830d8c2083fa66cc113f587cbfc4aa5a4f8a535.
2016-08-19coverity#1371372 Resource leak on an exceptional pathCaolán McNamara4-8/+30
and coverity#1371366 Resource leak on an exceptional path coverity#1371376 Resource leak on an exceptional path Change-Id: Ic0fd05f02b1d78a47d4ee924dee8f10811586d0d
2016-08-19coverity#1371367 Resource leak on an exceptional pathCaolán McNamara1-0/+3
Change-Id: I4da5f6d427e8132d62860b46cb4def88b8afb25d
2016-06-06remove unused imports in java codeNoel Grandin1-1/+0
Change-Id: I95041f49dd22ba9a15da3598b04a010eecf761a8
2016-05-15coverity#1361587 Dereference null return valueCaolán McNamara2-24/+26
and coverity#1361588 Dereference null return value Change-Id: Ia282c37e94d9d4131d18b3ccf6a8b7cb12c12344
2016-04-30Fix typosAndrea Gelmini1-1/+1
Change-Id: Id81b16ff26283611f0b84929d831c827f847ab73 Reviewed-on: https://gerrit.libreoffice.org/24317 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2016-03-14remove some unused Java codeNoel Grandin2-8/+0
found by UCDetector Change-Id: Ic0295a24b26e206eb53eda2da540755477df86df
2016-03-14scripting: JDK 1.5 compatibility: don't use java.awt.Font.MONOSPACEDDouglas Mencken1-1/+1
MONOSPACED is defined in java/awt/Font.java as /* @since 1.6 */ static final String MONOSPACED = "Monospaced"; Change-Id: I31847c939387c139971ff55f786773c7ce51448c Reviewed-on: https://gerrit.libreoffice.org/23164 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: jan iversen <jani@documentfoundation.org>
2016-03-04cid#1326861,1326862: Eq: Problems with implementation of equals()Stephan Bergmann2-27/+1
Cloneable, odd additional equals overloads, odd hasCode implementation---all smells like clueless cargo cult. And I see no place where it would get used. Change-Id: Icca89531ce9181fb47eacfb6fae704f4f45012a9
2016-03-04This ScriptEntry ctor is always called with empty languagedeppropsStephan Bergmann3-10/+4
Change-Id: Ia8ddfecf2f809e9f0132ba59812446973532476c
2016-03-04Scripting.location is unusedStephan Bergmann4-16/+7
Change-Id: Ia534b5aa579a678f8b0273e6c8c12a6ad335c67a
2016-03-04ScriptEntry fields can be finalStephan Bergmann1-6/+6
Change-Id: I7616641584b7ea8192cf3724d8b7d5b88af39da6
2016-03-04Turn forwarding among ScriptEntry ctors around, dropping oneStephan Bergmann1-19/+11
Change-Id: If3c86c7e5c4acaf4a3e48194e24c3c73e4e99499
2016-03-04Remove unusd ScriptEntry ctorStephan Bergmann1-4/+0
Change-Id: I7109877e789659b87cbc16e9c5da39dcc8249e09
2016-03-04Forwarding-only ctor, can be privateStephan Bergmann1-1/+1
Change-Id: I9ed2aa9c2bf2e17705dc711560154a9596c8264a
2016-03-04This ScriptEntry ctor is only needed by ctor of derived class ScriptMetaDataStephan Bergmann1-1/+1
Change-Id: If3e6aae326aa53825edca9d5dc207d185d288cce
2016-03-04Remove unused ScriptEntry.setLogicalNameStephan Bergmann1-4/+0
Change-Id: Iad58e4227433b766bbdce92a53c95aed48320f88