Example usage for com.vaadin.server FontAwesome REFRESH

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

Introduction

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

Prototype

FontAwesome REFRESH

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

Click Source Link

Usage

From source file:annis.gui.controlpanel.CorpusListPanel.java

License:Apache License

public CorpusListPanel(InstanceConfig instanceConfig, ExampleQueriesPanel autoGenQueries, final AnnisUI ui) {
    this.instanceConfig = instanceConfig;
    this.autoGenQueries = autoGenQueries;
    this.ui = ui;

    final CorpusListPanel finalThis = this;

    setSizeFull();//from  w  w w.  j av  a2  s  . c  o  m

    selectionLayout = new HorizontalLayout();
    selectionLayout.setWidth("100%");
    selectionLayout.setHeight("-1px");
    selectionLayout.setVisible(false);

    Label lblVisible = new Label("Visible: ");
    lblVisible.setSizeUndefined();
    selectionLayout.addComponent(lblVisible);

    cbSelection = new ComboBox();
    cbSelection.setDescription("Choose corpus selection set");
    cbSelection.setWidth("100%");
    cbSelection.setHeight("-1px");
    cbSelection.addStyleName(ValoTheme.COMBOBOX_SMALL);
    cbSelection.setInputPrompt("Add new corpus selection set");
    cbSelection.setNullSelectionAllowed(false);
    cbSelection.setNewItemsAllowed(true);
    cbSelection.setNewItemHandler((AbstractSelect.NewItemHandler) this);
    cbSelection.setImmediate(true);
    cbSelection.addValueChangeListener(new ValueChangeListener() {
        @Override
        public void valueChange(ValueChangeEvent event) {

            updateCorpusTable();
            updateAutoGeneratedQueriesPanel();

        }
    });

    selectionLayout.addComponent(cbSelection);
    selectionLayout.setExpandRatio(cbSelection, 1.0f);
    selectionLayout.setSpacing(true);
    selectionLayout.setComponentAlignment(cbSelection, Alignment.MIDDLE_RIGHT);
    selectionLayout.setComponentAlignment(lblVisible, Alignment.MIDDLE_LEFT);

    addComponent(selectionLayout);

    txtFilter = new TextField();
    txtFilter.setVisible(false);
    txtFilter.setInputPrompt("Filter");
    txtFilter.setImmediate(true);
    txtFilter.setTextChangeTimeout(500);
    txtFilter.addTextChangeListener(new FieldEvents.TextChangeListener() {
        @Override
        public void textChange(FieldEvents.TextChangeEvent event) {
            BeanContainer<String, AnnisCorpus> availableCorpora = ui.getQueryState().getAvailableCorpora();

            if (textFilter != null) {
                // remove the old filter
                availableCorpora.removeContainerFilter(textFilter);
                textFilter = null;
            }

            if (event.getText() != null && !event.getText().isEmpty()) {
                Set<String> selectedIDs = ui.getQueryState().getSelectedCorpora().getValue();

                textFilter = new SimpleStringFilter("name", event.getText(), true, false);
                availableCorpora.addContainerFilter(textFilter);
                // select the first item
                List<String> filteredIDs = availableCorpora.getItemIds();

                Set<String> selectedAndFiltered = new HashSet<>(selectedIDs);
                selectedAndFiltered.retainAll(filteredIDs);

                Set<String> selectedAndOutsideFilter = new HashSet<>(selectedIDs);
                selectedAndOutsideFilter.removeAll(filteredIDs);

                for (String id : selectedAndOutsideFilter) {
                    tblCorpora.unselect(id);
                }

                if (selectedAndFiltered.isEmpty() && !filteredIDs.isEmpty()) {
                    for (String id : selectedIDs) {
                        tblCorpora.unselect(id);
                    }
                    tblCorpora.select(filteredIDs.get(0));
                }
            }
        }
    });
    txtFilter.setWidth("100%");
    txtFilter.setHeight("-1px");
    txtFilter.addStyleName(ValoTheme.TEXTFIELD_SMALL);
    addComponent(txtFilter);

    pbLoadCorpora = new ProgressBar();
    pbLoadCorpora.setCaption("Loading corpus list...");
    pbLoadCorpora.setIndeterminate(true);
    addComponent(pbLoadCorpora);

    tblCorpora = new Table();

    addComponent(tblCorpora);

    tblCorpora.setVisible(false); // don't show list before it was not loaded
    tblCorpora.setContainerDataSource(ui.getQueryState().getAvailableCorpora());
    tblCorpora.setMultiSelect(true);
    tblCorpora.setPropertyDataSource(ui.getQueryState().getSelectedCorpora());

    tblCorpora.addGeneratedColumn("info", new InfoGenerator());
    tblCorpora.addGeneratedColumn("docs", new DocLinkGenerator());

    tblCorpora.setVisibleColumns("name", "textCount", "tokenCount", "info", "docs");
    tblCorpora.setColumnHeaders("Name", "Texts", "Tokens", "", "");
    tblCorpora.setHeight("100%");
    tblCorpora.setWidth("100%");
    tblCorpora.setSelectable(true);
    tblCorpora.setNullSelectionAllowed(false);
    tblCorpora.setColumnExpandRatio("name", 0.6f);
    tblCorpora.setColumnExpandRatio("textCount", 0.15f);
    tblCorpora.setColumnExpandRatio("tokenCount", 0.25f);
    tblCorpora.addStyleName(ValoTheme.TABLE_SMALL);

    tblCorpora.addActionHandler((Action.Handler) this);
    tblCorpora.setImmediate(true);
    tblCorpora.addItemClickListener(new ItemClickEvent.ItemClickListener() {
        @Override
        public void itemClick(ItemClickEvent event) {
            Set selections = (Set) tblCorpora.getValue();
            if (selections.size() == 1 && event.isCtrlKey() && tblCorpora.isSelected(event.getItemId())) {
                tblCorpora.setValue(null);
            }
        }
    });
    tblCorpora.setItemDescriptionGenerator(new TooltipGenerator());
    tblCorpora.addValueChangeListener(new CorpusTableChangedListener(finalThis));

    Button btReload = new Button();
    btReload.addClickListener(new Button.ClickListener() {
        @Override
        public void buttonClick(ClickEvent event) {
            updateCorpusSetList(false, false);
            Notification.show("Reloaded corpus list", Notification.Type.HUMANIZED_MESSAGE);
        }
    });
    btReload.setIcon(FontAwesome.REFRESH);
    btReload.setDescription("Reload corpus list");
    btReload.addStyleName(ValoTheme.BUTTON_ICON_ONLY);

    selectionLayout.addComponent(btReload);
    selectionLayout.setComponentAlignment(btReload, Alignment.MIDDLE_RIGHT);

    tblCorpora.setSortContainerPropertyId("name");

    setExpandRatio(tblCorpora, 1.0f);

    updateCorpusSetList(true, true);

}

