Reputation: 233
I know NetBeans has this feature, but I can't find it in Eclipse. A quick search for plugins was not successful.
Upvotes: 11
Views: 8735
Reputation: 18397
Convert files:
Select items in the Package Explorer, Navigator or other views and right click to open the context menu. There is a Java2Html menu item that opens the conversion dialog.Convert text from a text editor:
Right click on an editor and choose the Java2Html context menu item to convert the current selected text.Adjust preferences:
Colors, tab size, etc. for conversion can be adjusted on the preference pages (Menu "Window" - "Preferences" - "Java" - "Java2Html")...
Upvotes: 11
Reputation: 78934
Hackish way:
On Windows at least, when you do Ctrl-A (Select all), Ctrl+C (Copy) what actually gets copied to the clipboard is formatted text (with all the colors and fonts). Then you can paste (Ctrl-V) it to something that can accept formatted text, say Microsoft Word or even Wordpad and save it to whatever format you wish.
Upvotes: 5
Reputation: 51
The Copy as HTML eclipse IDE plugin allows us to directly copy our code as HTML and paste it to our blogs or forums without any formatting.
Download Copy as HTML eclipse plugin
Steps to install the plugin:
- Download the Copy as HTML eclipse plugin
- Copy it to the 'dropins' folder of your eclipse installation
- If 'dropins' folder is not present then copy it to the 'plugins' folder of your eclipse installation
- Restart eclipse IDE
- That's it
Steps to Use
- Select the code or text to be copied
- Select 'Copy as HTML' option or press 'cntrl+shift+3'
- Paste it your superb blog
Taken from here:
http://java-sample-program.blogspot.hu/2012/12/copy-as-html-eclipse-plugin.html
Upvotes: 1