Copyright 2009,2010, Lapetus Systems Ltd. (All rights reserved)

com.lapetus_ltd.api.db.gui
Interface ILptsCodeInsertListener


public interface ILptsCodeInsertListener

Class Description : This listener informs the listener of a plugin code insert.

This is used by a plugin to insert the generated code into an editor.

$LastChangedRevision: 1197 $
$LastChangedDate:: 2010-11-22 10:06:06#$


Method Summary
 TLptsCodeInsertRequest getCodeToBeGenerated(java.awt.Component source)
          This is sent to the listener before the 'newCodeGenerated' below.
 void newCodeGenerated(java.lang.String imports, java.lang.String code, TLptsCodeInsertRequest insertRequest)
           This is used to indicate that a new piece of code has been generated by a user action.
 

Method Detail

getCodeToBeGenerated

TLptsCodeInsertRequest getCodeToBeGenerated(java.awt.Component source)
This is sent to the listener before the 'newCodeGenerated' below. The listener then has the opportunity of specifying the format of the code to be returned.

Parameters:
source - This is the dialog that generated the code.
Returns:
The listener needs to return the request with the specified parameters. Returning null will stop the code generation and the 'newCodeGenerated' function will not be called on the listener.

newCodeGenerated

void newCodeGenerated(java.lang.String imports,
                      java.lang.String code,
                      TLptsCodeInsertRequest insertRequest)

This is used to indicate that a new piece of code has been generated by a user action.

Parameters:
imports - The IMPORTS section of the code. This can be null if the request above was for no IMPORTS.
code - This is the actual code to insert and can be the full class or partial, depending on the request.
insertRequest - This is the request returned by the listener through 'getCodeToBeGenerated'.


Copyright 2009,2010, Lapetus Systems Ltd. (All rights reserved)