org.acm.seguin.ide.common
Class IDEPlugin

java.lang.Object
  extended by org.acm.seguin.ide.common.IDEPlugin

public class IDEPlugin
extends java.lang.Object

Description of the Class

Author:
Chris Seguin

Constructor Summary
IDEPlugin()
           
 
Method Summary
static void addAnnotation(java.awt.Frame view, java.lang.Object buffer, int type, int lineNo, java.lang.String description)
          Adds an annotation to an ide buffer.
static boolean bufferContainsJavaSource(java.awt.Frame view, java.lang.Object buffer)
          Does the buffer contain Java source code.
static void bufferNavigatorTree(java.awt.Frame view, java.lang.Object buffer, javax.swing.tree.TreeNode node)
          Indicates that a buffer has been parsed and that a navigator tree of the source is available.
static void bufferParsed(java.awt.Frame view, java.lang.Object buffer, net.sourceforge.jrefactory.ast.Node compilationUnit)
          Indicates that a buffer has been parsed and that an Abstract Syntax Tree is available.
static void checkAllOpenBuffers(java.awt.Frame view)
          Description of the Method
static void checkBuffer(java.awt.Frame view, java.lang.Object buffer)
          Description of the Method
static void checkDirectory(java.awt.Frame view, boolean recursive)
          Description of the Method
static void clearAnnotations(java.awt.Frame view, java.lang.Object buffer, int type)
          Clears all annotation for an ide buffer.
static void cpdAllOpenBuffers(java.awt.Frame view)
          Description of the Method
static void cpdBuffer(java.awt.Frame view, java.lang.Object buffer)
          Description of the Method
static void cpdDir(java.awt.Frame view, boolean recursive)
          Description of the Method
static java.lang.Object getCurrentBuffer(java.awt.Frame view)
          Get the current (atcive) buffer.
static java.awt.Frame getEditorFrame()
          Returns the frame that contains the editor.
static java.io.File getFile(java.awt.Frame view, java.lang.Object buffer)
          Gets the file that is being edited
static java.lang.String getFilePathForBuffer(java.lang.Object buffer)
          Description of the Method
static int getLineCount(java.lang.Object buffer)
          Description of the Method
static int getLineEndOffset(java.lang.Object buffer, int end)
          Description of the Method
static int getLineNumber(java.awt.Frame view, java.lang.Object buffer)
          Get the line number of the cursor within the current buffer.
static int getLineStartOffset(java.lang.Object buffer, int begin)
          Description of the Method
static java.lang.String getProjectName(java.awt.Frame view, java.lang.Object buffer)
          Description of the Method
static java.lang.String[] getProjects(java.awt.Frame parent)
          Gets the Projects attribute of the IDEPlugin class
static PropertiesFile getProperties(java.lang.String type, java.lang.String project)
          Gets the Properties attribute of the IDEPlugin class
static java.lang.String getProperty(java.lang.String prop)
          Gets the Property attribute of the IDEPlugin class
static java.lang.String getProperty(java.lang.String prop, java.lang.String deflt)
          Gets the Property attribute of the IDEPlugin class
static java.lang.String getText(java.awt.Frame view, java.lang.Object buffer)
          Description of the Method
static void goToBuffer(java.awt.Frame view, java.lang.Object buffer)
          Description of the Method
static void hideWaitCursor(java.awt.Frame parent)
          Description of the Method
static javax.swing.Icon loadIcon(java.lang.String name)
          Load an icon from the IDE
static void log(int urgency, java.lang.Object source, java.lang.Object message)
          Description of the Method
static void moveCaretPosition(java.awt.Frame view, java.lang.Object buffer, int start)
          Description of the Method
static java.lang.Object openFile(java.awt.Frame view, java.lang.String fileName)
          Description of the Method
static void runInAWTThread(java.lang.Runnable runnable)
          Description of the Method
static void saveProperties()
          Description of the Method
static void setBuffer(java.awt.Frame view, java.lang.Object buffer)
          Description of the Method
static void setLineNumber(java.awt.Frame view, java.lang.Object buffer, int lineNumber)
          Get the line number of the cursor within the current buffer.
static void setPlugin(IDEInterface ideIf)
          Sets the Plugin attribute of the IDEPlugin class
static void setSelection(java.awt.Frame view, java.lang.Object buffer, int start, int end)
          Description of the Method
static void setText(java.awt.Frame view, java.lang.Object buffer, java.lang.String value)
          Sets the string in the IDE
static void showWaitCursor(java.awt.Frame parent)
          Description of the Method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IDEPlugin

