javalover520 / jsyntaxpane

Automatically exported from code.google.com/p/jsyntaxpane
0 stars 0 forks source link

MenuText, SmallIcon, and ShortDescription not being applied to Action properties in the popup menu. #137

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.  Configure any Action.action-name.MenuText property.
2.  Start the editor.
3.  Right click to display context menu.

What is the expected output? What do you see instead?
The context menu entry for the Action.action-name should display the text
specified by MenuText.  It only shows the action-name instead.

What version of the product are you using? On what operating system?
jsyntaxpane 0.9.5-b29, Fedora 11, Java 1.6.0_10-b33

Please provide any additional information below.
Looking at the code in jsyntaxpane.DefaultSyntaxKit.addActions, the
configActionProperties only seems to be called for "DefaultAction"
properties.  It needs to be called for "Action" properties too for it to
set the MenuText, SmallIcon, and ShortDescription properties for those actions.

Original issue reported on code.google.com by gleich...@gmail.com on 3 Mar 2010 at 7:42

GoogleCodeExporter commented 8 years ago
I noticed that the DefaultSyntaxAction.config sets the name using the
Action.action-name property and not the Action.action-name.MenuText property.  
It
also sets the small icon.

Is the DefaultSyntaxAction.config method responsible for setting all this or 
should
the DefaultSyntaxKit configActionProperties to it.  Either way, I don't think 
it is
currently working the way it should.

I have attached a screen shot of the popup menu that illustrates the problem.

Original comment by gleich...@gmail.com on 4 Mar 2010 at 9:23

Attachments:

GoogleCodeExporter commented 8 years ago
It's been a while since I touched that code.  And actually I think it used to 
work at 
some point in time.  Can't recall when it was broken though.

I think the DefaultSyntaxKit does all the configurations, and there is one call 
for 
the DefaultAction to configure itself.  So the code should be in one of the 
places.  
Can't recall which way I chose.

I don't have much time to work on this currently. 

Any takers?

Original comment by ayman.al...@gmail.com on 1 Apr 2010 at 5:13

GoogleCodeExporter commented 8 years ago
I would certainly be willing to.  It's hard to tell which class should do the
configuration though based on the current code base.  I'll look into previous
versions to see if I can find when it originally worked.

Original comment by gleich...@gmail.com on 2 Apr 2010 at 4:37

GoogleCodeExporter commented 8 years ago
I have attached diff patch with a proposed solution.  The problem was a pretty 
simple
bug where the DefaultSyntaxAction.config class would overwrite the action's
Action.NAME property after properly setting it via the reflection code that 
called
"setMenuText".  I just wrapped that to check if the name property had not 
already
been set.

Original comment by gleich...@gmail.com on 7 Apr 2010 at 7:11

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks for the patch.  Tested and works.  Will commit new version soon.

Original comment by ayman.al...@gmail.com on 19 Apr 2010 at 10:45

GoogleCodeExporter commented 8 years ago
committed r125

Original comment by ayman.al...@gmail.com on 19 Apr 2010 at 10:49