Example usage for com.vaadin.ui.themes ValoTheme BUTTON_LINK

List of usage examples for com.vaadin.ui.themes ValoTheme BUTTON_LINK

Introduction

In this page you can find the example usage for com.vaadin.ui.themes ValoTheme BUTTON_LINK.

Prototype

String BUTTON_LINK

To view the source code for com.vaadin.ui.themes ValoTheme BUTTON_LINK.

Click Source Link

Document

Makes the button look like the Link component.

Usage

From source file:com.hybridbpm.ui.component.TranslatedField.java

License:Apache License

public TranslatedField() {
    form.setSpacing(true);/*from   w  w  w.  ja v a 2 s .c  om*/
    form.setMargin(false);
    form.addStyleName(ValoTheme.LAYOUT_CARD);
    form.addStyleName("transacted-field");

    btnAdd.addStyleName(ValoTheme.BUTTON_LINK);
    btnAdd.setIcon(FontAwesome.PLUS_CIRCLE);
    form.addComponent(btnAdd);
}

From source file:com.hybridbpm.ui.component.ValoUserItemButton.java

License:Apache License

public ValoUserItemButton(final User user, TYPE type) {
    this.user = user;
    this.type = type;
    switch (this.type) {
    case FULL_NAME:
        addStyleName(ValoTheme.BUTTON_BORDERLESS);
        addStyleName(ValoTheme.BUTTON_TINY);
        setCaption(user.getFullName());//from w w w.  j  a v a2s . c  om
        break;
    case USER_NAME:
        addStyleName(ValoTheme.BUTTON_LINK);
        addStyleName(ValoTheme.BUTTON_TINY);
        setCaption("@" + user.getUsername());
        break;
    }
    addClickListener(new ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            //                UI.getCurrent().getNavigator().navigateTo(view.getUrl());
        }
    });
}

From source file:com.mcparland.john.vaadin_mvn_arch.samples.authentication.LoginScreen.java

License:Apache License

private Component buildLoginForm() {
    FormLayout loginForm = new FormLayout();

    loginForm.addStyleName("login-form");
    loginForm.setSizeUndefined();/*from   w  w  w  . j  av  a  2 s  .  c om*/
    loginForm.setMargin(false);

    loginForm.addComponent(username = new TextField("Username", "admin"));
    username.setWidth(15, Unit.EM);
    loginForm.addComponent(password = new PasswordField("Password"));
    password.setWidth(15, Unit.EM);
    password.setDescription("Write anything");
    CssLayout buttons = new CssLayout();
    buttons.setStyleName("buttons");
    loginForm.addComponent(buttons);

    buttons.addComponent(login = new Button("Login"));
    login.setDisableOnClick(true);
    login.addClickListener(new Button.ClickListener() {
        /**
         * The serialVersionUID.
         */
        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(Button.ClickEvent event) {
            try {
                login();
            } finally {
                login.setEnabled(true);
            }
        }
    });
    login.setClickShortcut(ShortcutAction.KeyCode.ENTER);
    login.addStyleName(ValoTheme.BUTTON_FRIENDLY);

    buttons.addComponent(forgotPassword = new Button("Forgot password?"));
    forgotPassword.addClickListener(new Button.ClickListener() {
        /**
         * The serialVersionUID.
         */
        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(Button.ClickEvent event) {
            showNotification(new Notification("Hint: Try anything"));
        }
    });
    forgotPassword.addStyleName(ValoTheme.BUTTON_LINK);
    return loginForm;
}

From source file:com.save.client.promodeals.PromoUI.java

public PromoUI(int clientId) {
    this.clientId = clientId;

    setWidth("90%");
    setHeight("100%");
    setMargin(new MarginInfo(true, true, false, false));

    PDDataGridProperties dataGrid = new PDDataGridProperties(getClientId());

    Button button = new Button("Acknowledgement Form");
    button.setWidthUndefined();/*from w ww.j av  a2  s.c om*/
    button.setIcon(FontAwesome.OPENID);
    button.addStyleName(ValoTheme.BUTTON_LINK);
    button.addStyleName(ValoTheme.BUTTON_SMALL);
    button.addClickListener((Button.ClickEvent event) -> {
        Window sub = new com.save.clients.AcknowledgementPromoForm(getClientId());
        if (sub.getParent() == null) {
            UI.getCurrent().addWindow(sub);
        }

        sub.addCloseListener((Window.CloseEvent e) -> {
            dataGrid.getContainerDataSource().removeAllItems();
            dataGrid.setContainerDataSource(new PDDataContainer(getClientId()));
        });
    });
    addComponent(button);
    setComponentAlignment(button, Alignment.TOP_RIGHT);

    addComponent(dataGrid);
    setExpandRatio(dataGrid, 2);
}

