Package com.vaadin.terminal

Examples of com.vaadin.terminal.Resource


     * @return the icon corresponding to the given file
     */
    public static Resource getIcon(String fileName) {

        final String mimeType = getMIMEType(fileName);
        final Resource icon = (Resource) MIMEToIconMap.get(mimeType);
        if (icon != null) {
            return icon;
        }

        // If nothing is known about the file-type, general file
View Full Code Here


     * @return the icon corresponding to the given file
     */
    public static Resource getIcon(File file) {

        final String mimeType = getMIMEType(file);
        final Resource icon = (Resource) MIMEToIconMap.get(mimeType);
        if (icon != null) {
            return icon;
        }

        // If nothing is known about the file-type, general file
View Full Code Here

            Command command = item.getCommand();
            if (command != null) {
                target.addAttribute("command", true);
            }

            Resource icon = item.getIcon();
            if (icon != null) {
                target.addAttribute("icon", icon);
            }

            if (!item.isEnabled()) {
View Full Code Here

            }

            // Gets the option attribute values
            final String key = itemIdMapper.key(id);
            final String caption = getItemCaption(id);
            final Resource icon = getItemIcon(id);
            getCaptionChangeListener().addNotifierForItem(id);

            // Paints the option
            target.startTag("so");
            if (icon != null) {
View Full Code Here

                    }
                }

                // Adds the attributes
                target.addAttribute("caption", getItemCaption(itemId));
                final Resource icon = getItemIcon(itemId);
                if (icon != null) {
                    target.addAttribute("icon", getItemIcon(itemId));
                }
                final String key = itemIdMapper.key(itemId);
                target.addAttribute("key", key);
View Full Code Here

    public static Resource getIcon(String fileName) {
        return getIconByMimeType(getMIMEType(fileName));
    }

    private static Resource getIconByMimeType(String mimeType) {
        final Resource icon = MIMEToIconMap.get(mimeType);
        if (icon != null) {
            return icon;
        }

        // If nothing is known about the file-type, general file
View Full Code Here

                    }
                }

                // Adds the attributes
                target.addAttribute("caption", getItemCaption(itemId));
                final Resource icon = getItemIcon(itemId);
                if (icon != null) {
                    target.addAttribute("icon", getItemIcon(itemId));
                }
                final String key = itemIdMapper.key(itemId);
                target.addAttribute("key", key);
View Full Code Here

            }

            // Gets the option attribute values
            final String key = itemIdMapper.key(id);
            final String caption = getItemCaption(id);
            final Resource icon = getItemIcon(id);
            getCaptionChangeListener().addNotifierForItem(id);

            // Paints the option
            target.startTag("so");
            if (icon != null) {
View Full Code Here

    public void moveComponentsFrom(ComponentContainer source) {
        for (final Iterator<Component> i = source.getComponentIterator(); i
                .hasNext();) {
            final Component c = i.next();
            String caption = null;
            Resource icon = null;
            if (TabSheet.class.isAssignableFrom(source.getClass())) {
                caption = ((TabSheet) source).getTabCaption(c);
                icon = ((TabSheet) source).getTabIcon(c);
            }
            source.removeComponent(c);
View Full Code Here

            if (tab.isClosable()) {
                target.addAttribute("closable", true);
            }

            final Resource icon = tab.getIcon();
            if (icon != null) {
                target.addAttribute("icon", icon);
            }
            final String caption = tab.getCaption();
            if (caption != null && caption.length() > 0) {
View Full Code Here

TOP

Related Classes of com.vaadin.terminal.Resource

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.