#4429 closed enhancement (fixed)
right click menu "cut, copy, paste" for each text component in josm
| Reported by: | bastiK | Owned by: | team |
|---|---|---|---|
| Priority: | normal | Component: | Core |
| Version: | Keywords: | ||
| Cc: | akks |
Description (last modified by Don-vip)
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 (16)
Changed 6 weeks ago by anonymous
comment:1 Changed 6 weeks ago by anonymous
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 6 weeks ago by Don-vip
- Description modified (diff)
- Summary changed from right click menu "cut, copy, paste" for each text component in josm to [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 become org.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 6 weeks ago by NooN
comment:3 Changed 6 weeks ago by anonymous
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 5 weeks ago by NooN
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 5 weeks ago by Don-vip
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:6 Changed 5 weeks ago by Don-vip
In 5884/josm:
comment:7 Changed 5 weeks ago by Don-vip
- Owner changed from team to Don-vip
- Status changed from new to assigned
comment:8 Changed 5 weeks ago by Don-vip
In 5886/josm:
comment:9 Changed 5 weeks ago by Don-vip
- Cc akks added
- Owner changed from Don-vip to team
- Status changed from assigned to new
- Summary changed from [Patch] right click menu "cut, copy, paste" for each text component in josm to 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 4 weeks ago by NooN
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 in reply to: ↑ 10 Changed 4 weeks ago by Don-vip
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 3 weeks ago by Don-vip
- Resolution set to fixed
- Status changed from new to closed
No related issue reported.
Please reopen if something is wrong with these new contextual menus.
comment:13 Changed 12 days ago by Don-vip
Ticket #6627 has been marked as a duplicate of this ticket.



Patch for context menu