Java 类com.vaadin.server.FontAwesome 实例源码

项目:esup-ecandidat    文件:I18nField.java   
/**
 * Constructeur, initialisation du champs
 * @param listeLangueEnService 
 * @param langueParDefaut 
 * @param libelleBtnPlus 
 */
public I18nField(Langue langueParDefaut, List<Langue> listeLangueEnService, String libelleBtnPlus) {
    super();
    setRequired(false);         
    this.langueParDefaut = langueParDefaut;
    this.listeLangueEnService = listeLangueEnService;

    listLayoutTraductions = new ArrayList<HorizontalLayout>();
    listeTraduction = new ArrayList<I18nTraduction>();
    layoutComplet = new VerticalLayout();
    layoutComplet.setSpacing(true);
    layoutLangue = new VerticalLayout();
    layoutLangue.setSpacing(true);
    layoutComplet.addComponent(layoutLangue);

    btnAddLangue = new OneClickButton(libelleBtnPlus,FontAwesome.PLUS_SQUARE_O);
    btnAddLangue.setVisible(false);
    btnAddLangue.addStyleName(ValoTheme.BUTTON_TINY);
    layoutComplet.addComponent(btnAddLangue);
    btnAddLangue.addClickListener(e->{
        layoutLangue.addComponent(getLangueLayout(null));
        checkVisibleAddLangue();
        centerWindow();
    });     
}
项目:holon-vaadin7    文件:ExampleDialog.java   
public void dialog1() {
    // tag::dialog1[]
    Dialog dialog = Components.dialog() // <1>
            .draggable(false) // <2>
            .closable(true) // <3>
            .resizable(true) // <4>
            .modal(true) // <5>
            .message("Dialog message", "dialog.message.code") // <6>
            .okButtonConfigurator(cfg -> cfg.caption("Done").icon(FontAwesome.CHECK_CIRCLE_O)) // <7>
            .withCloseListener((window, action) -> { // <8>
                // ...
            }).build();

    dialog.open(); // <9>

    dialog.close(); // <10>
    // end::dialog1[]
}
项目:esup-ecandidat    文件:CandidatCreerCompteView.java   
/**
 * Rafraichi le panel de connexion sans compte
 */
private void refreshConnexionPanelStudent() {
    vlConnexionIsStudent.removeAllComponents();

    OneClickButton logBtn = new OneClickButton(
            applicationContext.getMessage("btnConnect", null, UI.getCurrent().getLocale()), FontAwesome.SIGN_OUT);
    logBtn.addClickListener(e -> {
        userController.connectCAS();
    });

    HorizontalLayout hlConnect = new HorizontalLayout();
    hlConnect.setSpacing(true);
    Label labelConnect = new Label(
            applicationContext.getMessage("accueilView.connect.cas", null, UI.getCurrent().getLocale()));
    hlConnect.addComponent(labelConnect);
    hlConnect.setComponentAlignment(labelConnect, Alignment.MIDDLE_LEFT);
    hlConnect.addComponent(logBtn);
    hlConnect.setComponentAlignment(logBtn, Alignment.MIDDLE_CENTER);

    vlConnexionIsStudent.addComponent(hlConnect);
}
项目:esup-ecandidat    文件:CandidatViewTemplate.java   
/** Ajoute des boutons de navigation
 * @param previousView
 * @param nextView
 */
public void setNavigationButton(String previousView, String nextView){
    if (previousView!=null){
        OneClickButton btnPrevious = new OneClickButton(applicationContext.getMessage("btnPrevious", null, UI.getCurrent().getLocale()),FontAwesome.ARROW_CIRCLE_O_LEFT);
        btnPrevious.addClickListener(e->uiController.navigateTo(previousView));
        titleLayout.addComponent(btnPrevious);
        titleLayout.setComponentAlignment(btnPrevious, Alignment.MIDDLE_LEFT);
    }

    if (nextView!=null){
        OneClickButton btnNext = new OneClickButton(applicationContext.getMessage("btnNext", null, UI.getCurrent().getLocale()),FontAwesome.ARROW_CIRCLE_O_RIGHT);
        btnNext.addStyleName(ValoTheme.BUTTON_ICON_ALIGN_RIGHT);
        btnNext.addClickListener(e->uiController.navigateTo(nextView));
        titleLayout.addComponent(btnNext);
        titleLayout.setComponentAlignment(btnNext, Alignment.MIDDLE_RIGHT);
    }       
}
项目:esup-ecandidat    文件:MainUI.java   
/**
 * Construit le menu
 */
