Package com.vaadin.ui

Examples of com.vaadin.ui.CssLayout


//    initSortMenu();
  }  

  protected void initInputField() {
    // Csslayout is used to style inputtext as rounded
    CssLayout csslayout = new CssLayout();
    csslayout.setHeight(24, UNITS_PIXELS);
    csslayout.setWidth(100, UNITS_PERCENTAGE);
    layout.addComponent(csslayout);
   
    inputField = new TextField();
    inputField.setWidth(100, UNITS_PERCENTAGE);
    inputField.addStyleName(ExplorerLayout.STYLE_SEARCHBOX);
    inputField.setInputPrompt(i18nManager.getMessage(Messages.TASK_CREATE_NEW));
    inputField.focus();
    csslayout.addComponent(inputField);
   
    layout.setComponentAlignment(csslayout, Alignment.MIDDLE_LEFT);
    layout.setExpandRatio(csslayout, 1.0f);
  }
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

  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

//    initSortMenu();
  }  

  protected void initInputField() {
    // Csslayout is used to style inputtext as rounded
    CssLayout csslayout = new CssLayout();
    csslayout.setHeight(24, UNITS_PIXELS);
    csslayout.setWidth(100, UNITS_PERCENTAGE);
    layout.addComponent(csslayout);
   
    inputField = new TextField();
    inputField.setWidth(100, UNITS_PERCENTAGE);
    inputField.addStyleName(ExplorerLayout.STYLE_SEARCHBOX);
    inputField.setInputPrompt(i18nManager.getMessage(Messages.TASK_CREATE_NEW));
    inputField.focus();
    csslayout.addComponent(inputField);
   
    layout.setComponentAlignment(csslayout, Alignment.MIDDLE_LEFT);
    layout.setExpandRatio(csslayout, 1.0f);
  }
View Full Code Here

import com.vaadin.ui.Window;

public class HelpOverlay extends Window {

    public HelpOverlay() {
        setContent(new CssLayout());
        setPrimaryStyleName("help-overlay");
        setDraggable(false);
        setResizable(false);
    }
View Full Code Here

        tabs.setSizeFull();
        tabs.addStyleName("borderless");
        addComponent(tabs);
        tabs.addComponent(buildCalendarView());

        catalog = new CssLayout();
        catalog.setCaption("Catalog");
        catalog.addStyleName("catalog");
        tabs.addComponent(catalog);

     /*   for (final Movie movie : DataProvider.getMovies()) {
View Full Code Here

          e.printStackTrace();
        }
       
      }
    });;
        CssLayout panel = createPanel(notes);
        panel.addStyleName("notes");
        row.addComponent(panel);

        row = new HorizontalLayout();
        row.setMargin(true);
        row.setSizeFull();
View Full Code Here

        row.addComponent(createPanel(new ChartComposicionCartera().getChart()));

    }

    private CssLayout createPanel(Component content) {
        CssLayout panel = new CssLayout();
        panel.addStyleName("layout-panel");
        panel.setSizeFull();

        Button configure = new Button();
        configure.addStyleName("configure");
        configure.addStyleName("icon-cog");
        configure.addStyleName("icon-only");
        configure.addStyleName("borderless");
        configure.setDescription("Configure");
        configure.addStyleName("small");
        configure.addClickListener(new ClickListener() {
            /**
       *
       */
      private static final long serialVersionUID = 7437776387499650365L;

      @Override
            public void buttonClick(ClickEvent event) {
                Notification.show("No Implementado");
            }
        });
        panel.addComponent(configure);

        panel.addComponent(content);
        return panel;
    }
View Full Code Here

        loginLayout = new VerticalLayout();
        loginLayout.setSizeFull();
        loginLayout.addStyleName("login-layout");
        root.addComponent(loginLayout);

        final CssLayout loginPanel = new CssLayout();
        loginPanel.addStyleName("login-panel");

        HorizontalLayout labels = new HorizontalLayout();
        labels.setWidth("100%");
        labels.setMargin(true);
        labels.addStyleName("labels");
        loginPanel.addComponent(labels);

        Label welcome = new Label("Bienvenido");
        welcome.setSizeUndefined();
        welcome.addStyleName("h4");
        labels.addComponent(welcome);
        labels.setComponentAlignment(welcome, Alignment.MIDDLE_LEFT);

        Label title = new Label("Finanzas Budget");
        title.setSizeUndefined();
        title.addStyleName("h2");
        title.addStyleName("light");
        labels.addComponent(title);
        labels.setComponentAlignment(title, Alignment.MIDDLE_RIGHT);

        HorizontalLayout fields = new HorizontalLayout();
        fields.setSpacing(true);
        fields.setMargin(true);
        fields.addStyleName("fields");

        final TextField username = new TextField("Username");
        username.focus();
        fields.addComponent(username);
       
        final PasswordField password = new PasswordField("Password");
        fields.addComponent(password);
        //TODO: Borrar
        password.setValue("root");
        username.setValue("admin@tesis.com");
       
        final Button signin = new Button("Sign In");
        signin.addStyleName("default");
        fields.addComponent(signin);
        fields.setComponentAlignment(signin, Alignment.BOTTOM_LEFT);

        final ShortcutListener enter = new ShortcutListener("Sign In",
                KeyCode.ENTER, null) {
            /**
           *
           */
          private static final long serialVersionUID = -2425923923914266067L;

      @Override
            public void handleAction(Object sender, Object target) {
                signin.click();
            }
        };

        signin.addClickListener(new ClickListener() {
            /**
       *
       */
      private static final long serialVersionUID = 8646342267124075364L;
     

      @Override
            public void buttonClick(ClickEvent event) {
        if (username.getValue() != null
            && password.getValue() != null
            )
          idUsuario = Usuario.Login(username.getValue(),password.getValue());
        if (idUsuario != null){
          signin.removeShortcutListener(enter);
          buildMainView();

        } else {
          if (loginPanel.getComponentCount() > 2) {
            // Remove the previous error message
            loginPanel.removeComponent(loginPanel.getComponent(2));
          }
          // Add new error message
          Label error = new Label(
              "Wrong username or password. <span>Hint: try empty values</span>",
              ContentMode.HTML);
          error.addStyleName("error");
          error.setSizeUndefined();
          error.addStyleName("light");
          // Add animation
          error.addStyleName("v-animate-reveal");
          loginPanel.addComponent(error);
          username.focus();
        }
      }
        });

        signin.addShortcutListener(enter);

        loginPanel.addComponent(fields);

        loginLayout.addComponent(loginPanel);
        loginLayout.setComponentAlignment(loginPanel, Alignment.MIDDLE_CENTER);
    }
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.