public IDEPlugin()
Method Detail

setPlugin

public static void setPlugin(IDEInterface ideIf)
Sets the Plugin attribute of the IDEPlugin class

Parameters:
ideIf - The new Plugin value

setBuffer

public static void setBuffer(java.awt.Frame view,
                             java.lang.Object buffer)
Description of the Method

Parameters:
view - Description of Parameter
buffer - The new Buffer value

setSelection

public static void setSelection(java.awt.Frame view,
                                java.lang.Object buffer,
                                int start,
                                int end)
Description of the Method

Parameters:
view - Description of Parameter
start - The new Selection value
end - The new Selection value

getProperty

public static java.lang.String getProperty(java.lang.String prop)
Gets the Property attribute of the IDEPlugin class

Parameters:
prop - Description of Parameter
Returns:
The Property value

getProperty

public static java.lang.String getProperty(java.lang.String prop,
                                           java.lang.String deflt)
Gets the Property attribute of the IDEPlugin class

Parameters:
prop - Description of Parameter
deflt - Description of Parameter
Returns:
The Property value

getProjects

public static java.lang.String[] getProjects(java.awt.Frame parent)
Gets the Projects attribute of the IDEPlugin class

Parameters:
parent - Description of Parameter
Returns:
The Projects value

getProperties

public static PropertiesFile getProperties(java.lang.String type,
                                           java.lang.String project)
Gets the Properties attribute of the IDEPlugin class

Parameters:
type - Description of Parameter
project - Description of Parameter
Returns:
The Properties value

getLineStartOffset

public static int getLineStartOffset(java.lang.Object buffer,
                                     int begin)
Description of the Method

Parameters:
buffer - Description of Parameter
begin - Description of Parameter
Returns:
The BeginLine value

getLineEndOffset

public static int getLineEndOffset(java.lang.Object buffer,
                                   int end)
Description of the Method

Parameters:
buffer - Description of Parameter
end - Description of Parameter
Returns:
The LineEndOffset value

getText

public static java.lang.String getText(java.awt.Frame view,
                                       java.lang.Object buffer)
Description of the Method

Parameters:
view - Description of Parameter
Returns:
The Text value

getLineCount

public static int getLineCount(java.lang.Object buffer)
Description of the Method

Parameters:
buffer - Description of Parameter
Returns:
The LineCount value

getProjectName

public static java.lang.String getProjectName(java.awt.Frame view,
                                              java.lang.Object buffer)
Description of the Method

Parameters:
view - Description of Parameter
buffer - Description of Parameter
Returns:
The ProjectName value

showWaitCursor

public static void showWaitCursor(java.awt.Frame parent)
Description of the Method

Parameters:
parent - Description of Parameter

hideWaitCursor

public static void hideWaitCursor(java.awt.Frame parent)
Description of the Method

Parameters:
parent - Description of Parameter

log

public static void log(int urgency,
                       java.lang.Object source,
                       java.lang.Object message)
Description of the Method

Parameters:
urgency - Description of Parameter
source - Description of Parameter
message - Description of Parameter

cpdBuffer

public static void cpdBuffer(java.awt.Frame view,
                             java.lang.Object buffer)
                      throws java.io.IOException
Description of the Method

Parameters:
view - Description of Parameter
Throws:
java.io.IOException - Description of Exception

cpdAllOpenBuffers

public static void cpdAllOpenBuffers(java.awt.Frame view)
                              throws java.io.IOException
Description of the Method

Parameters:
view - Description of Parameter
Throws:
java.io.IOException - Description of Exception

cpdDir

public static void cpdDir(java.awt.Frame view,
                          boolean recursive)
                   throws java.io.IOException
Description of the Method

Parameters:
view - Description of Parameter
recursive - Description of Parameter
Throws:
java.io.IOException - Description of Exception

openFile

public static java.lang.Object openFile(java.awt.Frame view,
                                        java.lang.String fileName)
                                 throws java.io.IOException
Description of the Method

Parameters:
view - Description of Parameter
fileName - Description of Parameter
Returns:
Description of the Returned Value
Throws:
java.io.IOException - Description of Exception

moveCaretPosition

public static void moveCaretPosition(java.awt.Frame view,
                                     java.lang.Object buffer,
                                     int start)
Description of the Method

Parameters:
view - Description of Parameter
start - Description of Parameter

runInAWTThread

public static void runInAWTThread(java.lang.Runnable runnable)
Description of the Method

Parameters:
runnable - Description of Parameter

checkBuffer

