Extension SDK 9.0.5

oracle.jdeveloper.externaltools
Class ExternalTool

java.lang.Object
  extended byoracle.jdeveloper.externaltools.ExternalTool
All Implemented Interfaces:
Copyable

public abstract class ExternalTool
extends java.lang.Object
implements Copyable

The base class for external tools in JDeveloper.


Field Summary
static int AVAIL_ALWAYS
          Indicates that the tool is always available
static int AVAIL_REGEXP
          Indicates that the tool is available when the selection matches a regular expression.
static int AVAIL_SELECTION
          Indicates that the tool is available when there is a selection.
static int AVAIL_TYPES
          Indicates that the tool is available when the selection is included in a set of document types.
static int INTEG_CODE_EDITOR_CONTEXT_MENU_ITEM
          Indicates that the tool has a menu item in the code editor context menu.
static int INTEG_MAIN_WINDOW_TOOLBAR_BUTTON
          Indicates that the tool has a toolbar button in the main window toolbar.
static int INTEG_NAVIGATOR_CONTEXT_MENU_ITEM
          Indicates that the tool has a menu item in the navigator context menu.
static int INTEG_NAVIGATOR_TOOLBAR_BUTTON
          Indicates that the tool has a toolbar button in the navigator toolbar.
static int INTEG_TOOLS_MENU_ITEM
          Indicates that the tool has a menu item in the Tools menu.
 
Constructor Summary
ExternalTool()
           
 
Method Summary
protected  void copyToImpl(ExternalTool copy)
          Use this method when implementing the oracle.ide.util.Copyable interface.
 int getAvailability()
          Get when this tool is available.
 java.lang.String getAvailabilityExpression()
          Get the regular expression to be used when getAvailability() is of type AVAIL_REGEXP.
 java.util.List getAvailableTypes()
          Get the types this tool is available on, if the availability type is set to AVAIL_TYPES.
 java.lang.String getCaption()
          Get the caption for this external tool.
 java.net.URL getIconURL()
          Get the URL of the icon for this external tool.
 javax.swing.Icon getIconWhenRequired()
          If an external tool is displayed in the toolbar, an icon is required.
 int getIntegrationMask()
          Get the types of integration this tool has with the IDE.
 boolean getReloadBuffers()
          Get whether buffers will be reloaded after running this tool.
 java.lang.String getToolTipText()
          Get the tool tip text for this tool.
abstract  java.lang.Class getType()
          Get the type of tool this is.
 boolean hasIntegration(int integrationType)
          Is this tool integrated in the specified way? Utility method, equivalent to ((getIntegrationMask() & integrationType) != 0)
abstract  void run(ExternalToolManager manager, Context context)
          Invoke the external tool instance on the specified context.
 void setAvailability(int availability)
          Set when this tool is available.
 void setAvailabilityExpression(java.lang.String expression)
          Set the regular expression to be used when getAvailability() is of type AVAIL_REGEXP.
 void setAvailableTypes(java.util.List types)
          Set the types this tool is available on, if the availability type is set to AVAIL_TYPES.
 void setCaption(java.lang.String caption)
          Set the caption for this external tool.
 void setIconURL(java.net.URL u)
          Set the URL of the icon for this external tool.
 void setIntegrationMask(int integrationMask)
          Set the types of integration this tool has with the IDE.
 void setReloadBuffers(boolean reload)
          Set whether to reload buffers after running this tool
 void setToolTipText(java.lang.String toolTipText)
          Set the tool tip text for this tool.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface oracle.ide.util.Copyable
copyTo
 

Field Detail

INTEG_TOOLS_MENU_ITEM

public static final int INTEG_TOOLS_MENU_ITEM
Indicates that the tool has a menu item in the Tools menu.

See Also:
Constant Field Values

INTEG_CODE_EDITOR_CONTEXT_MENU_ITEM

public static final int INTEG_CODE_EDITOR_CONTEXT_MENU_ITEM
Indicates that the tool has a menu item in the code editor context menu.

See Also:
Constant Field Values

INTEG_NAVIGATOR_CONTEXT_MENU_ITEM

public static final int INTEG_NAVIGATOR_CONTEXT_MENU_ITEM
Indicates that the tool has a menu item in the navigator context menu.

See Also:
Constant Field Values

INTEG_MAIN_WINDOW_TOOLBAR_BUTTON

public static final int INTEG_MAIN_WINDOW_TOOLBAR_BUTTON
Indicates that the tool has a toolbar button in the main window toolbar.

See Also:
Constant Field Values

INTEG_NAVIGATOR_TOOLBAR_BUTTON

public static final int INTEG_NAVIGATOR_TOOLBAR_BUTTON
Indicates that the tool has a toolbar button in the navigator toolbar. This integration type is currently not supported, and has no effect.

See Also:
Constant Field Values

AVAIL_ALWAYS

public static final int AVAIL_ALWAYS
Indicates that the tool is always available

See Also:
Constant Field Values

AVAIL_SELECTION

public static final int AVAIL_SELECTION
Indicates that the tool is available when there is a selection.

