Return to PlugIns

com.kinabaloo.tji
Interface TJI


Fields

static int APPLET_PROJECT
           
static int APPLICATION_PROJECT
           
static int BOOKMARK_ADDED
           
static int BOOKMARK_REMOVED
           
static int CANCEL
           
static int CONSOLE_PROJECT
           
static int DOCUMENT_CHANGE
           
static int EDITOR_CHANGE
           
static int EMPTY_PROJECT
           
static int FILE_CHANGE
           
static int NO
           
static int PLUGIN_PROJECT
           
static int PROJECT_CHANGE
           
static int SERVLET_PROJECT
           
static int UTILITIES_PROJECT
           
static int YES
           

Methods

addEditMenuItem

public void addEditMenuItem(String itemName,
                            String moduleName,
                            String methodName, boolean allFileTypes)
Parameter methodName is the name of the method to be called when this editor menu item is selected by the user. It must have no parameters. Parameter moduleName must be the same as returned by getModuleName() Call from start method of TJIModule interface. Parameter allFileTypes : whether enabled for all file types or only java files.

addPopupEditMenuItem

public void addPopupEditMenuItem(String itemName,
                                 String moduleName,
                                 String methodName, boolean allFileTypes)
Parameter methodName is the name of the method to be called when this editor menu item is selected by the user. It must have no parameters. Parameter moduleName must be the same as returned by getModuleName() Call from start method of TJIModule interface. Parameter allFileTypes : whether enabled for all file types or only java files.

addSelectionPopupEditMenuItem

public void addSelectionPopupEditMenuItem(String itemName,
                                          String moduleName,
                                          String methodName, boolean allFileTypes)
Parameter methodName is the name of the method to be called when this editor menu item is selected by the user. It must have no parameters. Parameter moduleName must be the same as returned by getModuleName() Call from start method of TJIModule interface. Parameter allFileTypes : whether enabled for all file types or only java files.

addSelectionPopupMenu

public void addSelectionPopupMenu(String menuName,
                                  Vector menuData, boolean allFileTypes)
Vector menuData should contain String arrays of length 3 taking the following format : [String itemName, String moduleName, String methodName]. Parameter allFileTypes : whether enabled for all file types or only java files.

addPopupMenu

public void addPopupMenu(String menuName,
                         Vector menuData, boolean allFileTypes)
Vector menuData should contain String arrays of length 3 taking the following format : [String itemName, String moduleName, String methodName]. Parameter allFileTypes : whether enabled for all file types or only java files.

addEditMenu

public void addEditMenu(String menuName,
                        Vector menuData, boolean allFileTypes)
Adds a sub-menu to the main Edit menu. Vector menuData should contain String arrays of length 3 taking the following format : [String itemName, String moduleName, String methodName]. Parameter allFileTypes : whether enabled for all file types or only java files.

addProjectFile

public boolean addProjectFile(String s)
Adds a file to the current project.
Parameters:
s - : the full path of the file to add.

chooseDirectory

public Collection chooseDirectory(String msg,
                                  String startDirectory)
Lets the user select a directory using the IDE's File Browser. Returns a Collection with one String entry - the full path to the selected directory; or empty if no directory selected.
Parameters:
startDirectory - : use "" for default (+"/projects")

chooseFile

public Collection chooseFile(String msg,
                             boolean java,
                             boolean html,
                             boolean images,
                             boolean text,
                             boolean multipleSelection,
                             String startDirectory)
Lets the user select one or more files using the IDE's File Browser. Returns a Collection of String entries - the full paths to the selected files; or empty if no directory selected.
Parameters:
startDirectory - : use "" for default ([homePath]+"/projects")

clearBookMark

public void clearBookMark(int line)
Clears a bookmark in the current editor.

clearCurrentEditorSelection

public void clearCurrentEditorSelection()

closeProject

public void closeProject()
Closes the current project.

createProject

public boolean createProject(String nt)
Creates a new empty project, unopened.

formatTabs

public void formatTabs()

getCurrentEditorText

public String getCurrentEditorText()
Returns the current editor text. If current editor is in 'In Sections' mode, returns ALL text.

getCurrentEditorSelectionStart

public int getCurrentEditorSelectionStart()
Returns -1 if no current editor.

getCurrentEditorSelectionEnd

public int getCurrentEditorSelectionEnd()
Returns -1 if no current editor.

getCurrentEditorCaretPosition

public int getCurrentEditorCaretPosition()
Returns -1 if no current editor.

getLastChangedBookMarkLineNumber

public int getLastChangedBookMarkLineNumber()
Returns -1 if user has not yet made a bookmark change.

getParentFrame

public JFrame getParentFrame()
Returns the IDE's parent frame for creating dialogs.

