Example usage for com.vaadin.server FontAwesome LINK

List of usage examples for com.vaadin.server FontAwesome LINK

Introduction

In this page you can find the example usage for com.vaadin.server FontAwesome LINK.

Prototype

FontAwesome LINK

To view the source code for com.vaadin.server FontAwesome LINK.

Click Source Link

Usage

From source file:com.anphat.customer.ui.ImportCustomerUploadForm.java

private GridLayout buildGridUpload() {
    uploadInfoLayout = new GridLayout(4, 1);
    CommonUtils.setBasicAttributeLayout(uploadInfoLayout, null, false);
    choiceTypeUpload = CommonUtils.buildComboBox();
    uploadInfoLayout.addComponent(choiceTypeUpload, 1, 0, 2, 0);
    //        uploadInfoLayout.setComponentAlignment(choiceTypeUpload, Alignment.MIDDLE_LEFT);
    linkTemplate = new Link(LINK_CAPTION, FontAwesome.LINK);
    linkTemplate.setImmediate(true);/*ww w . j ava2  s .  com*/
    uploadInfoLayout.addComponent(linkTemplate, 3, 0);
    //        uploadInfoLayout.setComponentAlignment(linkTemplate, Alignment.MIDDLE_LEFT);

    return uploadInfoLayout;
}

From source file:com.anphat.statistics.ui.StatisticStaffPointUploadDialog.java

private GridLayout buildGridUpload() {
    uploadInfoLayout = new GridLayout(4, 1);
    CommonUtils.setBasicAttributeLayout(uploadInfoLayout, GRID_UPLOAD_CAPTION, true);
    uFileCommonInfo = new Upload();
    uFileCommonInfo.setCaption(Constants.NULL);
    uFileCommonInfo.setWidth("100%");

    uploadInfoLayout.addComponent(uFileCommonInfo, 0, 0, 1, 0);
    uploadInfoLayout.setComponentAlignment(uFileCommonInfo, Alignment.MIDDLE_CENTER);

    linkTemplate = new Link(LINK_CAPTION, FontAwesome.LINK);
    linkTemplate.setImmediate(true);//  ww w.j  ava  2 s .  c om
    File file = new File(Constants.PATH_TEMPLATE + "Thong ke diem.xlsx");
    FileDownloader downloader = new FileDownloader(file, "Thong ke diem.xlsx");
    linkTemplate.setResource(downloader);
    uploadInfoLayout.addComponent(linkTemplate, 2, 0);

    return uploadInfoLayout;
}

From source file:com.dungnv.streetfood.ui.ArticleItemUI.java

private void init() {
    this.addStyleName("item-interator");
    this.setSpacing(true);
    this.setWidth("100%");

    CssLayout horizontal = new CssLayout();
    horizontal.setStyleName("padding-5");
    horizontal.setWidth("100%");
    Responsive.makeResponsive(horizontal);
    this.addComponent(horizontal);

    Image imag = new Image();
    if (!StringUtils.isNullOrEmpty(item.getImageUrl())) {
        imag.setSource(new ExternalResource(item.getImageUrl()));
    }/*from   w w  w  . j  a v  a2  s. com*/
    horizontal.addComponent(imag);

    VerticalLayout vlInfo = new VerticalLayout();
    vlInfo.setStyleName("padding-5");
    vlInfo.setWidth("70%");

    horizontal.addComponent(vlInfo);

    lbTitle = new Label(item.getTitle());
    lbTitle.addStyleName("lb-title");
    vlInfo.addComponent(lbTitle);

    lbIntroduce = new Label(item.getShortContent());
    lbIntroduce.setStyleName("lb-description");
    vlInfo.addComponent(lbIntroduce);

    HorizontalLayout htInfo = new HorizontalLayout();
    vlInfo.addComponent(htInfo);

    lbInfo = new Label();
    lbInfo.setCaptionAsHtml(true);
    htInfo.addComponent(lbInfo);

    HorizontalLayout htToolBar = new HorizontalLayout();
    htToolBar.setStyleName("lb-toolbar");
    horizontal.addComponent(htToolBar);

    btnLink = new Button();
    btnLink.setIcon(FontAwesome.LINK);
    btnLink.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    btnLink.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED);
    btnLink.setWidth("25px");
    btnLink.setHeight("25px");
    htToolBar.addComponent(btnLink);
    htToolBar.setComponentAlignment(btnLink, Alignment.BOTTOM_RIGHT);

    btnEdit = new Button();
    btnEdit.setIcon(FontAwesome.EDIT);
    btnEdit.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    btnEdit.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED);
    btnEdit.setWidth("25px");
    btnEdit.setHeight("25px");
    htToolBar.addComponent(btnEdit);
    htToolBar.setComponentAlignment(btnEdit, Alignment.BOTTOM_RIGHT);

    btnDelete = new Button();
    btnDelete.setIcon(FontAwesome.TIMES);
    btnDelete.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    btnDelete.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED);
    btnDelete.setWidth("25px");
    btnDelete.setHeight("25px");
    htToolBar.addComponent(btnDelete);
    htToolBar.setComponentAlignment(btnDelete, Alignment.BOTTOM_RIGHT);
}

