Package org.python.pydev.core.bundle

Examples of org.python.pydev.core.bundle.ImageCache$ImageDecorator


        plugin = this;
    }

    public void start(BundleContext context) throws Exception {
        super.start(context);
        imageCache = new ImageCache(PydevDebugPlugin.getDefault().getBundle().getEntry("/"));
    }
View Full Code Here


                }
            }

            //Update the icon if it wasn't received.
            if (icon == null) {
                ImageCache imageCache = PydevPlugin.getImageCache();
                if (isDir) {
                    if (isPackage) {
                        icon = imageCache.get(UIConstants.FOLDER_PACKAGE_ICON);
                    } else {
                        icon = imageCache.get(UIConstants.FOLDER_ICON);
                    }
                } else {
                    if (PythonPathHelper.isValidSourceFile(file.getName())) {
                        icon = imageCache.get(UIConstants.PY_FILE_ICON);
                    } else {
                        icon = imageCache.get(UIConstants.FILE_ICON);
                    }
                }
            }
        } finally {
            setData(new LabelAndImage(getLabel(file, isPythonpathRoot), icon));
View Full Code Here

            }
        }
        interpreterInfoTreeRoot = null;

        try {
            ImageCache imageCache = PydevPlugin.getImageCache();

            //The root will create its children automatically.
            interpreterInfoTreeRoot = new InterpreterInfoTreeNodeRoot<LabelAndImage>(interpreterInfo, nature, parent,
                    new LabelAndImage(interpreterInfo.getNameForUI(), imageCache.get(UIConstants.PY_INTERPRETER_ICON)));

        } catch (Throwable e) {
            Log.log(e);
            return null;
        }
View Full Code Here

    public InterpreterInfoTreeNodeRoot(IInterpreterInfo interpreterInfo, IPythonNature nature, Object parent, X data) {
        super(parent, data);
        this.interpreterInfo = interpreterInfo;
        Assert.isNotNull(interpreterInfo);
        InterpreterInfoTreeNodeRoot root = this;
        ImageCache imageCache = PydevPlugin.getImageCache();

        String executableOrJar = interpreterInfo.getExecutableOrJar();
        File file = new File(executableOrJar);
        if (file.exists()) {
            belowRootFiles = new PythonpathTreeNode(root, file.getParentFile(),
                    imageCache.get(UIConstants.PY_INTERPRETER_ICON), true);
        } else {
            belowRootFiles = null;
        }

        systemLibs = new InterpreterInfoTreeNode<LabelAndImage>(root, new LabelAndImage("System Libs",
                imageCache.get(UIConstants.LIB_SYSTEM_ROOT)));

        List<String> pythonPath = interpreterInfo.getPythonPath();
        Collections.sort(pythonPath);
        for (String string : pythonPath) {
            new PythonpathTreeNode(systemLibs, new File(string), imageCache.get(UIConstants.LIB_SYSTEM), true);
        }

        externalLibs = new InterpreterInfoTreeNode<LabelAndImage>(root, new LabelAndImage("External Libs",
                imageCache.get(UIConstants.LIB_SYSTEM_ROOT)));

        IPythonPathNature pythonPathNature = nature.getPythonPathNature();
        try {
            List<String> projectExternalSourcePath = pythonPathNature.getProjectExternalSourcePathAsList(true);
            Collections.sort(projectExternalSourcePath);
            for (String string : projectExternalSourcePath) {
                File f = new File(string);
                new PythonpathTreeNode(externalLibs, f, imageCache.get(UIConstants.LIB_SYSTEM), true);
            }
        } catch (CoreException e) {
            Log.log(e);
        }

        predefinedCompletions = new InterpreterInfoTreeNode<LabelAndImage>(root, new LabelAndImage(
                "Predefined Completions", imageCache.get(UIConstants.LIB_SYSTEM_ROOT)));

        for (String string : interpreterInfo.getPredefinedCompletionsPath()) {
            new PythonpathTreeNode(predefinedCompletions, new File(string), imageCache.get(UIConstants.LIB_SYSTEM),
                    true);
        }

        forcedBuiltins = new InterpreterInfoTreeNode<LabelAndImage>(root, new LabelAndImage("Forced builtins",
                imageCache.get(UIConstants.LIB_SYSTEM_ROOT)));

        for (Iterator<String> it = interpreterInfo.forcedLibsIterator(); it.hasNext();) {
            String string = it.next();
            new InterpreterInfoTreeNode<LabelAndImage>(forcedBuiltins, new LabelAndImage(string,
                    imageCache.get(UIConstants.LIB_FORCED_BUILTIN)));
        }
    }
View Full Code Here

    /**
     *
     */
    public FileTreeLabelProvider() {
        imageCache = new ImageCache(PydevPlugin.getDefault().getBundle().getEntry("/"));
    }
View Full Code Here

                nameToInfo.put(interpreterInfo.getName(), interpreterInfo.makeCopy());
            }
        }

        if (USE_ICONS) {
            ImageCache imageCache = PydevPlugin.getImageCache();
            imageSystemLibRoot = imageCache.get(UIConstants.LIB_SYSTEM_ROOT);
            imageSystemLib = imageCache.get(UIConstants.LIB_SYSTEM);
            environmentImage = imageCache.get(UIConstants.ENVIRONMENT_ICON);
        }
        createControl(parent);
        updateTree();
    }
View Full Code Here

        assists.add(new AssistDocString());
        assists.add(new AssistAssign());
        assists.add(new AssistPercentToFormat());

        assists.addAll(ExtensionHelper.getParticipants(ExtensionHelper.PYDEV_CTRL_1));
        ImageCache imageCache = PydevPlugin.getImageCache();
        File editorFile = edit.getEditorFile();
        IPythonNature pythonNature = null;
        try {
            pythonNature = edit.getPythonNature();
        } catch (MisconfigurationException e1) {
View Full Code Here

        }
    }

    public void updateForceTabsMessage() {
        boolean forceTabs = getIndentPrefs().getForceTabs();
        ImageCache imageCache = PydevPlugin.getImageCache();
        ImageDescriptor desc;
        if (forceTabs) {
            desc = imageCache.getDescriptor(UIConstants.FORCE_TABS_ACTIVE);
        } else {
            desc = imageCache.getDescriptor(UIConstants.FORCE_TABS_INACTIVE);
        }
        IEditorStatusLine statusLine = (IEditorStatusLine) getAdapter(IEditorStatusLine.class);
        if (statusLine != null) {
            statusLine.setMessage(false, forceTabs ? "Forcing tabs" : "Not forcing tabs.", desc.createImage());
        }
View Full Code Here

    /*default*/Image imageClass;
    /*default*/Image imageMethod;
    /*default*/Image imageModule;

    public TddQuickFixParticipant() {
        ImageCache imageCache = PydevPlugin.getImageCache();
        if (imageCache != null) { //making tests
            imageClass = imageCache.get(UIConstants.CREATE_CLASS_ICON);
            imageMethod = imageCache.get(UIConstants.CREATE_METHOD_ICON);
            imageModule = imageCache.get(UIConstants.CREATE_MODULE_ICON);
        }
    }
View Full Code Here

    }

    // returns images based upon element type
    public Image getImage() {
        ImageCache imageCache = PydevPlugin.getImageCache();
        if (astThis == null) {
            return imageCache.get(UIConstants.ERROR);
        }

        SimpleNode token = astThis.node;
        return getImageForNode(imageCache, token, astThis.parent);
    }
View Full Code Here

TOP

Related Classes of org.python.pydev.core.bundle.ImageCache$ImageDecorator

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.