Examples of ImageCache


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

    public static Image getImageForAutoImportTypeInfo(IInfo info) {
        switch (info.getType()) {
            case IInfo.CLASS_WITH_IMPORT_TYPE:
                if (autoImportClassWithImportType == null) {
                    synchronized (lock) {
                        ImageCache imageCache = org.python.pydev.plugin.PydevPlugin.getImageCache();
                        autoImportClassWithImportType = imageCache.getImageDecorated(UIConstants.CLASS_ICON,
                                UIConstants.CTX_INSENSITIVE_DECORATION_ICON,
                                ImageCache.DECORATION_LOCATION_BOTTOM_RIGHT);
                    }
                }
                return autoImportClassWithImportType;

            case IInfo.METHOD_WITH_IMPORT_TYPE:
                if (autoImportMethodWithImportType == null) {
                    synchronized (lock) {
                        ImageCache imageCache = org.python.pydev.plugin.PydevPlugin.getImageCache();
                        autoImportMethodWithImportType = imageCache.getImageDecorated(UIConstants.METHOD_ICON,
                                UIConstants.CTX_INSENSITIVE_DECORATION_ICON,
                                ImageCache.DECORATION_LOCATION_BOTTOM_RIGHT);
                    }
                }
                return autoImportMethodWithImportType;

            case IInfo.ATTRIBUTE_WITH_IMPORT_TYPE:
                if (autoImportAttributeWithImportType == null) {
                    synchronized (lock) {
                        ImageCache imageCache = org.python.pydev.plugin.PydevPlugin.getImageCache();
                        autoImportAttributeWithImportType = imageCache.getImageDecorated(UIConstants.PUBLIC_ATTR_ICON,
                                UIConstants.CTX_INSENSITIVE_DECORATION_ICON,
                                ImageCache.DECORATION_LOCATION_BOTTOM_RIGHT);
                    }
                }
                return autoImportAttributeWithImportType;

            case IInfo.MOD_IMPORT_TYPE:
                if (autoImportModImportType == null) {
                    synchronized (lock) {
                        ImageCache imageCache = org.python.pydev.plugin.PydevPlugin.getImageCache();
                        autoImportModImportType = imageCache.getImageDecorated(UIConstants.FOLDER_PACKAGE_ICON,
                                UIConstants.CTX_INSENSITIVE_DECORATION_ICON,
                                ImageCache.DECORATION_LOCATION_BOTTOM_RIGHT);
                    }
                }
                return autoImportModImportType;
View Full Code Here

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

    public static Image getImageForTypeInfo(IInfo info) {
        switch (info.getType()) {
            case IInfo.CLASS_WITH_IMPORT_TYPE:
                if (classWithImportType == null) {
                    synchronized (lock) {
                        ImageCache imageCache = org.python.pydev.plugin.PydevPlugin.getImageCache();
                        classWithImportType = imageCache.get(UIConstants.CLASS_ICON);
                    }
                }
                return classWithImportType;

            case IInfo.METHOD_WITH_IMPORT_TYPE:
                if (methodWithImportType == null) {
                    synchronized (lock) {
                        ImageCache imageCache = org.python.pydev.plugin.PydevPlugin.getImageCache();
                        methodWithImportType = imageCache.get(UIConstants.METHOD_ICON);
                    }
                }
                return methodWithImportType;

            case IInfo.ATTRIBUTE_WITH_IMPORT_TYPE:
                if (attributeWithImportType == null) {
                    synchronized (lock) {
                        ImageCache imageCache = org.python.pydev.plugin.PydevPlugin.getImageCache();
                        attributeWithImportType = imageCache.get(UIConstants.PUBLIC_ATTR_ICON);
                    }
                }
                return attributeWithImportType;

            case IInfo.MOD_IMPORT_TYPE:
                if (modImportType == null) {
                    synchronized (lock) {
                        ImageCache imageCache = org.python.pydev.plugin.PydevPlugin.getImageCache();
                        modImportType = imageCache.get(UIConstants.FOLDER_PACKAGE_ICON);
                    }
                }
                return modImportType;
            default:
                throw new RuntimeException("Undefined type.");
View Full Code Here

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

        return "plugin_id";
    }

    public ImageCache getImageCache() {
        try {
            return new ImageCache(new URL("file:///" + TestDependent.TEST_PYDEV_PLUGIN_LOC));
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

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

    public static boolean getTitleShowExtension() {
        return PydevPrefs.getPreferences().getBoolean(TITLE_EDITOR_SHOW_EXTENSION);
    }

    public static Image getInitIcon() {
        ImageCache imageCache = PydevPlugin.getImageCache();
        if (useCustomInitIcon()) {
            return imageCache.get(UIConstants.CUSTOM_INIT_ICON);
        } else {
            return imageCache.get(UIConstants.PY_FILE_ICON); //default icon
        }
    }
View Full Code Here

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

     * @param type
     * @return
     */
    public static Image getImageForType(int type) {
        try {
            ImageCache imageCache = PydevPlugin.getImageCache();
            if (imageCache == null)
                return null;

            switch (type) {
                case IToken.TYPE_IMPORT:
                    return imageCache.get(UIConstants.COMPLETION_IMPORT_ICON);

                case IToken.TYPE_CLASS:
                    return imageCache.get(UIConstants.COMPLETION_CLASS_ICON);

                case IToken.TYPE_FUNCTION:
                    return imageCache.get(UIConstants.METHOD_ICON);

                case IToken.TYPE_ATTR:
                    return imageCache.get(UIConstants.PUBLIC_ATTR_ICON);

                case IToken.TYPE_BUILTIN:
                    return imageCache.get(UIConstants.BUILTINS_ICON);

                case IToken.TYPE_PARAM:
                case IToken.TYPE_LOCAL:
                case IToken.TYPE_OBJECT_FOUND_INTERFACE:
                    return imageCache.get(UIConstants.COMPLETION_PARAMETERS_ICON);

                case IToken.TYPE_PACKAGE:
                    return imageCache.get(UIConstants.COMPLETION_PACKAGE_ICON);

                case IToken.TYPE_RELATIVE_IMPORT:
                    return imageCache.get(UIConstants.COMPLETION_RELATIVE_IMPORT_ICON);

                case IToken.TYPE_EPYDOC:
                    return imageCache.get(UIConstants.COMPLETION_EPYDOC);

                default:
                    return null;
            }

View Full Code Here

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

                }
            }

            //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(zipPath)) {
                        icon = imageCache.get(UIConstants.PY_FILE_ICON);
                    } else {
                        icon = imageCache.get(UIConstants.FILE_ICON);
                    }
                }
            }
        } finally {
            setData(new LabelAndImage(getLabel(zipPath), icon));
View Full Code Here

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

        plugin = this;
    }

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

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

                }
            }

            //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

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

            }
        }
        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

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

    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
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.