Skip to content

Formatter settings

Tomasz Kuryłek edited this page Jul 8, 2013 · 3 revisions

Formatter settings can be accessed here: https://gist.github.com/tkurylek/5943736

Importing formatter to eclipse

Go to:

Window -> Preferences -> Java -> Code Style -> Formatter

Eclipse Preferences Formatter

Click Import... button and select the formatter file.

Preview

A sample source file for the code formatter preview

package mypackage;

import java.util.LinkedList;

public class MyIntStack {
	private final LinkedList fStack;

	public MyIntStack() {
		fStack = new LinkedList();
	}

	public int pop() {
		return ((Integer) fStack.removeFirst()).intValue();
	}

	public void push(int elem) {
		fStack.addFirst(new Integer(elem));
	}

	public boolean isEmpty() {
		return fStack.isEmpty();
	}
}

Clone this wiki locally