org.netbeans.modules.java.source 0.80.1 17

org.netbeans.api.java.source
Class CodeStyle

java.lang.Object
  extended by org.netbeans.api.java.source.CodeStyle

public final class CodeStyle
extends Object

XXX make sure the getters get the defaults from somewhere XXX add support for profiles XXX get the preferences node from somewhere else in odrer to be able not to use the getters and to be able to write to it.


Nested Class Summary
static class CodeStyle.BracePlacement
           
static class CodeStyle.BracesGenerationStyle
           
static class CodeStyle.WrapStyle
           
 
Method Summary
 boolean absoluteLabelIndent()
           
 boolean addLeadingStarInComment()
           
 boolean addOverrideAnnotation()
           
 boolean alignMultilineAnnotationArgs()
           
 boolean alignMultilineArrayInit()
           
 boolean alignMultilineAssignment()
           
 boolean alignMultilineBinaryOp()
           
 boolean alignMultilineCallArgs()
           
 boolean alignMultilineDisjunctiveCatchTypes()
           
 boolean alignMultilineFor()
           
 boolean alignMultilineImplements()
           
 boolean alignMultilineMethodParams()
           
 boolean alignMultilineParenthesized()
           
 boolean alignMultilineTernaryOp()
           
 boolean alignMultilineThrows()
           
 boolean alignMultilineTryResources()
           
 int countForUsingStarImport()
           
 int countForUsingStaticStarImport()
           
 boolean expandTabToSpaces()
           
 int getBlankLinesAfterClass()
           
 int getBlankLinesAfterClassHeader()
           
 int getBlankLinesAfterFields()
           
 int getBlankLinesAfterImports()
           
 int getBlankLinesAfterMethods()
           
 int getBlankLinesAfterPackage()
           
 int getBlankLinesBeforeClass()
           
 int getBlankLinesBeforeFields()
           
 int getBlankLinesBeforeImports()
           
 int getBlankLinesBeforeMethods()
           
 int getBlankLinesBeforePackage()
           
 CodeStyle.BracePlacement getClassDeclBracePlacement()
           
 int getContinuationIndentSize()
           
static CodeStyle getDefault(Document doc)
          Gets CodeStyle for the given document.
static CodeStyle getDefault(FileObject file)
          Gets CodeStyle for the given file.
