Java Text Copy Paste Module - plugin detail

Helps copy and paste text from and to Java source code by converting the text back and fourth between Java source and the original text format such as SQL, XML, or HTML. It ties into the system clipboard, so all one has to do is copy text in their favorite SQL or XML editor then use the "Java Text Copy Paste Module" specific actions to transform the code. Code can also be highlighted in the Java editor and copied using the "Java Text Copy Paste Module" specific actions to transform it back into the original text format for pasting into their favorite utility editor. Works great with SQL and XML editors.

NetBeans Plugin - Java Text Copy Paste Module
Plugin owner: wadechandler
Website: http://java.net/jira/browse/JAVATEXTCOPYPASTE
Added: 2007-06-03
License: CDDL
Category: Editing
Downloaded: 9,162 times
Rating:
 4.31, by 6 users

Plugin Log Show log

Versions available

Download plugin   Download size: 0.02 MB   Last Update: 2016-10-04

This plugin is also available on the NetBeans Plugin Portal Update Center. Use 'Tools > Plugins' action from the NetBeans IDE main menu for convenient installation of this plugin


What's new in this version

Nothing new as this is still version 1.4.1. I have tested this in NetBeans 8.1, and thus am adding it to the plugin portal for NetBeans 8.2.

Verifications for NetBeans versions

8.2 verification PASSED See verification details
Download plugin   Download size: 0.02 MB   Last Update: 2015-11-09

This plugin is also available on the NetBeans Plugin Portal Update Center. Use 'Tools > Plugins' action from the NetBeans IDE main menu for convenient installation of this plugin


What's new in this version

Nothing new as this is still version 1.4.1. I have tested this in NetBeans 8.1, and thus am adding it to the plugin portal for NetBeans 8.1.

Verifications for NetBeans versions

8.1 verification PASSED See verification details
Download plugin   Download size: 0.02 MB   Last Update: 2014-04-29

This plugin is also available on the NetBeans Plugin Portal Update Center. Use 'Tools > Plugins' action from the NetBeans IDE main menu for convenient installation of this plugin


What's new in this version

Nothing new as this is still version 1.4.1. I have tested this in NetBeans 8.0, and thus am adding it to the plugin portal for NetBeans 8.0.

Verifications for NetBeans versions

8.0 verification PASSED See verification details
Download plugin   Download size: 0.02 MB   Last Update: 2013-10-22

This plugin is also available on the NetBeans Plugin Portal Update Center. Use 'Tools > Plugins' action from the NetBeans IDE main menu for convenient installation of this plugin


What's new in this version

Nothing new. Works just the same as it did in 7.3.

Verifications for NetBeans versions

7.4 verification PASSED See verification details
Download plugin   Download size: 0.02 MB   Last Update: 2013-03-06

This plugin is also available on the NetBeans Plugin Portal Update Center. Use 'Tools > Plugins' action from the NetBeans IDE main menu for convenient installation of this plugin


What's new in this version

Nothing new. Works just the same as it did in 7.2.

Verifications for NetBeans versions

7.3 verification PASSED See verification details
Download plugin   Download size: 0.02 MB   Last Update: 2012-11-09

This plugin is also available on the NetBeans Plugin Portal Update Center. Use 'Tools > Plugins' action from the NetBeans IDE main menu for convenient installation of this plugin


What's new in this version

Still works in 7.2. Fixed an issue where the module would not uninstall. Fixed another issue where it would not reformat after pasting and the user had to do it manually.

Verifications for NetBeans versions

7.2 verification PASSED See verification details
Download plugin   Download size: 0.01 MB   Last Update: 2008-04-30

This plugin is also available on the NetBeans Plugin Portal Update Center. Use 'Tools > Plugins' action from the NetBeans IDE main menu for convenient installation of this plugin


What's new in this version

The latest version now works well with NB 6.0. Before there were some dependencies which are not available in NB 6.0. I have highlighted the revisions from version to version in the plugins long description.

Verifications for NetBeans versions

6.1 verification PASSED See verification details
Download plugin   Download size: 0.01 MB   Last Update: 2008-04-30

This plugin is also available on the NetBeans Plugin Portal Update Center. Use 'Tools > Plugins' action from the NetBeans IDE main menu for convenient installation of this plugin


What's new in this version

The latest version now works well with NB 6.0. Before there were some dependencies which are not available in NB 6.0. I have highlighted the revisions from version to version in the plugins long description.

Verifications for NetBeans versions

6.0 verification PASSED See verification details


Introduction