From source file:com.dungnv.streetfood.ui.CategoryItemUI.java

private void init() {
    this.addStyleName("item-interator");
    this.setSpacing(true);
    this.setWidth("100%");

    CssLayout horizontal = new CssLayout();
    horizontal.setStyleName("padding-5");
    horizontal.setWidth("100%");
    Responsive.makeResponsive(horizontal);
    this.addComponent(horizontal);

    Image imag = new Image();
    if (!StringUtils.isNullOrEmpty(item.getImageUrl())) {
        imag.setSource(new ExternalResource(item.getImageUrl()));
    }//w w w .  j a v  a 2  s.c  o  m
    horizontal.addComponent(imag);

    VerticalLayout vlInfo = new VerticalLayout();
    vlInfo.setStyleName("padding-5");
    vlInfo.setWidth("70%");

    horizontal.addComponent(vlInfo);

    lbTitle = new Label(item.getName());
    lbTitle.addStyleName("lb-title");
    if ("1".equals(item.getCategoryStatus())) {
        lbTitle.addStyleName("lb-status-active");
    } else {
        lbTitle.addStyleName("lb-status-inActive");
    }
    vlInfo.addComponent(lbTitle);

    lbDesc = new Label(item.getDescription());
    lbDesc.setStyleName("lb-description");
    vlInfo.addComponent(lbDesc);

    HorizontalLayout htInfo = new HorizontalLayout();
    vlInfo.addComponent(htInfo);

    lbInfo = new Label();
    lbInfo.setCaptionAsHtml(true);
    htInfo.addComponent(lbInfo);

    HorizontalLayout htToolBar = new HorizontalLayout();
    htToolBar.setStyleName("lb-toolbar");
    horizontal.addComponent(htToolBar);

    btnLock = new Button();
    if ("1".equals(item.getCategoryStatus())) {
        btnLock.setIcon(FontAwesome.LOCK);
    } else {
        btnLock.setIcon(FontAwesome.UNLOCK);
    }

    btnLock.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    btnLock.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED);
    btnLock.setWidth("25px");
    btnLock.setHeight("25px");
    htToolBar.addComponent(btnLock);
    htToolBar.setComponentAlignment(btnLock, Alignment.BOTTOM_RIGHT);

    btnLink = new Button();
    btnLink.setIcon(FontAwesome.LINK);
    btnLink.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    btnLink.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED);
    btnLink.setWidth("25px");
    btnLink.setHeight("25px");
    htToolBar.addComponent(btnLink);
    htToolBar.setComponentAlignment(btnLink, Alignment.BOTTOM_RIGHT);

    btnEdit = new Button();
    btnEdit.setIcon(FontAwesome.EDIT);
    btnEdit.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    btnEdit.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED);
    btnEdit.setWidth("25px");
    btnEdit.setHeight("25px");
    htToolBar.addComponent(btnEdit);
    htToolBar.setComponentAlignment(btnEdit, Alignment.BOTTOM_RIGHT);

    btnDelete = new Button();
    btnDelete.setIcon(FontAwesome.TIMES);
    btnDelete.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    btnDelete.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED);
    btnDelete.setWidth("25px");
    btnDelete.setHeight("25px");
    htToolBar.addComponent(btnDelete);
    htToolBar.setComponentAlignment(btnDelete, Alignment.BOTTOM_RIGHT);
}

From source file:com.dungnv.streetfood.ui.DishItemUI.java

private void init() {
    this.addStyleName("item-interator");
    this.setSpacing(true);
    this.setWidth("100%");

    CssLayout horizontal = new CssLayout();
    horizontal.setStyleName("padding-5");
    horizontal.setWidth("100%");
    Responsive.makeResponsive(horizontal);
    this.addComponent(horizontal);

    Image imag = new Image();
    if (!StringUtils.isNullOrEmpty(item.getImageUrl())) {
        imag.setSource(new ExternalResource(item.getImageUrl()));
    }//from   w ww  .j  a v a  2 s  . co  m
    horizontal.addComponent(imag);

    VerticalLayout vlInfo = new VerticalLayout();
    vlInfo.setStyleName("padding-5");
    vlInfo.setWidth("70%");

    horizontal.addComponent(vlInfo);

    lbTitle = new Label(item.getName());
    lbTitle.addStyleName("lb-title");
    vlInfo.addComponent(lbTitle);

    lbDesc = new Label(item.getShortDescription());
    lbDesc.setStyleName("lb-description");
    vlInfo.addComponent(lbDesc);

    HorizontalLayout htInfo = new HorizontalLayout();
    vlInfo.addComponent(htInfo);

    lbInfo = new Label();
    lbInfo.setCaptionAsHtml(true);
    htInfo.addComponent(lbInfo);

    HorizontalLayout htToolBar = new HorizontalLayout();
    htToolBar.setStyleName("lb-toolbar");
    horizontal.addComponent(htToolBar);

    btnLock = new Button();
    if ("1".equals(item.getDishStatus())) {
        btnLock.setIcon(FontAwesome.LOCK);
    } else {
        btnLock.setIcon(FontAwesome.UNLOCK);
    }

    btnLock.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    btnLock.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED);
    btnLock.setWidth("25px");
    btnLock.setHeight("25px");
    htToolBar.addComponent(btnLock);
    htToolBar.setComponentAlignment(btnLock, Alignment.BOTTOM_RIGHT);

    btnLink = new Button();
    btnLink.setIcon(FontAwesome.LINK);
    btnLink.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    btnLink.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED);
    btnLink.setWidth("25px");
    btnLink.setHeight("25px");
    htToolBar.addComponent(btnLink);
    htToolBar.setComponentAlignment(btnLink, Alignment.BOTTOM_RIGHT);

    btnEdit = new Button();
    btnEdit.setIcon(FontAwesome.EDIT);
    btnEdit.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    btnEdit.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED);
    btnEdit.setWidth("25px");
    btnEdit.setHeight("25px");
    htToolBar.addComponent(btnEdit);
    htToolBar.setComponentAlignment(btnEdit, Alignment.BOTTOM_RIGHT);

    btnDelete = new Button();
    btnDelete.setIcon(FontAwesome.TIMES);
    btnDelete.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    btnDelete.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED);
    btnDelete.setWidth("25px");
    btnDelete.setHeight("25px");
    htToolBar.addComponent(btnDelete);
    htToolBar.setComponentAlignment(btnDelete, Alignment.BOTTOM_RIGHT);
}

From source file:com.dungnv.streetfood.ui.RestaurantItemUI.java

private void init() {
    this.addStyleName("item-interator");
    this.setSpacing(true);
    this.setWidth("100%");

    CssLayout horizontal = new CssLayout();
    horizontal.setStyleName("padding-5");
    horizontal.setWidth("100%");
    Responsive.makeResponsive(horizontal);
    this.addComponent(horizontal);

    Image imag = new Image();
    if (!StringUtils.isNullOrEmpty(item.getImageUrl())) {
        imag.setSource(new ExternalResource(item.getImageUrl()));
    }//from   w  w  w.  ja  va  2 s.  c o m
    horizontal.addComponent(imag);

    VerticalLayout vlInfo = new VerticalLayout();
    vlInfo.setStyleName("padding-5");
    vlInfo.setWidth("70%");

    horizontal.addComponent(vlInfo);

    lbTitle = new Label(item.getName());
    lbTitle.addStyleName("lb-title");
    vlInfo.addComponent(lbTitle);

    lbIntroduce = new Label(item.getAddress());
    lbIntroduce.setStyleName("lb-description");
    vlInfo.addComponent(lbIntroduce);

    HorizontalLayout htInfo = new HorizontalLayout();
    vlInfo.addComponent(htInfo);

    lbInfo = new Label();
    lbInfo.setCaptionAsHtml(true);
    htInfo.addComponent(lbInfo);

    HorizontalLayout htToolBar = new HorizontalLayout();
    htToolBar.setStyleName("lb-toolbar");
    horizontal.addComponent(htToolBar);

    btnLock = new Button();
    if ("1".equals(item.getRestaurantStatus())) {
        btnLock.setIcon(FontAwesome.LOCK);
    } else {
        btnLock.setIcon(FontAwesome.UNLOCK);
    }

    btnLock.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    btnLock.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED);
    btnLock.setWidth("25px");
    btnLock.setHeight("25px");
    htToolBar.addComponent(btnLock);
    htToolBar.setComponentAlignment(btnLock, Alignment.BOTTOM_RIGHT);

    btnLink = new Button();
    btnLink.setIcon(FontAwesome.LINK);
    btnLink.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    btnLink.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED);
    btnLink.setWidth("25px");
    btnLink.setHeight("25px");
    htToolBar.addComponent(btnLink);
    htToolBar.setComponentAlignment(btnLink, Alignment.BOTTOM_RIGHT);

    btnEdit = new Button();
    btnEdit.setIcon(FontAwesome.EDIT);
    btnEdit.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    btnEdit.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED);
    btnEdit.setWidth("25px");
    btnEdit.setHeight("25px");
    htToolBar.addComponent(btnEdit);
    htToolBar.setComponentAlignment(btnEdit, Alignment.BOTTOM_RIGHT);

    btnDelete = new Button();
    btnDelete.setIcon(FontAwesome.TIMES);
    btnDelete.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    btnDelete.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED);
    btnDelete.setWidth("25px");
    btnDelete.setHeight("25px");
    htToolBar.addComponent(btnDelete);
    htToolBar.setComponentAlignment(btnDelete, Alignment.BOTTOM_RIGHT);
}

From source file:com.esofthead.mycollab.module.project.view.bug.BugReadViewImpl.java

License:Open Source License

@Override
protected ComponentContainer createButtonControls() {
    ProjectPreviewFormControlsGenerator<SimpleBug> bugPreviewFormControls = new ProjectPreviewFormControlsGenerator<>(
            previewForm);// w w  w  .j ava 2s  .  co m
    MButton linkBtn = new MButton("Link", new Button.ClickListener() {
        @Override
        public void buttonClick(ClickEvent clickEvent) {
            UI.getCurrent().addWindow(new LinkIssueWindow(beanItem));
        }
    }).withIcon(FontAwesome.LINK);
    linkBtn.addStyleName("black");
    bugPreviewFormControls.addOptionButton(linkBtn);

    final HorizontalLayout topPanel = bugPreviewFormControls.createButtonControls(
            ProjectPreviewFormControlsGenerator.ADD_BTN_PRESENTED
                    | ProjectPreviewFormControlsGenerator.DELETE_BTN_PRESENTED
                    | ProjectPreviewFormControlsGenerator.EDIT_BTN_PRESENTED
                    | ProjectPreviewFormControlsGenerator.CLONE_BTN_PRESENTED,
            ProjectRolePermissionCollections.BUGS);

    final Button assignBtn = new Button(AppContext.getMessage(GenericI18Enum.BUTTON_ASSIGN),
            new Button.ClickListener() {
                private static final long serialVersionUID = 1L;

                @Override
                public void buttonClick(final ClickEvent event) {
                    UI.getCurrent().addWindow(new AssignBugWindow(BugReadViewImpl.this, beanItem));
                }
            });
    assignBtn.setEnabled(CurrentProjectVariables.canWrite(ProjectRolePermissionCollections.BUGS));
    assignBtn.setIcon(FontAwesome.SHARE);

    assignBtn.setStyleName(UIConstants.THEME_GREEN_LINK);

    this.bugWorkflowControl = new HorizontalLayout();
    this.bugWorkflowControl.setMargin(false);
    this.bugWorkflowControl.addStyleName("workflow-controls");

    bugPreviewFormControls.insertToControlBlock(bugWorkflowControl);
    bugPreviewFormControls.insertToControlBlock(assignBtn);
    topPanel.setSizeUndefined();

    return topPanel;
}