private void buildMenu() {
    menu.addStyleName(ValoTheme.MENU_PART);

    final OneClickButton showMenu = new OneClickButton(applicationContext.getMessage("mainUi.menu", null, getLocale()), FontAwesome.LIST);
    showMenu.addStyleName(ValoTheme.BUTTON_PRIMARY);
    showMenu.addStyleName(ValoTheme.BUTTON_SMALL);
    showMenu.addStyleName(StyleConstants.VALO_MENU_TOGGLE);
    showMenu.addClickListener(e -> {
        if (menu.getStyleName().contains(StyleConstants.VALO_MENU_VISIBLE)) {
            menu.removeStyleName(StyleConstants.VALO_MENU_VISIBLE);
        } else {
            menu.addStyleName(StyleConstants.VALO_MENU_VISIBLE);
        }

    });
    menu.addComponent(showMenu);

    menuButtonLayout.setPrimaryStyleName(StyleConstants.VALO_MENUITEMS);
    menu.addComponent(menuButtonLayout);

    constructMainMenu();
}
项目:esup-ecandidat    文件:SearchAnneeUnivApoField.java   
/**
 * Constructeur, initialisation du champs
 * @param libelleBtnFind 
 */
public SearchAnneeUnivApoField(String libelleBtnFind) {
    super();
    layout = new HorizontalLayout();
    layout.setSpacing(true);
    anneeField = new TextField();
    anneeField.addValueChangeListener(e->showOrHideError());
    anneeField.setNullRepresentation("");
    anneeField.setReadOnly(true);
    btnSearch = new OneClickButton(libelleBtnFind,FontAwesome.SEARCH);
    btnSearch.addClickListener(e->{
        SearchAnneeUnivApoWindow window = new SearchAnneeUnivApoWindow();
        window.addAnneeUniListener(a->changeFieldValue(a));
        UI.getCurrent().addWindow(window);
    });
    layout.addComponent(anneeField);
    layout.addComponent(btnSearch);
}
项目:esup-ecandidat    文件:GridFormatting.java   
/**
 * Formate les colonnes en boolean : Ajoute une case a cocher a la place de O et
 * N
 * 
 * @param propertys
 */
private void addBooleanColumns(String... propertys) {
    for (String property : propertys) {
        Column col = getColumn(property).setRenderer(new HtmlRenderer(),
                new StringToBooleanConverter(
                        "<div style=width:100%;text-align:center>" + FontAwesome.CHECK_SQUARE_O.getHtml()
                                + "</div>",
                        "<div style=width:100%;text-align:center>" + FontAwesome.SQUARE_O.getHtml() + "</div>"));
        col.setWidth(119);
    }
}
项目:dubbo-switch    文件:ZookeeperConsumerManageUI.java   
/**
 * 创建删除按钮
 * @return
 */
private Button createDeleteButton() {
    Button deleteButton = new Button("删除",FontAwesome.CLOSE);
    deleteButton.addStyleName(ValoTheme.BUTTON_DANGER);
    deleteButton.addClickListener((Button.ClickListener) clickEvent -> {
        //validate
        Collection<Object> items = grid.getSelectedRows();
        if(items.size() == 0){
            Notification.show("请选中要删除的行!", Notification.Type.ERROR_MESSAGE);
            return;
        }
        //batch delete
        for (Object object : items) {
            Item item = grid.getContainerDataSource().getItem(object);
            if (item != null) {
                Long id = (Long) item.getItemProperty("序号").getValue();
                zookeeperConsumerRepository.delete(id);
            }
        }
        search();
    });
    return deleteButton;
}
项目:dubbo-switch    文件:ZookeeperAppAddUI.java   
/**
 * 创建保存按钮
 * @return
 */
private Button createSaveButton() {
    Button saveButton = new Button("保存", FontAwesome.CHECK);
    saveButton.addStyleName(ValoTheme.BUTTON_PRIMARY);
    saveButton.addClickListener((Button.ClickListener) clickEvent -> {
        String name = nameField.getValue();
        if (StringUtils.isEmpty(name)) {
            Notification.show("服务名称不能为空!",Notification.Type.ERROR_MESSAGE);
            return;
        }
        //insert data
        ZookeeperApp zookeeperApp = new ZookeeperApp();
        zookeeperApp.setName(name);
        zookeeperAppRepository.save(zookeeperApp);
        isAddSuccess = true;
        close();
    });
    return saveButton;
}
项目:dubbo-switch    文件:ZookeeperAppManageUI.java   
/**
 * 创建删除按钮
 * @return
 */
