Is there a possibility to prevent line wrapping for the some special cases in the Eclipse code style fromatter? I mean in particular the javafx property definition blocks. By default the code style are next:
private StringProperty name = new SimpleStringProperty();
public StringProperty nameProperty() {
return name;
}
public String getName() {
return name.get();
}
public void setName(String value) {
this.name.set(value);
}
I attempts provide more compact style without line wrapping:
private StringProperty name = new SimpleStringProperty();
public StringProperty nameProperty() { return name; }
public String getName() { return name.get(); }
public void setName(String value) { this.name.set(value); }
Yes, it is possible to prevent line wrapping. Like @Pshemo said, you can toggle the eclipse formatter. So your above code becomes:
// @formatter:off
private StringProperty name = new SimpleStringProperty();
public StringProperty nameProperty() { return name; }
public String getName() { return name.get(); }
public void setName(String value) { this.name.set(value); }
// @formatter:on
The comments turn the formatter off then on again to prevent the formatter from changing that code when you press ctrl + shift + f.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With