當前位置: 首頁>>代碼示例>>Java>>正文


Java FontAwesome.REFRESH屬性代碼示例

本文整理匯總了Java中com.vaadin.server.FontAwesome.REFRESH屬性的典型用法代碼示例。如果您正苦於以下問題:Java FontAwesome.REFRESH屬性的具體用法?Java FontAwesome.REFRESH怎麽用?Java FontAwesome.REFRESH使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在com.vaadin.server.FontAwesome的用法示例。


在下文中一共展示了FontAwesome.REFRESH屬性的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: AdminBatchHistoWindow

/**
 * Crée une fenêtre de visu de l'histo d'un batch
 * @param batch le batch à visualiser
 */
public AdminBatchHistoWindow(Batch batch) {
	/* Style */
	setModal(true);
	setWidth(700,Unit.PIXELS);
	setResizable(false);
	setClosable(false);

	/* Layout */
	VerticalLayout layout = new VerticalLayout();
	layout.setMargin(true);
	layout.setSpacing(true);
	setContent(layout);

	/* Titre */
	setCaption(applicationContext.getMessage("batchHisto.window", new Object[]{batch.getCodBatch()}, UI.getCurrent().getLocale()));

	/* Table */
	container = new BeanItemContainer<BatchHisto>(BatchHisto.class, batchController.getBatchHisto(batch));
	batchHistoTable = new TableFormating(null,container);
	batchHistoTable.addGeneratedColumn("duree", new ColumnGenerator() {
		
		/*** serialVersionUID*/
		private static final long serialVersionUID = 7461290324017459118L;

		@Override
		public Object generateCell(Table source, Object itemId, Object columnId) {
			final BatchHisto batchHisto = (BatchHisto) itemId;
			if (batchHisto.getDateFinBatchHisto()!=null)
			{
				LocalDateTime dateDeb = LocalDateTime.from(batchHisto.getDateDebBatchHisto());
				Long minutes = dateDeb.until(batchHisto.getDateFinBatchHisto(), ChronoUnit.MINUTES);
				dateDeb = dateDeb.plusMinutes(minutes);
				Long secondes = dateDeb.until(batchHisto.getDateFinBatchHisto(), ChronoUnit.SECONDS);
				return new Label(applicationContext.getMessage("batch.histo.duree", new Object[]{minutes,secondes}, UI.getCurrent().getLocale()));
			}
			return null;
		}
	});
	batchHistoTable.setSizeFull();
	batchHistoTable.setVisibleColumns((Object[]) BATCH_HISTO_FIELDS_ORDER);
	for (String fieldName : BATCH_HISTO_FIELDS_ORDER) {
		batchHistoTable.setColumnHeader(fieldName, applicationContext.getMessage("batchHisto.table." + fieldName, null, UI.getCurrent().getLocale()));
	}
	batchHistoTable.setSortContainerPropertyId(Batch_.codBatch.getName());
	batchHistoTable.setColumnCollapsingAllowed(true);
	batchHistoTable.setColumnReorderingAllowed(true);
	batchHistoTable.setSelectable(true);

	layout.addComponent(batchHistoTable);
	
	
	/* Ajoute les boutons */
	HorizontalLayout buttonsLayout = new HorizontalLayout();
	buttonsLayout.setWidth(100, Unit.PERCENTAGE);
	buttonsLayout.setSpacing(true);
	layout.addComponent(buttonsLayout);

	btnFermer = new OneClickButton(applicationContext.getMessage("btnClose", null, UI.getCurrent().getLocale()), FontAwesome.TIMES);
	btnFermer.addClickListener(e -> close());
	buttonsLayout.addComponent(btnFermer);
	buttonsLayout.setComponentAlignment(btnFermer, Alignment.MIDDLE_LEFT);
	
	btnRefresh = new OneClickButton(applicationContext.getMessage("btnRefresh", null, UI.getCurrent().getLocale()), FontAwesome.REFRESH);
	btnRefresh.addClickListener(e -> {
		container.removeAllItems();
		container.addAll(batchController.getBatchHisto(batch));
	});
	buttonsLayout.addComponent(btnRefresh);
	buttonsLayout.setComponentAlignment(btnRefresh, Alignment.MIDDLE_RIGHT);

	/* Centre la fenêtre */
	center();
}
 
開發者ID:EsupPortail,項目名稱:esup-ecandidat,代碼行數:77,代碼來源:AdminBatchHistoWindow.java

示例2: createSwitchButton

/**
 * 創建切換按鈕
 * @return
 */
private Button createSwitchButton() {
    switchButton = new Button("切換", FontAwesome.REFRESH);
    switchButton.setDisableOnClick(true);
    switchButton.addStyleName(ValoTheme.BUTTON_DANGER);
    switchButton.addClickListener((Button.ClickListener) clickEvent -> {
        Long consumerId = (Long) consumerBox.getValue();
        if (consumerId == null) {
            Notification.show("請選擇消費者!", Notification.Type.ERROR_MESSAGE);
            switchButton.setEnabled(true);
            return;
        }
        Long providerId = (Long) providerBox.getValue();
        if (providerId == null) {
            Notification.show("請選擇提供者!", Notification.Type.ERROR_MESSAGE);
            switchButton.setEnabled(true);
            return;
        }
        ZookeeperConsumer consumer = zookeeperConsumerRepository.findOne(consumerId);
        if (consumer == null) {
            Notification.show("消費者獲取失敗!", Notification.Type.ERROR_MESSAGE);
            switchButton.setEnabled(true);
            return;
        }
        ZookeeperProvider provider = zookeeperProviderRepository.findOne(providerId);
        if (provider == null) {
            Notification.show("提供者獲取失敗!", Notification.Type.ERROR_MESSAGE);
            switchButton.setEnabled(true);
            return;
        }
        //switch app service
        Response response = DubboSwitchTool.switchAppProvider(provider.getIp() + ":" + provider.getPort(), consumer.getIp() + ":" + consumer.getPort(), appField.getValue());
        if (!response.isSuccess()) {
            Notification.show(response.getMessage(), Notification.Type.ERROR_MESSAGE);
            switchButton.setEnabled(true);
            return;
        }
        updateZookeeperLastInfo(consumer, provider);
        switchButton.setEnabled(true);
        isSwitchSuccess = true;
        close();
    });
    return switchButton;
}
 
開發者ID:xburning,項目名稱:dubbo-switch,代碼行數:47,代碼來源:ZookeeperAppSwitchUI.java


注:本文中的com.vaadin.server.FontAwesome.REFRESH屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。