static CodeStyle getDefault(Project project)
          Deprecated. Please use getDefault(javax.swing.text.Document) or getDefault(org.openide.filesystems.FileObject) respectively.
 String getFieldNamePrefix()
           
 String getFieldNameSuffix()
           
 int getIndentSize()
           
 int getLabelIndent()
           
 String getLocalVarNamePrefix()
           
 String getLocalVarNameSuffix()
           
 CodeStyle.BracePlacement getMethodDeclBracePlacement()
           
 CodeStyle.BracePlacement getOtherBracePlacement()
           
 String[] getPackagesForStarImport()
           
 String getParameterNamePrefix()
           
 String getParameterNameSuffix()
           
 int getRightMargin()
           
 String getStaticFieldNamePrefix()
           
 String getStaticFieldNameSuffix()
           
 int getTabSize()
           
 boolean indentCasesFromSwitch()
           
 boolean indentTopLevelClassMembers()
           
 boolean makeLocalVarsFinal()
           
 boolean makeParametersFinal()
           
 boolean placeCatchOnNewLine()
           
 boolean placeElseOnNewLine()
           
 boolean placeFinallyOnNewLine()
           
 boolean placeNewLineAfterModifiers()
           
 boolean placeWhileOnNewLine()
           
 boolean preferLongerNames()
           
 boolean qualifyFieldAccess()
           
 CodeStyle.BracesGenerationStyle redundantDoWhileBraces()
           
 CodeStyle.BracesGenerationStyle redundantForBraces()
           
 CodeStyle.BracesGenerationStyle redundantIfBraces()
           
 CodeStyle.BracesGenerationStyle redundantWhileBraces()
           
 boolean spaceAfterColon()
           
 boolean spaceAfterComma()
           
 boolean spaceAfterSemi()
           
 boolean spaceAfterTypeCast()
           
 boolean spaceAroundAssignOps()
           
 boolean spaceAroundBinaryOps()
           
 boolean spaceAroundTernaryOps()
           
 boolean spaceAroundUnaryOps()
           
 boolean spaceBeforeAnnotationParen()
           
 boolean spaceBeforeArrayInitLeftBrace()
           
 boolean spaceBeforeCatch()
           
 boolean spaceBeforeCatchLeftBrace()
           
 boolean spaceBeforeCatchParen()
           
 boolean spaceBeforeClassDeclLeftBrace()
           
 boolean spaceBeforeColon()
           
 boolean spaceBeforeComma()
           
 boolean spaceBeforeDoLeftBrace()
           
 boolean spaceBeforeElse()
           
 boolean spaceBeforeElseLeftBrace()
           
 boolean spaceBeforeFinally()
           
 boolean spaceBeforeFinallyLeftBrace()
           
 boolean spaceBeforeForLeftBrace()
           
 boolean spaceBeforeForParen()
           
 boolean spaceBeforeIfLeftBrace()
           
 boolean spaceBeforeIfParen()
           
 boolean spaceBeforeMethodCallParen()
           
 boolean spaceBeforeMethodDeclLeftBrace()
           
 boolean spaceBeforeMethodDeclParen()
           
 boolean spaceBeforeSemi()
           
 boolean spaceBeforeStaticInitLeftBrace()
           
 boolean spaceBeforeSwitchLeftBrace()
           
 boolean spaceBeforeSwitchParen()
           
 boolean spaceBeforeSynchronizedLeftBrace()
           
 boolean spaceBeforeSynchronizedParen()
           
 boolean spaceBeforeTryLeftBrace()
           
 boolean spaceBeforeTryParen()
           
 boolean spaceBeforeWhile()
           
 boolean spaceBeforeWhileLeftBrace()
           
 boolean spaceBeforeWhileParen()
           
 boolean spaceWithinAnnotationParens()
           
 boolean spaceWithinArrayInitBrackets()
           
 boolean spaceWithinBraces()
           
 boolean spaceWithinCatchParens()
           
 boolean spaceWithinForParens()
           
 boolean spaceWithinIfParens()
           
 boolean spaceWithinMethodCallParens()
           
 boolean spaceWithinMethodDeclParens()
           
 boolean spaceWithinParens()
           
 boolean spaceWithinSwitchParens()
           
 boolean spaceWithinSynchronizedParens()
           
 boolean spaceWithinTryParens()
           
 boolean spaceWithinTypeCastParens()
           
 boolean spaceWithinWhileParens()
           
 boolean specialElseIf()
           
 boolean useFQNs()
           
 boolean useIsForBooleanGetters()
           
 boolean useSingleClassImport()
           
 boolean wrapAfterBinaryOps()
           
 boolean wrapAfterTernaryOps()
           
 CodeStyle.WrapStyle wrapAnnotationArgs()
           
 CodeStyle.WrapStyle wrapAnnotations()
           
 CodeStyle.WrapStyle wrapArrayInit()
           
 CodeStyle.WrapStyle wrapAssert()
           
 CodeStyle.WrapStyle wrapAssignOps()
           
 CodeStyle.WrapStyle wrapBinaryOps()
           
 CodeStyle.WrapStyle wrapChainedMethodCalls()
           
 CodeStyle.WrapStyle wrapDisjunctiveCatchTypes()
           
 CodeStyle.WrapStyle wrapDoWhileStatement()
           
 CodeStyle.WrapStyle wrapEnumConstants()
           
 CodeStyle.WrapStyle wrapExtendsImplementsKeyword()
           
 CodeStyle.WrapStyle wrapExtendsImplementsList()
           
 CodeStyle.WrapStyle wrapFor()
           
 CodeStyle.WrapStyle wrapForStatement()
           
 CodeStyle.WrapStyle wrapIfStatement()
           
 CodeStyle.WrapStyle wrapMethodCallArgs()
           
 CodeStyle.WrapStyle wrapMethodParams()
           
 CodeStyle.WrapStyle wrapTernaryOps()
           
 CodeStyle.WrapStyle wrapThrowsKeyword()
           
 CodeStyle.WrapStyle wrapThrowsList()
           
 CodeStyle.WrapStyle wrapTryResources()
           
 CodeStyle.WrapStyle wrapWhileStatement()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getDefault

