com.vaadin.ui.themes.ValoTheme Java Examples

The following examples show how to use com.vaadin.ui.themes.ValoTheme. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AbstractFilterButtons.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
private DragAndDropWrapper createDragAndDropWrapper(final Button tagButton, final String name, final Long id) {
    final DragAndDropWrapper bsmBtnWrapper = new DragAndDropWrapper(tagButton);
    bsmBtnWrapper.addStyleName(ValoTheme.DRAG_AND_DROP_WRAPPER_NO_VERTICAL_DRAG_HINTS);
    bsmBtnWrapper.addStyleName(ValoTheme.DRAG_AND_DROP_WRAPPER_NO_HORIZONTAL_DRAG_HINTS);
    bsmBtnWrapper.addStyleName(SPUIStyleDefinitions.FILTER_BUTTON_WRAPPER);
    if (getButtonWrapperData() != null) {
        if (id == null) {
            bsmBtnWrapper.setData(getButtonWrapperData());
        } else {
            bsmBtnWrapper.setData(getButtonWrapperData().concat("" + id));
        }
    }
    bsmBtnWrapper.setId(getButttonWrapperIdPrefix().concat(name));
    bsmBtnWrapper.setDragStartMode(DragStartMode.WRAPPER);
    bsmBtnWrapper.setDropHandler(getFilterButtonDropHandler());
    return bsmBtnWrapper;
}
 
Example #2
Source File: TargetTable.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
private Button getTagetPinButton(final Object itemId) {
    final Button pinBtn = new Button();
    final String controllerId = (String) getContainerDataSource().getItem(itemId)
            .getItemProperty(SPUILabelDefinitions.VAR_CONT_ID).getValue();
    final TargetIdName pinnedTarget = new TargetIdName((Long) itemId, controllerId);
    final StringBuilder pinBtnStyle = new StringBuilder(ValoTheme.BUTTON_BORDERLESS_COLORED);
    pinBtnStyle.append(' ');
    pinBtnStyle.append(ValoTheme.BUTTON_SMALL);
    pinBtnStyle.append(' ');
    pinBtnStyle.append(ValoTheme.BUTTON_ICON_ONLY);
    pinBtn.setStyleName(pinBtnStyle.toString());
    pinBtn.setHeightUndefined();
    pinBtn.setData(pinnedTarget);
    pinBtn.setId(UIComponentIdProvider.TARGET_PIN_ICON + controllerId);
    pinBtn.addClickListener(this::addPinClickListener);
    pinBtn.setDescription(getI18n().getMessage(UIMessageIdProvider.TOOLTIP_TARGET_PIN));
    if (isPinned(pinnedTarget)) {
        pinBtn.addStyleName(TARGET_PINNED);
        targetPinned = Boolean.TRUE;
        targetPinnedBtn = pinBtn;
        getEventBus().publish(this, PinUnpinEvent.PIN_TARGET);
    }
    pinBtn.addStyleName(SPUIStyleDefinitions.TARGET_STATUS_PIN_TOGGLE);
    HawkbitCommonUtil.applyStatusLblStyle(this, pinBtn, itemId);
    return pinBtn;
}
 
Example #3
Source File: ZookeeperAppViewUI.java    From dubbox with Apache License 2.0 6 votes vote down vote up
/**
 * zk
 * @return
 */
private OptionGroup createZkOptionGroup(){
    zkOption = new OptionGroup();
    zkOption.addItem(0);
    zkOption.setItemCaption(0, "消费者");
    zkOption.addItem(1);
    zkOption.setItemCaption(1, "提供者");
    zkOption.setStyleName(ValoTheme.OPTIONGROUP_HORIZONTAL);
    zkOption.select(0);
    zkOption.setNullSelectionAllowed(false);
    zkOption.addBlurListener((FieldEvents.BlurListener) blurEvent -> {
        String selected = blurEvent.getSource().toString();
        if ("0".equals(selected)) {
            isSelectedConsumer = true;
            reloadConsumerViewBox();
        } else if ("1".equals(selected)) {
            isSelectedConsumer = false;
            reloadProviderViewBox();
        }
    });
    return zkOption;
}
 