From source file:com.esofthead.mycollab.module.project.view.settings.ProjectNotificationSettingViewComponent.java

License:Open Source License

public ProjectNotificationSettingViewComponent(final ProjectNotificationSetting bean) {
    super(AppContext.getMessage(ProjectSettingI18nEnum.VIEW_TITLE));

    VerticalLayout bodyWrapper = new VerticalLayout();
    bodyWrapper.setSpacing(true);//from  ww  w  .java 2  s .c om
    bodyWrapper.setMargin(true);
    bodyWrapper.setSizeFull();

    HorizontalLayout notificationLabelWrapper = new HorizontalLayout();
    notificationLabelWrapper.setSizeFull();
    notificationLabelWrapper.setMargin(true);

    notificationLabelWrapper.setStyleName("notification-label");

    Label notificationLabel = new Label(AppContext.getMessage(ProjectSettingI18nEnum.EXT_LEVEL));
    notificationLabel.addStyleName("h2");

    notificationLabel.setHeightUndefined();
    notificationLabelWrapper.addComponent(notificationLabel);

    bodyWrapper.addComponent(notificationLabelWrapper);

    VerticalLayout body = new VerticalLayout();
    body.setSpacing(true);
    body.setMargin(new MarginInfo(true, false, false, false));

    final OptionGroup optionGroup = new OptionGroup(null);

    optionGroup.setItemCaptionMode(ItemCaptionMode.EXPLICIT);

    optionGroup.addItem(NotificationType.Default.name());
    optionGroup.setItemCaption(NotificationType.Default.name(),
            AppContext.getMessage(ProjectSettingI18nEnum.OPT_DEFAULT_SETTING));

    optionGroup.addItem(NotificationType.None.name());
    optionGroup.setItemCaption(NotificationType.None.name(),
            AppContext.getMessage(ProjectSettingI18nEnum.OPT_NONE_SETTING));

    optionGroup.addItem(NotificationType.Minimal.name());
    optionGroup.setItemCaption(NotificationType.Minimal.name(),
            AppContext.getMessage(ProjectSettingI18nEnum.OPT_MINIMUM_SETTING));

    optionGroup.addItem(NotificationType.Full.name());
    optionGroup.setItemCaption(NotificationType.Full.name(),
            AppContext.getMessage(ProjectSettingI18nEnum.OPT_MAXIMUM_SETTING));

    optionGroup.setHeight("100%");

    body.addComponent(optionGroup);
    body.setExpandRatio(optionGroup, 1.0f);
    body.setComponentAlignment(optionGroup, Alignment.MIDDLE_LEFT);

    String levelVal = bean.getLevel();
    if (levelVal == null) {
        optionGroup.select(NotificationType.Default.name());
    } else {
        optionGroup.select(levelVal);
    }

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

                @Override
                public void buttonClick(ClickEvent event) {
                    try {
                        bean.setLevel((String) optionGroup.getValue());
                        ProjectNotificationSettingService projectNotificationSettingService = ApplicationContextUtil
                                .getSpringBean(ProjectNotificationSettingService.class);

                        if (bean.getId() == null) {
                            projectNotificationSettingService.saveWithSession(bean, AppContext.getUsername());
                        } else {
                            projectNotificationSettingService.updateWithSession(bean, AppContext.getUsername());
                        }
                        NotificationUtil.showNotification(
                                AppContext.getMessage(ProjectSettingI18nEnum.DIALOG_UPDATE_SUCCESS));
                    } catch (Exception e) {
                        throw new MyCollabException(e);
                    }
                }
            });
    updateBtn.addStyleName(UIConstants.THEME_GREEN_LINK);
    updateBtn.setIcon(FontAwesome.REFRESH);
    body.addComponent(updateBtn);
    body.setComponentAlignment(updateBtn, Alignment.BOTTOM_LEFT);

    bodyWrapper.addComponent(body);
    this.addComponent(bodyWrapper);

}

