This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 6 - Pages: 1 - Last Post: 26-Jun-2017 22:51 Last Post By: jGromit
jGromit

Posts: 32,917
Registered: 01/31/06
CustomUI in onload.bsh
Posted: 14-May-2017 16:20
 
  Click to reply to this thread Reply
For reasons I won't bore you with at the moment, I wanted to put a customUI panel into a skin with a regular, non-compiled onload.bsh, and was having problems with it. So, I grabbed David's old demo skin for this, https://jalbum.net/en/skins/skin/CustomEditUI , just to steal the code.

Lo and behold, this doesn't work in jAlbum 13 or 14. Specifically, if you try to edit one of the custom fields in image-editing mode (there is no regular settings panel at all), you get a console dump:
Exception in thread "AWT-EventQueue-0" java.security.PrivilegedActionException: java.security.PrivilegedActionException: bsh.EvalError: Command not found: saveUI() : at Line: 44 : in file: inline evaluation of: ``/**   * This script is being run when a skin is selected  * The script installs  . . . '' : saveUI ( ) 

Called from method: focusLost : at Line: -1 : in file: <Called from Java Code> : <Compiled Java Code>
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.security.PrivilegedActionException: bsh.EvalError: Command not found: saveUI() : at Line: 44 : in file: inline evaluation of: ``/**   * This script is being run when a skin is selected  * The script installs  . . . '' : saveUI ( ) 

Called from method: focusLost : at Line: -1 : in file: <Called from Java Code> : <Compiled Java Code>
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue$4.run(Unknown Source)
	at java.awt.EventQueue$4.run(Unknown Source)
	... 9 more
Caused by: bsh.EvalError: Command not found: saveUI() : at Line: 44 : in file: inline evaluation of: ``/**   * This script is being run when a skin is selected  * The script installs  . . . '' : saveUI ( ) 

Called from method: focusLost : at Line: -1 : in file: <Called from Java Code> : <Compiled Java Code>
	at bsh.Name.invokeLocalMethod(Name.java:953)
	at bsh.Name.invokeMethod(Name.java:804)
	at bsh.BSHMethodInvocation.eval(BSHMethodInvocation.java:75)
	at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:102)
	at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:47)
	at bsh.BSHBlock.evalBlock(BSHBlock.java:130)
	at bsh.BSHBlock.eval(BSHBlock.java:80)
	at bsh.BshMethod.invokeImpl(BshMethod.java:362)
	at bsh.BshMethod.invoke(BshMethod.java:258)
	at bsh.BshMethod.invoke(BshMethod.java:186)
	at bsh.This.invokeMethod(This.java:352)
	at CustomUI$1.focusLost(BeanShell Generated via ASM (www.objectweb.org))
	at java.awt.AWTEventMulticaster.focusLost(Unknown Source)
	at java.awt.Component.processFocusEvent(Unknown Source)
	at java.awt.Component.processEvent(Unknown Source)
	at java.awt.Container.processEvent(Unknown Source)
	at java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
	at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
	at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
	at java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.awt.EventQueue.access$500(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	... 14 more
Anyone have a clue? I haven't run into anything like this in a compiled UI.

Edited by: jGromit, to remove comma from link
RobM

Posts: 4,250
Registered: 08/04/06
Re: CustomUI in onload.bsh
Posted: 14-May-2017 17:25   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
Have you changed anything?
It rang a distant bell and I found this https://jalbum.net/forum/thread.jspa?messageID=296387&#296387

The solution was "Playing around and changing the method from public to private seesm to do the trick"
Dschuwi

Posts: 1,521
Registered: 11/12/03
Re: CustomUI in onload.bsh
Posted: 14-May-2017 17:30   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
Purely FYI, just in case it helps ... I copy-pasted David's code into my skin (replacing my code) - no error here.
jGromit

Posts: 32,917
Registered: 01/31/06
Re: CustomUI in onload.bsh
Posted: 14-May-2017 17:31   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
Yes, that's the ticket.

Now, back into the alligator-infested swamp that got me there in the first place... :(
AndreWolff

Posts: 1,993
Registered: 12/14/07
Re: CustomUI in onload.bsh
Posted: 26-Jun-2017 22:37   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
jGromit wrote:
For reasons I won't bore you with at the moment, I wanted to put a customUI panel into a skin with a regular, non-compiled onload.bsh, and was having problems with it. So, I grabbed David's old demo skin for this, https://jalbum.net/en/skins/skin/CustomEditUI, just to steal the code.
Could you please give the correct link, I get a message No such skin if I click that link.
RobM

Posts: 4,250
Registered: 08/04/06
Re: CustomUI in onload.bsh
Posted: 26-Jun-2017 22:50   in response to: AndreWolff in response to: AndreWolff
 
  Click to reply to this thread Reply
AndreWolff wrote:
jGromit wrote:
For reasons I won't bore you with at the moment, I wanted to put a customUI panel into a skin with a regular, non-compiled onload.bsh, and was having problems with it. So, I grabbed David's old demo skin for this, https://jalbum.net/en/skins/skin/CustomEditUI, just to steal the code.
Could you please give the correct link, I get a message No such skin if I click that link.
https://jalbum.net/en/skins/skin/CustomEditUI
jGromit

Posts: 32,917
Registered: 01/31/06
Re: CustomUI in onload.bsh
Posted: 26-Jun-2017 22:51   in response to: AndreWolff in response to: AndreWolff
 
  Click to reply to this thread Reply
Lord, you're helpless, aren't you? Did you even think about searching on the skins page for that skin name? Do you have to be spoon-fed everything?

The forum software routinely grabs a trailing comma and makes it part of the URL, which breaks the link.
Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums