Package com.dci.intellij.dbn.common.content

Examples of com.dci.intellij.dbn.common.content.DynamicContent


        return contentDependency.getSourceContent();
    }

    @Override
    public boolean shouldLoad() {
        DynamicContent sourceContent = contentDependency.getSourceContent();
        // should reload if the source has been reloaded and is not dirty
        return !sourceContent.isDirty() && contentDependency.isDirty();
    }
View Full Code Here


    }

    @NotNull
    public DynamicContent getSourceContent() {
        if (sourceContentOwner != null) {
            DynamicContent sourceContent = sourceContentOwner.getDynamicContent(sourceContentType);
            if (sourceContent != null) {
                return sourceContent;
            }
        }
        return VoidDynamicContent.INSTANCE;
View Full Code Here

    public abstract boolean match(T sourceElement, DynamicContent dynamicContent);

    public void loadContent(DynamicContent<T> dynamicContent, boolean force) throws DynamicContentLoadException, InterruptedException {
        SubcontentDependencyAdapter dependencyAdapter = (SubcontentDependencyAdapter) dynamicContent.getDependencyAdapter();

        DynamicContent sourceContent = dependencyAdapter.getSourceContent();
        boolean isBackgroundLoad = DatabaseLoadMonitor.isLoadingInBackground();
        DynamicContentLoader<T> alternativeLoader = getAlternativeLoader();
        if ((sourceContent.isLoaded() && !sourceContent.isLoading() && !force) || isBackgroundLoad || alternativeLoader == null) {
            //load from sub-content
            boolean matchedOnce = false;
            List<T> list = null;
            for (Object object : sourceContent.getElements()) {
                dynamicContent.checkDisposed();

                T element = (T) object;
                if (match(element, dynamicContent) && dynamicContent.accepts(element)) {
                    matchedOnce = true;
                    if (list == null) list = new ArrayList<T>();
                    list.add(element);
                }
                else if (matchedOnce && optimized) {
                    // the optimization check assumes that source content is sorted
                    // such as all matching elements are building a consecutive segment in the source content.
                    // If at least one match occurred and current element does not match any more,
                    // => there are no matching elements left in the source content, hence break the loop
                    break;
                }
            }
            dynamicContent.setElements(list);
        } else {
            sourceContent.loadInBackground(force);
            alternativeLoader.loadContent(dynamicContent, force);
        }
    }
View Full Code Here

    }

    public DynamicContent getDynamicContent(DynamicContentType dynamicContentType) {
        if(dynamicContentType instanceof DBObjectType) {
            DBObjectType objectType = (DBObjectType) dynamicContentType;
            DynamicContent dynamicContent = objectLists.getObjectList(objectType);
            if (dynamicContent == null) dynamicContent = objectLists.getHiddenObjectList(objectType);
            return dynamicContent;
        }

        if (dynamicContentType instanceof DBObjectRelationType) {
View Full Code Here

    }

    public DynamicContent getDynamicContent(DynamicContentType dynamicContentType) {
        if(dynamicContentType instanceof DBObjectType && childObjects != null) {
            DBObjectType objectType = (DBObjectType) dynamicContentType;
            DynamicContent dynamicContent = childObjects.getObjectList(objectType);
            if (dynamicContent == null) dynamicContent = childObjects.getHiddenObjectList(objectType);
            return dynamicContent;
        }

        else if (dynamicContentType instanceof DBObjectRelationType && childObjectRelations != null) {
View Full Code Here

TOP

Related Classes of com.dci.intellij.dbn.common.content.DynamicContent

Copyright © 2018 www.massapicom. 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.