public static CodeStyle getDefault(Project project)
Deprecated. Please use getDefault(javax.swing.text.Document) or getDefault(org.openide.filesystems.FileObject) respectively.

Gets CodeStyle for files in the given project.

Please see the other two getDefault methods as they are the preferred way of getting CodeStyle.

Parameters:
project - The project to get the CodeStyle for.
Returns:
The current code style that would be used by documents opened from files belonging to the project.

getDefault

public static CodeStyle getDefault(FileObject file)
Gets CodeStyle for the given file. If you have a document instance you should use the getDefault(javax.swing.text.Document) method.

Parameters:
file - The file to get the CodeStyle for.
Returns:
The current code style that would be used by a document if the file were opened in the editor.
Since:
0.39

getDefault

public static CodeStyle getDefault(Document doc)
Gets CodeStyle for the given document. This is the preferred method of getting CodeStyle. If you don't have a document you can use getDefault(org.openide.filesystems.FileObject) method instead.

Parameters:
doc - The document to get the CodeStyle for.
Returns:
The current code style used by a document. This is the code style that will be used when formatting the document or generating new code.
Since:
0.39

expandTabToSpaces

public boolean expandTabToSpaces()

getTabSize

public int getTabSize()

getIndentSize

public int getIndentSize()

getContinuationIndentSize

public int getContinuationIndentSize()

getLabelIndent

public int getLabelIndent()

absoluteLabelIndent

public boolean absoluteLabelIndent()

indentTopLevelClassMembers

public boolean indentTopLevelClassMembers()

indentCasesFromSwitch

public boolean indentCasesFromSwitch()

getRightMargin

public int getRightMargin()

addLeadingStarInComment

public boolean addLeadingStarInComment()

preferLongerNames

public boolean preferLongerNames()

getFieldNamePrefix

public String getFieldNamePrefix()

getFieldNameSuffix

public String getFieldNameSuffix()

getStaticFieldNamePrefix

public String getStaticFieldNamePrefix()

getStaticFieldNameSuffix

public String getStaticFieldNameSuffix()

getParameterNamePrefix

public String getParameterNamePrefix()

getParameterNameSuffix

public String getParameterNameSuffix()

getLocalVarNamePrefix

public String getLocalVarNamePrefix()

getLocalVarNameSuffix

public String getLocalVarNameSuffix()

qualifyFieldAccess

public boolean qualifyFieldAccess()

useIsForBooleanGetters

public boolean useIsForBooleanGetters()

addOverrideAnnotation

public boolean addOverrideAnnotation()

makeLocalVarsFinal

public boolean makeLocalVarsFinal()

makeParametersFinal

public boolean makeParametersFinal()

getClassDeclBracePlacement

public CodeStyle.BracePlacement getClassDeclBracePlacement()

getMethodDeclBracePlacement

public CodeStyle.BracePlacement getMethodDeclBracePlacement()

getOtherBracePlacement

public CodeStyle.BracePlacement getOtherBracePlacement()

specialElseIf

public boolean specialElseIf()

redundantIfBraces

public CodeStyle.BracesGenerationStyle redundantIfBraces()

redundantForBraces

public CodeStyle.BracesGenerationStyle redundantForBraces()

redundantWhileBraces

public CodeStyle.BracesGenerationStyle redundantWhileBraces()

redundantDoWhileBraces

public CodeStyle.BracesGenerationStyle redundantDoWhileBraces()

alignMultilineMethodParams

public boolean alignMultilineMethodParams()

alignMultilineCallArgs

public boolean alignMultilineCallArgs()

alignMultilineAnnotationArgs

public boolean alignMultilineAnnotationArgs()

alignMultilineImplements

public boolean alignMultilineImplements()

alignMultilineThrows

public boolean alignMultilineThrows()

alignMultilineParenthesized

public boolean alignMultilineParenthesized()

alignMultilineBinaryOp

public boolean alignMultilineBinaryOp()

alignMultilineTernaryOp

public boolean alignMultilineTernaryOp()

alignMultilineAssignment

public boolean alignMultilineAssignment()

alignMultilineTryResources

public boolean alignMultilineTryResources()
Since:
0.67