See Also:
Constant Field Values

AVAIL_REGEXP

public static final int AVAIL_REGEXP
Indicates that the tool is available when the selection matches a regular expression. Note: this is no longer supported through the UI but is kept here for backwards compatibility.

See Also:
Constant Field Values

AVAIL_TYPES

public static final int AVAIL_TYPES
Indicates that the tool is available when the selection is included in a set of document types.

See Also:
Constant Field Values
Constructor Detail

ExternalTool

public ExternalTool()
Method Detail

getReloadBuffers

public boolean getReloadBuffers()
Get whether buffers will be reloaded after running this tool. Subclasses are responsible for ensuring that this request is honored after running the tool.

Returns:
true if the IDE's buffers are reloaded after running.

setReloadBuffers

public void setReloadBuffers(boolean reload)
Set whether to reload buffers after running this tool

Parameters:
reload - if true, the tool will force a buffer reload

getIconWhenRequired

public javax.swing.Icon getIconWhenRequired()
If an external tool is displayed in the toolbar, an icon is required. This method should return the icon to use for this external tool when no icon has been specified for the user, but the tool is present in the toolbar.

Returns:
an icon.

hasIntegration

public boolean hasIntegration(int integrationType)
Is this tool integrated in the specified way? Utility method, equivalent to ((getIntegrationMask() & integrationType) != 0)

Parameters:
integrationType - one of the INTEG_ constants defined in this class.
Returns:
true if this tool has the specified integration.

toString

public java.lang.String toString()

setAvailableTypes

public void setAvailableTypes(java.util.List types)
Set the types this tool is available on, if the availability type is set to AVAIL_TYPES.

Parameters:
types - a list of class names, which should match class names in oracle.ide.config.DocumentExtensions.DocRecord.getDocClass().

getAvailableTypes

public java.util.List getAvailableTypes()
Get the types this tool is available on, if the availability type is set to AVAIL_TYPES.

Returns:
a list of class names, which should match class names in oracle.ide.config.DocumentExtensions.DocRecord.getDocClass().

getIconURL

public java.net.URL getIconURL()
Get the URL of the icon for this external tool.

Returns:
a URL pointing to an icon file to use for this tool. If null, no icon will be used.

setIconURL

public void setIconURL(java.net.URL u)
Set the URL of the icon for this external tool.

Parameters:
u - a URL pointing to an icon file to use for this tool. If null, no icon will be used.

getCaption

public java.lang.String getCaption()
Get the caption for this external tool. If the caption contains an ampersand character, the subsequent character will be used as the mnemonic when this tool is displayed in menus.

Returns:
a String caption for the tool. Must not be null.

setCaption

public void setCaption(java.lang.String caption)
Set the caption for this external tool. If the caption contains an ampersand character, the subsequent character will be used as the mnemonic when this tool is displayed in menus.

Parameters:
caption - a String caption for the tool. Must not be null.

getToolTipText

public java.lang.String getToolTipText()
Get the tool tip text for this tool.

Returns:
a String to be used as tool tip text for the tool. May be null.

setToolTipText

public void setToolTipText(java.lang.String toolTipText)
Set the tool tip text for this tool.

Parameters:
toolTipText - a String to be used as tool tip text for the tool. May be null.

getIntegrationMask

public int getIntegrationMask()
Get the types of integration this tool has with the IDE.

Returns:
a bitmask of IT_ constants from this interface.

setIntegrationMask

public void setIntegrationMask(int integrationMask)
Set the types of integration this tool has with the IDE.

Parameters:
integrationMask - a bitmask of IT_ constants from this interface.

getAvailability

public int getAvailability()
Get when this tool is available.

Returns:
one of the AVAIL_ constants from this interface.

setAvailability

public void setAvailability(int availability)
Set when this tool is available.

Parameters:
availability - one of the AVAIL_ constants from this interface.

getAvailabilityExpression

public java.lang.String getAvailabilityExpression()
Get the regular expression to be used when getAvailability() is of type AVAIL_REGEXP.

Returns:
a string containing a regular expression. Optional if getAvailability() != AVAIL_REGEXP, otherwise must not be null.

setAvailabilityExpression

public void setAvailabilityExpression(java.lang.String expression)
Set the regular expression to be used when getAvailability() is of type AVAIL_REGEXP.

Parameters:
expression - a string containing a regular expression. Optional if getAvailability() != AVAIL_REGEXP, otherwise must not be null.

copyToImpl

protected void copyToImpl(ExternalTool copy)
Use this method when implementing the oracle.ide.util.Copyable interface.

See Also:
Copyable.copyTo( Object )

run

public abstract void run(ExternalToolManager manager,
                         Context context)
                  throws ToolRunException
Invoke the external tool instance on the specified context.

Parameters:
context - the IDE context the tool was invoked in.
Throws:
ToolRunException - if the tool failed to run.

getType

public abstract java.lang.Class getType()
Get the type of tool this is.

Returns:
a class, which should be an ExternalToolType.

Extension SDK

 

Copyright © 1997, 2004, Oracle. All rights reserved.