From source file:com.swifta.mats.web.usermanagement.UserDetailsModule.java

private HorizontalLayout getLC() {

    VerticalLayout cAgentInfo = new VerticalLayout();
    cAgentInfo.setMargin(new MarginInfo(true, true, true, true));
    cAgentInfo.setStyleName("c_details_test");

    final VerticalLayout cLBody = new VerticalLayout();

    cLBody.setStyleName("c_body_visible");
    tb = new Table("Linked child accounts");
    addLinksTable();//from  w ww .jav a 2s  .  c o m
    cLBody.addComponent(tb);
    tb.setSelectable(true);

    cAgentInfo.addComponent(cLBody);

    btnLink = new Button("Add New Link");
    btnLink.setIcon(FontAwesome.LINK);
    btnLink.setDescription("Link new account.");

    cLBody.addComponent(btnLink);
    cLBody.setComponentAlignment(btnLink, Alignment.TOP_LEFT);
    btnLink.addClickListener(new LinkClickHandler());

    cPlaceholder.setVisible(false);
    addLinkUserContainer();
    cPlaceholder.setWidth("100%");

    cLBody.addComponent(cPlaceholder);
    cLBody.setComponentAlignment(cPlaceholder, Alignment.TOP_CENTER);

    HorizontalLayout c = new HorizontalLayout();
    c.addComponent(cAgentInfo);

    return c;

}

From source file:com.swifta.mats.web.usermanagement.UserDetailsModule.java