From source file:com.github.carljmosca.ui.MainUI.java

private void addHeader() {
    HorizontalLayout hl = new HorizontalLayout();
    hl.setSpacing(true);/* w  ww .  j ava2 s .  c o  m*/
    cmbWidgets = new ComboBox();
    cmbWidgets.setContainerDataSource(widgets);
    cmbWidgets.setItemCaptionPropertyId("name");
    hl.addComponent(cmbWidgets);

    Button btnUpdate = new Button("Update", FontAwesome.ADJUST);
    btnUpdate.addClickListener((Button.ClickEvent event) -> {
        cmbWidgets.select(widgets.getIdByIndex(0));
    });
    hl.addComponent(btnUpdate);

    Button btnShow = new Button("Show", FontAwesome.DASHBOARD);
    btnShow.addClickListener((Button.ClickEvent event) -> {
        try {
            fgWidget.commit();
        } catch (FieldGroup.CommitException ex) {
            Logger.getLogger(MainUI.class.getName()).log(Level.SEVERE, null, ex);
        }
        System.out.println(demoAppData.getSelectedWidget().getName());
    });
    hl.addComponent(btnShow);

    Button btnChange = new Button("Change", FontAwesome.REFRESH);
    btnChange.addClickListener((Button.ClickEvent event) -> {
        Widget widget = (Widget) biDemoAppData.getItemProperty("selectedWidget").getValue();
        widget.setName("test xxxx");
        System.out.println(demoAppData.getSelectedWidget().getName());
    });
    hl.addComponent(btnChange);

    mainLayout.addComponent(hl);
}