getProjectName

public String getProjectName()
Returns an empty string ("") if no project is open.

getCurrentEditorDocument

public Document getCurrentEditorDocument()
Returns null if no editor open. Allows the examination of the document's elements (lines). By adding a DocumentListener to the document, one can be notified of edits. However, note that changes to the document to be made by the plugin should be made when method editOccurred() is called by the IDE; alternatively, place the code that changes the document within a Runnable started by SwingUtilities.invokeLater()

getCurrentPlugins

public Object[] getCurrentPlugins()
Returns the currently loaded plugins as an array of TJIModule.

getHTMLMain

public String getHTMLMain()

getJavaMain

public String getJavaMain()

getProjectDirectory

public String getProjectDirectory()

getProjectFiles

public Vector getProjectFiles()
Returns the project files in the current project; as full path strings. '/' is the directory separator. Returns an empty Vector if the project is empty; null if no project is open.

getProjectType

public int getProjectType()
Returns the current project type.

getProjectPackage

public String getProjectPackage()
Returns the current project package.

getSystemClip

public String getSystemClip()
Returns the current content of the system clipboard.

getUserInput

public String getUserInput(String title,
                           String msg,
                           String startText)
Dialog for requesting user input.

getOpenFiles

public Vector getOpenFiles()
Returns the OPEN project files in the current project; as full path strings. '/' is the directory separator. Returns an empty Vector if the project is empty; null if no project is open.

getCurrentFile

public String getCurrentFile()
Returns the full path of the current editor file. '/' is the directory separator. Returns "" if no editor open.

informationMessage

public void informationMessage(String message)
Dialog for providing a simple message.

isCurrentEditorInSections

public boolean isCurrentEditorInSections()

openProject

public void openProject(String name)
Opens the named project, if not already open.

proceedYNC

public int proceedYNC(String question)
Proceed? dialog. Yes, No or Cancel.

readFile

public String readFile(String fileName)
Read a text file. Param 'fileName' should provide the full path.

removeAllComments

public String removeAllComments(String txt)
Removes all comments from String txt. Would only be useful in situations where line number information is not required.

removeProjectFile

public void removeProjectFile(String s)
Removes the named project file.

setBookMark

public void setBookMark(int line)
Sets a bookmark in the current editor.

setProjectName

public boolean setProjectName(String name)
Sets the name of the current project.

setProjectPackage

public void setProjectPackage(String packageName,
                              boolean refactor)
Sets the current project package.

setProjectType

public void setProjectType(int type)
Sets the current project type.

setJavaMain

public boolean setJavaMain(String file)

setHTMLMain

public boolean setHTMLMain(String file)

setProjectDirectory

public void setProjectDirectory(String path,
                                boolean refactor)

setNormalCursor

public void setNormalCursor()

setWaitCursor

public void setWaitCursor()

startProgressBar

public void startProgressBar(String message)
Show a progress bar in a dialog with the provided message.

setProgressValue

public void setProgressValue(int percent)
Value 'percent' should range from 0 to 99. When 100 or greater, the progress bar dialog hides.

setStatusMessage

public void setStatusMessage(String msg)
Set "" to clear.

setErrorTreeData

public void setErrorTreeData(Collection c)
Each 'error' is a String in a Collection.
Format : description @ file # line
e.g. "Non-standard style @ c:/sdk1.4/projs/Shaker.java # 123"

setSystemClip

public void setSystemClip(String txt)
Sets the current content of the system clipboard.

setInSectionsFalse

public void setInSectionsFalse()
Return the current editor to 'Whole Text' mode.

setCurrentEditorText

public void setCurrentEditorText(String text)
Replace the current editor's text with this new text.

setCurrentEditorCaretPosition

public void setCurrentEditorCaretPosition(int pos)

warningMessage

public void warningMessage(String message)
Dialog for providing a warning message.

writeFile

public void writeFile(String fileName,
                      String txt)
Write a text file. Param 'fileName' should provide the full path.

getHomePath

public String getHomePath()
Returns the location of ide.jar

getJavaPath

public String getJavaPath()
Returns the location of javac (the sdk bin directory)

setUserHome

public void setUserHome(String path)

setUserMenuEnabled

public void setUserMenuEnabled(boolean enabled)

getKPanel

public JPanel getKPanel()

getKMenuBar

public JMenuBar getKMenuBar()

getKMenu

public JMenu getKMenu(String txt)

getKMenuItem

public JMenuItem getKMenuItem(String txt)

requestModuleFocus

public void requestModuleFocus(String name)
Requests that the named module get keyboard focus (it's tab be selected). Applies only to plugins that are GUI based.

returnFocus

public void returnFocus()
Returns focus to the main editor tab.

Return to PlugIns