private void addLinkUserContainer() {

    VerticalLayout cDeletePrompt = new VerticalLayout();
    cPlaceholder.addComponent(cDeletePrompt);
    cPlaceholder.setComponentAlignment(cDeletePrompt, Alignment.MIDDLE_CENTER);
    // cDeletePrompt.setWidth("100%");
    cDeletePrompt.setStyleName("c_link");
    cDeletePrompt.setSpacing(true);//w w w.  j  av  a 2s.  c om
    String username = curUser;

    Label lbActivationPrompt = new Label(
            "<span style='text-align: center;'>Please enter Child Username to link to " + username
                    + "'s Account</span>");
    lbActivationPrompt.setContentMode(ContentMode.HTML);
    lbActivationPrompt.setWidth("300px");
    lbActivationPrompt.setStyleName("lb_link_user");

    cDeletePrompt.addComponent(lbActivationPrompt);
    cDeletePrompt.setComponentAlignment(lbActivationPrompt, Alignment.TOP_LEFT);

    VerticalLayout frmDeleteReason = new VerticalLayout();
    frmDeleteReason.setSizeUndefined();
    frmDeleteReason.setSpacing(true);
    frmDeleteReason.setMargin(true);
    cDeletePrompt.addComponent(frmDeleteReason);
    cDeletePrompt.setComponentAlignment(frmDeleteReason, Alignment.TOP_CENTER);

    tFU = new TextField("Child Username");
    tFU.setRequired(true);

    final ComboBox comboUProf = new ComboBox("Select Profile");
    comboUProf.setNullSelectionAllowed(false);
    comboUProf.setRequired(true);
    comboUProf.addItem(8);
    comboUProf.setItemCaption(8, "DEPOSIT_ONLY");

    comboUProf.addItem(9);
    comboUProf.setItemCaption(9, "DEPOSIT_AND_WITHDRAWAL");

    comboUProf.select(8);

    final TextField tFP = new TextField("Parent Account ID");
    tFP.setValue(username);
    tFP.setEnabled(false);

    final TextField tFInitUser = new TextField("Initiating User");
    tFInitUser.setValue(UI.getCurrent().getSession().getAttribute("user").toString());
    tFInitUser.focus();
    tFInitUser.setEnabled(false);

    frmDeleteReason.addComponent(tFU);
    frmDeleteReason.addComponent(comboUProf);
    frmDeleteReason.addComponent(tFP);
    frmDeleteReason.addComponent(tFInitUser);

    HorizontalLayout cPopupBtns = new HorizontalLayout();
    cPopupBtns.setSizeUndefined();
    cPopupBtns.setSpacing(true);

    final Button btnCancel = new Button();
    btnCancel.setIcon(FontAwesome.UNDO);
    btnCancel.setStyleName("btn_link");
    btnCancel.setDescription("Cancel");

    final Button btnSet = new Button("Link");
    btnSet.setDescription("Link specified account.");
    btnSet.setIcon(FontAwesome.LINK);
    cPopupBtns.addComponent(btnSet);
    cPopupBtns.addComponent(btnCancel);
    frmDeleteReason.addComponent(cPopupBtns);

    cDeletePrompt.setComponentAlignment(frmDeleteReason, Alignment.MIDDLE_CENTER);
    btnSet.setClickShortcut(KeyCode.ENTER, null);

    btnSet.addClickListener(new Button.ClickListener() {

        private static final long serialVersionUID = -6318666715385643538L;

        @Override
        public void buttonClick(ClickEvent event) {

            tFU.validate();
            btnSet.setEnabled(false);
            btnCancel.setEnabled(false);

            Button btn = event.getButton();

            if (ums == null)
                ums = new UserManagementService();
            btn.setEnabled(false);

            String strResponse = null;
            try {

                strResponse = UserManagementService.linkUser(tFP.getValue(),
                        new Integer(comboUProf.getValue().toString()), tFInitUser.getValue(), tFU.getValue());

                if (strResponse.equals("The operation was successful and completed")) {

                    updateLinksTable(tFU.getValue());
                    cPlaceholder.setVisible(false);
                    tFU.setValue("");
                    btnLink.setVisible(true);

                    NotifCustom.show("Link", strResponse);

                } else {
                    NotifCustom.show("Link", strResponse);
                }

            } catch (RemoteException e) {

                e.printStackTrace();

            }

            btnSet.setEnabled(true);
            btnCancel.setEnabled(true);

        }
    });

    btnCancel.addClickListener(new ClickListener() {
        private static final long serialVersionUID = 7161821652386306043L;

        @Override
        public void buttonClick(ClickEvent event) {
            btnLink.setVisible(true);
            cPlaceholder.setVisible(false);

        }

    });

}

From source file:com.swifta.mats.web.usermanagement.UserDetailsModule.java