private Button createDeleteButton() {
    Button deleteButton = new Button("删除",FontAwesome.CLOSE);
    deleteButton.addStyleName(ValoTheme.BUTTON_DANGER);
    deleteButton.addClickListener((Button.ClickListener) clickEvent -> {
        //validate
        Collection<Object> items = grid.getSelectedRows();
        if(items.size() == 0){
            Notification.show("请选中要删除的行!", Notification.Type.ERROR_MESSAGE);
            return;
        }
        //batch delete
        for (Object object : items) {
            Item item = grid.getContainerDataSource().getItem(object);
            if(item != null){
                Long id = (Long) item.getItemProperty("序号").getValue();
                zookeeperAppRepository.delete(id);
            }
        }
        search();
    });
    return deleteButton;
}
项目:dubbo-switch    文件:ZookeeperAppViewUI.java   
/**
 * 添加节点
 * @param dubboServiceBean
 * @param serviceName
 * @param node
 */
private void addServiceNode(DubboServiceBean dubboServiceBean, String serviceName,String node) {
    String serviceNode = serviceName + "->" + node;
    viewTree.addItem(serviceNode);
    viewTree.setParent(serviceNode, serviceName);
    viewTree.expandItem(serviceNode);
    List<String> nodeList = null;
    if ("providers".equals(node)) {
        nodeList = dubboServiceBean.getProvidersList();
    } else if ("consumers".equals(node)) {
        nodeList = dubboServiceBean.getConsumersList();
    }
    if (nodeList != null) {
        for (String _node : nodeList) {
            String url = DubboSwitchTool.decode(_node);
            viewTree.addItem(url);
            viewTree.setParent(url, _node);
            viewTree.setItemIcon(url,FontAwesome.STAR_O);
            viewTree.setChildrenAllowed(url, false);
        }
    }
}
项目:dubbo-switch    文件:ZookeeperProviderManageUI.java   
/**
 * 创建删除按钮
 * @return
 */