From source file:com.hack23.cia.web.impl.ui.application.views.admin.datasummary.pagemode.DataSummaryOverviewPageModContentFactoryImpl.java

License:Apache License

@Secured({ "ROLE_ADMIN" })
@Override//from   w w  w .  j  a  v a 2 s . co  m
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
    final VerticalLayout content = createPanelContent();

    getMenuItemFactory().createMainPageMenuBar(menuBar);

    LabelFactory.createHeader2Label(content, ADMIN_DATA_SUMMARY);

    final Table createDataSummaryTable = tableFactory.createDataSummaryTable();
    content.addComponent(createDataSummaryTable);
    content.setExpandRatio(createDataSummaryTable, ContentRatio.LARGE);

    content.setSizeFull();
    content.setMargin(false);
    content.setSpacing(true);

    final Button refreshViewsButton = new Button(REFRESH_VIEWS, FontAwesome.REFRESH);

    refreshViewsButton.addClickListener(event -> {

        final RefreshDataViewsRequest serviceRequest = new RefreshDataViewsRequest();
        serviceRequest.setSessionId(RequestContextHolder.currentRequestAttributes().getSessionId());

        getApplicationManager().asyncService(serviceRequest);
        Notification.show(REFRESH_VIEWS_STARTED);
    });

    content.addComponent(refreshViewsButton);
    content.setExpandRatio(refreshViewsButton, ContentRatio.SMALL);

    final Button updateSearchIndexButton = new Button(UPDATE_SEARCH_INDEX, FontAwesome.REFRESH);

    updateSearchIndexButton.addClickListener(event -> {

        final UpdateSearchIndexRequest serviceRequest = new UpdateSearchIndexRequest();
        serviceRequest.setSessionId(RequestContextHolder.currentRequestAttributes().getSessionId());

        getApplicationManager().asyncService(serviceRequest);
        Notification.show(UPDATE_SEARCH_INDEX_STARTED);
    });

    content.addComponent(updateSearchIndexButton);
    content.setExpandRatio(updateSearchIndexButton, ContentRatio.SMALL);

    return content;

}

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

License:Apache License

public AbstractTabLayout() {
    Design.read(this);
    Responsive.makeResponsive(this);

    btnAdd.setIcon(FontAwesome.PLUS_CIRCLE);
    btnAdd.addClickListener(this);

    btnRefresh.setIcon(FontAwesome.REFRESH);
    btnRefresh.addClickListener(this);

    prepareUI();//from   w w w  .ja  v  a2 s  .c  o m
}

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

License:Apache License

public AbstractTableLayout() {
    Design.read(this);
    Responsive.makeResponsive(this);

    btnAdd.setIcon(FontAwesome.PLUS_CIRCLE);
    btnAdd.addClickListener(this);

    btnRefresh.setIcon(FontAwesome.REFRESH);
    btnRefresh.addClickListener(this);

    setExpandRatio(iTable, 1f);/*  ww w  .j  a v a2 s  .  com*/
    prepareTable();
}

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

License:Apache License

public AbstractTreeTableLayout() {
    Design.read(this);
    Responsive.makeResponsive(this);

    btnAdd.setIcon(FontAwesome.PLUS_CIRCLE);
    btnAdd.addClickListener(this);

    btnRefresh.setIcon(FontAwesome.REFRESH);
    btnRefresh.addClickListener(this);

    setExpandRatio(iTable, 1f);/*from w  w  w  .  ja v  a 2s  .com*/
    prepareTable();
}

From source file:com.hybridbpm.ui.view.DevelopmentView.java

