com.spidasoftware.EclipseFormatter
Class SpidaFormatterPreferences

java.lang.Object
  extended by org.codehaus.groovy.eclipse.refactoring.formatter.FormatterPreferencesOnStore
      extended by com.spidasoftware.EclipseFormatter.SpidaFormatterPreferences
All Implemented Interfaces:
org.codehaus.groovy.eclipse.refactoring.formatter.IFormatterPreferences

public class SpidaFormatterPreferences
extends org.codehaus.groovy.eclipse.refactoring.formatter.FormatterPreferencesOnStore

This class provides the client with various methods to set his or her desired groovy formatting preferences. SpidaFormatterPreferences extends FormatterPreferencesOnStore which adds setter methods to allow the client to change the default groovy formatting preferences.

Author:
Nicholas Joodi

Constructor Summary
SpidaFormatterPreferences(org.eclipse.jface.preference.IPreferenceStore preferences)
          A one argument constructor that takes an IPreferenceStore object.
 
Method Summary
 int getBracesEnd()
          A no-argument method that will return the value for where the braces end relative to the last line of code of the method, field, conditional, etc.
 int getBracesStart()
          A no-argument method that will return a value for where the braces will start relative to the method, field, conditional declaration, etc.
 int getIndentationMultiline()
          A no-argument method that returns the indentation level for wrapped lines.
 int getIndentationSize()
          A no-argument method that returns the value for the indentation size.
 int getLongListLength()
          A no-argument method that returns the value for the length of a square bracket list.
 int getMaxLineLength()
          A no-argument method that will return the value for the maximum length of a line of code.
 int getTabSize()
          A no-argument method returns the value for the size of a tab.
 boolean isIndentEmptyLines()
          A no-argument method that returns a boolean indicating if the formatter is indenting empty lines.
 boolean isRemoveUnnecessarySemicolons()
          A no-argument method that returns the boolean indicating if the formatter will remove unnecessary semicolons.
 int setBracesEnd(int newValue)
          A one-argument method that will set a new value for where the braces end relative to the last line of code of the method, field, conditional, etc.
 int setBracesStart(int newValue)
          A one-argument method that will set a new value for where the braces will start relative to the method, field, conditional declaration, etc.
 int setIndentationMultiline(int newValue)
          A one-argument method that sets a new value for the indentation level for wrapped lines.
 int setIndentationSize(int newValue)
          A one-argument method that sets a new value for the indentation size.
 boolean setIndentEmptyLines(boolean newValue)
          A one-argument method that takes a boolean indicating if the formatter will indent empty lines.
 int setLongListLength(int newValue)
          A one-argument method that sets a new value for the length of a square bracket list.
 int setMaxLineLength(int newValue)
          A one-argument method that will set a new value for the maximum length of a line of code.
 boolean setRemoveUnnecessarySemicolons(boolean newValue)
          A one-argument method that takes a boolean indicating if the formatter will remove unnecessary semicolons.
 int setTabSize(int newValue)
          If the tabs are being used for formatting, then this one-argument method will set a new value for the size of a tab.
 boolean setUseTabs(boolean newValue)
          A one-argument method that will take a boolean indicating whether to use tabs or not.
 boolean useTabs()
          A no-argument method that will return a boolean indicating if the formatter is using tabs.
 
Methods inherited from class org.codehaus.groovy.eclipse.refactoring.formatter.FormatterPreferencesOnStore
isSmartPaste, refresh
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpidaFormatterPreferences

public SpidaFormatterPreferences(org.eclipse.jface.preference.IPreferenceStore preferences)
A one argument constructor that takes an IPreferenceStore object. If this object equals null, then the new SpidaFormatterPreferences object will have the default preferences.

Parameters:
preferences -
Method Detail

setBracesStart

public int setBracesStart(int newValue)
A one-argument method that will set a new value for where the braces will start relative to the method, field, conditional declaration, etc. Default value is 0.

Parameters:
newValue -
Returns:
int containg the value of where the braces will start.

setUseTabs

public boolean setUseTabs(boolean newValue)
A one-argument method that will take a boolean indicating whether to use tabs or not. Default value is true.

Parameters:
newValue -
Returns:
a boolean indicating if the formmatter will use tabs.

setBracesEnd

public int setBracesEnd(int newValue)
A one-argument method that will set a new value for where the braces end relative to the last line of code of the method, field, conditional, etc. Default value is 1.

Parameters:
newValue -
Returns:
int containg the value of where the braces will end.

setMaxLineLength

public int setMaxLineLength(int newValue)
A one-argument method that will set a new value for the maximum length of a line of code. The default value is 80.

Parameters:
newValue -
Returns:
int representing the maximum line length.

setIndentEmptyLines

public boolean setIndentEmptyLines(boolean newValue)
A one-argument method that takes a boolean indicating if the formatter will indent empty lines. The default value is false.

Parameters:
newValue -
Returns:
a boolean indicating if the formatter will indent empty lines.

setIndentationSize

public int setIndentationSize(int newValue)
A one-argument method that sets a new value for the indentation size. The default value is 4.

Parameters:
newValue -
Returns:
int representing the indentation size.

setTabSize

public int setTabSize(int newValue)
If the tabs are being used for formatting, then this one-argument method will set a new value for the size of a tab. the default value is 4.

Parameters:
newValue -
Returns:
int representing the tab size.

setRemoveUnnecessarySemicolons