Example #4
Source File: ZookeeperProviderManageUI.java    From dubbox with Apache License 2.0 6 votes vote down vote up
/**
 * 创建删除按钮
 * @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;
}
 
Example #5
Source File: SoftwareModuleAddUpdateWindow.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
private void createRequiredComponents() {

        nameTextField = createTextField("textfield.name", UIComponentIdProvider.SOFT_MODULE_NAME,
                SoftwareModule.NAME_MAX_SIZE);

        versionTextField = createTextField("textfield.version", UIComponentIdProvider.SOFT_MODULE_VERSION,
                SoftwareModule.VERSION_MAX_SIZE);

        vendorTextField = new TextFieldBuilder(SoftwareModule.VENDOR_MAX_SIZE)
                .caption(i18n.getMessage("textfield.vendor")).id(UIComponentIdProvider.SOFT_MODULE_VENDOR)
                .buildTextComponent();

        descTextArea = new TextAreaBuilder(SoftwareModule.DESCRIPTION_MAX_SIZE)
                .caption(i18n.getMessage("textfield.description")).style("text-area-style")
                .id(UIComponentIdProvider.ADD_SW_MODULE_DESCRIPTION).buildTextComponent();

        typeComboBox = SPUIComponentProvider.getComboBox(
                i18n.getMessage(UIMessageIdProvider.CAPTION_ARTIFACT_SOFTWARE_MODULE_TYPE), "", null, null, true, null,
                i18n.getMessage(UIMessageIdProvider.CAPTION_ARTIFACT_SOFTWARE_MODULE_TYPE));
        typeComboBox.setId(UIComponentIdProvider.SW_MODULE_TYPE);
        typeComboBox.setStyleName(SPUIDefinitions.COMBO_BOX_SPECIFIC_STYLE + " " + ValoTheme.COMBOBOX_TINY);
        typeComboBox.setNewItemsAllowed(Boolean.FALSE);
        typeComboBox.setImmediate(Boolean.TRUE);
    }
 
Example #6
Source File: ActionStatusMsgGrid.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public Component getDetails(final RowReference rowReference) {
    // Find the bean to generate details for
    final Item item = rowReference.getItem();
    final String message = (String) item.getItemProperty(ProxyMessage.PXY_MSG_VALUE).getValue();

    final TextArea textArea = new TextArea();
    textArea.addStyleName(ValoTheme.TEXTAREA_BORDERLESS);
    textArea.addStyleName(ValoTheme.TEXTAREA_TINY);
    textArea.addStyleName("inline-icon");
    textArea.setHeight(120, Unit.PIXELS);
    textArea.setWidth(100, Unit.PERCENTAGE);
    textArea.setValue(message);
    textArea.setReadOnly(Boolean.TRUE);
    return textArea;
}
 
Example #7
Source File: AbstractTagLayout.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
protected void createRequiredComponents() {
    colorLabel = new LabelBuilder().name(i18n.getMessage("label.choose.tag.color")).buildLabel();
    colorLabel.addStyleName(SPUIStyleDefinitions.COLOR_LABEL_STYLE);

    tagName = new TextFieldBuilder(getTagNameSize()).caption(i18n.getMessage("textfield.name"))
            .styleName(ValoTheme.TEXTFIELD_TINY + " " + SPUIDefinitions.TAG_NAME).required(true, i18n)
            .prompt(i18n.getMessage("textfield.name")).immediate(true).id(getTagNameId()).buildTextComponent();

    tagDesc = new TextAreaBuilder(getTagDescSize()).caption(i18n.getMessage("textfield.description"))
            .styleName(ValoTheme.TEXTFIELD_TINY + " " + SPUIDefinitions.TAG_DESC)
            .prompt(i18n.getMessage("textfield.description")).id(getTagDescId()).buildTextComponent();

    tagDesc.setNullRepresentation("");

    tagColorPreviewBtn = new Button();
    tagColorPreviewBtn.setId(UIComponentIdProvider.TAG_COLOR_PREVIEW_ID);
    getPreviewButtonColor(ColorPickerConstants.DEFAULT_COLOR);
    tagColorPreviewBtn.setStyleName(TAG_DYNAMIC_STYLE);
}
 
Example #8
Source File: ZookeeperAppAddUI.java    From dubbox with Apache License 2.0 6 votes vote down vote up
/**
 * 创建保存按钮
 * @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;
}
 
Example #9
Source File: FieldFactory.java    From vaadin-grid-util with MIT License 6 votes vote down vote up
public static <T> DateField genDateField(Binder<T> binder, String propertyId, final java.text.SimpleDateFormat dateFormat) {
    DateField dateField = new DateField();

    binder.bind(dateField, propertyId);
    if (dateFormat != null) {
        dateField.setDateFormat(dateFormat.toPattern());
    }
    dateField.setWidth("100%");

    dateField.setResolution(DateResolution.DAY);
    dateField.addStyleName(STYLENAME_GRIDCELLFILTER);
    dateField.addStyleName(ValoTheme.DATEFIELD_TINY);
    dateField.addValueChangeListener(e -> {
        if (binder.isValid()) {
            dateField.setComponentError(null);
        }
    });
    return dateField;
}
 
Example #10
Source File: LoginWindow.java    From jpa-invoicer with The Unlicense 6 votes vote down vote up
@Override
public void attach() {
    super.attach();

    service = createService();
    String url = service.getAuthorizationUrl(null);
    
    gplusLoginButton = new Link("Login with Google", new ExternalResource(url));
    gplusLoginButton.addStyleName(ValoTheme.LINK_LARGE);

    VaadinSession.getCurrent().addRequestHandler(this);

    setContent(new MVerticalLayout(gplusLoginButton).alignAll(
            Alignment.MIDDLE_CENTER).withFullHeight());
    setModal(true);
    setWidth("300px");
    setHeight("200px");

}
 
Example #11
Source File: TargetTableHeader.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
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();
    }
    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);
}
 
Example #12
Source File: ZookeeperConsumerManageUI.java    From dubbox with Apache License 2.0 6 votes vote down vote up
/**
 * 创建删除按钮
 * @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;
}
 
Example #13
Source File: CreateOrUpdateFilterTable.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
CreateOrUpdateFilterTable(final VaadinMessageSource i18n, final UIEventBus eventBus,
        final FilterManagementUIState filterManagementUIState) {
    this.i18n = i18n;
    this.filterManagementUIState = filterManagementUIState;
    this.eventBus = eventBus;

    setStyleName("sp-table");
    setSizeFull();
    setImmediate(true);
    setHeight(100.0F, Unit.PERCENTAGE);
    addStyleName(ValoTheme.TABLE_NO_VERTICAL_LINES);
    addStyleName(ValoTheme.TABLE_SMALL);
    setColumnCollapsingAllowed(true);
    addCustomGeneratedColumns();
    restoreOnLoad();
    populateTableData();
    setId(UIComponentIdProvider.CUSTOM_FILTER_TARGET_TABLE_ID);
    setSelectable(false);
    eventBus.subscribe(this);
    setItemDescriptionGenerator(new AssignInstalledDSTooltipGenerator());
}
 
Example #14
Source File: RolloutGroupsListHeader.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
@Override
protected HorizontalLayout getHeaderCaptionLayout() {
    headerCaption = new LabelBuilder().id(UIComponentIdProvider.ROLLOUT_GROUP_HEADER_CAPTION).name("")
            .buildCaptionLabel();
    final Button rolloutsListViewLink = SPUIComponentProvider.getButton(null, "", "", null, false, null,
            SPUIButtonStyleNoBorder.class);
    rolloutsListViewLink.setStyleName(ValoTheme.LINK_SMALL + " " + "on-focus-no-border link rollout-caption-links");
    rolloutsListViewLink.setDescription(i18n.getMessage("message.rollouts"));
    rolloutsListViewLink.setCaption(i18n.getMessage("message.rollouts"));
    rolloutsListViewLink.addClickListener(value -> showRolloutListView());

    final HorizontalLayout headerCaptionLayout = new HorizontalLayout();
    headerCaptionLayout.addComponent(rolloutsListViewLink);
    headerCaptionLayout.addComponent(new Label(">"));
    headerCaption.addStyleName("breadcrumbPaddingLeft");
    headerCaptionLayout.addComponent(headerCaption);

    return headerCaptionLayout;
}
 
Example #15
Source File: FieldFactory.java    From vaadin-grid-util with MIT License 6 votes vote down vote up
public static <T> TextField genNumberField(Binder<T> binder, String propertyId, Converter converter, String inputPrompt) {
    final TextField field = new TextField();
    field.setWidth("100%");
    field.addStyleName(STYLENAME_GRIDCELLFILTER);
    field.addStyleName(ValoTheme.TEXTFIELD_TINY);
    field.addValueChangeListener(e -> {
        if (binder.isValid()) {
            field.setComponentError(null);
        }
    });
    binder.forField(field)
            .withNullRepresentation("")
            // .withValidator(text -> text != null && text.length() > 0, "invalid")
            .withConverter(converter)
            .bind(propertyId);
    field.setPlaceholder(inputPrompt);
    return field;
}
 
Example #16
Source File: AddUpdateRolloutWindowLayout.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
private HorizontalLayout createApprovalLayout() {
    approveButtonsGroup = new OptionGroup();
    approveButtonsGroup.setId(UIComponentIdProvider.ROLLOUT_APPROVAL_OPTIONGROUP_ID);
    approveButtonsGroup.addStyleName(ValoTheme.OPTIONGROUP_SMALL);
    approveButtonsGroup.addStyleName(ValoTheme.OPTIONGROUP_HORIZONTAL);
    approveButtonsGroup.addStyleName("custom-option-group");
    approveButtonsGroup.addItems(Rollout.ApprovalDecision.APPROVED, Rollout.ApprovalDecision.DENIED);

    approveButtonsGroup.setItemCaption(Rollout.ApprovalDecision.APPROVED, i18n.getMessage(APPROVAL_BUTTON_LABEL));
    approveButtonsGroup.setItemIcon(Rollout.ApprovalDecision.APPROVED, FontAwesome.CHECK);
    approveButtonsGroup.setItemCaption(Rollout.ApprovalDecision.DENIED, i18n.getMessage(DENY_BUTTON_LABEL));
    approveButtonsGroup.setItemIcon(Rollout.ApprovalDecision.DENIED, FontAwesome.TIMES);

    approvalRemarkField = createTextField("label.approval.remark",
            UIComponentIdProvider.ROLLOUT_APPROVAL_REMARK_FIELD_ID, Rollout.APPROVAL_REMARK_MAX_SIZE);
    approvalRemarkField.setWidth(100.0F, Unit.PERCENTAGE);

    final HorizontalLayout layout = new HorizontalLayout(approveButtonsGroup, approvalRemarkField);
    layout.setWidth(100.0F, Unit.PERCENTAGE);
    layout.setExpandRatio(approvalRemarkField, 1.0F);
    return layout;
}
 
Example #17
Source File: RolloutGroupTargetsListHeader.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
@Override
protected HorizontalLayout getHeaderCaptionLayout() {
    headerCaption = new LabelBuilder().name("").buildCaptionLabel();
    headerCaption.setStyleName(ValoTheme.LABEL_BOLD + " " + ValoTheme.LABEL_SMALL);
    final Button rolloutsListViewLink = SPUIComponentProvider.getButton(null, "", "", null, false, null,
            SPUIButtonStyleNoBorder.class);
    rolloutsListViewLink.setStyleName(ValoTheme.LINK_SMALL + " " + "on-focus-no-border link rollout-caption-links");
    rolloutsListViewLink.setDescription(i18n.getMessage("message.rollouts"));
    rolloutsListViewLink.setCaption(i18n.getMessage("message.rollouts"));
    rolloutsListViewLink.addClickListener(value -> showRolloutListView());

    rolloutNameLink = SPUIComponentProvider.getButton(null, "", "", null, false, null,
            SPUIButtonStyleNoBorder.class);
    rolloutNameLink.setStyleName(ValoTheme.LINK_SMALL + " " + "on-focus-no-border link rollout-caption-links");
    rolloutNameLink.setDescription(i18n.getMessage("dashboard.rollouts.caption"));
    rolloutNameLink.addClickListener(value -> showRolloutGroupListView());

    final HorizontalLayout headerCaptionLayout = new HorizontalLayout();
    headerCaptionLayout.addComponent(rolloutsListViewLink);
    headerCaptionLayout.addComponent(new Label(">"));
    headerCaptionLayout.addComponent(rolloutNameLink);
    headerCaptionLayout.addComponent(new Label("> "));
    headerCaptionLayout.addComponent(headerCaption);

    return headerCaptionLayout;
}
 
Example #18
Source File: ComboBoxBuilder.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * @return a new ComboBox
 */
