ctrl+shift+F work fine for what is inside the public class . but the formatting does not work inside the method, see the = sign is not aligned. why? and how do I get this to work?
public class myClass extends ActivityInstrumentationTestCase2 {
public static boolean myVar = true;
private static final String TARGET_PACKAGE_ID = "com.xxxx.test";
private static final String LAUNCHER_ACTIVITY_FULL_CLASSNAME = "com.xxxx.test";
private static Class launcherActivityClass;
...
...
private String getOnScreeninfoByType() {
ArrayList<TextView> textViews = new ArrayList<TextView>();
ArrayList<Button> listButtons = new ArrayList<Button>();
ArrayList<ToggleButton> listToggleButtons = new ArrayList<ToggleButton>();
ArrayList<EditText> listEditTexts = new ArrayList<EditText>();
ArrayList<CheckBox> listCheckBoxes = new ArrayList<CheckBox>();
ArrayList<RadioButton> listRadioButtons = new ArrayList<RadioButton>();
ArrayList<ImageButton> listImageButtons = new ArrayList<ImageButton>();
ArrayList<ImageView> listImageViews = new ArrayList<ImageView>();
ArrayList<ProgressBar> listProgressBars = new ArrayList<ProgressBar>();
...
}
thanks
If you mean formatting, then Ctrl + Shift + F .
There is an option Align Fields in Columns
in Preferences > Java > Code Style > Formatter > Edit > Indentation
. If this option is checked, fields in class are aligned as you saw. However, I couldn't find any options Align Local Variables
or something like that. It seems that there is no option to align local variables in columns.
They are not aligned because they should not be aligned!
The special alignment in the class, could be caused by a special non standard formating rule, that was set up by the person which created that project.
Look in project settings in eclipse under Code Formatter (or simillar)
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