License:Apache License

public DevelopmentView() {
    Design.read(this);
    Responsive.makeResponsive(panelLayout);

    moduleType.addContainerProperty("NAME", String.class, null);
    moduleType.addItem(Boolean.FALSE).getItemProperty("NAME").setValue("Module");
    moduleType.addItem(Boolean.TRUE).getItemProperty("NAME").setValue("Template");
    moduleType.setItemCaptionMode(AbstractSelect.ItemCaptionMode.PROPERTY);
    moduleType.setItemCaptionPropertyId("NAME");
    moduleType.setValue(Boolean.FALSE);
    moduleType.addValueChangeListener(this);

    btnAdd.setIcon(FontAwesome.PLUS_CIRCLE);
    btnAdd.addClickListener(this);

    btnRefresh.setIcon(FontAwesome.REFRESH);
    btnRefresh.addClickListener(this);

    btnExport.setIcon(FontAwesome.CLOUD_UPLOAD);
    btnExport.addClickListener(this);

    btnImport.setIcon(FontAwesome.CLOUD_DOWNLOAD);
    btnImport.addClickListener(this);

    btnRegenerate.setIcon(FontAwesome.WRENCH);
    btnRegenerate.addClickListener(this);

    modulesLayout.setMargin(new MarginInfo(true, false, false, false));
    modulesLayout.setExpandRatio(modulesTable, 1f);

    modulesTable.addContainerProperty("title", Component.class, null, "Title", null, Table.Align.LEFT);
    modulesTable.setColumnExpandRatio("title", 1f);
    modulesTable.addContainerProperty("updateDate", Date.class, null, "Update Date", null, Table.Align.LEFT);
    modulesTable.addContainerProperty("actions", TableButtonBar.class, null, "Actions", null, Table.Align.LEFT);
    modulesTable.setColumnWidth("updateDate", 150);
    modulesTable.setColumnWidth("actions", 80);
    modulesTable.addGeneratedColumn("updateDate", new DateColumnGenerator());
    modulesTable.setVisibleColumns("title", "updateDate", "actions");
}

From source file:com.hybridbpm.ui.view.DocumentView.java

License:Apache License

public DocumentView() {
    Design.read(this);
    tabSheet.getTab(documentsLayout).setCaption(Translate.getMessage("Documents"));
    btnSearch.setCaption(Translate.getMessage("btnSearch"));
    btnRefresh.setCaption(Translate.getMessage("btnRefresh"));
    btnAddFile.setCaption(Translate.getMessage("btnAddFile"));
    btnAddFolder.setCaption(Translate.getMessage("btnAddFolder"));
    textFieldSearch.setCaption(Translate.getMessage("textFieldSearch"));

    Responsive.makeResponsive(panelLayout);
    btnAddFolder.setIcon(FontAwesome.FOLDER_O);
    btnAddFolder.addClickListener(this);
    btnAddFile.setIcon(FontAwesome.FILE_O);
    btnAddFile.addClickListener(this);

    btnRefresh.setIcon(FontAwesome.REFRESH);
    btnRefresh.addClickListener(this);

    textFieldSearch.setIcon(FontAwesome.SEARCH);

    documentsLayout.setMargin(new MarginInfo(true, false, false, false));
    documentsLayout.setExpandRatio(documentTable, 1f);

    documentTable.addContainerProperty("name", String.class, null, Translate.getMessage("tableDocumentsName"),
            null, Table.Align.LEFT);//from  w  w w .  j av  a2 s  . co m
    documentTable.setColumnExpandRatio("name", 1f);
    documentTable.addContainerProperty("description", String.class, null,
            Translate.getMessage("tableDocumentsTitle"), null, Table.Align.LEFT);
    documentTable.addContainerProperty("creator", String.class, null,
            Translate.getMessage("tableDocumentsCreator"), null, Table.Align.LEFT);
    documentTable.addContainerProperty("createDate", Date.class, null,
            Translate.getMessage("tableDocumentsCreateDate"), null, Table.Align.LEFT);
    documentTable.addContainerProperty("updateDate", Date.class, null,
            Translate.getMessage("tableDocumentsUpdateDate"), null, Table.Align.LEFT);
    documentTable.addContainerProperty("actions", TableButtonBar.class, null,
            Translate.getMessage("tableDocumentsActions"), null, Table.Align.LEFT);
    documentTable.setColumnWidth("createDate", 150);
    documentTable.setColumnWidth("updateDate", 150);
    documentTable.setColumnWidth("actions", 55);
    documentTable.addGeneratedColumn("name", new DocumentColumnGenerator(this));
    documentTable.addGeneratedColumn("createDate", new DateColumnGenerator());
    documentTable.addGeneratedColumn("updateDate", new DateColumnGenerator());
    documentTable.setVisibleColumns("name", "description", "creator", "createDate", "updateDate", "actions");
    tabSheet.addSelectedTabChangeListener(this);
}

