/** * Get the ActionService by profile name. Clients need to check whether the profile exists before calling this method. * * @param profileName profile name * @return the UIComponentService */ public static ActionService getActionService(String profileName) { SQLDevToolsConfiguration conf = SQLToolsFacade.getConfigurationByProfileName(profileName); return conf.getActionService(); }
/** * Get the ActionService by DatabaseVendorDefinitionId * * @param vendorId * @return the UIComponentService */ public static ActionService getActionService(DatabaseVendorDefinitionId vendorId) { SQLDevToolsConfiguration conf = SQLToolsFacade.getConfigurationByVendorIdentifier(vendorId); return conf.getActionService(); } }
public static boolean showAction(String dbType, String actionId) { SQLDevToolsConfiguration f = null; f = getConfigurationByDBDefName(dbType); if (f != null) { return f.getActionService().supportsAction(actionId); } return false; }
protected void fillContextMenu(IMenuManager menu) { super.fillContextMenu(menu); // TODO add debug action menu.add(new Separator()); // 2006-07-20 // Fix 380668-1 Users are confused by 'Execute' and 'Run' context menu // in the editor. // Keep Execute All, but will only be enabled when youre editing a SQL // file. Disabled at all other times. menu.remove(ISQLEditorActionConstants.EXECUTE_SQL_ACTION_ID); SQLDevToolsConfiguration config = SQLToolsFacade .getConfigurationByVendorIdentifier(getConnectionInfo() .getDatabaseVendorDefinitionId()); ActionService actionService = config.getActionService(); if (actionService.supportsAction(ISQLEditorActionConstants.RUN_ACTION_ID)) { // Run addAction(menu, ISQLEditorActionConstants.GROUP_SQLEDITOR_EXECUTE, ISQLEditorActionConstants.RUN_ACTION_ID); } if (actionService.supportsAction(ISQLEditorActionConstants.DEBUG_ACTION_ID)) { // Debug addAction(menu, ISQLEditorActionConstants.GROUP_SQLEDITOR_EXECUTE, ISQLEditorActionConstants.DEBUG_ACTION_ID); } addAction(menu, ITextEditorActionConstants.GROUP_UNDO, ISQLEditorActionConstants.REFRESH_FROM_DATABASE_ACTION_ID); addAction(menu, ISQLEditorActionConstants.GROUP_SQLEDITOR_SAVE, ISQLEditorActionConstants.SAVE_TO_DATABASE_ACTION_ID); }
ActionService actionServie = config.getActionService(); SQLEditorService editorService = config.getSQLEditorService();