Example usage for com.vaadin.server FontAwesome UNLINK

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

Introduction

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

Prototype

FontAwesome UNLINK

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

Click Source Link

Usage

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

License:Open Source License

public ToggleBugSummaryWithDependentField(final BugWithBLOBs hostBug, final BugWithBLOBs relatedBug) {
    toggleBugSummaryField = new ToggleBugSummaryField(relatedBug);
    Button unlinkBtn = new Button(null, new Button.ClickListener() {
        @Override//from ww w.  ja v  a  2  s.  co m
        public void buttonClick(Button.ClickEvent clickEvent) {
            ConfirmDialogExt.show(UI.getCurrent(),
                    AppContext.getMessage(GenericI18Enum.DIALOG_DELETE_TITLE, AppContext.getSiteName()),
                    AppContext.getMessage(GenericI18Enum.DIALOG_DELETE_SINGLE_ITEM_MESSAGE),
                    AppContext.getMessage(GenericI18Enum.BUTTON_YES),
                    AppContext.getMessage(GenericI18Enum.BUTTON_NO), new ConfirmDialog.Listener() {
                        @Override
                        public void onClose(ConfirmDialog confirmDialog) {
                            RelatedBugExample ex = new RelatedBugExample();
                            ex.createCriteria().andBugidEqualTo(hostBug.getId())
                                    .andRelatedidEqualTo(relatedBug.getId());
                            RelatedBugMapper bugMapper = AppContextUtil.getSpringBean(RelatedBugMapper.class);
                            bugMapper.deleteByExample(ex);
                            UIUtils.removeChildAssociate(toggleBugSummaryField,
                                    RemoveInlineComponentMarker.class);
                        }
                    });
        }
    });
    unlinkBtn.setIcon(FontAwesome.UNLINK);
    unlinkBtn.setDescription("Remove relationship");
    unlinkBtn.addStyleName(ValoTheme.BUTTON_ICON_ALIGN_TOP);
    unlinkBtn.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    toggleBugSummaryField.addControl(unlinkBtn);
}

From source file:com.esofthead.mycollab.module.project.view.task.components.ToggleTaskSummaryWithChildRelationshipField.java

License:Open Source License

public ToggleTaskSummaryWithChildRelationshipField(final SimpleTask parentTask, final SimpleTask childTask) {
    toggleTaskSummaryField = new ToggleTaskSummaryField(parentTask);
    Button unlinkBtn = new Button(null, new Button.ClickListener() {
        @Override/*  w  ww . ja v  a 2s  .co  m*/
        public void buttonClick(Button.ClickEvent clickEvent) {
            childTask.setParenttaskid(null);
            ProjectTaskService taskService = AppContextUtil.getSpringBean(ProjectTaskService.class);
            taskService.updateWithSession(childTask, AppContext.getUsername());
            UIUtils.removeChildAssociate(ToggleTaskSummaryWithChildRelationshipField.this,
                    RemoveInlineComponentMarker.class);
        }
    });
    unlinkBtn.setIcon(FontAwesome.UNLINK);
    unlinkBtn.setDescription("Remove parent-child relationship");
    unlinkBtn.addStyleName(ValoTheme.BUTTON_ICON_ALIGN_TOP);
    unlinkBtn.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    toggleTaskSummaryField.addControl(unlinkBtn);
}

From source file:com.esofthead.mycollab.module.project.view.task.components.ToggleTaskSummaryWithParentRelationshipField.java

License:Open Source License

