Modify

Opened 9 years ago

Closed 6 years ago

Last modified 5 years ago

#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 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)

textfield.patch (51.0 KB) - added by anonymous 6 years ago.
Patch for context menu
josmtextfield_01.patch (50.5 KB) - added by NooN 6 years ago.
josmtextfield_02.patch (113.7 KB) - added by noon 6 years ago.
Patch for context menu, version 2

Download all attachments as: .zip

Change History (19)

Changed 6 years ago by anonymous

Attachment: textfield.patch added

Patch for context menu

comment:1 Changed 6 years 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 years ago by Don-vip

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:

  1. org.openstreetmap.josm.gui.MyTextField should become org.openstreetmap.josm.gui.widgets.JosmTextField
  2. 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;
  3. The Sun patch is Windows-oriented. Has this patch been tested under Linux as well ?
  4. Please no debug stuff (the main method in comments). Unused imports should be removed instead of being commented.
  5. We credit patch authors. Who are you ? :)

Changed 6 years ago by NooN

Attachment: josmtextfield_01.patch added

comment:3 Changed 6 years ago by anonymous

You are welcome.

To your remarks/questions:

1./2./4. I changed the patch accordingly.

  1. It's more the otherway around. I only have Linux, so the patch is not tested on Mac or Windos.
  2. You can credit the patch to: NooN.

ToDo:

  1. I don't hade time to change alle instances of JTextField in the preference part of the source
  2. Tests have to be done on Windows and Mac.
  3. Some Combo Boxes don't profit from the patch
  4. 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.

Changed 6 years ago by noon

Attachment: josmtextfield_02.patch added

Patch for context menu, version 2

comment:4 Changed 6 years 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 6 years ago by Don-vip

Thanks for this new version :) New status:

  1. OK
  2. OK
  3. OK on Windows 8. I will ask a Mac user to make some tests after we commit this patch, so all OK.
  4. OK
  5. OK
  6. Popup menu should be refactored to a new class to avoid duplicate code. Something like org.openstreetmap.josm.gui.widgets.TextContextualPopupMenu.
  7. I confirm the popup does not work with HistoryComboBox.
  8. Please no new public classes/methods without Javadoc. See DevelopersGuide/StyleGuide

I look into those points.

Last edited 6 years ago by Don-vip (previous) (diff)

comment:6 Changed 6 years ago by Don-vip

In 5884/josm:

see #4429 - Get popup menu from PopupMenuLauncher + fix javadoc

comment:7 Changed 6 years ago by Don-vip

Owner: changed from team to Don-vip
Status: newassigned

comment:8 Changed 6 years ago by Don-vip

In 5886/josm:

see #4429 - Right click menu "undo, cut, copy, paste, delete, select all" for each text component (originally based on patch by NooN)

comment:9 Changed 6 years ago by Don-vip

Cc: akks added
Owner: changed from Don-vip to team
Status: assignednew
Summary: [Patch] right click menu "cut, copy, paste" for each text component in josmright 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 Changed 6 years 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 6 years 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 6 years ago by Don-vip

Resolution: fixed
Status: newclosed

No related issue reported.
Please reopen if something is wrong with these new contextual menus.

comment:13 Changed 6 years ago by Don-vip

Ticket #6627 has been marked as a duplicate of this ticket.

comment:14 Changed 6 years ago by Don-vip

Ticket #3292 has been marked as a duplicate of this ticket.

comment:15 Changed 5 years ago by akks

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 :)

Last edited 5 years ago by akks (previous) (diff)

comment:16 Changed 5 years ago by akks

In 6832/josm:

see #4429: Copy/Paste context menu for comboboxes did not appear

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.