org.eclipse.datatools.sqltools.plan
Interface IPlanOption

All Known Implementing Classes:
PlanOption

public interface IPlanOption

Generally speaking, a database server may support several types of execution plan, for example, a text type and a graphic type, which renders the execution plan in text string or using graph respectively.
This interface tries to build a relationship between the type id and type name, and check which type is graphic one, such that the framework can draw the execution plan in a canvas instead of displaying it as a literal string.
Also, the consumer needs to create the preference section on "Execution Plan View Option" page to let the end user select the plan type, the framework does not implement this part.

Author:
Dafan Yang

Field Summary
static int TYPE_EVENT
           
static int TYPE_SP
           
static int TYPE_TRIGGER
           
static int TYPE_UDF
           
 
Method Summary
 int getCurrentType()
          Returns the current plan type configured by the user
 int getDefaultOption()
          Returns the default plan type id
 java.lang.String[] getPlanTypes()
          Returns all available plan types, in string mode.
 int getTypeIdByName(java.lang.String name)
          Returns type id by name
 java.lang.String getTypeNameById(int type)
          Returns type name by id
 boolean isGraphicPlan(int type)
          Checks if the given type id is graphic type
 boolean supportPlan(int procType)
          Returns if the execution plan is supported for the given proc type
 

Field Detail

TYPE_SP

static final int TYPE_SP
See Also:
Constant Field Values

TYPE_UDF

static final int TYPE_UDF
See Also:
Constant Field Values

TYPE_EVENT

static final int TYPE_EVENT
See Also:
Constant Field Values

TYPE_TRIGGER

static final int TYPE_TRIGGER
See Also:
Constant Field Values
Method Detail

getPlanTypes

java.lang.String[] getPlanTypes()
Returns all available plan types, in string mode.

Returns:
all plan types

isGraphicPlan

boolean isGraphicPlan(int type)
Checks if the given type id is graphic type

Parameters:
type - a given plan type
Returns:
true if the given type is grahic type, false otherwise

getDefaultOption

int getDefaultOption()
Returns the default plan type id

Returns:
the default plan type id

getTypeNameById

java.lang.String getTypeNameById(int type)
Returns type name by id

Parameters:
type - the plan type id
Returns:
the plan type name

getTypeIdByName

int getTypeIdByName(java.lang.String name)
Returns type id by name

Parameters:
name - the name of the plan type
Returns:
the id of the plan type

getCurrentType

int getCurrentType()
Returns the current plan type configured by the user

Returns:
the current plan type

supportPlan

boolean supportPlan(int procType)
Returns if the execution plan is supported for the given proc type

Parameters:
procType - the type of procedural object
Returns:
true if the execution plan for the given type is supported
See Also:
TYPE_SP, TYPE_UDF, TYPE_TRIGGER, TYPE_EVENT