public boolean setRemoveUnnecessarySemicolons(boolean newValue)
A one-argument method that takes a boolean indicating if the formatter will remove unnecessary semicolons. The default value is false.

Parameters:
newValue -
Returns:
boolean indicating if the formatter will remove unnecessary semicolons.

setLongListLength

public int setLongListLength(int newValue)
A one-argument method that sets a new value for the length of a square bracket list. The default value is 30.

Parameters:
newValue -
Returns:
int representing the length of a square bracket list.

setIndentationMultiline

public int setIndentationMultiline(int newValue)
A one-argument method that sets a new value for the indentation level for wrapped lines. The default value is 2.

Parameters:
newValue -
Returns:
int representing the indentation level for wrapped lines.

getBracesStart

public int getBracesStart()
A no-argument method that will return a value for where the braces will start relative to the method, field, conditional declaration, etc. Default value is 0.

Specified by:
getBracesStart in interface org.codehaus.groovy.eclipse.refactoring.formatter.IFormatterPreferences
Overrides:
getBracesStart in class org.codehaus.groovy.eclipse.refactoring.formatter.FormatterPreferencesOnStore
Returns:
int containg the value of where the braces will start.

useTabs

public boolean useTabs()
A no-argument method that will return a boolean indicating if the formatter is using tabs. Default value is true.

Specified by:
useTabs in interface org.codehaus.groovy.eclipse.refactoring.formatter.IFormatterPreferences
Overrides:
useTabs in class org.codehaus.groovy.eclipse.refactoring.formatter.FormatterPreferencesOnStore
Returns:
a boolean indicating if the formatter is using tabs

getBracesEnd

public int getBracesEnd()
A no-argument method that will return the value for where the braces end relative to the last line of code of the method, field, conditional, etc. Default value is 1.

Specified by:
getBracesEnd in interface org.codehaus.groovy.eclipse.refactoring.formatter.IFormatterPreferences
Overrides:
getBracesEnd in class org.codehaus.groovy.eclipse.refactoring.formatter.FormatterPreferencesOnStore
Returns:
int containg the value of where the braces will end.

getMaxLineLength

public int getMaxLineLength()
A no-argument method that will return the value for the maximum length of a line of code. The default value is 80.

Specified by:
getMaxLineLength in interface org.codehaus.groovy.eclipse.refactoring.formatter.IFormatterPreferences
Overrides:
getMaxLineLength in class org.codehaus.groovy.eclipse.refactoring.formatter.FormatterPreferencesOnStore
Returns:
int representing the maximum line length.

isIndentEmptyLines

public boolean isIndentEmptyLines()
A no-argument method that returns a boolean indicating if the formatter is indenting empty lines. The default value is false.

Specified by:
isIndentEmptyLines in interface org.codehaus.groovy.eclipse.refactoring.formatter.IFormatterPreferences
Overrides:
isIndentEmptyLines in class org.codehaus.groovy.eclipse.refactoring.formatter.FormatterPreferencesOnStore
Returns:
a boolean indicating if the formatter is indenting empty lines.

getIndentationSize

public int getIndentationSize()
A no-argument method that returns the value for the indentation size. The default value is 4.

Specified by:
getIndentationSize in interface org.codehaus.groovy.eclipse.refactoring.formatter.IFormatterPreferences
Overrides:
getIndentationSize in class org.codehaus.groovy.eclipse.refactoring.formatter.FormatterPreferencesOnStore
Returns:
int representing the indentation size.

getTabSize

public int getTabSize()
A no-argument method returns the value for the size of a tab. the default value is 4.

Specified by:
getTabSize in interface org.codehaus.groovy.eclipse.refactoring.formatter.IFormatterPreferences
Overrides:
getTabSize in class org.codehaus.groovy.eclipse.refactoring.formatter.FormatterPreferencesOnStore
Returns:
int representing the tab size.

isRemoveUnnecessarySemicolons

public boolean isRemoveUnnecessarySemicolons()
A no-argument method that returns the boolean indicating if the formatter will remove unnecessary semicolons. The default value is false.

Specified by:
isRemoveUnnecessarySemicolons in interface org.codehaus.groovy.eclipse.refactoring.formatter.IFormatterPreferences
Overrides:
isRemoveUnnecessarySemicolons in class org.codehaus.groovy.eclipse.refactoring.formatter.FormatterPreferencesOnStore
Returns:
boolean indicating if the formatter will remove unnecessary semicolons

getLongListLength

public int getLongListLength()
A no-argument method that returns the value for the length of a square bracket list. The default value is 30.

Specified by:
getLongListLength in interface org.codehaus.groovy.eclipse.refactoring.formatter.IFormatterPreferences
Overrides:
getLongListLength in class org.codehaus.groovy.eclipse.refactoring.formatter.FormatterPreferencesOnStore
Returns:
int representing the length of a square bracket list.

getIndentationMultiline

public int getIndentationMultiline()
A no-argument method that returns the indentation level for wrapped lines. The default value is 2.

Specified by:
getIndentationMultiline in interface org.codehaus.groovy.eclipse.refactoring.formatter.IFormatterPreferences
Overrides:
getIndentationMultiline in class org.codehaus.groovy.eclipse.refactoring.formatter.FormatterPreferencesOnStore
Returns:
int representing the the indentation level for wrapped lines.


Copyright © 2013. All rights reserved.