public ComboBox buildCombBox() {
    final ComboBox comboBox = SPUIComponentProvider.getComboBox(null, "", null, ValoTheme.COMBOBOX_SMALL, false, "",
            prompt);
    comboBox.setImmediate(true);
    comboBox.setPageLength(7);
    comboBox.setItemCaptionPropertyId(SPUILabelDefinitions.VAR_NAME);
    comboBox.setSizeUndefined();
    if (caption != null) {
        comboBox.setCaption(caption);
    }
    if (id != null) {
        comboBox.setId(id);
    }
    if (valueChangeListener != null) {
        comboBox.addValueChangeListener(valueChangeListener);
    }
    return comboBox;
}
 
Example #19
Source File: ZookeeperAppAddUI.java    From dubbo-switch with Apache License 2.0 6 votes vote down vote up
/**
 * 创建保存按钮
 * @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;
}
 
Example #20
Source File: ZookeeperAppManageUI.java    From dubbo-switch with Apache License 2.0 6 votes vote down vote up
/**
 * 创建删除按钮
 * @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;
}
 
Example #21
Source File: ArtifactDetailsLayout.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
private Button getArtifactDownloadButton(final Table table, final Object itemId) {
    final String fileName = (String) table.getContainerDataSource().getItem(itemId)
            .getItemProperty(PROVIDED_FILE_NAME).getValue();
    final Button downloadIcon = SPUIComponentProvider.getButton(
            fileName + "-" + UIComponentIdProvider.ARTIFACT_FILE_DOWNLOAD_ICON, "",
            i18n.getMessage(UIMessageIdProvider.TOOLTIP_ARTIFACT_DOWNLOAD), ValoTheme.BUTTON_TINY + " " + "blueicon", 
            true, FontAwesome.DOWNLOAD, SPUIButtonStyleNoBorder.class);
    downloadIcon.setData(itemId);
    FileDownloader fileDownloader = new FileDownloader(createStreamResource((Long) itemId));
    fileDownloader.extend(downloadIcon);
    fileDownloader.setErrorHandler(new ErrorHandler() {

        /**
         * Error handler for file downloader
         */
        private static final long serialVersionUID = 4030230501114422570L;

        @Override
        public void error(com.vaadin.server.ErrorEvent event) {
            uINotification.displayValidationError(i18n.getMessage(UIMessageIdProvider.ARTIFACT_DOWNLOAD_FAILURE_MSG));
        }
    });
    return downloadIcon;
}
 
