/** * Get the ActionService by DatabaseVendorDefinitionId * * @param vendorId * @return the UIComponentService */ public static ActionService getActionService(DatabaseVendorDefinitionId vendorId) { SQLDevToolsConfiguration conf = SQLToolsFacade.getConfigurationByVendorIdentifier(vendorId); return conf.getActionService(); } }
/** * Gets the <code>SQLDevToolsConfiguration</code> object by the database definition name. * * @param dbDefName database definition name, which is product name appended by "_" and version. * @return <code>SQLDevToolsConfiguration</code> object */ public static SQLDevToolsConfiguration getConfigurationByDBDefName(String dbDefName) { return getConfigurationByVendorIdentifier(new DatabaseVendorDefinitionId(dbDefName)); }
/** * Gets the <code>SQLDevToolsConfiguration</code> object by the connection profile name. Since different versions * of a database may use the same connection profile provider id, we'll compare the real version of the server with * the version string declared for the <code>SQLDevToolsConfiguration</code> and finds the most suitable one. * * @param profileName connection profile name * @return <code>SQLDevToolsConfiguration</code> object */ public static SQLDevToolsConfiguration getConfigurationByProfileName(String profileName) { return getConfigurationByVendorIdentifier(ProfileUtil.getDatabaseVendorDefinitionId(profileName)); }
/** * Returns the data type provider of this database * * @return */ protected DataTypeProvider getDataTypeProvider() { DatabaseVendorDefinitionId id = getDatabaseVendorDefinitionId(); if (id == null) { return null; } SQLDevToolsConfiguration config = SQLToolsFacade.getConfigurationByVendorIdentifier(id); if (config == null) { return null; } return config.getSQLDataService().getDataTypeProvider(); } }
public ProceduralObjectSourceUpdater(SQLObject _object, DatabaseDefinition dbDefinition) { this._routine = _object; _dbDefinition = dbDefinition; _dbDefinitionId = new DatabaseVendorDefinitionId(_dbDefinition.getProduct(), _dbDefinition.getVersion()); SQLDevToolsConfiguration f = SQLToolsFacade.getConfigurationByVendorIdentifier(_dbDefinitionId); _parser = f.getSQLService().getSQLParser(); _parserParameters = new ParserParameters(false); _parserParameters.setProperty(ParserParameters.PARAM_HEADER_MODE, Boolean.TRUE); }
/** * Creates, configures, and returns the ContentFormatter to use. * * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getContentFormatter(ISourceViewer) */ public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) { ContentFormatter formatter = new ContentFormatter(); formatter.setDocumentPartitioning( SQLPartitionScanner.SQL_PARTITIONING ); SQLDevToolsConfiguration factory = SQLToolsFacade.getConfigurationByVendorIdentifier(getSQLEditor().getConnectionInfo().getDatabaseVendorDefinitionId()); IFormattingStrategy formattingStrategy = new SQLWordStrategy(factory.getSQLService().getSQLSyntax()); formatter.setFormattingStrategy( formattingStrategy, IDocument.DEFAULT_CONTENT_TYPE ); return formatter; }
.getDatabaseVendorDefinitionId(); _config = SQLToolsFacade .getConfigurationByVendorIdentifier(_databaseVendorDefinitionId); SQLParser _parser = _config.getSQLService().getSQLParser();
.getConfigurationByVendorIdentifier(editor.getConnectionInfo() .getDatabaseVendorDefinitionId()); if (config != null) {
/** * Sets up the document partitioner. Since we support multiple dialects, each time when the database vendor definition for this SQL editor * is changed, this method should be called to update the document partitioner. */ protected void setupDocumentPartitioner() { IDocument document = getDocumentProvider().getDocument(getEditorInput()); DatabaseVendorDefinitionId vendorId = getConnectionInfo().getDatabaseVendorDefinitionId(); SQLDevToolsConfiguration factory = SQLToolsFacade.getConfigurationByVendorIdentifier(vendorId); SQLPartitionScanner _sqlPartitionSanner = new SQLPartitionScanner(factory.getSQLService().getSQLSyntax()); if (document instanceof IDocumentExtension3) { IDocumentExtension3 extension3 = (IDocumentExtension3) document; IDocumentPartitioner partitioner = new FastPartitioner( _sqlPartitionSanner, new String[] { SQLPartitionScanner.SQL_COMMENT, SQLPartitionScanner.SQL_MULTILINE_COMMENT, SQLPartitionScanner.SQL_STRING, SQLPartitionScanner.SQL_DOUBLE_QUOTES_IDENTIFIER }); partitioner.connect(document); extension3.setDocumentPartitioner(SQLPartitionScanner.SQL_PARTITIONING, partitioner); } }
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); }
SQLDevToolsConfiguration config = SQLToolsFacade.getConfigurationByVendorIdentifier(getConnectionInfo().getDatabaseVendorDefinitionId()); ActionService actionServie = config.getActionService(); SQLEditorService editorService = config.getSQLEditorService();
SQLDevToolsConfiguration f =SQLToolsFacade.getConfigurationByVendorIdentifier(_editor.getConnectionInfo().getDatabaseVendorDefinitionId()); SQLParser p = f.getSQLService().getSQLParser(); ISourceViewer viewer = _editor.getSV();
public void run() { Template template = new Template(); template.setPattern(_sqlEditor.getSelectedText()); SQLDevToolsConfiguration config = SQLToolsFacade.getConfigurationByVendorIdentifier(_sqlEditor.getConnectionInfo().getDatabaseVendorDefinitionId()); SQLService sqlService = config.getSQLService(); template.setContextTypeId(sqlService.getSQLContextType().getSQLContextId()); Dialog dialog = new EditTemplateDialog(null, template, false, true, SQLEditorPlugin.getDefault().getTemplateContextTypeRegistry()); if (dialog.open() == Window.OK) { TemplatePersistenceData data = new TemplatePersistenceData(template, true); SQLEditorPlugin.getDefault().getTemplateStore().add(data); try { SQLEditorPlugin.getDefault().getTemplateStore().save(); } catch (IOException e) { openWriteErrorDialog(e); } } }
SQLDevToolsConfiguration toolsConfig = SQLToolsFacade.getConfigurationByVendorIdentifier(getConnectionInfo().getDatabaseVendorDefinitionId()); SQLEditorService editorService = toolsConfig.getSQLEditorService(); fDBProposalsService = editorService.getSQLDBProposalsService(getConnectionInfo());
SQLDevToolsConfiguration factory = SQLToolsFacade.getConfigurationByVendorIdentifier(getSQLEditor().getConnectionInfo().getDatabaseVendorDefinitionId()); if (factory != null)