Helps copy and paste text from and to Java source code. This module works well with SQL or HTML or XML which needs to be embedded in Java source code or needs to be extracted from Java source code. Look for the "Java Text Copy and Paste" context menu inside Java source files. There are no default hot keys for the functionality. I suggest playing around with the different actions to get a feel for how they work. + signs are pre-pended at the beginning of lines of source to make hand editing of generated code easier.

Version 1.1 added a new way to copy the text from the editor which keeps newlines in the selected text yet removes any newlines from the actual Java sources.

Version 1.2 adds tested support for NetBeans 6.0 and corrects a bug which deals with concurrent access of the edited document.

Version 1.3 fixes an issue dealing with the context menu sorting and NetBeans 6.0.

Version 1.4 Gets the plugin working for NetBeans 7.2 and 7.2.1 and should work for 7.3. Does have an issue where the pasted text is no longer reformatted in the current coding style and the user will have to reformat their file to apply that. This will be addressed in a 1.4.1 release. The module is useful without that feature/fix and needs to make it to the portal while some questions are being answered.

Version 1.4.1 Fixed a bug where the module was not able to be uninstalled. Also put automatic reformatting of the pasted text back into the module.

[ You have to be logged in to be able to comment. ]

User Comments

  

Warnings on NB 8.0.1


WARNING [org.openide.filesystems.Ordering]: Relative ordering attribute org-netbeans-modules-javatextcopypaste-CopyAsSQLWithNewlines.shadow/org-netbeans-modules-javatextcopypaste-CopyAsSQLWithNewlinesAndNoJavaNewlines.shadow on Editors/text/x-java/Popup/Java Text Copy and Paste is deprecated in favor of numeric position attributes
WARNING [org.openide.filesystems.Ordering]: Relative ordering attribute org-netbeans-modules-javatextcopypaste-PasteAsJavaSourceNewlinesToSpaces.shadow/org-netbeans-modules-javatextcopypaste-PasteAsJavaSourceWithNewlines.shadow on Editors/text/x-java/Popup/Java Text Copy and Paste is deprecated in favor of numeric position attributes
WARNING [org.openide.filesystems.Ordering]: Relative ordering attribute org-netbeans-modules-javatextcopypaste-CopyAsSQLNewlinesToSpaces.shadow/org-netbeans-modules-javatextcopypaste-CopyAsSQLWithNewlines.shadow on Editors/text/x-java/Popup/Java Text Copy and Paste is deprecated in favor of numeric position attributes
WARNING [org.openide.filesystems.Ordering]: Relative ordering attribute org-netbeans-modules-javatextcopypaste-CopyAsSQLWithNewlinesAndNoJavaNewlines.shadow/org-netbeans-modules-javatextcopypaste-PasteAsJavaSourceNewlinesToSpaces.shadow on Editors/text/x-java/Popup/Java Text Copy and Paste is deprecated in favor of numeric position attributes
WARNING [org.openide.filesystems.Ordering]: Relative ordering attribute org-netbeans-modules-javatextcopypaste-CopyAsTextNewlinesToSpacesAndJavaNewlinesToSpaces.shadow/org-netbeans-modules-javatextcopypaste-CopyAsSQLWithNewlines.shadow on Editors/text/x-java/Popup/Java Text Copy and Paste is deprecated in favor of numeric position attributes



I'be tried accessing JIRA on java.net but without luck. So I'm reporting here instead.
Posted by phansson on Nov 11, 2014
  

Waiting verification for NB 8.0 Portal

All,

Sorry, I missed the comment about adding to the portal for NB 8.0. I have requested verification, so should be up soon.

Thank you for your nice words!
Posted by wadechandler on Jun 11, 2014
  

NB 8.0

Just downloaded and installed manually, works perfectly.

Thanks, this is the best thing since Beatles.
Posted by jotranen on Mar 24, 2014
  

NB 8.0 ?

Will you be adding to the Plugin Portal for NB 8?
Posted by mclaborn on Mar 22, 2014
  

Awesome work!

I have absolutely no comment to make, I just wanted to thank you for this incredibly time saving tool!

Cheers!
Posted by bftanase on Dec 07, 2012
  

RE: FYI Feature in 7.2

Yes, one of the actions provided is there. None of the others are. If you work with SQL or XML or other text in other editors, and then paste and copy back and fourth to Java and another editor, then this module helps a lot. That is its purpose: round trip work with other text languages and Java source.

