当前位置: 首页>>代码示例>>Java>>正文


Java DbPsiFacade类代码示例

本文整理汇总了Java中com.intellij.database.psi.DbPsiFacade的典型用法代码示例。如果您正苦于以下问题:Java DbPsiFacade类的具体用法?Java DbPsiFacade怎么用?Java DbPsiFacade使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DbPsiFacade类属于com.intellij.database.psi包,在下文中一共展示了DbPsiFacade类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setUp

import com.intellij.database.psi.DbPsiFacade; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
    super.setUp();
    myFixture.configureFromExistingVirtualFile(myFixture.copyFileToProject("classes.php"));


    DbPsiFacade facade =  DbPsiFacade.getInstance(myFixture.getProject());
    if (facade.getDataSources().size() == 0) {
        TestDataSource source = new TestDataSource(myFixture.getProject());
        facade.getDataSources().add(source);
        List<DbDataSource> dataSources = facade.getDataSources();
    }
}
 
开发者ID:nvlad,项目名称:yii2support,代码行数:14,代码来源:ActiveQueryTest.java

示例2: AndroidDbManager

import com.intellij.database.psi.DbPsiFacade; //导入依赖的package包/类
public AndroidDbManager(@NotNull DbPsiFacade dbFacade) {
  super(dbFacade, AndroidDataSourceStorage.getInstance(dbFacade.getProject()).getDataSources());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:AndroidDbManager.java

示例3: invoke

import com.intellij.database.psi.DbPsiFacade; //导入依赖的package包/类
@Override
public void invoke(@NotNull final Project project,
                   final Editor editor,
                   @NotNull final PsiElement psiElement) throws IncorrectOperationException {

    final ExtractorProperties extractorProperties =
            ProjectSettings.getExtractorProperties(SimpleDataContext.getProjectContext(project));

    final List<DbDataSource> dataSources = DbPsiFacade.getInstance(project).getDataSources();

    if (dataSources.isEmpty()) {
        showPopup(editor, MessageType.ERROR, "Could not find datasource.");
        return;
    }

    final String selectedDataSourceName = extractorProperties.getSelectedDataSourceName();

    final DbDataSource dataSource = getDataSource(editor, dataSources, selectedDataSourceName);

    final String query;
    if (editor.getSelectionModel().hasSelection()) {
        query = StringUtil.trim(editor.getSelectionModel().getSelectedText());
    } else {
        final SmartPsiElementPointer<SqlSelectStatement> pointer = getNearestPointer(project, psiElement);
        if (pointer != null) {
            query = pointer.getElement().getText();

            final int startOffset = pointer.getRange().getStartOffset();
            int endOffset = pointer.getRange().getEndOffset();

            if (editor.getDocument().getText(TextRange.create(endOffset, endOffset + 1)).equals(";")) {
                endOffset += 1; // take semicolon after query
            }
            editor.getSelectionModel().setSelection(startOffset, endOffset);
        } else {
            query = null;
        }
    }

    ApplicationManager.getApplication().executeOnPooledThread(new Runnable() {
        @Override
        public void run() {
            applySelectionChange(project, editor, extractorProperties, dataSource, query);
        }
    });
}
 
开发者ID:kTT,项目名称:dbunit-extractor,代码行数:47,代码来源:QueryToXMLConverter.java


注:本文中的com.intellij.database.psi.DbPsiFacade类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。