private HorizontalLayout getPC() {

    VerticalLayout cAgentInfo = new VerticalLayout();
    final HorizontalLayout cPlaceholder = new HorizontalLayout();
    cAgentInfo.setMargin(new MarginInfo(true, true, true, true));
    cAgentInfo.setStyleName("c_details_test");

    final VerticalLayout cLBody = new VerticalLayout();

    cLBody.setStyleName("c_body_visible");
    tb = new Table("Linked child accounts");
    // addLinksTable();

    final VerticalLayout cAllProf = new VerticalLayout();

    HorizontalLayout cProfActions = new HorizontalLayout();
    final FormLayout cProfName = new FormLayout();

    cProfName.setStyleName("frm_profile_name");
    cProfName.setSizeUndefined();/* w ww. j a va 2  s. c o m*/

    final Label lbProf = new Label();
    final TextField tFProf = new TextField();

    lbProf.setCaption("Profile Name: ");
    lbProf.setValue("Certified Authorized User.");

    tFProf.setCaption(lbProf.getCaption());
    cProfName.addComponent(lbProf);

    final Button btnEdit = new Button();
    btnEdit.setIcon(FontAwesome.EDIT);
    btnEdit.setStyleName("btn_link");
    btnEdit.setDescription("Edit profile name");

    final Button btnCancel = new Button();
    btnCancel.setIcon(FontAwesome.UNDO);
    btnCancel.setStyleName("btn_link");
    btnCancel.setDescription("Cancel Profile name editting.");

    Button btnAdd = new Button("+");
    // btnAdd.setIcon(FontAwesome.EDIT);
    btnAdd.setStyleName("btn_link");
    btnAdd.setDescription("Set new profile");

    Button btnRemove = new Button("-");
    // btnRemove.setIcon(FontAwesome.EDIT);
    btnRemove.setStyleName("btn_link");
    btnRemove.setDescription("Remove current profile");

    // cProf.addComponent(cProfName);
    cProfActions.addComponent(btnEdit);
    cProfActions.addComponent(btnCancel);
    cProfActions.addComponent(btnAdd);
    cProfActions.addComponent(btnRemove);

    btnCancel.setVisible(false);

    cAllProf.addComponent(cProfName);
    cAllProf.addComponent(cProfActions);
    cAllProf.setComponentAlignment(cProfActions, Alignment.TOP_CENTER);

    cLBody.addComponent(cAllProf);

    // cLBody.addComponent(tb);

    tb.setSelectable(true);

    cAgentInfo.addComponent(cLBody);

    btnLink = new Button("Add New Link");
    btnLink.setIcon(FontAwesome.LINK);
    btnLink.setDescription("Link new account.");

    // cLBody.addComponent(btnLink);
    // cLBody.setComponentAlignment(btnLink, Alignment.TOP_LEFT);
    btnLink.addClickListener(new LinkClickHandler());

    cPlaceholder.setVisible(false);
    addLinkUserContainer();
    cPlaceholder.setWidth("100%");

    cLBody.addComponent(cPlaceholder);
    cLBody.setComponentAlignment(cPlaceholder, Alignment.TOP_CENTER);
    HorizontalLayout c = new HorizontalLayout();
    c.addComponent(cAgentInfo);

    btnEdit.addClickListener(new Button.ClickListener() {

        private static final long serialVersionUID = -8427226211153164650L;

        @Override
        public void buttonClick(ClickEvent event) {

            if (btnEdit.getIcon().equals(FontAwesome.EDIT)) {

                tFProf.setValue(lbProf.getValue());
                tFProf.selectAll();
                cProfName.replaceComponent(lbProf, tFProf);
                btnEdit.setIcon(FontAwesome.SAVE);
                btnCancel.setVisible(true);
                return;

            } else if (btnEdit.getIcon().equals(FontAwesome.SAVE)) {

                lbProf.setValue(tFProf.getValue());
                cProfName.replaceComponent(tFProf, lbProf);
                btnEdit.setIcon(FontAwesome.EDIT);
                btnCancel.setVisible(false);

                return;
            }
            lbProf.setValue(tFProf.getValue());
            cProfName.replaceComponent(tFProf, lbProf);
            btnEdit.setIcon(FontAwesome.EDIT);
            btnCancel.setVisible(false);

        }
    });

    btnCancel.addClickListener(new Button.ClickListener() {
        private static final long serialVersionUID = -2870045546205986347L;

        @Override
        public void buttonClick(ClickEvent event) {
            cProfName.replaceComponent(tFProf, lbProf);
            btnEdit.setIcon(FontAwesome.EDIT);
            btnCancel.setVisible(false);

        }
    });

    btnAdd.addClickListener(new AddProfileHandler(cAllProf, cPlaceholder));

    btnRemove.addClickListener(new RemoveProfileHandler(pop));

    return c;

}