alignMultilineDisjunctiveCatchTypes

public boolean alignMultilineDisjunctiveCatchTypes()

alignMultilineFor

public boolean alignMultilineFor()

alignMultilineArrayInit

public boolean alignMultilineArrayInit()

placeElseOnNewLine

public boolean placeElseOnNewLine()

placeWhileOnNewLine

public boolean placeWhileOnNewLine()

placeCatchOnNewLine

public boolean placeCatchOnNewLine()

placeFinallyOnNewLine

public boolean placeFinallyOnNewLine()

placeNewLineAfterModifiers

public boolean placeNewLineAfterModifiers()

wrapExtendsImplementsKeyword

public CodeStyle.WrapStyle wrapExtendsImplementsKeyword()

wrapExtendsImplementsList

public CodeStyle.WrapStyle wrapExtendsImplementsList()

wrapMethodParams

public CodeStyle.WrapStyle wrapMethodParams()

wrapThrowsKeyword

public CodeStyle.WrapStyle wrapThrowsKeyword()

wrapThrowsList

public CodeStyle.WrapStyle wrapThrowsList()

wrapMethodCallArgs

public CodeStyle.WrapStyle wrapMethodCallArgs()

wrapAnnotationArgs

public CodeStyle.WrapStyle wrapAnnotationArgs()

wrapChainedMethodCalls

public CodeStyle.WrapStyle wrapChainedMethodCalls()

wrapArrayInit

public CodeStyle.WrapStyle wrapArrayInit()

wrapTryResources

public CodeStyle.WrapStyle wrapTryResources()
Since:
0.67

wrapDisjunctiveCatchTypes

public CodeStyle.WrapStyle wrapDisjunctiveCatchTypes()

wrapFor

public CodeStyle.WrapStyle wrapFor()

wrapForStatement

public CodeStyle.WrapStyle wrapForStatement()

wrapIfStatement

public CodeStyle.WrapStyle wrapIfStatement()

wrapWhileStatement

public CodeStyle.WrapStyle wrapWhileStatement()

wrapDoWhileStatement

public CodeStyle.WrapStyle wrapDoWhileStatement()

wrapAssert

public CodeStyle.WrapStyle wrapAssert()

wrapEnumConstants

public CodeStyle.WrapStyle wrapEnumConstants()

wrapAnnotations

public CodeStyle.WrapStyle wrapAnnotations()

wrapBinaryOps

public CodeStyle.WrapStyle wrapBinaryOps()

wrapAfterBinaryOps

public boolean wrapAfterBinaryOps()

wrapTernaryOps

public CodeStyle.WrapStyle wrapTernaryOps()

wrapAfterTernaryOps

public boolean wrapAfterTernaryOps()

wrapAssignOps

public CodeStyle.WrapStyle wrapAssignOps()

getBlankLinesBeforePackage

public int getBlankLinesBeforePackage()

getBlankLinesAfterPackage

public int getBlankLinesAfterPackage()

getBlankLinesBeforeImports

public int getBlankLinesBeforeImports()

getBlankLinesAfterImports

public int getBlankLinesAfterImports()

getBlankLinesBeforeClass

public int getBlankLinesBeforeClass()

getBlankLinesAfterClass

public int getBlankLinesAfterClass()

getBlankLinesAfterClassHeader

public int getBlankLinesAfterClassHeader()

getBlankLinesBeforeFields

public int getBlankLinesBeforeFields()

getBlankLinesAfterFields

public int getBlankLinesAfterFields()

getBlankLinesBeforeMethods

public int getBlankLinesBeforeMethods()

getBlankLinesAfterMethods

public int getBlankLinesAfterMethods()

spaceBeforeWhile

public boolean spaceBeforeWhile()

spaceBeforeElse

public boolean spaceBeforeElse()

spaceBeforeCatch

public boolean spaceBeforeCatch()

spaceBeforeFinally

public boolean spaceBeforeFinally()

spaceBeforeMethodDeclParen

public boolean spaceBeforeMethodDeclParen()

spaceBeforeMethodCallParen

public boolean spaceBeforeMethodCallParen()

spaceBeforeIfParen

public boolean spaceBeforeIfParen()

spaceBeforeForParen

public boolean spaceBeforeForParen()

