Example usage for com.vaadin.ui HorizontalLayout setSpacing

List of usage examples for com.vaadin.ui HorizontalLayout setSpacing

Introduction

In this page you can find the example usage for com.vaadin.ui HorizontalLayout setSpacing.

Prototype

@Override
    public void setSpacing(boolean spacing) 

Source Link

Usage

From source file:com.klwork.explorer.ui.task.ProcessInstanceEventsPanel.java

License:Apache License

protected void addInputField() {
    HorizontalLayout hLayout = new HorizontalLayout();
    hLayout.setSpacing(true);
    hLayout.setWidth(100, Unit.PERCENTAGE);
    pMainContent.addComponent(hLayout);//from   w w w .j  a v  a  2  s. co m
    // ?
    initAddEventInput(hLayout);

    Button addCommentButton = new Button(i18nManager.getMessage(Messages.TASK_ADD_COMMENT));
    hLayout.addComponent(addCommentButton);
    hLayout.setComponentAlignment(addCommentButton, Alignment.MIDDLE_LEFT);
    addCommentButton.addClickListener(new ClickListener() {
        public void buttonClick(ClickEvent event) {
            addNewComment(commentInputField.getValue().toString());
        }
    });
}

From source file:com.klwork.explorer.ui.task.TaskDetailPanel.java

License:Apache License

protected void initHeader() {
    GridLayout taskDetails = new GridLayout(2, 2);
    taskDetails.setWidth(100, Unit.PERCENTAGE);
    taskDetails.addStyleName(ExplorerLayout.STYLE_TITLE_BLOCK);
    taskDetails.setSpacing(true);/* w  ww.  j a  va2s.  c o m*/
    taskDetails.setMargin(new MarginInfo(false, false, true, false));
    taskDetails.setColumnExpandRatio(1, 1.0f);
    centralLayout.addComponent(taskDetails);

    // Add image
    Embedded image = new Embedded(null, Images.TASK_50);
    //??
    taskDetails.addComponent(image, 0, 0, 0, 1);

    // Add task name
    Label nameLabel = new Label(task.getName());
    nameLabel.addStyleName(Reindeer.LABEL_H2);
    taskDetails.addComponent(nameLabel, 1, 0);
    taskDetails.setComponentAlignment(nameLabel, Alignment.MIDDLE_LEFT);

    // Properties
    HorizontalLayout propertiesLayout = new HorizontalLayout();//
    propertiesLayout.setSpacing(true);
    taskDetails.addComponent(propertiesLayout);

    propertiesLayout.addComponent(new DueDateComponent(task, i18nManager, taskService));
    propertiesLayout.addComponent(new PriorityComponent(task, i18nManager, taskService));
    //?
    initCreateTime(propertiesLayout);
}

From source file:com.klwork.explorer.ui.task.TaskDetailPanel.java

License:Apache License

protected void initDescriptionAndClaimButton() {
    HorizontalLayout layout = new HorizontalLayout();
    layout.addStyleName(ExplorerLayout.STYLE_DETAIL_BLOCK);
    layout.setWidth(100, Unit.PERCENTAGE);
    layout.setSpacing(true);
    centralLayout.addComponent(layout);/*www  .j  av a2s . c  om*/

    initClaimButton(layout);
    initDescription(layout);
}

From source file:com.klwork.explorer.ui.task.TaskEventsPanel.java

License:Apache License

protected void addInputField() {
    HorizontalLayout hLayout = new HorizontalLayout();
    hLayout.setSpacing(true);
    hLayout.setWidth(100, Unit.PERCENTAGE);
    pMainContent.addComponent(hLayout);/* w w  w.  j  a v  a 2 s. c o m*/
    //?
    initAddEventInput(hLayout);

    Button addCommentButton = new Button(i18nManager.getMessage(Messages.TASK_ADD_COMMENT));
    hLayout.addComponent(addCommentButton);
    hLayout.setComponentAlignment(addCommentButton, Alignment.MIDDLE_LEFT);
    addCommentButton.addListener(new ClickListener() {
        public void buttonClick(ClickEvent event) {
            addNewComment(commentInputField.getValue().toString());
        }
    });
}

From source file:com.klwork.explorer.ui.task.UserDetailsComponent.java

License:Apache License

