Example usage for com.vaadin.server FontAwesome TIMES_CIRCLE

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

Introduction

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

Prototype

FontAwesome TIMES_CIRCLE

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

Click Source Link

Usage

From source file:de.fatalix.bookery.view.admin.BatchJobCard.java

private HorizontalLayout createHeader() {
    captionLabel = new Label("some.batchjob");

    Button deleteBatchJob = new Button(null, new Button.ClickListener() {

        @Override/*from ww w .j av  a 2s. c  om*/
        public void buttonClick(Button.ClickEvent event) {
            presenter.deleteBatchJob(jobConfig);
            for (BatchJobCard.Listener listener : listeners) {
                listener.jobDeleted(BatchJobCard.this);
            }
        }
    });
    deleteBatchJob.setIcon(FontAwesome.TIMES_CIRCLE);
    deleteBatchJob.addStyleName("borderless");
    deleteBatchJob.addStyleName("icon-only");

    HorizontalLayout captionLayout = new HorizontalLayout();
    captionLayout.addStyleName("v-panel-caption");
    captionLayout.setWidth("100%");
    captionLayout.addComponents(captionLabel, deleteBatchJob);
    captionLayout.setExpandRatio(captionLabel, 1);

    return captionLayout;
}

From source file:de.fatalix.bookery.view.admin.ServerSettingsLayout.java

License:Open Source License

private Label[] generateStatusFields() {
    statusFields = new ArrayList<>();
    Label solrStatus = new Label("Offline " + FontAwesome.TIMES_CIRCLE.getHtml(), ContentMode.HTML);
    solrStatus.addStyleName("red-icon");
    solrStatus.setCaption("Status");
    statusFields.add(solrStatus);/*  w w w  . j a v  a 2 s . co  m*/
    Label numberOfDocs = new Label("100");
    numberOfDocs.setCaption("Library");
    statusFields.add(numberOfDocs);
    Label sizeOnDisk = new Label("73MB");
    sizeOnDisk.setCaption("Size");
    statusFields.add(sizeOnDisk);

    Label[] result = new Label[statusFields.size()];
    return statusFields.toArray(result);
}

From source file:fi.semantum.strategia.Utils.java

License:Open Source License

public static void fillTagEditor(final Database database, final AbstractLayout layout, final List<String> tags,
        final boolean allowRemove) {

    layout.removeAllComponents();//  www.ja  v  a2  s. c  o m

    for (int i = 0; i < tags.size(); i++) {

        String tag = tags.get(i);

        HorizontalLayout hl = new HorizontalLayout();

        if (allowRemove) {
            final int index = i;
            Button b = new Button();
            b.addStyleName(ValoTheme.BUTTON_BORDERLESS);
            b.setIcon(FontAwesome.TIMES_CIRCLE);
            b.addClickListener(new ClickListener() {

                private static final long serialVersionUID = -4473258383318654850L;

                @Override
                public void buttonClick(ClickEvent event) {
                    tags.remove(index);
                    fillTagEditor(database, layout, tags, allowRemove);
                }
            });
            hl.addComponent(b);
        }

        Button tagButton = tagButton(database, "dialog", tag, i);
        hl.addComponent(tagButton);
        hl.setComponentAlignment(tagButton, Alignment.MIDDLE_LEFT);

        layout.addComponent(hl);

    }

}

From source file:fi.semantum.strategia.widget.Tag.java

License:Open Source License