spaceBeforeWhileParen

public boolean spaceBeforeWhileParen()

spaceBeforeTryParen

public boolean spaceBeforeTryParen()
Since:
0.67

spaceBeforeCatchParen

public boolean spaceBeforeCatchParen()

spaceBeforeSwitchParen

public boolean spaceBeforeSwitchParen()

spaceBeforeSynchronizedParen

public boolean spaceBeforeSynchronizedParen()

spaceBeforeAnnotationParen

public boolean spaceBeforeAnnotationParen()

spaceAroundUnaryOps

public boolean spaceAroundUnaryOps()

spaceAroundBinaryOps

public boolean spaceAroundBinaryOps()

spaceAroundTernaryOps

public boolean spaceAroundTernaryOps()

spaceAroundAssignOps

public boolean spaceAroundAssignOps()

spaceBeforeClassDeclLeftBrace

public boolean spaceBeforeClassDeclLeftBrace()

spaceBeforeMethodDeclLeftBrace

public boolean spaceBeforeMethodDeclLeftBrace()

spaceBeforeIfLeftBrace

public boolean spaceBeforeIfLeftBrace()

spaceBeforeElseLeftBrace

public boolean spaceBeforeElseLeftBrace()

spaceBeforeWhileLeftBrace

public boolean spaceBeforeWhileLeftBrace()

spaceBeforeForLeftBrace

public boolean spaceBeforeForLeftBrace()

spaceBeforeDoLeftBrace

public boolean spaceBeforeDoLeftBrace()

spaceBeforeSwitchLeftBrace

public boolean spaceBeforeSwitchLeftBrace()

spaceBeforeTryLeftBrace

public boolean spaceBeforeTryLeftBrace()

spaceBeforeCatchLeftBrace

public boolean spaceBeforeCatchLeftBrace()

spaceBeforeFinallyLeftBrace

public boolean spaceBeforeFinallyLeftBrace()

spaceBeforeSynchronizedLeftBrace

public boolean spaceBeforeSynchronizedLeftBrace()

spaceBeforeStaticInitLeftBrace

public boolean spaceBeforeStaticInitLeftBrace()

spaceBeforeArrayInitLeftBrace

public boolean spaceBeforeArrayInitLeftBrace()

spaceWithinParens

public boolean spaceWithinParens()

spaceWithinMethodDeclParens

public boolean spaceWithinMethodDeclParens()

spaceWithinMethodCallParens

public boolean spaceWithinMethodCallParens()

spaceWithinIfParens

public boolean spaceWithinIfParens()

spaceWithinForParens

public boolean spaceWithinForParens()

spaceWithinWhileParens

public boolean spaceWithinWhileParens()

spaceWithinSwitchParens

public boolean spaceWithinSwitchParens()

spaceWithinTryParens

public boolean spaceWithinTryParens()
Since:
0.67

spaceWithinCatchParens

public boolean spaceWithinCatchParens()

spaceWithinSynchronizedParens

public boolean spaceWithinSynchronizedParens()

spaceWithinTypeCastParens

public boolean spaceWithinTypeCastParens()

spaceWithinAnnotationParens

public boolean spaceWithinAnnotationParens()

spaceWithinBraces

public boolean spaceWithinBraces()

spaceWithinArrayInitBrackets

public boolean spaceWithinArrayInitBrackets()

spaceBeforeComma

public boolean spaceBeforeComma()

spaceAfterComma

public boolean spaceAfterComma()

spaceBeforeSemi

public boolean spaceBeforeSemi()

spaceAfterSemi

public boolean spaceAfterSemi()

spaceBeforeColon

public boolean spaceBeforeColon()

spaceAfterColon

public boolean spaceAfterColon()

spaceAfterTypeCast

public boolean spaceAfterTypeCast()

useSingleClassImport

public boolean useSingleClassImport()

useFQNs

public boolean useFQNs()

countForUsingStarImport

public int countForUsingStarImport()

countForUsingStaticStarImport

public int countForUsingStaticStarImport()

getPackagesForStarImport

public String[] getPackagesForStarImport()

org.netbeans.modules.java.source 0.80.1 17

Built on December 5 2011.  |  Portions Copyright 1997-2011 Sun Microsystems, Inc. All rights reserved.