简体   繁体   中英

In Eclipse, what plugin/class provides the style formatting on Java code?

As you type Java code in Eclipse, the Viewer colors, emboldens, italicizes, fades, and provides styles to the Java code as you type it, as seen in the picture:

Eclipse格式化

What is actually implementing these effects?

Is it an Eclipse plugin? Can you identify which (and tell me how you identified it)? Furthermore can you narrow it down to a class?

Select "Peferences" from the Eclipse menu. Go to Java -> Code Style -> Formatter

Preferences can be set at project level.

Incase you are planning on writing your own formatting code, then take a look at "workspace mechanics" plugin.

This functionality is part of the JDT project (Java Developer Tools). The actual code sits in org.eclipse.jdt.core (non-UI parts) and org.eclipse.jdt.ui (UI parts).

The viewer stuff is mostly in the UI plugin ( sources ). It's hard to give any more specifics as highlighting includes custom viewer, parser, extension mechanisms (for 3rd party plugins)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM