Package com.vaadin.ui

Examples of com.vaadin.ui.CssLayout


    header.setWidth("100%");
    header.setMargin(true);
    header.setSpacing(true);
    // header.setStyleName(Reindeer.LAYOUT_BLACK);

    CssLayout titleLayout = new CssLayout();
    H2 title = new H2("Dynamic Vaadin OSGi Demo");
    titleLayout.addComponent(title);
    SmallText description = new SmallText(
        "Select the \"Bundle View\" tab and activate/stop OSGi bundles dynamically.");
    description.setSizeUndefined();
    titleLayout.addComponent(description);

    header.addComponent(titleLayout);

    return header;
  }
View Full Code Here


      VerticalLayout layout = (VerticalLayout) aboutWindow.getContent();
      layout.setMargin(true);
      layout.setSpacing(true);
      layout.setStyleName("blue");

      CssLayout titleLayout = new CssLayout();
      H2 title = new H2("Dynamic Vaadin OSGi Demo");
      titleLayout.addComponent(title);
      SmallText description = new SmallText(
          "<br>Copyright (c) Siemens AG, Kai Tödter and others.<br>"
              + "Licensed under Eclipse Public License (EPL).<br><br>"
              + "This software contains modules licenced under<br>"
              + " the Apache Software Foundation 2.0 license (ASF) and EPL<br><br>"
              + "Many thanks to Chris Brind, Neil Bartlett and<br>"
              + " Petter Holmström for their OSGi and Vaadin<br>"
              + " related work, blogs, and bundles.<br><br>"
              + "The icons are from the Silk icon set by Mark James<br>"
              + "<a href=\"http://www.famfamfam.com/lab/icons/silk/\">http://www.famfamfam.com/lab/icons/silk/</a>");
      description.setSizeUndefined();
      description.setContentMode(Label.CONTENT_XHTML);

      titleLayout.addComponent(description);
      aboutWindow.addComponent(titleLayout);

      @SuppressWarnings("serial")
      Button close = new Button("Close", new Button.ClickListener() {
        @Override
View Full Code Here

  public void setMainNavigation(String navigation) {
    mainMenuBar.setMainNavigation(navigation);
  }
 
  protected void initHeader() {
    header = new CssLayout();
    header.addStyleName(ExplorerLayout.STYLE_HEADER);
    header.setWidth(100, UNITS_PERCENTAGE);
    addComponent(header);
  }
View Full Code Here

    header.setWidth(100, UNITS_PERCENTAGE);
    addComponent(header);
  }

  protected void initMain() {
    main = new CssLayout();
    main.setSizeFull();
    main.addStyleName(ExplorerLayout.STYLE_MAIN_CONTENT);
    addComponent(main);
    setExpandRatio(main, 1.0f);
  }
View Full Code Here

    addComponent(main);
    setExpandRatio(main, 1.0f);
  }

  protected void initFooter() {
    footer = new CssLayout();
    footer.setWidth(100, UNITS_PERCENTAGE);
    footer.addStyleName(ExplorerLayout.STYLE_MAIN_FOOTER);
    addComponent(footer);
   
    Label footerLabel = new Label();
View Full Code Here

    taskDetails.setColumnExpandRatio(4, 1.0f);
    centralLayout.addComponent(taskDetails);
  }
 
  protected void initDescription() {
    CssLayout descriptionLayout = new CssLayout();
    descriptionLayout.addStyleName(ExplorerLayout.STYLE_DETAIL_BLOCK);
    descriptionLayout.setWidth(100, UNITS_PERCENTAGE);
   
    if (historicTask.getDescription() != null) {
      Label descriptionLabel = new Label(historicTask.getDescription());
      descriptionLayout.addComponent(descriptionLabel);
    }
   
    centralLayout.addComponent(descriptionLayout);
  }
View Full Code Here

      layout.setComponentAlignment(claimButton, Alignment.MIDDLE_LEFT);
    }
  }

  protected void initDescription(HorizontalLayout layout) {
    final CssLayout descriptionLayout = new CssLayout();
    descriptionLayout.setWidth(100, UNITS_PERCENTAGE);
    layout.addComponent(descriptionLayout);
    layout.setExpandRatio(descriptionLayout, 1.0f);
    layout.setComponentAlignment(descriptionLayout, Alignment.MIDDLE_LEFT);

    String descriptionText = null;
    if (task.getDescription() != null && !"".equals(task.getDescription())) {
      descriptionText = task.getDescription();
    } else {
      descriptionText = i18nManager.getMessage(Messages.TASK_NO_DESCRIPTION);
    }
    final Label descriptionLabel = new Label(descriptionText);
    descriptionLabel.addStyleName(ExplorerLayout.STYLE_CLICKABLE);
    descriptionLayout.addComponent(descriptionLabel);
   
    descriptionLayout.addListener(new LayoutClickListener() {
      public void layoutClick(LayoutClickEvent event) {
        if (event.getClickedComponent() != null && event.getClickedComponent().equals(descriptionLabel)) {
          // layout for textarea + ok button
          final VerticalLayout editLayout = new VerticalLayout();
          editLayout.setSpacing(true);
         
          // textarea
          final TextArea descriptionTextArea = new TextArea();
          descriptionTextArea.setNullRepresentation("");
          descriptionTextArea.setWidth(100, UNITS_PERCENTAGE);
          descriptionTextArea.setValue(task.getDescription());
          editLayout.addComponent(descriptionTextArea);
         
          // ok button
          Button okButton = new Button(i18nManager.getMessage(Messages.BUTTON_OK));
          editLayout.addComponent(okButton);
          editLayout.setComponentAlignment(okButton, Alignment.BOTTOM_RIGHT);
         
          // replace
          descriptionLayout.replaceComponent(descriptionLabel, editLayout);
         
          // When OK is clicked -> update task data + ui
          okButton.addListener(new ClickListener() {
            public void buttonClick(ClickEvent event) {
              // Update data
              task.setDescription(descriptionTextArea.getValue().toString());
              taskService.saveTask(task);
             
              // Update UI
              descriptionLabel.setValue(task.getDescription());
              descriptionLayout.replaceComponent(editLayout, descriptionLabel);
            }
          });
        }
      }
    });
View Full Code Here

      centralLayout.addComponent(taskForm);
    } else {
      // Just add a button to complete the task
      // TODO: perhaps move to a better place
     
      CssLayout buttonLayout = new CssLayout();
      buttonLayout.addStyleName(ExplorerLayout.STYLE_DETAIL_BLOCK);
      buttonLayout.setWidth(100, UNITS_PERCENTAGE);
      centralLayout.addComponent(buttonLayout);
     
      completeButton = new Button(i18nManager.getMessage(Messages.TASK_COMPLETE));
     
      completeButton.addListener(new ClickListener() {
       
        private static final long serialVersionUID = 1L;

        public void buttonClick(ClickEvent event) {
          // If no owner, make assignee owner (will go into archived then)
          if (task.getOwner() == null) {
            task.setOwner(task.getAssignee());
            taskService.setOwner(task.getId(), task.getAssignee());
          }
         
          taskService.complete(task.getId());    
          notificationManager.showInformationNotification(Messages.TASK_COMPLETED, task.getName());
          taskPage.refreshSelectNext();
        }
      });
     
      completeButton.setEnabled(isCurrentUserAssignee() || isCurrentUserOwner());
      buttonLayout.addComponent(completeButton);
    }
  }
View Full Code Here

    taskDetails.setColumnExpandRatio(4, 1.0f);
    centralLayout.addComponent(taskDetails);
  }
 
  protected void initDescription() {
    CssLayout descriptionLayout = new CssLayout();
    descriptionLayout.addStyleName(ExplorerLayout.STYLE_DETAIL_BLOCK);
    descriptionLayout.setWidth(100, UNITS_PERCENTAGE);
   
    if (historicTask.getDescription() != null) {
      Label descriptionLabel = new Label(historicTask.getDescription());
      descriptionLayout.addComponent(descriptionLabel);
    }
   
    centralLayout.addComponent(descriptionLayout);
  }
View Full Code Here

  public DetailPanel() {
    setSizeFull();
    addStyleName(ExplorerLayout.STYLE_DETAIL_PANEL);
    setMargin(true);
   
    CssLayout cssLayout = new CssLayout(); // Needed for rounded corners
    cssLayout.addStyleName(ExplorerLayout.STYLE_DETAIL_PANEL);
    cssLayout.setSizeFull();
    super.addComponent(cssLayout);
   
    mainPanel = new Panel();
    mainPanel.addStyleName(Reindeer.PANEL_LIGHT);
    mainPanel.setSizeFull();
    cssLayout.addComponent(mainPanel);
   
    // Use default layout
    VerticalLayout verticalLayout = new VerticalLayout();
    verticalLayout.setWidth(100, UNITS_PERCENTAGE);
    verticalLayout.setMargin(true);
View Full Code Here

TOP

Related Classes of com.vaadin.ui.CssLayout

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.