From source file:com.mycollab.module.crm.view.setting.CrmNotificationSettingViewImpl.java

License:Open Source License

@Override
public void showNotificationSettings(final CrmNotificationSetting notification) {
    this.removeAllComponents();

    MVerticalLayout bodyWrapper = new MVerticalLayout();
    bodyWrapper.setSizeFull();//from  ww  w .  j  a  v a2s  .c om

    MVerticalLayout body = new MVerticalLayout().withMargin(new MarginInfo(true, false, false, false));

    final OptionGroup optionGroup = new OptionGroup(null);
    optionGroup.setItemCaptionMode(ItemCaptionMode.EXPLICIT);

    optionGroup.addItem(NotificationType.Default.name());
    optionGroup.setItemCaption(NotificationType.Default.name(),
            UserUIContext.getMessage(ProjectSettingI18nEnum.OPT_DEFAULT_SETTING));

    optionGroup.addItem(NotificationType.None.name());
    optionGroup.setItemCaption(NotificationType.None.name(),
            UserUIContext.getMessage(ProjectSettingI18nEnum.OPT_NONE_SETTING));

    optionGroup.addItem(NotificationType.Minimal.name());
    optionGroup.setItemCaption(NotificationType.Minimal.name(),
            UserUIContext.getMessage(ProjectSettingI18nEnum.OPT_MINIMUM_SETTING));

    optionGroup.addItem(NotificationType.Full.name());
    optionGroup.setItemCaption(NotificationType.Full.name(),
            UserUIContext.getMessage(ProjectSettingI18nEnum.OPT_MAXIMUM_SETTING));

    optionGroup.setHeight("100%");

    body.with(optionGroup).withAlign(optionGroup, Alignment.MIDDLE_LEFT).expand(optionGroup);

    String levelVal = notification.getLevel();
    if (levelVal == null) {
        optionGroup.select(NotificationType.Default.name());
    } else {
        optionGroup.select(levelVal);
    }

    Button updateBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_UPDATE_LABEL), clickEvent -> {
        try {
            notification.setLevel((String) optionGroup.getValue());
            CrmNotificationSettingService crmNotificationSettingService = AppContextUtil
                    .getSpringBean(CrmNotificationSettingService.class);
            if (notification.getId() == null) {
                crmNotificationSettingService.saveWithSession(notification, UserUIContext.getUsername());
            } else {
                crmNotificationSettingService.updateWithSession(notification, UserUIContext.getUsername());
            }
            NotificationUtil.showNotification(UserUIContext.getMessage(GenericI18Enum.OPT_CONGRATS),
                    UserUIContext.getMessage(ProjectSettingI18nEnum.DIALOG_UPDATE_SUCCESS));
        } catch (Exception e) {
            throw new MyCollabException(e);
        }
    }).withIcon(FontAwesome.REFRESH).withStyleName(WebThemes.BUTTON_ACTION);
    body.with(updateBtn).withAlign(updateBtn, Alignment.BOTTOM_LEFT);

    bodyWrapper.addComponent(body);
    this.addComponent(bodyWrapper);
}