站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc 5.5.1

CodeTemplate (NetBeans Editor Code Templates) - NetBeans API Javadoc 5.5.1

org.netbeans.modules.editor.codetemplates/1 1.2.31

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

java.lang.Object
  extended by 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

org.netbeans.modules.editor.codetemplates/1 1.2.31

Built on March 26 2007.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.