org.acm.seguin.ide.jdeveloper
Class JDeveloperPrettyPrinter

java.lang.Object
  extended by org.acm.seguin.pretty.PrettyPrintFile
      extended by org.acm.seguin.pretty.PrettyPrintString
          extended by org.acm.seguin.pretty.PrettyPrintFromIDE
              extended by org.acm.seguin.ide.jdeveloper.JDeveloperPrettyPrinter

public class JDeveloperPrettyPrinter
extends PrettyPrintFromIDE

The PrettyPrinter Extension for Oracle jDeveloper 9i.

Author:
Guenther Bodlak

Constructor Summary
JDeveloperPrettyPrinter()
          Constructor for the JDeveloperPrettyPrinter object
 
Method Summary
 boolean canShutdown()
          The AddinManager calls this method to see if this Addin is ready to shut down before the IDE terminates.
 void checkCommands(Context context, Controller activeController)
          checkCommands() should be called on the controller associated with the active view whenever the Context changes.
static javax.swing.Icon doLoadIcon(java.lang.String gifName)
          Loads the icon.
protected  int getLineNumber()
          Gets the lineNumber attribute of the PrettyPrinterAddin object
protected  java.lang.String getStringFromIDE()
          Gets the stringFromIDE attribute of the PrettyPrinterAddin object
 boolean handleEvent(IdeAction action, Context context)
          We call the PrettyPrinter ...
 float ideVersion()
          The AddinManager calls this method to request the IDE version number for which this Addin was written and tested against.
 void initialize()
          The AddinManager calls this method at startup time to allow initialization.
static boolean isMenuAvailable(Context context)
          This method is called to see if a Menu should be Enabled or Disabled The code here can be arbitrarily complex to determine the availability.
static boolean NodeIsFileType(Context context, java.lang.String extension)
          Description of the Method
protected  void setLineNumber(int iLine)
          Sets the lineNumber attribute of the PrettyPrinterAddin object
protected  void setStringInIDE(java.lang.String value)
          Sets the stringInIDE attribute of the PrettyPrinterAddin object
 void shutdown()
          The AddinManager calls this method to allow an Addin to release any resources held before the IDE shuts down.
 Controller supervisor()
          Gets the supervising controller if any associated with this Controller.
 boolean update(IdeAction action, Context context)
          This method updates the enabled status of the specified action within the specified context.
 float version()
          The AddinManager calls this method to request the version number of this addin (1.0f).
 
Methods inherited from class org.acm.seguin.pretty.PrettyPrintFromIDE
getPrintData, prettyPrintCurrentWindow
 
Methods inherited from class org.acm.seguin.pretty.PrettyPrintString
getOutputBuffer, getWriter, resetOutputBuffer, setInputString
 
Methods inherited from class org.acm.seguin.pretty.PrettyPrintFile
apply, apply, getParserFactory, isApplicable, postApply, setAsk, setParserFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDeveloperPrettyPrinter

public JDeveloperPrettyPrinter()
Constructor for the JDeveloperPrettyPrinter object

Method Detail

doLoadIcon

public static final javax.swing.Icon doLoadIcon(java.lang.String gifName)
Loads the icon.

Parameters:
gifName - Description of the Parameter
Returns:
the Icon

NodeIsFileType

public static boolean NodeIsFileType(Context context,
                                     java.lang.String extension)
Description of the Method

Parameters:
context - Description of the Parameter
extension - Description of the Parameter
Returns:
Description of the Return Value

isMenuAvailable

public static boolean isMenuAvailable(Context context)
This method is called to see if a Menu should be Enabled or Disabled The code here can be arbitrarily complex to determine the availability.

Parameters:
context - - the Current Context to examine to determine true/false result
Returns:
true if the Action should be enabled, false otherwise

version

public float version()
The AddinManager calls this method to request the version number of this addin (1.0f).
This is different then the ideVersion which represents the version of the JDeveloper IDE for which this Addin was written and tested against.

Returns:
the version number of this Addin (e.g. 1.0f).

ideVersion

public float ideVersion()
The AddinManager calls this method to request the IDE version number for which this Addin was written and tested against.
Returning the wrong version number will tell the IDE to reject this Addin and not load it.
Note: This is different then the version method which represents the version number for this particular Addin.

Returns:
the IDE version number oracle.ide.Ide.IDE_VERSION.

canShutdown

public boolean canShutdown()
The AddinManager calls this method to see if this Addin is ready to shut down before the IDE terminates.

Returns:
allways true

shutdown

public void shutdown()
The AddinManager calls this method to allow an Addin to release any resources held before the IDE shuts down. This can include things such as saving the state of the Addin, Closing connections, etc. *


initialize

public void initialize()
The AddinManager calls this method at startup time to allow initialization.


supervisor

public Controller supervisor()
Gets the supervising controller if any associated with this Controller. This method allows multiple custom/specific controllers to allow common processing for update()/checkCommands() to be done by a common Controller (supervisor).

Returns:
null

handleEvent

public boolean handleEvent(IdeAction action,
                           Context context)
We call the PrettyPrinter ...

Parameters:
action - action the IdeAction whose command (ID) is to be executed.
context - the current context under which this action has been invoked.
Returns:
true if method carried out the specified command, otherwise return false.

update

public boolean update(IdeAction action,
                      Context context)
This method updates the enabled status of the specified action within the specified context.

Parameters:
action - action whose command is to be executed.
context - the current context
Returns:
true if the controller handles the specified command.

checkCommands

public void checkCommands(Context context,
                          Controller activeController)
checkCommands() should be called on the controller associated with the active view whenever the Context changes.

Parameters:
context - the current context. Null values are acceptable.
activeController - the controller associated with the active view. Null values are acceptable.

setStringInIDE

protected void setStringInIDE(java.lang.String value)
Sets the stringInIDE attribute of the PrettyPrinterAddin object

Specified by:
setStringInIDE in class PrettyPrintFromIDE
Parameters:
value - The new stringInIDE value

getStringFromIDE

protected java.lang.String getStringFromIDE()
Gets the stringFromIDE attribute of the PrettyPrinterAddin object

Specified by:
getStringFromIDE in class PrettyPrintFromIDE
Returns:
The stringFromIDE value

getLineNumber

protected int getLineNumber()
Gets the lineNumber attribute of the PrettyPrinterAddin object

Specified by:
getLineNumber in class PrettyPrintFromIDE
Returns:
The lineNumber value

setLineNumber

protected void setLineNumber(int iLine)
Sets the lineNumber attribute of the PrettyPrinterAddin object

Specified by:
setLineNumber in class PrettyPrintFromIDE
Parameters:
iLine - The new lineNumber value