/** * 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() { run(null); }
private void runDelegate() { super.run(); }
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) thread.setConnection(_conn); thread.setUser(true); thread.schedule(); try thread.join(); handleEnd(_conn);
/** * Constructor * * @param targetEditor the editor in which this action will be applied */ public ExplainSQLActionDelegate(SQLEditor targetEditor) { setText(Messages.getString("ExplainSQLActionDelegate.action_title")); //$NON-NLS-1$ setToolTipText(Messages.getString("ExplainSQLActionDelegate.action_tooltip")); //$NON-NLS-1$ setImageDescriptor(Images.DESC_EXPLAIN_SQL); setActionDefinitionId(ISQLEditorActionConstants.EXPLAIN_SQL_ACTION_ID); setActiveEditor(targetEditor); targetEditor.getSelectionProvider().addSelectionChangedListener(this); update(); PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IHelpContextIds.GET_EXECUTION_PLAN_ACTION); }
String task = Messages.getString("GroupPlanSupportRunnable.sql_execution_plan"); //$NON-NLS-1$ if (groups.length > 1) task += NLS.bind(Messages.getString("GroupPlanSupportRunnable.groups"), (new Object[] //$NON-NLS-1$ monitor.subTask(NLS.bind(Messages.getString("GroupPlanSupportRunnable.group"), (new Object[] //$NON-NLS-1$ request.setSql(processVarDecs(request.getSql(), databaseIdentifier, _request.getVarDecs())); if(getConnection() != null) planRunnable.setConnection(getConnection()); ConfirmRunnable run = new ConfirmRunnable(); SQLEditorPlugin.getDisplay().syncExec(run); if (!run.goon)
public void update() { setEnabled(_sqlEditor != null && (_sqlEditor.isConnected()) && super.canBeEnabled()); }
public String getSQLStatements() { if(explainAsRoutineObject()) { return _procSql; } else { return super.getSQLStatements(); } }
/** * Returns the image managed under the given key in this registry. * * @param key the image's key * @return the image managed under the given key */ public static Image get(String key) { return getImageRegistry().get(key); }
/** * Updates the action when selection changes * * @param event */ public void selectionChanged(SelectionChangedEvent event) { if (event.getSelection() instanceof ITextSelection) { update(); } } }
private static ImageDescriptor createManaged(String name) { try { ImageDescriptor result = ImageDescriptor.createFromURL(makeIconFileURL(name.substring(NAME_PREFIX_LENGTH))); fgAvoidSWTErrorMap.put(name, result); return result; } catch (MalformedURLException e) { return ImageDescriptor.getMissingImageDescriptor(); } }
/** * 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; }
.getActiveWorkbenchShell(), Messages.getString("GroupPlanSupportRunnable.continue_explain"), //$NON-NLS-1$ Messages.getString("GroupPlanSupportRunnable.error_info"), //$NON-NLS-1$ null/* use default toggle message */, false, store, PreferenceConstants.EXECUTE_SQL_ERROR_MODE); int result = dlg.getReturnCode();
&& super.canBeEnabled()); setEnabled(_sqlEditor != null && (_sqlEditor.isConnected()) && super.canBeEnabled());