From source file:com.save.employee.maintenance.MRUI.java

public MRUI(int employeeId) {
    this.employeeId = employeeId;

    setWidth("90%");
    setHeight("100%");
    setMargin(new MarginInfo(true, false, false, false));

    MRDataGridProperties dataGrid = new MRDataGridProperties(getEmployeeId());

    Button mrForm = new Button("Maintenance/Reimbursement Form");
    mrForm.setWidthUndefined();//from   w ww.j  av a  2 s  .c  o m
    mrForm.setIcon(FontAwesome.OPENID);
    mrForm.addStyleName(ValoTheme.BUTTON_SMALL);
    mrForm.addStyleName(ValoTheme.BUTTON_LINK);
    mrForm.addClickListener((Button.ClickEvent event) -> {
        Window sub = new MRFormWindow(getEmployeeId());
        if (sub.getParent() == null) {
            UI.getCurrent().addWindow(sub);
        }

        sub.addCloseListener((Window.CloseEvent e) -> {
            dataGrid.getContainerDataSource().removeAllItems();
            dataGrid.setContainerDataSource(new MRDataContainer(getEmployeeId()));
        });
    });

    addComponent(mrForm);
    setComponentAlignment(mrForm, Alignment.MIDDLE_RIGHT);

    addComponent(dataGrid);
    setExpandRatio(dataGrid, 2);
}

From source file:com.save.employee.request.RLUI.java

public RLUI(int employeeId) {
    this.employeeId = employeeId;

    setWidth("90%");
    setHeight("100%");
    setMargin(new MarginInfo(true, false, false, false));

    RLDataGridProperties dataGrid = new RLDataGridProperties(getEmployeeId());

    Button rlForm = new Button("Request/Liquidation FORM");
    rlForm.setIcon(FontAwesome.OPENID);/* w w w.ja v a  2 s .  c o m*/
    rlForm.addStyleName(ValoTheme.BUTTON_SMALL);
    rlForm.addStyleName(ValoTheme.BUTTON_LINK);
    rlForm.addClickListener((Button.ClickEvent event) -> {
        Window sub = new RequestFormWindow(getEmployeeId(), 0, false, dataGrid);
        if (sub.getParent() == null) {
            UI.getCurrent().addWindow(sub);
        }
        sub.addCloseListener((Window.CloseEvent e) -> {
            dataGrid.getContainerDataSource().removeAllItems();
            dataGrid.setContainerDataSource(new RLDataContainer(getEmployeeId()));
        });
    });

    addComponent(rlForm);
    setComponentAlignment(rlForm, Alignment.MIDDLE_RIGHT);

    addComponent(dataGrid);
    setExpandRatio(dataGrid, 2);
}

From source file:com.snowy.Login.java

@PostConstruct
void init() {// w w w. ja  v a2  s.c  o m
    d = ((MyVaadinUI) UI.getCurrent()).getDataObject();
    //Logger.getLogger(Login.class.getName()).info(d);
    this.setSizeFull();
    this.setSpacing(false);
    this.setMargin(true);
    Label MainL = new Label("<h1>Connect 4</h1?>", ContentMode.HTML);
    //layout.addComponent(MainL);
    MainL.setSizeUndefined();
    VerticalLayout lay = new VerticalLayout();
    lay.setMargin(false);
    lay.addComponent(MainL);
    lay.setComponentAlignment(MainL, Alignment.TOP_CENTER);
    HorizontalLayout hz = new HorizontalLayout();
    hz.setMargin(false);
    hz.setSpacing(false);
    LoginForm lf = new LoginForm();
    lf.addLoginListener((e) -> {
        String token = d.genToken(e.getLoginParameter("username"), e.getLoginParameter("password"));
        //String token="true";
        if (!token.equals("false")) {

            Cookie c = new Cookie("token", token);
            VaadinService.getCurrentResponse().addCookie(c);
            //https://vaadin.com/wiki/-/wiki/Main/Setting+and+reading+Cookies
            //Notification.show(VaadinService.getCurrentRequest().getCookies()[1].getValue(),Notification.Type.ERROR_MESSAGE);
            //this.getNavigator().navigateTo("main");
            //this.getUI().get
            this.getUI().getNavigator().navigateTo("main");
        } else {
            Label l = new Label("<h4 style=\"color:red\">Invalid Username or Password</h4>", ContentMode.HTML);
            l.setId("created");

            if (lay.getComponent(lay.getComponentIndex(lf) + 1).getId() == null) {
                //lay.addComponent(new Label(String.valueOf(lay.getComponentIndex(l))));
                lay.addComponent(l, lay.getComponentIndex(lf) + 1);
                l.setSizeUndefined();
                lay.setComponentAlignment(l, Alignment.TOP_CENTER);
            }

        }

    });

    lay.addComponent(lf);
    Button newUser = new Button("New User");
    newUser.addClickListener((e) -> {

        this.getUI().addWindow(new NewUserSubWindow(d));
    });
    //newUser.setWidth((float)5.5, Unit.EM);
    Button forgotPass = new Button("Forgot Password");
    //temp
    forgotPass.addClickListener((e) -> {
        //Notification.show(, Notification.Type.ERROR_MESSAGE);
    });
    forgotPass.setEnabled(false);
    forgotPass.setDescription("Feature Disabled, Contact Administrator for Assistance");
    //forgotPass.setWidth((float) 8.5,Unit.EM);
    forgotPass.setStyleName(ValoTheme.BUTTON_LINK);
    newUser.setStyleName(ValoTheme.BUTTON_LINK);

    hz.addComponent(newUser);
    hz.addComponent(forgotPass);
    lay.addComponent(hz);
    lay.setComponentAlignment(lf, Alignment.TOP_CENTER);
    lay.setComponentAlignment(hz, Alignment.MIDDLE_CENTER);
    this.addComponent(lay);
    this.setComponentAlignment(lay, Alignment.MIDDLE_CENTER);
}