public static void updateRelatedTags(final Main main, boolean canWrite) {

    final Database database = main.getDatabase();

    final Base base = main.getUIState().currentItem;

    Collection<Tag> tags = base.getRelatedTags(database);
    if (!tags.isEmpty() || canWrite) {

        HorizontalLayout tagHeader = new HorizontalLayout();
        tagHeader.setSpacing(true);//from w ww .j  av  a 2  s .c o m

        Label header2 = new Label("Aihetunnisteet");
        header2.setHeight("32px");
        header2.addStyleName(ValoTheme.LABEL_HUGE);
        header2.addStyleName(ValoTheme.LABEL_BOLD);
        tagHeader.addComponent(header2);
        tagHeader.setComponentAlignment(header2, Alignment.BOTTOM_CENTER);

        if (canWrite) {
            final Image editTags = new Image("", new ThemeResource("tag_blue_edit.png"));
            editTags.setHeight("24px");
            editTags.setWidth("24px");
            editTags.addClickListener(new MouseEvents.ClickListener() {

                private static final long serialVersionUID = -6140867347404571880L;

                @Override
                public void click(com.vaadin.event.MouseEvents.ClickEvent event) {
                    Utils.loseFocus(editTags);
                    Utils.editTags(main, "Muokkaa aihetunnisteita", main.getUIState().currentItem);
                }

            });
            tagHeader.addComponent(editTags);
            tagHeader.setComponentAlignment(editTags, Alignment.BOTTOM_CENTER);
        }

        main.properties.addComponent(tagHeader);
        main.properties.setComponentAlignment(tagHeader, Alignment.MIDDLE_CENTER);

        HorizontalLayout divider = new HorizontalLayout();
        main.properties.addComponent(divider);
        main.properties.setComponentAlignment(divider, Alignment.MIDDLE_CENTER);

        VerticalLayout left = new VerticalLayout();
        left.setSpacing(true);
        left.setWidth("400px");
        left.setMargin(true);
        divider.addComponent(left);
        VerticalLayout right = new VerticalLayout();
        right.setSpacing(true);
        right.setWidth("400px");
        right.setMargin(true);
        divider.addComponent(right);

        Set<Tag> monitoredTags = getMonitoredTags(database, base);

        int i = 0;
        for (final Tag tag : tags) {

            final boolean monitor = base.hasMonitorTag(database, tag);
            String tagId = tag.getId(database);

            HorizontalLayout hl = new HorizontalLayout();
            hl.setSpacing(true);
            hl.setHeight("37px");

            Button tagButton = Utils.tagButton(database, "list", tagId, i++);
            left.addComponent(tagButton);
            left.setComponentAlignment(tagButton, Alignment.MIDDLE_RIGHT);

            if (canWrite) {
                Button b = new Button();
                b.addStyleName(ValoTheme.BUTTON_BORDERLESS);
                b.setIcon(FontAwesome.TIMES_CIRCLE);
                b.addClickListener(new ClickListener() {

                    private static final long serialVersionUID = -4473258383318654850L;

                    @Override
                    public void buttonClick(ClickEvent event) {
                        base.removeRelatedTags(database, tag);
                        Utils.loseFocus(main.properties);
                        Updates.update(main, true);
                    }

                });
                hl.addComponent(b);
                hl.setComponentAlignment(b, Alignment.MIDDLE_LEFT);
            }

            if (base instanceof Strategiakartta) {

                Button tagButton2 = new Button();
                tagButton2.setCaption(monitor ? "Seurataan toteutuksessa" : "Ei seurata toteutuksessa");
                tagButton2.addStyleName(monitor ? "greenButton" : "redButton");
                tagButton2.addStyleName(ValoTheme.BUTTON_SMALL);
                tagButton2.setWidth("200px");
                if (canWrite) {
                    tagButton2.addClickListener(new ClickListener() {

                        private static final long serialVersionUID = -1769769368034323594L;

                        @Override
                        public void buttonClick(ClickEvent event) {
                            if (monitor) {
                                base.removeMonitorTags(database, tag);
                            } else {
                                base.assertMonitorTags(database, tag);
                            }
                            Utils.loseFocus(main.properties);
                            Updates.update(main, true);
                        }

                    });
                    tagButton2.setEnabled(true);
                } else {
                    tagButton2.setEnabled(false);
                }

                hl.addComponent(tagButton2);
                hl.setComponentAlignment(tagButton2, Alignment.MIDDLE_LEFT);

            } else {

                if (monitoredTags.contains(tag)) {
                    Label l = new Label(" toteuttaa seurattavaa aihetta ");
                    hl.addComponent(l);
                    hl.setComponentAlignment(l, Alignment.MIDDLE_LEFT);
                }

            }

            right.addComponent(hl);
            right.setComponentAlignment(hl, Alignment.MIDDLE_LEFT);

        }

    }

}

From source file:org.eclipse.hawkbit.ui.common.filterlayout.AbstractFilterHeader.java

License:Open Source License

private Button createCancelButtonForUpdateOrDeleteTag() {
    cancelTagButton = SPUIComponentProvider.getButton(UIComponentIdProvider.CANCEL_UPDATE_TAG_ID, "", "", null,
            false, FontAwesome.TIMES_CIRCLE, SPUIButtonStyleNoBorder.class);
    cancelTagButton.addClickListener(this::cancelUpdateOrDeleteTag);
    return cancelTagButton;
}

From source file:org.eclipse.hawkbit.ui.filtermanagement.AutoCompleteTextFieldComponent.java

License:Open Source License

/**
 * Shows the validation error icon in the textfield
 * //from w ww  .jav a2 s .c om
 * @param validationMessage
 *            the validation message which should be added to the error-icon
 *            tooltip
 */
public void showValidationFailureIcon(final String validationMessage) {
    validationIcon.setValue(FontAwesome.TIMES_CIRCLE.getHtml());
    validationIcon.setStyleName(SPUIStyleDefinitions.ERROR_ICON);
    validationIcon.setDescription(validationMessage);
    filterManagementUIState.setFilterQueryValue(null);
    filterManagementUIState.setIsFilterByInvalidFilterQuery(Boolean.TRUE);
}

From source file:org.eclipse.hawkbit.ui.management.actionhistory.ActionHistoryTable.java

License:Open Source License

/**
 * Get status icon./*from   w w  w.  ja v a2  s.  co m*/
 *
 * @param status
 *            as Status
 * @return Label as UI
 */
