com.borland.jbuilder.jot
Class JotCodeGen

java.lang.Object
  |
  +--com.borland.jbuilder.jot.JotCodeGen

public class JotCodeGen
extends java.lang.Object

This interface encapsulates the user's code-formatting preferences such as tabsize, positioning of braces, adapter style, etc.


Field Summary
static int ANONYMOUS_INNER_ADAPTER_TYPE
          Generate event adapters as an anonymous inner class
static java.lang.String BEANS_INSTANTIATE
           
static java.lang.String BRACE_STYLE
           
static java.lang.String CODE_STYLE
           
static java.lang.String EVENT_MATCH
           
static java.lang.String EVENT_STYLE
           
static java.lang.String INSTANCE_VISIBILITY
           
static int NAMED_CLASS_ADAPTER_TYPE
          Generate event adapters as a separate named class
static java.lang.String USE_TABS
           
 
Constructor Summary
JotCodeGen()
           
 
Method Summary
static int addBasicOffset(int level)
           
static int addBraceOffset(int level)
           
static int addContinuedBraceOffset(int level)
           
static int addContinuedOffset(int level)
           
static int addLabelOffset(int level)
           
static java.lang.String getBraces(int indentLevel)
           
static java.lang.String getContinuedBraces(int indentLevel)
           
static int getEventAdapterType()
          Returns the logical type of event adapter to use for events.
static java.lang.String getIndent(int indentLevel)
          Returns a string containing the proper whitespace to indent to the given level.
static java.lang.String getIndentedBraces(int level)
           
static java.lang.String getIndentWhitespace(int level)
           
static int getInstanceVisibility()
          Returns the Modifier constant that specifies what visibility to use for generated instance variables.
static java.lang.String getLabelIndent(int indentLevel)
           
static void initProperties(JBProject project)
          Interrogates the user's property settings concerning code generation style and sets the global(!) properties used by the rest of JOT and CMT
static boolean isMatchEventStyle()
          Returns true if we try to match the user's event adapter style
static boolean isUseBeansInstantiate()
          Returns true if the user prefers to use use Beans.instantiate as the default technique for instantiating a component.
static void setEventAdapterType(int type)
          Specifies the logical type of event adapter to use for events.
static void setInstanceVisibility(int visibility)
          Set the visibility to use for generated instance variables.
static void setMatchEventStyle(boolean yesNo)
          Specifies whether JOT should try to match the user's event adapter style.
static void setUseBeansInstantiate(boolean yesNo)
          Specifies whether to use Beans.instantiate as the default technique for instantiating a component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAMED_CLASS_ADAPTER_TYPE

public static final int NAMED_CLASS_ADAPTER_TYPE
Generate event adapters as a separate named class
See Also:
setEventAdapterType

ANONYMOUS_INNER_ADAPTER_TYPE

public static final int ANONYMOUS_INNER_ADAPTER_TYPE
Generate event adapters as an anonymous inner class
See Also:
setEventAdapterType

BRACE_STYLE

public static final java.lang.String BRACE_STYLE

EVENT_STYLE

public static final java.lang.String EVENT_STYLE

EVENT_MATCH

public static final java.lang.String EVENT_MATCH

USE_TABS

public static final java.lang.String USE_TABS

BEANS_INSTANTIATE

public static final java.lang.String BEANS_INSTANTIATE

INSTANCE_VISIBILITY

public static final java.lang.String INSTANCE_VISIBILITY

CODE_STYLE

public static final java.lang.String CODE_STYLE
Constructor Detail

JotCodeGen

public JotCodeGen()
Method Detail

initProperties

public static void initProperties(JBProject project)
Interrogates the user's property settings concerning code generation style and sets the global(!) properties used by the rest of JOT and CMT

getInstanceVisibility

public static int getInstanceVisibility()
Returns the Modifier constant that specifies what visibility to use for generated instance variables.
Returns:
Returns the constant that specifies what visibility to use for generated instance variables. Valid values are:
  • Modifier.PRIVATE
  • 0 (used for package visibility)
  • Modifier.PROTECTED
  • Modifier.PUBLIC
    See Also:
    setInstanceVisibility(int)

  • setInstanceVisibility

    public static void setInstanceVisibility(int visibility)
    Set the visibility to use for generated instance variables.
    Parameters:
    visibility - The constant that specifies what visibility to use for generated instance variables. Valid values are:
  • Modifier.PRIVATE
  • 0 (used for package visibility)
  • Modifier.PROTECTED
  • Modifier.PUBLIC
    See Also:
    getInstanceVisibility()

  • isUseBeansInstantiate

    public static boolean isUseBeansInstantiate()
    Returns true if the user prefers to use use Beans.instantiate as the default technique for instantiating a component. Otherwise, a new expression is used.

    setUseBeansInstantiate

    public static void setUseBeansInstantiate(boolean yesNo)
    Specifies whether to use Beans.instantiate as the default technique for instantiating a component.

    getEventAdapterType

    public static int getEventAdapterType()
    Returns the logical type of event adapter to use for events. If the return value is NAMED_CLASS_ADAPTER_TYPE, then a member class is used for the adapter. If the return value is ANONYMOUS_INNER_ADAPTER_TYPE, then event adapters are generated as anonymous classes.

    setEventAdapterType

    public static void setEventAdapterType(int type)
    Specifies the logical type of event adapter to use for events. If the value is NAMED_CLASS_ADAPTER_TYPE, then a member class is used for the adapter. If the value is ANONYMOUS_INNER_ADAPTER_TYPE, then event adapters are generated as anonymous classes.

    isMatchEventStyle

    public static boolean isMatchEventStyle()
    Returns true if we try to match the user's event adapter style

    setMatchEventStyle

    public static void setMatchEventStyle(boolean yesNo)
    Specifies whether JOT should try to match the user's event adapter style.

    getIndent

    public static java.lang.String getIndent(int indentLevel)
    Returns a string containing the proper whitespace to indent to the given level. Will use tabs or spaces depending on isUseTabs

    getLabelIndent

    public static java.lang.String getLabelIndent(int indentLevel)

    getBraces

    public static java.lang.String getBraces(int indentLevel)

    getContinuedBraces

    public static java.lang.String getContinuedBraces(int indentLevel)

    addBasicOffset

    public static int addBasicOffset(int level)

    addBraceOffset

    public static int addBraceOffset(int level)

    addLabelOffset

    public static int addLabelOffset(int level)

    addContinuedOffset

    public static int addContinuedOffset(int level)

    addContinuedBraceOffset

    public static int addContinuedBraceOffset(int level)

    getIndentedBraces

    public static java.lang.String getIndentedBraces(int level)

    getIndentWhitespace

    public static java.lang.String getIndentWhitespace(int level)