private Button createDeleteButton() {
    Button deleteButton = new Button("删除",FontAwesome.CLOSE);
    deleteButton.addStyleName(ValoTheme.BUTTON_DANGER);
    deleteButton.addClickListener((Button.ClickListener) clickEvent -> {
        //validate
        Collection<Object> items = grid.getSelectedRows();
        if(items.size() == 0){
            Notification.show("请选中要删除的行!", Notification.Type.ERROR_MESSAGE);
            return;
        }
        //batch delete
        for (Object object : items) {
            Item item = grid.getContainerDataSource().getItem(object);
            if (item != null) {
                Long id = (Long) item.getItemProperty("序号").getValue();
                zookeeperProviderRepository.delete(id);
            }
        }
        search();
    });
    return deleteButton;
}
项目:imotSpot    文件:DashboardView.java   
private Component buildEditButton() {
    Button result = new Button();
    result.setId(EDIT_ID);
    result.setIcon(FontAwesome.EDIT);
    result.addStyleName("icon-edit");
    result.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    result.setDescription("Add Imot");
    result.addClickListener(new ClickListener() {
        @Override
        public void buttonClick(final ClickEvent event) {
            getUI().addWindow(
                    new AddingImot(DashboardView.this, titleLabel
                            .getValue()));
        }
    });
    return result;
}
项目:imotSpot    文件:DashboardMenu.java   
private Component buildToggleButton() {
    Button valoMenuToggleButton = new Button("Menu", new ClickListener() {
        @Override
        public void buttonClick(final ClickEvent event) {
            if (getCompositionRoot().getStyleName().contains(STYLE_VISIBLE)) {
                getCompositionRoot().removeStyleName(STYLE_VISIBLE);
            } else {
                getCompositionRoot().addStyleName(STYLE_VISIBLE);
            }
        }
    });
    valoMenuToggleButton.setIcon(FontAwesome.LIST);
    valoMenuToggleButton.addStyleName("valo-menu-toggle");
    valoMenuToggleButton.addStyleName(ValoTheme.BUTTON_BORDERLESS);
    valoMenuToggleButton.addStyleName(ValoTheme.BUTTON_SMALL);
    return valoMenuToggleButton;
}
项目:kumoreg    文件:AttendeeDetailWindow.java   
public AttendeeDetailWindow(AttendeePrintView parentView, AttendeeSearchPresenter handler) {
    super("Attendee Detail");
    this.handler = handler;
    this.parentView = parentView;
    setIcon(FontAwesome.USER);
    center();
    setModal(true);
    setWidth(1100, Unit.PIXELS);
    setHeight(800, Unit.PIXELS);

    VerticalLayout verticalLayout = new VerticalLayout();
    verticalLayout.setMargin(false);
    verticalLayout.setSpacing(true);
    form = new AttendeeDetailForm(this);
    form.setAllFieldsButCheckInDisabled();
    verticalLayout.addComponent(form);
    verticalLayout.addComponent(buildSaveCancel());
    setContent(verticalLayout);

    btnSave.setClickShortcut(ShortcutAction.KeyCode.ENTER);
    btnSave.addStyleName(ValoTheme.BUTTON_PRIMARY);
}
项目:kumoreg    文件:WarningWindow.java   
public WarningWindow(String message) {
    super("Warning");

    setIcon(FontAwesome.WARNING);
    setModal(true);
    center();

    lblMessage.setValue(message);

    VerticalLayout verticalLayout = new VerticalLayout();
    verticalLayout.setMargin(true);
    verticalLayout.setSpacing(true);
    verticalLayout.addComponent(lblMessage);

    verticalLayout.addComponent(btnOk);
    btnOk.focus();
    btnOk.addClickListener((Button.ClickListener) clickEvent -> this.close());
    setContent(verticalLayout);

    btnOk.setClickShortcut(ShortcutAction.KeyCode.ENTER);
    btnOk.addStyleName(ValoTheme.BUTTON_DANGER);
}
项目:vaadin-vertx-samples    文件:DashboardView.java   
private Component buildEditButton() {
    Button result = new Button();
    result.setId(EDIT_ID);
    result.setIcon(FontAwesome.EDIT);
    result.addStyleName("icon-edit");
    result.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    result.setDescription("Edit Dashboard");
    result.addClickListener(new ClickListener() {
        @Override
        public void buttonClick(final ClickEvent event) {
            getUI().addWindow(
                    new DashboardEdit(DashboardView.this, titleLabel
                            .getValue()));
        }
    });
    return result;
}
项目:vaadin-vertx-samples    文件:DashboardMenu.java   
private Component buildToggleButton() {
    Button valoMenuToggleButton = new Button("Menu", new ClickListener() {
        @Override
        public void buttonClick(final ClickEvent event) {
            if (getCompositionRoot().getStyleName().contains(STYLE_VISIBLE)) {
                getCompositionRoot().removeStyleName(STYLE_VISIBLE);
            } else {
                getCompositionRoot().addStyleName(STYLE_VISIBLE);
            }
        }
    });
    valoMenuToggleButton.setIcon(FontAwesome.LIST);
    valoMenuToggleButton.addStyleName("valo-menu-toggle");
    valoMenuToggleButton.addStyleName(ValoTheme.BUTTON_BORDERLESS);
    valoMenuToggleButton.addStyleName(ValoTheme.BUTTON_SMALL);
    return valoMenuToggleButton;
}
项目:vaadin-vertx-samples    文件:ProfilePreferencesWindow.java   
private Component buildPreferencesTab() {
    VerticalLayout root = new VerticalLayout();
    root.setCaption("Preferences");
    root.setIcon(FontAwesome.COGS);
    root.setSpacing(true);
    root.setMargin(true);
    root.setSizeFull();

    Label message = new Label("Not implemented in this demo");
    message.setSizeUndefined();
    message.addStyleName(ValoTheme.LABEL_LIGHT);
    root.addComponent(message);
    root.setComponentAlignment(message, Alignment.MIDDLE_CENTER);

    return root;
}
项目:hawkbit-examples    文件:SimulatorView.java   
@Override
public String convertToPresentation(final Status value, final Class<? extends String> targetType,
        final Locale locale) {
    switch (value) {
    case UNKNWON:
        return "<span class=\"v-icon grayicon\" style=\"font-family: " + FontAwesome.FONT_FAMILY
                + ";\"color\":\"gray\";\">&#x" + Integer.toHexString(FontAwesome.QUESTION_CIRCLE.getCodepoint())
                + HTML_SPAN;
    case PEDNING:
        return "<span class=\"v-icon yellowicon\" style=\"font-family: " + FontAwesome.FONT_FAMILY
                + ";\"color\":\"yellow\";\">&#x" + Integer.toHexString(FontAwesome.REFRESH.getCodepoint())
                + HTML_SPAN;
    case FINISH:
        return "<span class=\"v-icon greenicon\" style=\"font-family: " + FontAwesome.FONT_FAMILY
                + ";\"color\":\"green\";\">&#x" + Integer.toHexString(FontAwesome.CHECK_CIRCLE.getCodepoint())
                + HTML_SPAN;
    case ERROR:
        return "<span class=\"v-icon redicon\" style=\"font-family: " + FontAwesome.FONT_FAMILY
                + ";\"color\":\"red\";\">&#x"
                + Integer.toHexString(FontAwesome.EXCLAMATION_CIRCLE.getCodepoint()) + HTML_SPAN;
    default:
        throw new IllegalStateException("unknown value");
    }
}
项目:hawkbit-examples    文件:GenerateDialog.java   
private void createOkButton(final GenerateDialogCallback callback) {

        this.buttonOk = new Button("generate");
        buttonOk.setImmediate(true);
        buttonOk.setIcon(FontAwesome.GEARS);
        buttonOk.addClickListener(event -> {
            try {
                callback.okButton(namePrefixTextField.getValue(), tenantTextField.getValue(),
                        Integer.valueOf(amountTextField.getValue().replace(".", "").replace(",", "")),
                        Integer.valueOf(pollDelayTextField.getValue().replace(".", "")),
                        new URL(pollUrlTextField.getValue()), gatewayTokenTextField.getValue(),
                        (Protocol) protocolGroup.getValue());
            } catch (final NumberFormatException | MalformedURLException e) {
                LOGGER.info(e.getMessage(), e);
            }
            GenerateDialog.this.close();
        });
    }
项目:bookery    文件:BatchJobCard.java   
private HorizontalLayout createHeader() {
    captionLabel = new Label("some.batchjob");

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

        @Override
        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;
}
项目:VaadinSpringShiroMongoDB    文件:SampleCrudView.java   
public HorizontalLayout createTopBar() {
    TextField filter = new TextField();
    filter.setStyleName("filter-textfield");
    filter.setInputPrompt("Filter");
    ResetButtonForTextField.extend(filter);
    filter.setImmediate(true);
    filter.addTextChangeListener(event -> table.setFilter(event.getText()));

    newProduct = new Button("New product");
    newProduct.addStyleName(ValoTheme.BUTTON_PRIMARY);
    newProduct.setIcon(FontAwesome.PLUS_CIRCLE);
    newProduct.addClickListener(event -> viewLogic.newProduct());

    HorizontalLayout topLayout = new HorizontalLayout();
    topLayout.setSpacing(true);
    topLayout.setWidth("100%");
    topLayout.addComponent(filter);
    topLayout.addComponent(newProduct);
    topLayout.setComponentAlignment(filter, Alignment.MIDDLE_LEFT);
    topLayout.setExpandRatio(filter, 1);
    topLayout.setStyleName("top-bar");
    return topLayout;
}
项目:VaadinSpringShiroMongoDB    文件:MainScreen.java   
public MainScreen(MyUI ui) {

        setStyleName("main-screen");

        CssLayout viewContainer = new CssLayout();
        viewContainer.addStyleName("valo-content");
        viewContainer.setSizeFull();

        //final Navigator navigator = new Navigator(ui, viewContainer);
        final Navigator navigator = new DiscoveryNavigator(ui, viewContainer);

        navigator.setErrorView(ErrorView.class);
        menu = new Menu(navigator);
        menu.addView(new SampleCrudView(), SampleCrudView.VIEW_NAME,
                SampleCrudView.VIEW_NAME, FontAwesome.EDIT);
        menu.addView(new AboutView(), AboutView.VIEW_NAME, AboutView.VIEW_NAME,
                FontAwesome.INFO_CIRCLE);

        navigator.addViewChangeListener(viewChangeListener);

        addComponent(menu);
        addComponent(viewContainer);
        setExpandRatio(viewContainer, 1);
        setSizeFull();
    }
项目:hawkbit    文件:UploadStatusInfoWindow.java   
private void resizeWindow(final ClickEvent event) {
    if (FontAwesome.EXPAND.equals(event.getButton().getIcon())) {
        event.getButton().setIcon(FontAwesome.COMPRESS);
        setWindowMode(WindowMode.MAXIMIZED);
        resetColumnWidth();
        grid.getColumn(STATUS).setExpandRatio(0);
        grid.getColumn(PROGRESS).setExpandRatio(1);
        grid.getColumn(FILE_NAME).setExpandRatio(2);
        grid.getColumn(REASON).setExpandRatio(3);
        grid.getColumn(SPUILabelDefinitions.NAME_VERSION).setExpandRatio(4);
        mainLayout.setSizeFull();
    } else {
        event.getButton().setIcon(FontAwesome.EXPAND);
        setWindowMode(WindowMode.NORMAL);
        setColumnWidth();
        setPopupSizeInMinMode();
    }
}
项目:hawkbit    文件:ArtifactDetailsLayout.java   
private void addGeneratedColumnButton(final Table table) {
    table.addGeneratedColumn(ACTION, new ColumnGenerator() {
        private static final long serialVersionUID = 1L;

        @Override
        public Button generateCell(final Table source, final Object itemId, final Object columnId) {
            final String fileName = (String) table.getContainerDataSource().getItem(itemId)
                    .getItemProperty(PROVIDED_FILE_NAME).getValue();
            final Button deleteIcon = SPUIComponentProvider.getButton(
                    fileName + "-" + UIComponentIdProvider.UPLOAD_FILE_DELETE_ICON, "",
                    SPUILabelDefinitions.DISCARD, ValoTheme.BUTTON_TINY + " " + "blueicon", true,
                    FontAwesome.TRASH_O, SPUIButtonStyleSmallNoBorder.class);
            deleteIcon.setData(itemId);
            deleteIcon.addClickListener(event -> confirmAndDeleteArtifact((Long) itemId, fileName));
            return deleteIcon;
        }
    });

}
项目:FontAwesomeRenderer    文件:DemoUI.java   
@Override
protected void init(VaadinRequest request) {

    // Show it in the middle of the screen
    final VerticalLayout layout = new VerticalLayout();
    layout.setStyleName("demoContentLayout");
    layout.setSizeFull();
    setContent(layout);

    Grid grid = new Grid();

    grid.addColumn("name", String.class).setHeaderCaption("Name");
    grid.addColumn("icon", String.class)
            .setHeaderCaption("icon")
            .setRenderer(new FontIconRenderer(e -> Notification.show(e.toString())));

    grid.getDefaultHeaderRow().join("name", "icon").setText("Brand");

    grid.addRow("Android", FontAwesome.ANDROID.getHtml());
    grid.addRow("Ios", FontAwesome.APPLE.getHtml());
    grid.addRow("Who cares", FontAwesome.WINDOWS.getHtml());
    layout.addComponent(grid);

}
项目:hawkbit    文件:AbstractDeleteActionsLayout.java   
private DragAndDropWrapper createDeleteWrapperLayout() {
    final Button dropToDelete = new Button(i18n.getMessage("label.components.drop.area"));
    dropToDelete.setCaptionAsHtml(true);
    dropToDelete.setIcon(FontAwesome.TRASH_O);
    dropToDelete.addStyleName(ValoTheme.BUTTON_BORDERLESS);
    dropToDelete.addStyleName("drop-to-delete-button");
    dropToDelete.addStyleName(SPUIStyleDefinitions.ACTION_BUTTON);
    dropToDelete.addStyleName(SPUIStyleDefinitions.DEL_ACTION_BUTTON);
    dropToDelete.addStyleName("delete-icon");

    final DragAndDropWrapper wrapper = new DragAndDropWrapper(dropToDelete);
    wrapper.setStyleName(ValoTheme.BUTTON_PRIMARY);
    wrapper.setId(getDeleteAreaId());
    wrapper.setDropHandler(this);
    wrapper.addStyleName("delete-button-border");
    return wrapper;
}
项目:cherry-web    文件:PagesSpace.java   
private HierarchicalContainer createNavigationContainer() {
    HierarchicalContainer container = new HierarchicalContainer();
    container.addContainerProperty("name", String.class, "?");
    container.addContainerProperty("tecName", String.class, "");
    container.addContainerProperty("object", NavNode.class, null);
    container.addContainerProperty("theme", String.class, false);
    container.addContainerProperty("acl", Boolean.class, false);
    container.addContainerProperty("pageType", String.class, "");
    container.addContainerProperty("hidden", Boolean.class, false);
    container.addContainerProperty("icon", FontAwesome.class, null);

    String host = ((ControlUi)GuiUtil.getApi()).getHost();
    VirtualHost vHost = MApi.lookup(CherryApi.class).findVirtualHost(host);
    NavNode navRoot = vHost.getNavigationProvider().getNode("/");

    try {
        Item item = container.addItem(navRoot.getId());
        fillItem(item, navRoot);
        container.setParent(navRoot.getId(), null);
        container.setChildrenAllowed(navRoot.getId(), true);
    } catch (Throwable t) {
        MLogUtil.log().i(t);
    }
    return container;
}
项目:hawkbit    文件:MultipleTargetFilter.java   
/**
 * Intialize component.
 */
private void buildComponents() {
    filterByStatusFotter.init();

    filterByButtons.addStyleName(SPUIStyleDefinitions.NO_TOP_BORDER);
    targetFilterQueryButtonsTab.init(customTargetTagFilterButtonClick);
    if (permChecker.hasCreateTargetPermission() || permChecker.hasUpdateTargetPermission()) {
        config = SPUIComponentProvider.getButton(UIComponentIdProvider.ADD_TARGET_TAG, "", "", "", true,
                FontAwesome.COG, SPUIButtonStyleSmallNoBorder.class);
        config.addClickListener(event -> settingsIconClicked());
    }
    addStyleName(ValoTheme.ACCORDION_BORDERLESS);
    addTabs();
    setSizeFull();
    switchToTabSelectedOnLoad();
    addSelectedTabChangeListener(this);
}
项目:hybridbpm    文件:LookAndFeelLayout.java   
public LookAndFeelLayout(BeanFieldGroup<DiagrammePreference> preferences) {
    super(preferences);
    addComponent(splitLayout);

    chartSplit.addComponent(chartContainer);
    chartSplit.addComponent(btnPreview);

    btnPreview.setIcon(FontAwesome.PLAY);
    chartSplit.setComponentAlignment(chartContainer, Alignment.MIDDLE_CENTER);
    chartSplit.setExpandRatio(chartContainer, 1f);

    chartSplit.setSizeFull();
    colourContainer.setSizeFull();

    splitLayout.setSizeFull();
    splitLayout.addComponent(chartSplit);
    splitLayout.setSplitPosition(70f);
    splitLayout.addComponent(colourContainer);

    bindHandlers();
}
项目:hybridbpm    文件:ParameterForm.java   
private void prepareComponents() {
    name.setIcon(FontAwesome.ARROW_RIGHT);
    name.setWidth(100, Unit.PERCENTAGE);

    ((AceEditor) valueEditor).setTheme(AceTheme.textmate);
    ((AceEditor) valueEditor).setShowGutter(true);
    ((AceEditor) valueEditor).setSizeFull();
    ((AceEditor) valueEditor).setHeight(150, Unit.PIXELS);
    if (Objects.equals(type, TYPE.INPUT)) {
        ((AceEditor) valueEditor).setMode(AceMode.groovy);
    } else {
        ((AceEditor) valueEditor).setMode(AceMode.json);
    }
    valueEditor.setWidth(100, Unit.PERCENTAGE);
    if (suggester != null) {
        SuggestionExtension extension = new SuggestionExtension(suggester);
        extension.setSuggestOnDot(false);
        extension.extend(valueEditor);
    }
}
项目:hawkbit    文件:DistributionTable.java   
private Button getPinBtn(final Object itemId) {

        final Item item = getContainerDataSource().getItem(itemId);
        final String name = (String) item.getItemProperty(SPUILabelDefinitions.VAR_NAME).getValue();

        final String version = (String) item.getItemProperty(SPUILabelDefinitions.VAR_VERSION).getValue();
        final DistributionSetIdName distributionSetIdName = new DistributionSetIdName((Long) itemId, name, version);

        final Button pinBtn = new Button();
        pinBtn.setIcon(FontAwesome.THUMB_TACK);
        pinBtn.setHeightUndefined();
        pinBtn.addStyleName(getPinStyle());
        pinBtn.setData(distributionSetIdName);
        pinBtn.setId(getPinButtonId(name, version));
        pinBtn.setImmediate(true);
        return pinBtn;
    }
项目:hawkbit    文件:ManangementConfirmationWindowLayout.java   
private void deleteAllDistributions(final ConfirmationTab tab) {
    final Collection<Long> deletedIds = managementUIState.getDeletedDistributionList().stream()
            .map(DistributionSetIdName::getId).collect(Collectors.toList());

    distributionSetManagement.delete(deletedIds);
    eventBus.publish(this, new DistributionTableEvent(BaseEntityEventType.REMOVE_ENTITY, deletedIds));

    addToConsolitatedMsg(FontAwesome.TRASH_O.getHtml() + SPUILabelDefinitions.HTML_SPACE
            + i18n.getMessage("message.dist.deleted", managementUIState.getDeletedDistributionList().size()));

    removeDeletedDistributionsFromAssignmentTab();
    removeCurrentTab(tab);
    setActionMessage(i18n.getMessage("message.dist.delete.success"));

    managementUIState.getTargetTableFilters().getPinnedDistId()
            .ifPresent(distId -> unPinDeletedDS(deletedIds, distId));
    managementUIState.getDeletedDistributionList().clear();
}
项目:hybridbpm    文件:InParametersLayout.java   
public void initUI() {
    removeAllComponents();
    btnAdd.setCaption(("Add parameter"));
    btnAdd.setStyleName(ValoTheme.BUTTON_LINK);
    btnAdd.setIcon(FontAwesome.PLUS_CIRCLE);
    setMargin(true);
    setSpacing(true);
    setWidth(100, Sizeable.Unit.PERCENTAGE);
    for (FieldModel fieldModel : connectoModel.getInParameters()) {
        FieldForm fieldForm = new FieldForm(FieldForm.CLASS_LIST_TYPE.BOTH);
        fieldForm.setFieldModel(fieldModel);
        addComponent(fieldForm);
    }
    addComponent(btnAdd);
    setComponentAlignment(btnAdd, Alignment.MIDDLE_RIGHT);
}
项目:hybridbpm    文件:AbstractEditor.java   
public AbstractEditor() {
    setSizeFull();
    setSpacing(true);
    setMargin(new MarginInfo(true, false, false, false));
    addComponent(buttonBar);
    setComponentAlignment(buttonBar, Alignment.MIDDLE_RIGHT);
    addComponent(horizontalSplitPanel);
    setExpandRatio(horizontalSplitPanel, 1f);

    horizontalSplitPanel.setSizeFull();
    horizontalSplitPanel.setStyleName("transparent");

    buttonBar.setSpacing(true);
    buttonBar.setSpacing(true);

    btnSave.setIcon(FontAwesome.SAVE);
    btnSave.setStyleName(ValoTheme.BUTTON_BORDERLESS);
    btnSave.addStyleName(ValoTheme.BUTTON_SMALL);
    btnSave.addStyleName(ValoTheme.BUTTON_PRIMARY);
}
项目:hybridbpm    文件:DataEditor.java   
private void prepareModeler() {
    btnAdd.setCaption("Add field");
    btnAdd.setIcon(FontAwesome.PLUS_CIRCLE);
    btnAdd.setStyleName(ValoTheme.BUTTON_LINK);
    btnAdd.addStyleName(ValoTheme.BUTTON_SMALL);

    modelerLayout.setMargin(true);
    modelerLayout.setSpacing(true);
    modelerLayout.setWidth(100, Sizeable.Unit.PERCENTAGE);
    for (FieldModel fieldModel : dataModel.getFields()) {
        FieldForm fieldForm = new FieldForm(FieldForm.CLASS_LIST_TYPE.BOTH);
        fieldForm.setFieldModel(fieldModel);
        modelerLayout.addComponent(fieldForm);
    }
    modelerLayout.addComponent(btnAdd);
    modelerLayout.setComponentAlignment(btnAdd, Alignment.MIDDLE_RIGHT);
}
项目:hawkbit    文件:DistributionsConfirmationWindowLayout.java   
private void saveAllAssignments(final ConfirmationTab tab) {
    manageDistUIState.getAssignedList().forEach((distIdName, softIdNameSet) -> {
        final List<Long> softIds = softIdNameSet.stream().map(softIdName -> softIdName.getId())
                .collect(Collectors.toList());
        distributionSetManagement.assignSoftwareModules(distIdName.getId(), softIds);

    });

    int count = 0;
    for (final Entry<DistributionSetIdName, HashSet<SoftwareModuleIdName>> entry : manageDistUIState
            .getAssignedList().entrySet()) {
        count += entry.getValue().size();
    }
    addToConsolitatedMsg(FontAwesome.TASKS.getHtml() + SPUILabelDefinitions.HTML_SPACE
            + i18n.getMessage("message.software.assignment", new Object[] { count }));
    manageDistUIState.getAssignedList().clear();
    manageDistUIState.getConsolidatedDistSoftwarewList().clear();
    removeCurrentTab(tab);
    eventBus.publish(this, SaveActionWindowEvent.SAVED_ASSIGNMENTS);
}
项目:kumoreg    文件:AttendeeDetailWindow.java   
public AttendeeDetailWindow(AttendeePrintView parentView, AttendeeSearchPresenter handler) {
    super("Attendee Detail");
    this.handler = handler;
    this.parentView = parentView;
    setIcon(FontAwesome.USER);
    center();
    setModal(true);
    setWidth(1100, Unit.PIXELS);
    setHeight(800, Unit.PIXELS);

    VerticalLayout verticalLayout = new VerticalLayout();
    verticalLayout.setMargin(false);
    verticalLayout.setSpacing(true);
    form = new AttendeeDetailForm(this);
    form.setAllFieldsButCheckInDisabled();
    verticalLayout.addComponent(form);
    verticalLayout.addComponent(buildSaveCancel());
    setContent(verticalLayout);

    btnSave.setClickShortcut(ShortcutAction.KeyCode.ENTER);
    btnSave.addStyleName(ValoTheme.BUTTON_PRIMARY);
}
项目:componentrenderer    文件:ViewComponents.java   
public static Component createFoodIcon(Customer cust) {
    Label label = new Label(FontAwesome.HOURGLASS_2.getHtml(), ContentMode.HTML);

    label.setHeight(24, Sizeable.Unit.PIXELS);
    label.setWidth(30, Sizeable.Unit.PIXELS);

    if (cust.getFood() == Customer.Food.HAMBURGER) {
        label.setValue(FontAwesome.AMBULANCE.getHtml());
    }

    if (cust.getFood() == Customer.Food.FISH) {
        label.setValue(FontAwesome.HEART.getHtml());
    }

    if (cust.getFood() == Customer.Food.VEGETABLES) {
        label.setValue(FontAwesome.SUN_O.getHtml());
    }

    return label;

}