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

CodeTemplateProcessor (NetBeans Editor Code Templates) - NetBeans API Javadoc 5.0.0

 

org.netbeans.lib.editor.codetemplates.spi
Interface CodeTemplateProcessor


public interface CodeTemplateProcessor

Fills in default values of the code template's parameters and may react to user's typing modifications of the parameters.
Each processor is associated with CodeTemplateInsertRequest which was given to it during construction by CodeTemplateProcessorFactory.

See Also:
CodeTemplateProcessorFactory

Method Summary
 void parameterValueChanged(CodeTemplateParameter masterParameter, boolean typingChange)
          Notification that a master parameter's value has been modified by the user and the processor may need to react to it.
 void release()
          Notify the processor that the insert request which it services was already completed and there is no more work to do.
 void updateDefaultValues()
          Update the values of the parameters in the parsed code template before the code template gets physically inserted into the document.
 

Method Detail

updateDefaultValues

public void updateDefaultValues()
Update the values of the parameters in the parsed code template before the code template gets physically inserted into the document.
The processor may call CodeTemplateInsertRequest.getMasterParameters() to find the master parameters.
On each parameter CodeTemplateParameter.setValue(String) can be called. The value will be propagated to all slave parameters automatically.


parameterValueChanged

public void parameterValueChanged(CodeTemplateParameter masterParameter,
                                  boolean typingChange)
Notification that a master parameter's value has been modified by the user and the processor may need to react to it.
This notification is only done after the code template was physically inserted into the document i.e. CodeTemplateInsertRequest.isInserted() returns true.
Typically the processor either does nothing or it may change other parameter(s)' values. The change may occur in the same thread or it may post the parameter's new value recomputation and changing into another thread.

The processor is only allowed to change master parameters.

Slave parameter's changes are not notified at all.

Parameters:
masterParameter - master parameter that was changed.
typingChange - allows to react to user's typing immediately or only react once the active parameter gets changed e.g. by TAB.
true is passed if the parameter value was modified by user's typing. Some processors may want such immediate reaction.
Others will only react when this parameter is false which happens when at least one typing change occurred in the current active parameter and the active parameter is being changed by TAB or Shift-TAB or Enter.

release

public void release()
Notify the processor that the insert request which it services was already completed and there is no more work to do.
The processor can free possible resources related to the insert request processing.

See Also:
CodeTemplateInsertRequest.isReleased()

 

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