protected void addUserDetails() {
    VerticalLayout detailsLayout = new VerticalLayout();
    addComponent(detailsLayout);//  w ww. j  a  v  a2 s  .c o m

    // Layout for name + skype
    HorizontalLayout nameLayout = new HorizontalLayout();
    nameLayout.setSpacing(true);
    detailsLayout.addComponent(nameLayout);

    // Name 
    Label nameLabel = null;
    if (user != null) {
        nameLabel = new Label(user.getFirstName() + " " + user.getLastName());
        nameLabel.addStyleName(ExplorerLayout.STYLE_LABEL_BOLD);
    } else {
        nameLabel = new Label(" ", Label.CONTENT_XHTML);
    }
    nameLayout.addComponent(nameLabel);

    // Layout for lower details
    HorizontalLayout actionsLayout = new HorizontalLayout();
    actionsLayout.setSpacing(true);
    detailsLayout.addComponent(actionsLayout);

    // Role
    Label roleLabel = new Label(role);
    actionsLayout.addComponent(roleLabel);

    // Action button
    if (clickListener != null) {
        Button button = new Button(buttonCaption);
        button.addStyleName(Reindeer.BUTTON_SMALL);
        button.addClickListener(clickListener);
        actionsLayout.addComponent(button);
    }
}

From source file:com.kpg.diary.ui.NativeSelects.java

License:Apache License

public NativeSelects() {
    setMargin(true);/*  w w  w .j  a  v a2  s.  c o m*/

    Label h1 = new Label("Selects");
    h1.addStyleName(ValoTheme.LABEL_H2);
    addComponent(h1);

    HorizontalLayout row = new HorizontalLayout();
    row.addStyleName(ValoTheme.LAYOUT_HORIZONTAL_WRAPPING);
    row.setSpacing(true);
    addComponent(row);

    NativeSelect select = new NativeSelect("Drop Down Select");
    row.addComponent(select);

    ListSelect list = new ListSelect("List Select");
    list.setNewItemsAllowed(true);
    row.addComponent(list);

    TwinColSelect tcs = new TwinColSelect("TwinCol Select");
    tcs.setLeftColumnCaption("Left Column");
    tcs.setRightColumnCaption("Right Column");
    tcs.setNewItemsAllowed(true);
    row.addComponent(tcs);

    TwinColSelect tcs2 = new TwinColSelect("Sized TwinCol Select");
    tcs2.setLeftColumnCaption("Left Column");
    tcs2.setRightColumnCaption("Right Column");
    tcs2.setNewItemsAllowed(true);
    tcs2.setWidth("280px");
    tcs2.setHeight("200px");
    row.addComponent(tcs2);

    for (int i = 1; i <= 10; i++) {
        select.addItem("Option " + i);
        list.addItem("Option " + i);
        tcs.addItem("Option " + i);
        tcs2.addItem("Option " + i);
    }
}

From source file:com.liferay.mail.vaadin.AccountEditor.java

License:Open Source License

private void createComponents() {

    addressField = new TextField(Lang.get("email-address"));
    addressField.focus();/*from w  w w .jav a  2s. co  m*/
    loginField = new TextField(Lang.get("login"));
    personalNameField = new TextField(Lang.get("personal-name"));
    passwordField = new TextField(Lang.get("password"));
    passwordField.setSecret(true);
    passwordSavedCheckBox = new CheckBox(Lang.get("save-password"));
    mailInHostNameField = new TextField(Lang.get("incoming-imap-server"));
    mailInPortCombo = new ComboBox(Lang.get("incoming-port"),
            controller.getConfigurationManager().getIncomingPorts());
    mailInSecureCheckBox = new CheckBox(Lang.get("use-secure-incoming-connection"));
    mailOutHostNameField = new TextField(Lang.get("outgoing-smtp-server"));
    mailOutPortCombo = new ComboBox(Lang.get("outgoing-port"),
            controller.getConfigurationManager().getOutgoingPorts());
    mailOutSecureCheckBox = new CheckBox(Lang.get("use-secure-outgoing-connection"));

    // initial validation - the account is then tested
    addressField.setRequired(true);
    mailInHostNameField.setRequired(true);
    mailOutHostNameField.setRequired(true);

    addComponent(addressField);
    if (!useLocalPartOfEmailAddressAsLogin) {
        addComponent(loginField);
    }
    addComponent(personalNameField);
    addComponent(passwordField);
    addComponent(passwordSavedCheckBox);
    if (!hideSettings) {
        addComponent(mailInHostNameField);
        addComponent(mailInPortCombo);
        addComponent(mailInSecureCheckBox);
        addComponent(mailOutHostNameField);
        addComponent(mailOutPortCombo);
        addComponent(mailOutSecureCheckBox);
    }

    HorizontalLayout footer = new HorizontalLayout();
    footer.setSpacing(true);
    okButton = new Button(Lang.get("save"));
    okButton.setStyleName("primary");
    okButton.addListener(this);
    footer.addComponent(okButton);
    cancelButton = new Button(Lang.get("cancel"));
    cancelButton.addListener(this);
    footer.addComponent(cancelButton);

    // TODO add footer to layout in a cleaner manner
    addComponent(footer);
}

