|
From: Christopher W. <caw...@us...> - 2006-02-10 18:32:51
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/formatter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5591/src/org/rubypeople/rdt/internal/formatter Modified Files: AbstractBlockMarker.java IndentationState.java Log Message: chnages to make our old code formatter compatible with the new formatting options Index: IndentationState.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/formatter/IndentationState.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IndentationState.java 11 Apr 2003 22:12:10 -0000 1.1 --- IndentationState.java 10 Feb 2006 18:32:41 -0000 1.2 *************** *** 1,4 **** --- 1,5 ---- package org.rubypeople.rdt.internal.formatter; + public class IndentationState { private int lastIndentation ; *************** *** 9,20 **** private int indentation ; private String unformattedText ; - private char fillCharacter ; ! public IndentationState(String unformattedText, int indentationLength, int offset, char fillCharacter) { this.unformattedText = unformattedText ; this.indentationLength = indentationLength ; ! this.fillCharacter = fillCharacter ; ! this.offset = offset ; ! indentationLevel = 0 ; pos = 0 ; this.calculateIndentation() ; --- 10,19 ---- private int indentation ; private String unformattedText ; ! public IndentationState(String unformattedText, int indentationLength, int offset, int initialIndentLevel) { this.unformattedText = unformattedText ; this.indentationLength = indentationLength ; ! this.offset = offset; ! indentationLevel = initialIndentLevel; pos = 0 ; this.calculateIndentation() ; *************** *** 36,45 **** } ! public void calculateIndentation() { indentation = offset + indentationLength * indentationLevel ; } - - - public int getIndentation() { --- 35,41 ---- } ! public void calculateIndentation() { indentation = offset + indentationLength * indentationLevel ; } public int getIndentation() { *************** *** 101,116 **** return lastIndentation ; } - - protected String getIndentationString() { - if (indentation <= 0) { - return ""; - } - char[] chars = new char[indentation]; - for (int i = 0; i < indentation; i++) { - chars[i] = fillCharacter; - } - return new String(chars); - } - } --- 97,100 ---- Index: AbstractBlockMarker.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/formatter/AbstractBlockMarker.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AbstractBlockMarker.java 11 Apr 2003 22:12:10 -0000 1.1 --- AbstractBlockMarker.java 10 Feb 2006 18:32:41 -0000 1.2 *************** *** 1,4 **** --- 1,8 ---- package org.rubypeople.rdt.internal.formatter; + import java.util.Map; + + import org.rubypeople.rdt.core.formatter.Indents; + public abstract class AbstractBlockMarker { protected int pos; *************** *** 34,40 **** } ! public void appendIndentedLine(StringBuffer sb, IndentationState state, String originalLine, String strippedLine) { ! ! sb.append(state.getIndentationString()); sb.append(strippedLine); } --- 38,48 ---- } ! public void appendIndentedLine(StringBuffer sb, IndentationState state, String originalLine, String strippedLine, Map options) { ! String spaces = ""; ! for (int i = 0; i < state.getOffset(); i++) { ! spaces+= " "; ! } ! sb.append(spaces); ! sb.append(Indents.createIndentString(state.getIndentationLevel(), options)); sb.append(strippedLine); } |