tuliob / jsyntaxpane

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

Missing cut/copy/paste in right click menu of second jsyntaxpane instance #72

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create more than one instance of a jsyntaxpane in your app
2. Right click in the first instance, you will see cut/copy/paste
3. Right click in second instance, you will NOT see cut/copy/paste

What is the expected output? What do you see instead?
I expect to see cut/copy/paste in the right click menu of all instances of
jsyntaxpane

What version of the product are you using? On what operating system?
0.9.5 b11

Please provide any additional information below.

Original issue reported on code.google.com by chad.dor...@gmail.com on 10 Mar 2009 at 7:31

GoogleCodeExporter commented 9 years ago
Are they both in the same JFrame?  I tried this, and it works with the latest 
svn
copy.  I did not check the binary release as it did have some issues I fixed 
already.

Original comment by ayman.al...@gmail.com on 10 Mar 2009 at 11:19

GoogleCodeExporter commented 9 years ago
Both jsyntaxpanes are within the same JFrame, but live within different 
JPanels.  I
tried using the latest r095 branch with the same results.  Perhaps it is how I
initialize them?  I run the following code every time I create a new 
jsyntaxpane.

DefaultSyntaxKit.initKit();

/* Init and Add Code Panel */
JEditorPane editorPane = new JEditorPane();
JScrollPane scrollPane = new JScrollPane(editorPane);
editorPane.setContentType("text/java");

Original comment by chad.dor...@gmail.com on 10 Mar 2009 at 10:41

GoogleCodeExporter commented 9 years ago
After some debug with your source code I have found the issue.  Each time you 
call
addActions() in DefaultSyntaxKit class you find the default actions and 
configure
them to better appear in the GUI.  This is a great, except you rename the 
Actions
when modifying them to appear friendlier(for example: "cut-to-clipboard" becomes
"Cut").  Once this is done the first time, the default Actions can not be found 
by
their default names the second time around, and therefore do not get included 
in your
right click menu, or in the ActionMap at all for that matter.

Original comment by chad.dor...@gmail.com on 11 Mar 2009 at 5:37

GoogleCodeExporter commented 9 years ago
Many thanks!  I was pulling my hair trying to recreate, but i could not.
Now I see the problem.  But it will be tricky solving it.

Original comment by ayman.al...@gmail.com on 11 Mar 2009 at 5:53

GoogleCodeExporter commented 9 years ago
Fixed in r99 in svn.
Wasn't too tricky after all!

Original comment by ayman.al...@gmail.com on 11 Mar 2009 at 6:23

GoogleCodeExporter commented 9 years ago
That did the trick.  Thanks!

Original comment by chad.dor...@gmail.com on 11 Mar 2009 at 6:33