public ToggleTaskSummaryWithParentRelationshipField(final SimpleTask task) {
    toggleTaskSummaryField = new ToggleTaskSummaryField(task);
    Button unlinkBtn = new Button(null, new Button.ClickListener() {
        @Override/*from   w w  w  .j  av  a2  s. com*/
        public void buttonClick(Button.ClickEvent clickEvent) {
            task.setParenttaskid(null);
            ProjectTaskService taskService = AppContextUtil.getSpringBean(ProjectTaskService.class);
            taskService.updateWithSession(task, AppContext.getUsername());
            UIUtils.removeChildAssociate(ToggleTaskSummaryWithParentRelationshipField.this,
                    RemoveInlineComponentMarker.class);
        }
    });
    unlinkBtn.setIcon(FontAwesome.UNLINK);
    unlinkBtn.setDescription("Remove parent-child relationship");
    unlinkBtn.addStyleName(ValoTheme.BUTTON_ICON_ALIGN_TOP);
    unlinkBtn.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    toggleTaskSummaryField.addControl(unlinkBtn);
}

From source file:com.mycollab.module.project.view.bug.components.ToggleBugSummaryWithDependentField.java

License:Open Source License

public ToggleBugSummaryWithDependentField(final BugWithBLOBs hostBug, final BugWithBLOBs relatedBug) {
    toggleBugSummaryField = new ToggleBugSummaryField(relatedBug);
    MButton unlinkBtn = new MButton("", clickEvent -> {
        ConfirmDialogExt.show(UI.getCurrent(),
                AppContext.getMessage(GenericI18Enum.DIALOG_DELETE_TITLE, AppContext.getSiteName()),
                AppContext.getMessage(GenericI18Enum.DIALOG_DELETE_SINGLE_ITEM_MESSAGE),
                AppContext.getMessage(GenericI18Enum.BUTTON_YES),
                AppContext.getMessage(GenericI18Enum.BUTTON_NO), confirmDialog -> {
                    RelatedBugExample ex = new RelatedBugExample();
                    ex.createCriteria().andBugidEqualTo(hostBug.getId())
                            .andRelatedidEqualTo(relatedBug.getId());
                    RelatedBugMapper bugMapper = AppContextUtil.getSpringBean(RelatedBugMapper.class);
                    bugMapper.deleteByExample(ex);
                    UIUtils.removeChildAssociate(toggleBugSummaryField, RemoveInlineComponentMarker.class);
                });//from   w  w w  .j  a v  a  2s.  c  o m
    });
    unlinkBtn.setIcon(FontAwesome.UNLINK);
    unlinkBtn.setDescription("Remove relationship");
    unlinkBtn.addStyleName(ValoTheme.BUTTON_ICON_ALIGN_TOP);
    unlinkBtn.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    toggleBugSummaryField.addControl(unlinkBtn);
}

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

License:Open Source License

public ToggleBugSummaryWithDependentField(final BugWithBLOBs hostBug, final BugWithBLOBs relatedBug) {
    toggleBugSummaryField = new ToggleBugSummaryField(relatedBug);
    MButton unlinkBtn = new MButton("", clickEvent -> {
        ConfirmDialogExt.show(UI.getCurrent(),
                UserUIContext.getMessage(GenericI18Enum.DIALOG_DELETE_TITLE, MyCollabUI.getSiteName()),
                UserUIContext.getMessage(GenericI18Enum.DIALOG_DELETE_SINGLE_ITEM_MESSAGE),
                UserUIContext.getMessage(GenericI18Enum.BUTTON_YES),
                UserUIContext.getMessage(GenericI18Enum.BUTTON_NO), confirmDialog -> {
                    RelatedBugExample ex = new RelatedBugExample();
                    ex.createCriteria().andBugidEqualTo(hostBug.getId())
                            .andRelatedidEqualTo(relatedBug.getId());
                    RelatedBugMapper bugMapper = AppContextUtil.getSpringBean(RelatedBugMapper.class);
                    bugMapper.deleteByExample(ex);
                    UIUtils.removeChildAssociate(toggleBugSummaryField, RemoveInlineComponentMarker.class);
                });/*from   ww w.  jav  a 2s . c om*/
    }).withIcon(FontAwesome.UNLINK).withStyleName(ValoTheme.BUTTON_ICON_ALIGN_TOP, ValoTheme.BUTTON_ICON_ONLY)
            .withDescription(UserUIContext.getMessage(BugI18nEnum.OPT_REMOVE_RELATIONSHIP));
    toggleBugSummaryField.addControl(unlinkBtn);
}

From source file:com.mycollab.module.project.view.task.components.ToggleTaskSummaryWithChildRelationshipField.java

License:Open Source License

public ToggleTaskSummaryWithChildRelationshipField(final SimpleTask parentTask, final SimpleTask childTask) {
    toggleTaskSummaryField = new ToggleTaskSummaryField(parentTask);
    MButton unlinkBtn = new MButton("", clickEvent -> {
        childTask.setParenttaskid(null);
        ProjectTaskService taskService = AppContextUtil.getSpringBean(ProjectTaskService.class);
        taskService.updateWithSession(childTask, AppContext.getUsername());
        UIUtils.removeChildAssociate(ToggleTaskSummaryWithChildRelationshipField.this,
                RemoveInlineComponentMarker.class);
    }).withIcon(FontAwesome.UNLINK).withStyleName(ValoTheme.BUTTON_ICON_ONLY, ValoTheme.BUTTON_ICON_ALIGN_TOP);
    unlinkBtn.setDescription("Remove parent-child relationship");
    toggleTaskSummaryField.addControl(unlinkBtn);
}

From source file:com.mycollab.module.project.view.task.components.ToggleTaskSummaryWithParentRelationshipField.java

License:Open Source License

public ToggleTaskSummaryWithParentRelationshipField(final SimpleTask task) {
    toggleTaskSummaryField = new ToggleTaskSummaryField(task);
    MButton unlinkBtn = new MButton("", clickEvent -> {
        task.setParenttaskid(null);/*from ww  w.  ja va  2 s.c  om*/
        ProjectTaskService taskService = AppContextUtil.getSpringBean(ProjectTaskService.class);
        taskService.updateWithSession(task, AppContext.getUsername());
        UIUtils.removeChildAssociate(ToggleTaskSummaryWithParentRelationshipField.this,
                RemoveInlineComponentMarker.class);
    }).withIcon(FontAwesome.UNLINK).withStyleName(ValoTheme.BUTTON_ICON_ALIGN_TOP, ValoTheme.BUTTON_ICON_ONLY);
    unlinkBtn.setDescription("Remove parent-child relationship");
    toggleTaskSummaryField.addControl(unlinkBtn);
}

From source file:com.mycollab.module.project.view.task.ToggleTaskSummaryWithChildRelationshipField.java

License:Open Source License

public ToggleTaskSummaryWithChildRelationshipField(final SimpleTask parentTask, final SimpleTask childTask) {
    toggleTaskSummaryField = new ToggleTaskSummaryField(parentTask, false);
    MButton unlinkBtn = new MButton("", clickEvent -> {
        childTask.setParenttaskid(null);
        ProjectTaskService taskService = AppContextUtil.getSpringBean(ProjectTaskService.class);
        taskService.updateWithSession(childTask, UserUIContext.getUsername());
        UIUtils.removeChildAssociate(ToggleTaskSummaryWithChildRelationshipField.this,
                RemoveInlineComponentMarker.class);
    }).withIcon(FontAwesome.UNLINK).withStyleName(ValoTheme.BUTTON_ICON_ONLY, ValoTheme.BUTTON_ICON_ALIGN_TOP)
            .withDescription(UserUIContext.getMessage(TaskI18nEnum.OPT_REMOVE_PARENT_CHILD_RELATIONSHIP));

    toggleTaskSummaryField.addControl(unlinkBtn);
}

From source file:com.mycollab.module.project.view.task.ToggleTaskSummaryWithParentRelationshipField.java

License:Open Source License

public ToggleTaskSummaryWithParentRelationshipField(final SimpleTask task) {
    toggleTaskSummaryField = new ToggleTaskSummaryField(task, false);
    MButton unlinkBtn = new MButton("", clickEvent -> {
        task.setParenttaskid(null);/* w w w  .j a v a 2 s .  c o  m*/
        ProjectTaskService taskService = AppContextUtil.getSpringBean(ProjectTaskService.class);
        taskService.updateWithSession(task, UserUIContext.getUsername());
        UIUtils.removeChildAssociate(ToggleTaskSummaryWithParentRelationshipField.this,
                RemoveInlineComponentMarker.class);
    }).withIcon(FontAwesome.UNLINK).withStyleName(ValoTheme.BUTTON_ICON_ALIGN_TOP, ValoTheme.BUTTON_ICON_ONLY)
            .withDescription(UserUIContext.getMessage(TaskI18nEnum.OPT_REMOVE_PARENT_CHILD_RELATIONSHIP));
    toggleTaskSummaryField.addControl(unlinkBtn);
}

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

@SuppressWarnings("unchecked")
private void addLinksTable() {

    container.addContainerProperty("S/N", Integer.class, 0);
    container.addContainerProperty("Username", String.class, null);
    container.addContainerProperty("MSISDN", String.class, null);
    container.addContainerProperty("Email", String.class, null);
    container.addContainerProperty("Action", Button.class, null);

    StringBuilder sb = new StringBuilder();

    sb.append(/* w w w . jav a2  s.co m*/
            " SELECT concat(ahd.firstname,' ',ahd.lastname) as Name, ah.username as 'username', ah.msisdn as msisdn, ah.email as email ");
    sb.append(" FROM linkaccountrelations pl, accountholders ah, accountholderdetails ahd ");
    sb.append(" where linkstatus = 'LINKED' ");
    sb.append(" and ah.accountholderdetailid = ahd.accountdetailsid ");
    sb.append(" and pl.childuserresourceid = ah.accountholderid ");
    sb.append(" and parentuserresourceid in (select accountholderid from accountholders ");
    sb.append(" where (username = '" + curUser + "'))");

    String drivers = "com.mysql.jdbc.Driver";
    try {
        Class<?> driver_class = Class.forName(drivers);
        Driver driver = (Driver) driver_class.newInstance();
        DriverManager.registerDriver(driver);

        Connection conn = DriverManager.getConnection(MatsWebPortalUI.conf.DB, MatsWebPortalUI.conf.UN,
                MatsWebPortalUI.conf.PW);

        Statement stmt = conn.createStatement();

        ResultSet rs = stmt.executeQuery(sb.toString());

        int x = 0;
        Property<String> pUn;
        Property<String> pMsisdn;
        Property<String> pEmail;
        Property<Integer> pSn;
        Property<Button> pBtn;

        String un;
        String msisdn;
        String email;
        Object rid;
        Button btnLink;
        Item r;

        while (rs.next()) {

            x++;

            un = rs.getString("username");
            msisdn = rs.getString("msisdn");
            email = rs.getString("email");

            rid = container.addItem();
            r = container.getItem(rid);

            pSn = r.getItemProperty("S/N");
            pUn = r.getItemProperty("Username");
            pMsisdn = r.getItemProperty("MSISDN");
            pEmail = r.getItemProperty("Email");
            pBtn = r.getItemProperty("Action");
            btnLink = new Button();
            btnLink.setIcon(FontAwesome.UNLINK);
            btnLink.setStyleName("btn_link");
            btnLink.setDescription("Unlink this account.");
            btnLink.addClickListener(new UNLinkClickHandler());
            btnLink.setId(un);
            btnLink.setData(rid);

            pSn.setValue(x);
            pUn.setValue(un);
            pMsisdn.setValue(msisdn);
            pEmail.setValue(email);
            pBtn.setValue(btnLink);

        }

        tb.setContainerDataSource(container);
        if (x > 30)
            x = 30;
        tb.setPageLength(x);

    } catch (SQLException | ClassNotFoundException | InstantiationException | IllegalAccessException e) {

        errorHandler(e);
    }

}