For instance, if you have a SQL query with tens of lines plus, and later you find you have a weird bug in it, then you can take that out of the sources much easier to get it into a SQL query tool to try to fix it. If someone has written the query, and it has escaped newlines in it or not, then you will probably want to be able to convert that back into multiple lines without extra lines. Maybe they didn't have the escaped ones, but only the Java source newlines are there. Maybe you don't want to retain any new lines when you copy it. Too, you may want to paste without escaped newlines. Reason being your JDBC driver or your database doesn't support it, but your query tool does some translations. I ran into that years back with a desktop engine a group was using on a project, and is why the action is there.
Posted by wadechandler on Nov 24, 2012
  

FYI feature in 7.2

The feature "Paste as java source - real newlines to escaped newlines in java source" is natively supported in 7.2 (and improved/bugfixed in 7.3)

* https://blogs.oracle.com/geertjan/entry/paste_a_multiline_literal
* http://netbeans.org/bugzilla/show_bug.cgi?id=201130
* http://netbeans.org/bugzilla/show_bug.cgi?id=222418
Posted by markiewb on Nov 24, 2012
  

I moved the module from version 1.4 to 1.4.1 to address a couple issues

First, the module will now uninstall and deactivate. If you click the check box labeled "Show Details" on the Installed tab, then you see the module, and you can act on it to either "Deactivate" or "Uninstall". This from Tools|Plugins. Next, after pasting it will reformat the specially pasted value so the user doesn't have to perform two actions.
Posted by wadechandler on Nov 09, 2012
  

Just what I needed

This is just what I was looking for. Thanks Wade for bringing it back!

Suggestions:
  • An option to change tabs to spaces when pasting.

  • Some way to mark which copy and paste operations are the ones I will use once, kind of a "favorites" of some kind.

Posted by mclaborn on Nov 09, 2012
  

Issue : cannot disable module

Hi,
the module can't be disabled via the Plugin Manager. Could you fix it ?
Thx ;)

Tested on NB 7.2.1 running on JDK6 and JDK7, Windows 7 x64 and XP x86.
Posted by ent38 on Nov 09, 2012
  

It's back

I have brought the plugin back. It should now work for 7.2. There is one small issue in that the user now has to use ALT+SHIFT+F to reformat the file after using the paste actions of the module, and this is because the Formatter class was removed from NetBeans and I haven't found a suitable alternative yet. Still, it works, and should still save you a lot of time when going back and forth between the Java editor and a SQL or XML editor.
Posted by wadechandler on Nov 09, 2012
  

This should be part of NB IDE

As I also prefer the + sign on the front I would love to see this functionality being added to come with the IDE.
And as JavaFX does not support multiline strings this module will useful in that environment, too.
Posted by giorgio42 on Dec 12, 2008
  

6.5 Plugin status and plus sign issue

I will be updating to 6.5 soon or at least testing it in 6.5.

With the plus sign issue, I handle this mostly by going into the formatting preferences under Tools|Options|Editor|Formatting (tab)|Language Java|Category Wrapping|Binary Operators set to if long. That at least makes it bearable. The reason for the + on the front was originally intended to allow things to be removed if needed without having to cursor around and access two lines. I'll play around with it and see what I can do.
Posted by wadechandler on Nov 23, 2008
  

Plus sign on the left is formatted away by Netbeans

The plugin uses plus signs on the left of each new line when pasting into Netbeans.
Netbeans does not understand this and creates a single line when using Source-Format.
I know that it is arguable where the signs should be placed, but I would prefer to let Netbeans have its way.
Can this be configured somehow in the plugin?
Posted by dschulten on Nov 23, 2008
  

Any 6.5 Plugin

Will a 6.5 plugin be available soon?
Posted by desmond_kirrane on Sep 24, 2008
  

I have verified this plugin works in NB 6.1

This is just an update to let everyone know. I have made sure the module works in NB 6.1. I am using it myself.
Posted by wadechandler on Apr 29, 2008
  

Now works for 6.0

The module should work in NB 6.0. I had to drop some dependencies and cleaned it up a little. I also fixed one issue I saw where I had forgot to lock the document before modifying it. This is mentioned in the Version 1.2 section of the long module description.
Posted by wadechandler on Jul 27, 2007
  

cannot install on 6.0

works great on 5.5.1

however, I cannot install it on 6.0, error below
I am using the base IDE installation, july-21-07 build

Plugin Java Text Copy Paste Module cannot match its dependencies:
module javax.jmi.model/1 > 1.7.22
module javax.jmi.reflect/1 > 1.7.22
module org.netbeans.api.mdr/1 > 1.4.22
module org.netbeans.jmi.javamodel/2 > 1.21.22
module org.netbeans.modules.java/1 > 1.25.22.2.2.2
module org.netbeans.modules.javacore/1 > 1.18.22.2.2
module org.openide.src > 1.8.22
Posted by sid21177 on Jul 23, 2007
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo