1 19 package org.netbeans.modules.java.source.engine; 20 21 import java.lang.reflect.Field ; 22 23 public final class JavaFormatOptions { 24 public static JavaFormatOptions getDefault() { 25 JavaFormatOptions defaultOptions = new JavaFormatOptions(); 26 propertySheet.loadValues(defaultOptions); 27 return defaultOptions; 28 } 29 private static final PropertySheetInfo propertySheet = 30 PropertySheetInfo.find(JavaFormatOptions.class); 31 private final static Field [] fields = JavaFormatOptions.class.getFields(); 32 33 public void save() { 34 try { 35 propertySheet.saveValues(this); 36 } catch (Exception e) { 37 throw new AssertionError ("failed saving format options: " + e); 38 } 39 } 40 41 public boolean blankLineAfterDeclarations = true; 43 public boolean blankLineBeforeInlineDeclarations; 44 public boolean blankLineBeforeDocComments = true; 45 public boolean blankLineBeforeAllComments; 46 public boolean blankLineBeforeMethods = true; 47 public boolean sameLineIfFit=false; 48 public boolean excessParensAroundConditionals; 49 public boolean forceCondExprWrap = true; 50 public int starThreshold = 2; public int useThreshold = 1; public boolean cuddleOpenBrace = true; 55 public boolean cuddleCloseBrace; 56 public boolean indBracesHalfway; 57 public int caseInd=2; 59 public boolean cuddleElse = true; 60 public boolean methodNamesStartLine; 65 public boolean formatCol1Comments = true; 69 public int continuationIndent=8; 71 public boolean lineupToParens=true; 73 public int rightMargin = 80; 74 public int blockCommentMaxCol = rightMargin; 75 public boolean extraExpressionIndent=true; 81 public int indentSize=4; 82 public boolean indBracesInner; 83 public boolean alignDecl; 85 public int unindentDisplace; 89 public int appendCommentCol = 32; 90 public PickOne spaceOperatorsBelow = new PickOne(13, 91 new String []{ "none", "=", "op=", "? :", "||", "&&", "|", "^", "&", "==, !=", 92 "<, >, <=, >=", "<<, >>, >>>", "+, -", "*, /", "++i, --i", "i++, i--" }); 93 public boolean cuddleElseIf=true; 95 public boolean indentParameters; 96 public PickOne blockCommentStyle = new PickOne(1, 97 new String []{ "Compact /* */", "K&R", "Boxed /* */", "//" }); 98 public PickOne smallCommentStyle = new PickOne(3,blockCommentStyle.keys); 99 public PickOne docCommentStyle = new PickOne(1,blockCommentStyle.keys); 100 public boolean moveAppendedComments; 101 public PickOne sort1 = new PickOne(0, 102 new String [] { "none", "variable/method/class", 103 "public/protected/private", "name" }); 104 public PickOne redundantBraces = new PickOne(0, 105 new String [] { "Leave Alone", "Eliminate", 106 "Add" }); 107 public PickOne sort2 = new PickOne(0, sort1.keys); 108 public PickOne sort3 = new PickOne(0, sort1.keys); 109 110 } 111 | Popular Tags |