Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| org.netbeans.modules.editor.codetemplates/1 1.2.22
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.netbeans.lib.editor.codetemplates.api
Class CodeTemplate

    java.lang.Object
      org.netbeans.lib.editor.codetemplates.api.CodeTemplate

    public final class CodeTemplate

extends Object

Code template is represented by a parametrized text that, after pre-processing, can be pasted into a given text component.
Code template instances are either persistent (can be retrieved by `CodeTemplateManager.getCodeTemplates()`) or temporary code templates that can be created by `CodeTemplateManager.createTemporary(String)`.

Method Summary
`String` | `getAbbreviation()` Get abbreviation that triggers expansion of this code template.
`String` | `getDescription()` Get textual description of this code template.
`String` | `getParametrizedText()` Get the parametrized text of this code template.
`void` | `insert(JTextComponent component)` Insert this code template into the given text component at the caret position.
`String` | `toString()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Method Detail

### insert

    public void insert(JTextComponent component)

  Insert this code template into the given text component at the caret position.

  Parameters:
    `component` - non-null text component.

### getAbbreviation

    public String getAbbreviation()

  Get abbreviation that triggers expansion of this code template.

  Returns:
    non-null abbreviation that expands to this template.

### getDescription

    public String getDescription()

  Get textual description of this code template.
  It's being displayed e.g. in the code completion window.

  Returns:
    non-null description text.

### getParametrizedText

    public String getParametrizedText()

  Get the parametrized text of this code template.
  The parameters have form "${...}" and there can be arbitrary number of them.

  Returns:
    non-null parametrized text.

### toString

    public String toString()

  Overrides:
    `toString` in class `Object`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| org.netbeans.modules.editor.codetemplates/1 1.2.22
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Built on December 7 2006. | Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.