Modify

Opened 3 years ago

Closed 3 weeks ago

Last modified 12 days 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 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 weeks ago.
Patch for context menu
josmtextfield_01.patch (50.5 KB) - added by NooN 6 weeks ago.
josmtextfield_02.patch (113.7 KB) - added by noon 5 weeks ago.
Patch for context menu, version 2

Download all attachments as: .zip

Change History (16)

Changed 6 weeks ago by anonymous

Patch for context menu

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:

  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 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.

  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 5 weeks ago by noon

Patch for context menu, version 2

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:

  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 5 weeks ago by Don-vip (previous) (diff)

comment:6 Changed 5 weeks ago by Don-vip

In 5884/josm:

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

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:

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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed .
as The resolution will be set. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.