Package com.vaadin.shared.communication

Examples of com.vaadin.shared.communication.URLReference


     *            a string identifying the resource.
     * @return the resource URL as a string, or <code>null</code> if no
     *         corresponding resource is found.
     */
    public String getResourceUrl(String key) {
        URLReference urlReference = getState().resources.get(key);
        if (urlReference == null) {
            return null;
        } else {
            return urlReference.getURL();
        }
    }
View Full Code Here


        widget.setControls(state.showControls);

        if (event.hasPropertyChanged("sources")) {
            widget.removeAllSources();
            for (int i = 0; i < state.sources.size(); i++) {
                URLReference source = state.sources.get(i);
                String sourceType = state.sourceTypes.get(i);
                widget.addSource(source.getURL(), sourceType);
            }
            widget.load();
        }
    }
View Full Code Here

    private void updateCaptionInternal(ComponentConnector child) {
        Slot slot = getWidget().getSlot(child.getWidget());

        String caption = child.getState().caption;
        URLReference iconUrl = child.getState().resources
                .get(ComponentConstants.ICON_RESOURCE);
        String iconUrlString = iconUrl != null ? iconUrl.getURL() : null;
        Icon icon = child.getConnection().getIcon(iconUrlString);

        List<String> styles = child.getState().styles;
        String error = child.getState().errorMessage;
        boolean showError = error != null;
View Full Code Here

        assertEquals("Unexpected resource is got on getResource() method",
                resource, opener.getResource());
        Assert.assertNull("Unexpected resource is got on getUrl() method",
                opener.getUrl());

        URLReference ref = opener.getState(false).resources
                .get(BrowserWindowOpenerState.locationResource);
        Assert.assertTrue(
                "Url reference in the state is not ResourceReference",
                ref instanceof ResourceReference);
        Assert.assertEquals("Unexpected resource saved in state", resource,
View Full Code Here

                opener.getUrl());
        Assert.assertNotNull(
                "Unexpected resource is got on getResource() method",
                opener.getResource());

        URLReference ref = opener.getState(false).resources
                .get(BrowserWindowOpenerState.locationResource);
        Assert.assertTrue(
                "Url reference in the state is not ResourceReference",
                ref instanceof ResourceReference);
        Resource resource = ((ResourceReference) ref).getResource();
View Full Code Here

                        "Requested source index {0} is out of bounds",
                        sourceIndex);
                return false;
            }

            URLReference reference = sources.get(sourceIndex);
            ConnectorResource resource = (ConnectorResource) ResourceReference
                    .getResource(reference);
            stream = resource.getStream();
        } finally {
            session.unlock();
View Full Code Here

                        "Requested source index {0} is out of bounds",
                        sourceIndex);
                return false;
            }

            URLReference reference = sources.get(sourceIndex);
            ConnectorResource resource = (ConnectorResource) ResourceReference
                    .getResource(reference);
            stream = resource.getStream();
        } finally {
            session.unlock();
View Full Code Here

                        "Requested source index {0} is out of bounds",
                        sourceIndex);
                return false;
            }

            URLReference reference = sources.get(sourceIndex);
            ConnectorResource resource = (ConnectorResource) ResourceReference
                    .getResource(reference);
            resource.getStream().writeResponse(request, response);
            return true;
        } else {
View Full Code Here

TOP

Related Classes of com.vaadin.shared.communication.URLReference

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.