Package com.vaadin.terminal

Examples of com.vaadin.terminal.Resource


    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

        Tab newTab = tabs.get(newComponent);
        Tab oldTab = tabs.get(oldComponent);

        // Gets the captions
        String oldCaption = null;
        Resource oldIcon = null;
        String newCaption = null;
        Resource newIcon = null;

        if (oldTab != null) {
            oldCaption = oldTab.getCaption();
            oldIcon = oldTab.getIcon();
        }
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

  protected void initPicture(IdentityService identityService, boolean renderPicture, final String userName) {
    if(renderPicture) {
      Picture picture = identityService.getUserPicture(userName);
      if(picture != null) {
        Resource imageResource = new StreamResource(new InputStreamStreamSource(picture.getInputStream()),
          userName + picture.getMimeType(), ExplorerApp.get());
       
        Embedded image = new Embedded(null, imageResource);
        image.addStyleName(ExplorerLayout.STYLE_CLICKABLE);
        image.setType(Embedded.TYPE_IMAGE);
View Full Code Here

    // Add all possible attachment types
    for (AttachmentEditor editor : attachmentRendererManager.getAttachmentEditors()) {
      String name = editor.getTitle(i18nManager);
      Embedded image = null;

      Resource resource = editor.getImage();
      if (resource != null) {
        image = new Embedded(null, resource);
      }
      Item item = attachmentTypes.addItem(editor.getName());
      item.getItemProperty("type").setValue(image);
View Full Code Here

      item.getItemProperty("tableName").setValue(tableName + " (" + tables.get(tableName) + ")");
    }
  }
 
  protected Embedded determineTableIcon(String tableName) {
      Resource image = null;
      if (tableName.contains("ACT_HI")) {
        image = Images.DATABASE_HISTORY;
      } else if (tableName.contains("ACT_RU")) {
        image = Images.DATABASE_RUNTIME;
      } else if (tableName.contains("ACT_RE")) {
View Full Code Here

    TaskService taskService = ProcessEngines.getDefaultProcessEngine().getTaskService();
   
    String mimeType = extractMineType(attachment.getType());
   
    InputStream imageStream = ImageUtil.resizeImage(taskService.getAttachmentContent(attachment.getId()), mimeType, 900, 550);
    Resource resource = new StreamResource(new InputStreamStreamSource(imageStream),
            attachment.getName() + extractExtention(attachment.getType()),ExplorerApp.get());
    Embedded image = new Embedded(null, resource);
    verticalLayout.addComponent(image);
   
    // Linke
    HorizontalLayout LinkLayout = new HorizontalLayout();
    LinkLayout.setSpacing(true);
    verticalLayout.addComponent(LinkLayout);
    verticalLayout.setComponentAlignment(LinkLayout, Alignment.MIDDLE_CENTER);
   
    Label fullSizeLabel = new Label(ExplorerApp.get().getI18nManager().getMessage(Messages.RELATED_CONTENT_SHOW_FULL_SIZE));
    LinkLayout.addComponent(fullSizeLabel);
   
    Link link = null;
    if(attachment.getUrl() != null) {
      link = new Link(attachment.getUrl(), new ExternalResource(attachment.getUrl()));
    } else {
      taskService = ProcessEngines.getDefaultProcessEngine().getTaskService();
      Resource res = new StreamResource(new InputStreamStreamSource(taskService.getAttachmentContent(attachment.getId())),
              attachment.getName() + extractExtention(attachment.getType()),ExplorerApp.get());
     
      link = new Link(attachment.getName(), res);
    }
   
View Full Code Here

      addUserPicture();
      addUserDetails();
    }

    protected void addUserPicture() {
      Resource pictureResource = Images.USER_32; // default icon
      if (user != null) {
        final Picture userPicture = identityService.getUserPicture(user.getId());
        if (userPicture != null) {
          pictureResource = new StreamResource(new StreamSource() {       
            public InputStream getStream() {
View Full Code Here

  protected Component createTaskIcon(TaskItemProviderParams params) {
    BpmTask task = params.getTask();
    final ProcessDefinitionConfig cfg = task.getProcessInstance().getDefinition();
    String path = cfg.getProcessLogo() != null ? cfg.getBpmDefinitionKey() + "_" + cfg.getId() + "_logo.png" : "/img/aperte-logo.png";
    Resource res = params.getResource(path);
    if (res == null) {
      if (cfg.getProcessLogo() != null) {
        res = params.getStreamResource(path, cfg.getProcessLogo());
      }
      else {
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.