public static void checkBuffer(java.awt.Frame view,
                               java.lang.Object buffer)
Description of the Method

Parameters:
view - Description of Parameter

checkAllOpenBuffers

public static void checkAllOpenBuffers(java.awt.Frame view)
Description of the Method

Parameters:
view - Description of Parameter

checkDirectory

public static void checkDirectory(java.awt.Frame view,
                                  boolean recursive)
Description of the Method

Parameters:
view - Description of Parameter
recursive - Description of Parameter

goToBuffer

public static void goToBuffer(java.awt.Frame view,
                              java.lang.Object buffer)
Description of the Method

Parameters:
view - Description of Parameter
buffer - Description of Parameter

saveProperties

public static void saveProperties()
Description of the Method

Parameters:
view - Description of Parameter
buffer - Description of Parameter

getFilePathForBuffer

public static java.lang.String getFilePathForBuffer(java.lang.Object buffer)
Description of the Method

Parameters:
buffer - Description of Parameter
Returns:
The File path for this buffer

loadIcon

public static javax.swing.Icon loadIcon(java.lang.String name)
Load an icon from the IDE

Parameters:
name - The name of the icon.
Returns:
An icon (or null if the icon cannot be found).

getEditorFrame

public static java.awt.Frame getEditorFrame()
Returns the frame that contains the editor. If this is not available or you want dialog boxes to be centered on the screen return null from this operation.

Returns:
the frame

getCurrentBuffer

public static java.lang.Object getCurrentBuffer(java.awt.Frame view)
Get the current (atcive) buffer.

Parameters:
view - The frame containing the IDE.
Returns:
The active buffer or null if no active buffer.

getLineNumber

public static int getLineNumber(java.awt.Frame view,
                                java.lang.Object buffer)
Get the line number of the cursor within the current buffer.

Parameters:
view - The frame containing the IDE.
Returns:
The ine number of the cursor in the current buffer, or -1 if no current buffer.

setLineNumber

public static void setLineNumber(java.awt.Frame view,
                                 java.lang.Object buffer,
                                 int lineNumber)
Get the line number of the cursor within the current buffer.

Parameters:
view - The frame containing the IDE.
buffer - Description of Parameter

bufferContainsJavaSource

public static boolean bufferContainsJavaSource(java.awt.Frame view,
                                               java.lang.Object buffer)
Does the buffer contain Java source code.

Parameters:
view - The frame containing the IDE.
buffer - Description of Parameter
Returns:
true if the buffer contains Java source code, false otherwise.

setText

public static void setText(java.awt.Frame view,
                           java.lang.Object buffer,
                           java.lang.String value)
Sets the string in the IDE

Parameters:
view - The frame containing the IDE.
buffer - Description of Parameter
value - The new file contained in a string

getFile

public static java.io.File getFile(java.awt.Frame view,
                                   java.lang.Object buffer)
Gets the file that is being edited

Returns:
The File value

bufferParsed

public static void bufferParsed(java.awt.Frame view,
                                java.lang.Object buffer,
                                net.sourceforge.jrefactory.ast.Node compilationUnit)
Indicates that a buffer has been parsed and that an Abstract Syntax Tree is available.

Parameters:
view - The frame containing the IDE.
buffer - The buffer (containing Java Source) that has been parsed.
compilationUnit - The root node of the AST.

bufferNavigatorTree

public static void bufferNavigatorTree(java.awt.Frame view,
                                       java.lang.Object buffer,
                                       javax.swing.tree.TreeNode node)
Indicates that a buffer has been parsed and that a navigator tree of the source is available.

Parameters:
view - The frame containing the IDE.
buffer - The buffer (containing Java Source) that has been parsed.
node - The root node of the tree.

addAnnotation

public static void addAnnotation(java.awt.Frame view,
                                 java.lang.Object buffer,
                                 int type,
                                 int lineNo,
                                 java.lang.String description)
Adds an annotation to an ide buffer.

Parameters:
view - The frame containing the IDE.
buffer - The buffer (containing Java Source) that has been parsed.
type - either CODING_STANDARDS or CUT_AND_PASTE_DETECTION
lineNo - The line number of the annotation.
description - The annotation

clearAnnotations

public static void clearAnnotations(java.awt.Frame view,
                                    java.lang.Object buffer,
                                    int type)
Clears all annotation for an ide buffer.

Parameters:
view - The frame containing the IDE.
buffer - The buffer (containing Java Source) that has been parsed.
type - either CODING_STANDARDS or CUT_AND_PASTE_DETECTION