From source file:com.terralcode.gestion.frontend.view.panel.species.SpeciesPanel.java

private void addElementToolbar() {
    Button newElement = new Button("", FontAwesome.ELLIPSIS_H);
    newElement.addStyleName(ValoTheme.BUTTON_LINK);
    newElement.addClickListener(new Button.ClickListener() {

        @Override/* ww w  .  ja v a  2  s.c o m*/
        public void buttonClick(Button.ClickEvent event) {
            openElementSelector();
            refreshBind();
        }
    });
    layout.addComponent(newElement);
}

From source file:com.terralcode.gestion.frontend.view.widgets.appointment.AppointmentComplaintsPanel.java

private void addComplaintToolbar() {
    Button newComplaint = new Button("", FontAwesome.PLUS);
    newComplaint.addStyleName(ValoTheme.BUTTON_LINK);
    newComplaint.addClickListener(new Button.ClickListener() {

        @Override//from   ww  w .j a v  a2s .  co m
        public void buttonClick(Button.ClickEvent event) {
            Complaint newComplaint = new Complaint();
            newComplaint.setAppointment(appointment);
            appointment.getComplaints().add(newComplaint);
            openComplaintWindow(newComplaint);
        }
    });
    layout.addComponent(newComplaint);
}

From source file:com.terralcode.gestion.frontend.view.widgets.incomingAppointments.IncomingAppointments.java

public AppointmentPreview(Appointment app) {
    this.appointment = app;
    this.addStyleName(ValoTheme.WINDOW_BOTTOM_TOOLBAR);

    HorizontalLayout hl = new HorizontalLayout();
    hl.setSpacing(false);//from ww w.ja  v a 2 s  .c  om

    SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");
    String scheduleText = sdf.format(app.getProgramDateStart().getTime());
    if (app.getTimeLapse() != null) {
        scheduleText += " (" + app.getTimeLapse().toString() + ")";
    }
    schedule = new Button(scheduleText);
    schedule.addClickListener(new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {
            onAppointmentClicked(appointment);
        }
    });
    schedule.addStyleName(ValoTheme.BUTTON_LINK);
    schedule.setWidth("100%");
    hl.addComponent(schedule);
    //type = new Label();
    if (app.getAppointmentType().getCode().equals("VIS")) {
        schedule.setIcon(FontAwesome.HOME);
    }
    if (app.getAppointmentType().getCode().equals("COM")) {
        schedule.setIcon(FontAwesome.PHONE);
    }
    if (app.getAppointmentType().getCode().equals("CON")) {
        schedule.setIcon(FontAwesome.USER);
    }
    //hl.addComponent(type);
    //hl.setComponentAlignment(type, Alignment.MIDDLE_RIGHT);
    hl.setExpandRatio(schedule, 1);
    this.addComponent(hl);

    if (app.getAppointmentType().getCode().equals("VIS") || app.getAppointmentType().getCode().equals("COM")) {
        customer = new Label(app.getCustomer().toString());
        //customer.addStyleName(ValoTheme.LABEL_H3);
        customer.setWidth("100%");
        this.addComponent(customer);
    }

    if ("VIS".equals(app.getAppointmentType().getCode())) {
        address = new Label(Objects.toString(app.getAddress(), "Direccin no disponible"));
        //address.addStyleName(ValoTheme.LABEL_H3);
        address.setWidth("100%");
        this.addComponent(address);
    }
    if ("CON".equals(app.getAppointmentType().getCode())) {
        contact = new Label(app.getContactNotes());
        //address.addStyleName(ValoTheme.LABEL_H3);
        contact.setWidth("100%");
        this.addComponent(contact);
    }

}