From source file:com.liferay.mail.vaadin.ConfirmDialog.java

License:Open Source License

public ConfirmDialog() {

    setModal(true);//from  ww  w  . j a v a2s.  c  o  m
    VerticalLayout vl = new VerticalLayout();
    vl.setMargin(true);
    vl.setSpacing(true);
    setContent(vl);

    setCaption(confirmWindowCaption);

    confirmButton.setCaption(Lang.get("ok"));
    confirmButton.setStyleName("primary");
    cancelButton.setCaption(Lang.get("cancel"));

    cancelButton.addListener(new Button.ClickListener() {

        public void buttonClick(Button.ClickEvent event) {

            closeDialog();
        }
    });

    vl.addComponent(message);

    vl.addComponent(extraLayout);

    HorizontalLayout buttons = new HorizontalLayout();
    buttons.setSpacing(true);

    buttons.addComponent(confirmButton);
    buttons.addComponent(cancelButton);

    vl.addComponent(buttons);
    vl.setComponentAlignment(buttons, "right");

    setWidth("300px");
    setResizable(false);
    confirmButton.focus();
}

From source file:com.liferay.mail.vaadin.PasswordPrompt.java

License:Open Source License

public PasswordPrompt(Account account) {
    this.account = account;

    setCaption(Lang.get("please-enter-your-password-for-x", new String[] { account.getAddress() }));
    setWidth("400px");
    setResizable(false);//w  ww.j a  va  2s. c o m
    setModal(true);
    setClosable(false);

    VerticalLayout layout = new VerticalLayout();
    layout.setSpacing(true);
    layout.setMargin(true);
    setContent(layout);

    password.setSecret(true);
    password.setWidth("100%");
    addComponent(password);

    savePassword.setValue(account.isSavePassword());
    addComponent(savePassword);

    HorizontalLayout buttons = new HorizontalLayout();
    buttons.setSpacing(true);
    buttons.addComponent(loginBtn);
    buttons.setComponentAlignment(loginBtn, Alignment.MIDDLE_CENTER);
    buttons.addComponent(cancelBtn);
    buttons.setComponentAlignment(cancelBtn, Alignment.MIDDLE_CENTER);
    addComponent(buttons);
    layout.setComponentAlignment(buttons, Alignment.BOTTOM_RIGHT);

}

From source file:com.liferay.mail.vaadin.PreferencesView.java

License:Open Source License

public PreferencesView(final Controller controller) {

    this.controller = controller;

    setSpacing(true);/*w w w.j av a2s  .co m*/

    accountPanel = new Panel(Lang.get("your-email-accounts"));
    updateAccountList();
    addComponent(accountPanel);

    HorizontalLayout buttons = new HorizontalLayout();
    buttons.setSpacing(true);
    addComponent(buttons);

    Button createAccountButton = new Button(Lang.get("create-account"));
    createAccountButton.addListener(new ClickListener() {
        public void buttonClick(ClickEvent event) {
            editAccount(null);
        }
    });
    buttons.addComponent(createAccountButton);

    Button createGmailButton = new Button("Create GMail account");
    createGmailButton.addListener(new ClickListener() {
        public void buttonClick(ClickEvent event) {
            editGmailAccount(null);

        }
    });
    buttons.addComponent(createGmailButton);

    Link poweredByVaadin = new Link("", new ExternalResource("http://vaadin.com"));
    poweredByVaadin.setIcon(new PortletResource("images/vaadin/powered-by-vaadin.png"));
    poweredByVaadin.setDescription("Mail portlet interface created using Vaadin - RIA's with pure Java.");
    addComponent(poweredByVaadin);
}