private Label getStatusIcon(final Action.Status status) {
    final Label label = new LabelBuilder().name("").buildLabel();
    final String statusIconPending = "statusIconPending";
    label.setContentMode(ContentMode.HTML);
    if (Action.Status.FINISHED == status) {
        label.setDescription(i18n.get("label.finished"));
        label.setStyleName(STATUS_ICON_GREEN);
        label.setValue(FontAwesome.CHECK_CIRCLE.getHtml());
    } else if (Action.Status.ERROR == status) {
        label.setDescription(i18n.get("label.error"));
        label.setStyleName("statusIconRed");
        label.setValue(FontAwesome.EXCLAMATION_CIRCLE.getHtml());
    } else if (Action.Status.WARNING == status) {
        label.setStyleName("statusIconOrange");
        label.setDescription(i18n.get("label.warning"));
        label.setValue(FontAwesome.EXCLAMATION_CIRCLE.getHtml());
    } else if (Action.Status.RUNNING == status) {
        // dynamic spinner
        label.setStyleName(statusIconPending);
        label.setDescription(i18n.get("label.running"));
        label.setValue(FontAwesome.ADJUST.getHtml());
    } else if (Action.Status.CANCELING == status) {
        label.setStyleName(statusIconPending);
        label.setDescription(i18n.get("label.cancelling"));
        label.setValue(FontAwesome.TIMES_CIRCLE.getHtml());
    } else if (Action.Status.CANCELED == status) {
        label.setStyleName(statusIconPending);
        label.setDescription(i18n.get("label.cancelled"));
        label.setStyleName(STATUS_ICON_GREEN);
        label.setValue(FontAwesome.TIMES_CIRCLE.getHtml());
    } else if (Action.Status.RETRIEVED == status) {
        label.setStyleName(statusIconPending);
        label.setDescription(i18n.get("label.retrieved"));
        label.setValue(FontAwesome.CIRCLE_O.getHtml());
    } else if (Action.Status.DOWNLOAD == status) {
        label.setStyleName(statusIconPending);
        label.setDescription(i18n.get("label.download"));
        label.setValue(FontAwesome.CLOUD_DOWNLOAD.getHtml());
    } else if (Action.Status.SCHEDULED == status) {
        label.setStyleName(statusIconPending);
        label.setDescription(i18n.get("label.scheduled"));
        label.setValue(FontAwesome.HOURGLASS_1.getHtml());
    } else {
        label.setDescription("");
        label.setValue("");
    }
    return label;

}

From source file:org.eclipse.hawkbit.ui.management.targettable.TargetTableHeader.java

License:Open Source License

private void addFilterTextField(final DistributionSetIdName distributionSetIdName) {
    final Button filterLabelClose = SPUIComponentProvider.getButton("drop.filter.close", "", "", "", true,
            FontAwesome.TIMES_CIRCLE, SPUIButtonStyleNoBorder.class);
    filterLabelClose.addClickListener(clickEvent -> closeFilterByDistribution());
    final Label filteredDistLabel = new Label();
    filteredDistLabel.setStyleName(ValoTheme.LABEL_COLORED + " " + ValoTheme.LABEL_SMALL);
    String name = HawkbitCommonUtil.getDistributionNameAndVersion(distributionSetIdName.getName(),
            distributionSetIdName.getVersion());
    if (name.length() > SPUITargetDefinitions.DISTRIBUTION_NAME_MAX_LENGTH_ALLOWED) {
        name = new StringBuilder(name.substring(0, SPUITargetDefinitions.DISTRIBUTION_NAME_LENGTH_ON_FILTER))
                .append("...").toString();
    }//from ww  w .  j  av a2  s .c  om
    filteredDistLabel.setValue(name);
    filteredDistLabel.setSizeUndefined();
    getFilterDroppedInfo().removeAllComponents();
    getFilterDroppedInfo().setSizeFull();
    getFilterDroppedInfo().addComponent(filteredDistLabel);
    getFilterDroppedInfo().addComponent(filterLabelClose);
    getFilterDroppedInfo().setExpandRatio(filteredDistLabel, 1.0F);
    eventBus.publish(this, TargetFilterEvent.FILTER_BY_DISTRIBUTION);
}

From source file:org.eclipse.hawkbit.ui.management.targettag.filter.MultipleTargetFilter.java

License:Open Source License

protected Button createCancelButtonForUpdateOrDeleteTag() {
    cancelTagButton = SPUIComponentProvider.getButton(UIComponentIdProvider.CANCEL_UPDATE_TAG_ID, "", "", null,
            false, FontAwesome.TIMES_CIRCLE, SPUIButtonStyleNoBorder.class);
    cancelTagButton.addClickListener(this::cancelUpdateOrDeleteTag);
    return cancelTagButton;
}

From source file:org.tylproject.vaadin.addon.fields.search.SearchPatternField.java

License:Apache License

/**
 *
 * @param backingField input field//from   w w  w. j  a  va 2s .c  o m
 * @param fieldType value type of the backingField
 * @param propertyId the propertyId of the Filter
 * @param propertyType the type of the property in the Filter
 */
public SearchPatternField(final F backingField, final Class<T> fieldType, final Object propertyId,
        final Class<?> propertyType) {
    super(backingField, new Button(FontAwesome.TIMES_CIRCLE), fieldType);
    final Button clearBtn = getButton();

    this.targetPropertyId = propertyId;
    this.targetPropertyType = propertyType;

    backingField.setImmediate(true);

    clearBtn.addClickListener(new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent event) {
            clear();
        }
    });
}