Example #22
Source File: ZookeeperProviderManageUI.java    From dubbo-switch with Apache License 2.0 6 votes vote down vote up
/**
 * 创建删除按钮
 * @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;
}
 
Example #23
Source File: DurationField.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Creates a DurationField
 */
protected DurationField() {
    this.setTimeZone(TimeZone.getTimeZone(ZONEID_UTC));
    durationFormat.setTimeZone(TimeZone.getTimeZone(ZONEID_UTC));
    additionalFormat.setTimeZone(TimeZone.getTimeZone(ZONEID_UTC));
    durationFormat.setLenient(false);
    additionalFormat.setLenient(false);

    this.setResolution(Resolution.SECOND);
    this.setDateFormat(DURATION_FORMAT_STIRNG);
    this.addStyleName(CSS_STYLE_NAME);
    this.addStyleName(ValoTheme.TEXTFIELD_TINY);
    this.setWidth("100px");

    // needed that popup shows a 24h clock
    this.setLocale(Locale.GERMANY);

    this.addValueChangeListener(this);
}
 
Example #24
Source File: AbstractTable.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
protected AbstractTable(final UIEventBus eventBus, final VaadinMessageSource i18n,
        final UINotification notification, final SpPermissionChecker permChecker) {
    this.eventBus = eventBus;
    this.i18n = i18n;
    this.notification = notification;
    this.permChecker = permChecker;
    setStyleName("sp-table");
    setSizeFull();
    setImmediate(true);
    setHeight(100.0F, Unit.PERCENTAGE);
    addStyleName(ValoTheme.TABLE_NO_VERTICAL_LINES);
    addStyleName(ValoTheme.TABLE_SMALL);
    setSortEnabled(false);
    setId(getTableId());
    addCustomGeneratedColumns();
    addDeleteColumn();
    setDefault();
    addValueChangeListener(event -> onValueChange());
    setPageLength(SPUIDefinitions.PAGE_SIZE);
    if (doSubscribeToEventBus()) {
        eventBus.subscribe(this);
    }
}
 
Example #25
Source File: SPUIButtonStyleSmall.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public Button decorate(final Button button, final String style, final boolean setStyle, final Resource icon) {
    button.addStyleName(ValoTheme.BUTTON_SMALL);
    if (style != null) {
        if (setStyle) {
            button.setStyleName(style);
        } else {
            button.addStyleName(style);
        }
    }
    if (icon != null) {
        button.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
        button.setIcon(icon);
    }
    return button;
}
 
Example #26
Source File: DistributionSetTypeSoftwareModuleSelectLayout.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
private void buildSelectedTable() {
    selectedTable = new Table();
    selectedTable.setId(SPUIDefinitions.TWIN_TABLE_SELECTED_ID);
    selectedTable.setSelectable(true);
    selectedTable.setMultiSelect(true);
    selectedTable.setSortEnabled(false);
    selectedTable.addStyleName(ValoTheme.TABLE_NO_HORIZONTAL_LINES);
    selectedTable.addStyleName(ValoTheme.TABLE_NO_STRIPES);
    selectedTable.addStyleName(ValoTheme.TABLE_NO_VERTICAL_LINES);
    selectedTable.addStyleName(ValoTheme.TABLE_SMALL);
    selectedTable.addStyleName("dist_type_twin-table");
    selectedTable.setSizeFull();
    createSelectedTableContainer();
    selectedTable.setContainerDataSource(selectedTableContainer);
    addTooltTipToSelectedTable();
    selectedTable.setImmediate(true);
    selectedTable.setVisibleColumns(DIST_TYPE_NAME, DIST_TYPE_MANDATORY);
    selectedTable.setColumnHeaders(i18n.getMessage("header.dist.twintable.selected"), STAR);
    selectedTable.setColumnExpandRatio(DIST_TYPE_NAME, 0.75F);
    selectedTable.setColumnExpandRatio(DIST_TYPE_MANDATORY, 0.25F);
    selectedTable.setRequired(true);
}
 
