aymanhs / jsyntaxpane

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

Right click menu has many unuseful options when Editor is non-editable #170

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Use the code on the UsingNew Page
2. Change the Editor Pane so it is non editable 
(JEditorPane.setEditable(false)).
3. Launch application
4. Right Click on the editor.

What is the expected output? What do you see instead?
There are menu items such as Cut, Paste, and several others that should not do 
anything if the editor pane is not editable.  It would be nice if they were not 
there.

What version of the product are you using? On what operating system?
0.9.4 on Windows 7

Please provide any additional information below.

Original issue reported on code.google.com by jay.ask...@gmail.com on 4 Feb 2011 at 6:50

GoogleCodeExporter commented 8 years ago
In my opinion, implementation wide, this would complicate things more than I 
can handle now.  What if the editor pane is changed at a later time to be 
editable after it jsyntaxpane takes control?

I generally like to see all menu-items and have them disabled, rather than not 
seeing them if they are disabled.  

Having said that, If you have some code I can see, I'll try to do that. 

Original comment by ayman.al...@gmail.com on 26 Feb 2011 at 5:30

GoogleCodeExporter commented 8 years ago
In the case of our app, it doesn't make sense for them to be there, because we 
never allow the editor pane to be editable, so they will never be used.  I do 
agree that in many use cases, it would be better for the menu items to be 
grayed out rather than removed.  

However, for our purposes, we found a work around, so this isn't a big 
priority.  We just manually removed the menu items.  I could take a look at 
your code and see if I can find a way that would allow both options (removing 
the menu items or greying them out)

Original comment by jay.ask...@gmail.com on 26 Feb 2011 at 7:52