Skip to content

Java Formatting Import option #8861

@MamaikAn

Description

@MamaikAn

Description

An option to combine imports with different Java packages together, separated from other imports.

Use case/motivation

According to the Checkstyle I need to group Java packages: java.* and javax.* together, without blank line between them.
The import layout I need:

  1. import static ...;
  2. (blank line);
  3. import java.*;
  4. import javax.*;
  5. (blank line);
  6. import org.*;

The way I try to organize imports is specifying groups inside section "Import Layout" (Tools - Options - Editor - Formatting):

  • all other imports (static);
  • java., javax.;
  • all other imports.

(with checked options "Separate Groups" and "Separate Static Imports")

After applying changes, Netbeans splits "java., javax." into two different lines, so it's not possible to combine them together.

Related issues

No response

Are you willing to submit a pull request?

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    Java[ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form)kind:featureA feature requestneeds:triageRequires attention from one of the committers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions