#4429 closed enhancement (fixed)
right click menu "cut, copy, paste" for each text component in josm
Reported by: | bastiK | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Core | Version: | |
Keywords: | Cc: | akks |
Description (last modified by )
On most platforms you can copy text by right clicking on the selection and then choose copy from the context menu.
Some users will miss this and it certainly adds to the foreign feel when using java apps.
The java bug for this:
http://bugs.sun.com/view_bug.do?bug_id=4818418
Attachments (3)
Change History (19)
Changed 10 years ago by
Attachment: | textfield.patch added |
---|
comment:1 Changed 10 years ago by
The textfield.patch adds a right click menu to the JTextField.
It's a basic variant and adapted from the sun example.
comment:2 Changed 10 years ago by
Description: | modified (diff) |
---|---|
Summary: | right click menu "cut, copy, paste" for each text component in josm → [Patch] right click menu "cut, copy, paste" for each text component in josm |
Thanks for the patch, this is highly appreciated. Some work remains to be done before being considered for merging:
org.openstreetmap.josm.gui.MyTextField
should becomeorg.openstreetmap.josm.gui.widgets.JosmTextField
- All text displayed must be translated by using JOSM translation system (example: "Paste" becomes tr("Paste"), with
import static org.openstreetmap.josm.tools.I18n.tr;
- The Sun patch is Windows-oriented. Has this patch been tested under Linux as well ?
- Please no debug stuff (the main method in comments). Unused imports should be removed instead of being commented.
- We credit patch authors. Who are you ? :)
Changed 10 years ago by
Attachment: | josmtextfield_01.patch added |
---|
comment:3 Changed 10 years ago by
You are welcome.
To your remarks/questions:
1./2./4. I changed the patch accordingly.
- It's more the otherway around. I only have Linux, so the patch is not tested on Mac or Windos.
- You can credit the patch to: NooN.
ToDo:
- I don't hade time to change alle instances of JTextField in the preference part of the source
- Tests have to be done on Windows and Mac.
- Some Combo Boxes don't profit from the patch
- Someone should look over the constructor/super stuff in JosmTextField if this is "java like". My java knowlege is very limited and this was more try and error.
comment:4 Changed 10 years ago by
In the new patch "josmtextfield_02.patch" I changed also the JTextField in the prefernce part of the source. So the ToDo point 1 is done.
The ToDo point 3: I tried to implemened the context menu for the HistoryComboBox but it did not work. I want this feature for the PlaceSelection dialog.
I don't have a Windows/Mac computer so I can't test the ToDo point 2
For ToDo point 4 is my java knowledge limited. Someone should check patch befor commiting.
comment:5 Changed 10 years ago by
Thanks for this new version :) New status:
- OK
- OK
- OK on Windows 8. I will ask a Mac user to make some tests after we commit this patch, so all OK.
- OK
- OK
- Popup menu should be refactored to a new class to avoid duplicate code. Something like
org.openstreetmap.josm.gui.widgets.TextContextualPopupMenu
. - I confirm the popup does not work with HistoryComboBox.
- Please no new public classes/methods without Javadoc. See DevelopersGuide/StyleGuide
I look into those points.
comment:7 Changed 10 years ago by
Owner: | changed from team to Don-vip |
---|---|
Status: | new → assigned |
comment:9 Changed 10 years ago by
Cc: | akks added |
---|---|
Owner: | changed from Don-vip to team |
Status: | assigned → new |
Summary: | [Patch] right click menu "cut, copy, paste" for each text component in josm → right click menu "cut, copy, paste" for each text component in josm |
Quite a big patch :)
Didn't see particular problem with my tests under Windows 8
Can you make some tests on Linux ?
@akks: I have removed "paste tag" and "paste value" from the contextual menu of AddTagDialog with this change, you understand why :)
comment:10 follow-up: 11 Changed 10 years ago by
I don't get a connection with the version 5899.
The input boxes I tested worked under Linux
There is no german translation for cut.
Thanks for getting the patch submitted.
comment:11 Changed 10 years ago by
Replying to NooN:
I don't get a connection with the version 5899.
Unrelated to this subject, see #8627
The input boxes I tested worked under Linux
Nice :)
There is no german translation for cut.
You can help, everyone can contribute to JOSM translations, see Translations.
Thanks for getting the patch submitted.
Welcome, thanks for starting it !
comment:12 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
No related issue reported.
Please reopen if something is wrong with these new contextual menus.
comment:15 Changed 10 years ago by
I was asked to fix half-working "Copy-Paste" context menu in Alt-A/Alt-E dialog.
Debugging said that menu appeared and immediately disappeared due to mouse click event.
So I have just deleted the line. Hope it does not break Linux and exotic look-and-feels :)
Patch for context menu