public void update() { setEnabled(_sqlEditor != null && (_sqlEditor.isConnected()) && super.canBeEnabled()); }
/** * Returns an instance of <code>GroupPlanSupportRunnable</code> * * @param request the plan request * @param databaseIdentifier the database identifier * @return an instance of <code>GroupPlanSupportRunnable</code> */ protected GroupPlanSupportRunnable createGroupPlanSupportRunnable(PlanRequest request, DatabaseIdentifier databaseIdentifier) { return new GroupPlanSupportRunnable(request, databaseIdentifier, getPostRun()); }
public void run() if (!isEnabled()) String sql = getSQLStatements(); DatabaseIdentifier databaseIdentifier = getDatabaseIdentifier(); if (databaseIdentifier == null || sql == null) int planType = option.getCurrentType(); _planRequest = createPlanRequest(sql, databaseDefinitionId, planType, PlanRequest.VIEW_ACTIVATE); GroupPlanSupportRunnable thread = createGroupPlanSupportRunnable(_planRequest, databaseIdentifier); if(_conn != null) handleEnd(_conn);
/** * Checks if the neccessary classes are obtainable * * @return <code>true</code> if the neccessary classes are obtainable */ protected boolean canBeEnabled() { DatabaseIdentifier databaseIdentifier = getDatabaseIdentifier(); if (databaseIdentifier == null) { return false; } IPlanService planService = SQLToolsFacade.getPlanService(databaseIdentifier); if (planService != null && planService.getPlanOption() != null) { return true; } return false; }
/** * Creates an instance of <code>PlanRequest</code> * * @param sql the SQL statement * @param databaseDefinitionId the database definition id * @param planType the type of plan * @param mode the show view mode * @return an instance of <code>PlanRequest</code> */ protected PlanRequest createPlanRequest(String sql, String databaseDefinitionId, int planType, int mode) { PlanRequest request = new PlanRequest(sql, databaseDefinitionId, planType, mode); request.setNoexec(false); request.setVarDecs(getVariableDeclarations()); return request; }