Example #27
Source File: TargetDetails.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
private HorizontalLayout getSecurityTokenLayout(final String securityToken) {
    final HorizontalLayout securityTokenLayout = new HorizontalLayout();

    final Label securityTableLbl = new Label(
            SPUIComponentProvider.getBoldHTMLText(getI18n().getMessage("label.target.security.token")),
            ContentMode.HTML);
    securityTableLbl.addStyleName(SPUIDefinitions.TEXT_STYLE);
    securityTableLbl.addStyleName("label-style");

    final TextField securityTokentxt = new TextField();
    securityTokentxt.addStyleName(ValoTheme.TEXTFIELD_BORDERLESS);
    securityTokentxt.addStyleName(ValoTheme.TEXTFIELD_TINY);
    securityTokentxt.addStyleName("targetDtls-securityToken");
    securityTokentxt.addStyleName(SPUIDefinitions.TEXT_STYLE);
    securityTokentxt.setCaption(null);
    securityTokentxt.setNullRepresentation("");
    securityTokentxt.setValue(securityToken);
    securityTokentxt.setReadOnly(true);

    securityTokenLayout.addComponent(securityTableLbl);
    securityTokenLayout.addComponent(securityTokentxt);
    return securityTokenLayout;
}
 
Example #28
Source File: SPUITagButtonStyle.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public Button decorate(final Button button, final String style, final boolean setStyle, final Resource icon) {

    button.setImmediate(true);
    button.addStyleName("generatedColumnPadding button-no-border" + " " + ValoTheme.BUTTON_BORDERLESS + " "
            + "button-tag-no-border");

    // Set Style
    if (null != style) {
        if (setStyle) {
            button.setStyleName(style);
        } else {
            button.addStyleName(style);
        }
    }
    // Set icon
    if (null != icon) {
        button.setIcon(icon);
    }
    return button;
}
 
Example #29
Source File: ZookeeperConsumerManageUI.java    From dubbo-switch with Apache License 2.0 6 votes vote down vote up
/**
 * 创建删除按钮
 * @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;
}
 
Example #30
Source File: TargetFilterQueryButtons.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private void setStyle() {
    addStyleName(ValoTheme.TABLE_NO_STRIPES);
    addStyleName(ValoTheme.TABLE_NO_HORIZONTAL_LINES);
    addStyleName(ValoTheme.TABLE_NO_VERTICAL_LINES);
    addStyleName(ValoTheme.TABLE_BORDERLESS);
    addStyleName(ValoTheme.TABLE_COMPACT);
}