# nb-paste-to-new-file
NetBeans plugin which pastes textual clipboard content into a new file. This is useful if you have to copy code samples (especially whole java classes) from online tutorials.
- Core-Plugin: http://plugins.netbeans.org/plugin/57739/?show=true
- Java-Addon for the Core-Plugin: http://plugins.netbeans.org/plugin/57740/?show=true
Select a node in the project view and then invoke Menu|Edit|Paste to new file
. A dialog will ask you for the file name and after confirming it a new file will be created with the given name and the content from the clipboard.
-
The idea of this feature is taken from Eclipse IDE and IntelliJ Idea, but now it is also available for NetBeans IDE
-
Variant 1: Select a "Source" or "Test Sources" node and paste Java code (incl. package declaration) via
Menu|Edit|Paste to new file
and a Java file is created in the package defined by the pasted source code. -
Variant 2: Select a package node below the "Source" or "Test Sources" node and paste Java code (incl. package declaration) via
Menu|Edit|Paste to new file
and a Java file is created in the selected package. The package declaration in the file is updated automatically.