Examples of DBContentType


Examples of com.dci.intellij.dbn.editor.DBContentType

        String postfix = ddlFileSettings.getGeneralSettings().getStatementPostfix().value();

        if (ddlFiles != null && !ddlFiles.isEmpty()) {
            for (VirtualFile ddlFile : ddlFiles) {
                DDLFileType ddlFileType = ddlFileManager.getDDLFileTypeForExtension(ddlFile.getExtension());
                DBContentType fileContentType = ddlFileType.getContentType();

                StringBuilder buffer = new StringBuilder();
                if (fileContentType.isBundle()) {
                    DBContentType[] contentTypes = fileContentType.getSubContentTypes();
                    for (DBContentType contentType : contentTypes) {
                        SourceCodeFile virtualFile = (SourceCodeFile) databaseFile.getContentFile(contentType);
                        String statement = virtualFile.createDDLStatement();
                        if (statement.trim().length() > 0) {
                            buffer.append(statement);
View Full Code Here

Examples of com.dci.intellij.dbn.editor.DBContentType

            DBObjectType objectType = identifierPsiElement.getObjectType();
            ElementType elementType = basePsiElement.getElementType();

            if (identifierPsiElement.isObject() && objectType.getGenericType() == DBObjectType.METHOD) {

                DBContentType targetContentType =
                        elementType.is(ElementTypeAttribute.OBJECT_DECLARATION) ? DBContentType.CODE_SPEC :
                        elementType.is(ElementTypeAttribute.OBJECT_SPECIFICATION) ? DBContentType.CODE_BODY : null;

                if (targetContentType != null && identifierPsiElement.getFile() instanceof PSQLFile) {
                    PSQLFile file = (PSQLFile) identifierPsiElement.getFile();
View Full Code Here

Examples of com.dci.intellij.dbn.editor.DBContentType

public class SourceCodeEditorProvider extends BasicSourceCodeEditorProvider {

    public boolean accept(@NotNull Project project, @NotNull VirtualFile virtualFile) {
        if (virtualFile instanceof DatabaseEditableObjectFile) {
            DatabaseEditableObjectFile databaseFile = (DatabaseEditableObjectFile) virtualFile;
            DBContentType contentType = databaseFile.getObject().getContentType();
            return contentType.isOneOf(DBContentType.CODE, DBContentType.CODE_AND_DATA);

        }
        return false;
    }
View Full Code Here

Examples of com.dci.intellij.dbn.editor.DBContentType

                object.getStatus().set(DBObjectStatus.SAVING, false);
                return;
            }

            final Project project = virtualFile.getProject();
            final DBContentType contentType = virtualFile.getContentType();
            object.getStatus().set(DBObjectStatus.SAVING, true);

            new BackgroundTask(project, "Checking for third party changes on " + object.getQualifiedNameWithType(), true) {
                public void execute(@NotNull ProgressIndicator progressIndicator) {
                    try {
View Full Code Here

Examples of com.dci.intellij.dbn.editor.DBContentType

        DBObjectProperties properties = object.getProperties();
        if(object instanceof DBSchemaObject) {
            DBSchemaObject schemaObject = (DBSchemaObject) object;

            if (properties.is(DBObjectProperty.EDITABLE)) {
                DBContentType contentType = schemaObject.getContentType();
                if (contentType == DBContentType.DATA || contentType == DBContentType.CODE_AND_DATA) {
                    add(new EditObjectDataAction(schemaObject));
                }

                if (contentType == DBContentType.CODE || contentType == DBContentType.CODE_AND_DATA || contentType == DBContentType.CODE_SPEC_AND_BODY) {
View Full Code Here

Examples of com.dci.intellij.dbn.editor.DBContentType

    @Override
    public boolean canPutAt(@NotNull VirtualFile file, int line, @NotNull Project project) {
        if (file.getFileType().equals(PSQLFileType.INSTANCE)) {
            if (file instanceof SourceCodeFile) {
                SourceCodeFile sourceCodeFile = (SourceCodeFile) file;
                DBContentType contentType = sourceCodeFile.getContentType();
                if (contentType == DBContentType.CODE || contentType == DBContentType.CODE_BODY) {
                    Document document = DocumentUtil.getDocument(file);
                    int lineOffset = document.getLineStartOffset(line);
                    PsiFile psiFile = PsiUtil.getPsiFile(project, file);
                    PsiElement element = psiFile.findElementAt(lineOffset);
View Full Code Here

Examples of com.dci.intellij.dbn.editor.DBContentType

                DatabaseCompatibilityInterface compatibilityInterface = DatabaseCompatibilityInterface.getInstance(schemaObject);
                if (schemaObject.getProperties().is(DBObjectProperty.COMPILABLE) &&  compatibilityInterface.supportsFeature(DatabaseFeature.OBJECT_INVALIDATION)) {
                    CompilerSettings compilerSettings = getCompilerSettings(schemaObject.getProject());
                    CompileType compileType = compilerSettings.getCompileType();
                    DBObjectStatusHolder status = schemaObject.getStatus();
                    DBContentType contentType = virtualFile.getContentType();

                    boolean isDebug = compileType == CompileType.DEBUG;
                    if (compileType == CompileType.KEEP) {
                        isDebug = status.is(contentType, DBObjectStatus.DEBUG);
                    }
View Full Code Here

Examples of com.dci.intellij.dbn.editor.DBContentType

    public boolean preOpen() {
        DBSchemaObject object = getObject();
        if (object != null) {
            Project project = object.getProject();
            DBContentType contentType = object.getContentType();
            if (contentType == DBContentType.DATA) {
                DBDataset dataset = (DBDataset) object;
                DatasetFilterManager filterManager = DatasetFilterManager.getInstance(project);
                DatasetFilter filter = filterManager.getActiveFilter(dataset);

                if (filter == null) {
                    DataEditorSettings settings = DataEditorSettings.getInstance(project);
                    if (settings.getFilterSettings().isPromptFilterDialog()) {
                        int exitCode = filterManager.openFiltersDialog(dataset, true, false, settings.getFilterSettings().getDefaultFilterType());
                        return exitCode != DialogWrapper.CANCEL_EXIT_CODE;
                    }
                }
            }
            else if (contentType.isOneOf(DBContentType.CODE, DBContentType.CODE_SPEC_AND_BODY)) {

                DDLFileGeneralSettings ddlFileSettings = DDLFileSettings.getInstance(project).getGeneralSettings();
                ConnectionHandler connectionHandler = object.getConnectionHandler();
                boolean ddlFileBinding = connectionHandler.getSettings().getDetailSettings().isDdlFileBinding();
                if (ddlFileBinding && ddlFileSettings.getLookupDDLFilesEnabled().value()) {
View Full Code Here

Examples of com.dci.intellij.dbn.editor.DBContentType

    }

    public synchronized List<DatabaseContentFile> getContentFiles() {
        if (contentFiles == null) {
            contentFiles = new ArrayList<DatabaseContentFile>();
            DBContentType objectContentType = getObject().getContentType();
            if (objectContentType.isBundle()) {
                DBContentType[] contentTypes = objectContentType.getSubContentTypes();
                for (DBContentType contentType : contentTypes) {
                    DatabaseContentFile virtualFile =
                            contentType.isCode() ? new SourceCodeFile(this, contentType) :
                            contentType.isData() ? new DatasetFile(this, contentType) : null;
                    contentFiles.add(virtualFile);
                }
            } else {
                DatabaseContentFile virtualFile =
                        objectContentType.isCode() ? new SourceCodeFile(this, objectContentType) :
                        objectContentType.isData() ? new DatasetFile(this, objectContentType) : null;
                contentFiles.add(virtualFile);
            }
        }
        return contentFiles;
    }
View Full Code Here

Examples of com.dci.intellij.dbn.editor.DBContentType

    public boolean isDirectory() {
        return false;
    }

    public DatabaseContentFile getDebuggableContentFile(){
        DBContentType contentType = getObject().getContentType();
        if (contentType == DBContentType.CODE) {
            return getContentFile(DBContentType.CODE);
        }

        if (contentType == DBContentType.CODE_SPEC_AND_BODY) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.