public static Button smallButton(String caption) { Button button = new Button(caption); button.setImmediate(true); button.setStyleName("default small"); return button; }
public static Button button(String caption, String description, String style, Button.ClickListener listener) { Button button = new Button(caption); if (description != null) { button.setDescription(description); } if(style != null) button.setStyleName(style); if (listener != null) { button.addListener(listener); } button.setImmediate(true); button.setWidth(haxWidth(caption, (style != null ? style.contains("link") : false))); return button; }
@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; } }
public static Button icon(String description, Resource icon, Button.ClickListener listener) { Button b = new Button(); b.setStyleName("link"); b.setIcon(icon); b.setImmediate(true); b.setDescription(description); if (listener != null) { b.addListener(listener); } return b; }
@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; } }
private Button createRegisterTargetsButton() { final Button button = new Button("R"); button.setDisableOnClick(true); button.setImmediate(true); button.setEnabled(false); button.addListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { m_targetsPanel.registerSelectedTargets(); } }); m_targetsPanel.addListener(new ValueChangeListener() { @Override public void valueChange(ValueChangeEvent event) { TargetsPanel targetsPanel = (TargetsPanel) event.getProperty(); Collection<?> itemIDs = (Collection<?>) targetsPanel.getValue(); boolean enabled = false; for (Object itemID : itemIDs) { if (targetsPanel.isItemRegistrationNeeded(itemID)) { enabled = true; break; } } button.setEnabled(enabled); } }); return button; }
final Button button = new Button("A"); button.setDisableOnClick(true); button.setImmediate(true); button.setEnabled(false); button.addListener(new Button.ClickListener() {
private void refreshWindow(String buttonType, String buttonName) { mainWindow.removeAllComponents(); VerticalLayout main = new VerticalLayout(); main.setMargin(true); Label header = new Label(); if (StringUtils.isEmpty(buttonName)) header.setCaption("[No button name]"); else header.setCaption("Button name: " + buttonName); main.addComponent(header); buttonList = prepareButtonList(buttonType); main.addComponent(buttonList); if (!StringUtils.isEmpty(buttonType)) { Class<? extends ProcessToolActionButton> buttonClass = getRegistry().getAvailableButtons().get(buttonType); propertiesPanel.init(buttonClass); propertiesPanel.refreshForm(true, oldActionParameters); main.addComponent(propertiesPanel); } saveButton = new Button("save", this); saveButton.setImmediate(true); main.addComponent(saveButton); mainWindow.setContent(main); }
@Override public Component render() { vl = new VerticalLayout(); Button refreshDocumentList = new Button(getMessage("pt.ext.cmis.list.refresh")); refreshDocumentList.setIcon(new ClassResource(CmisDocumentListWidget.class, "/img/load-repository.png", getApplication())); refreshDocumentList.setImmediate(true); refreshDocumentList.setStyleName(BaseTheme.BUTTON_LINK); refreshDocumentList.addListener(new ClickListener() { @Override public void buttonClick(ClickEvent event) { reload(); } }); vl.addComponent(refreshDocumentList); reload(); return vl; }
@Inject protected DefaultUserStatusPanel(Navigator navigator, SubjectProvider subjectProvider, Translate translate, SubjectIdentifier subjectIdentifier, SessionBusProvider eventBusProvider, CurrentLocale currentLocale) { super(); this.navigator = navigator; this.subjectProvider = subjectProvider; this.translate = translate; this.subjectIdentifier = subjectIdentifier; this.eventBus = eventBusProvider.get(); this.currentLocale = currentLocale; // eventBus.subscribe(this); setSizeFull(); addStyleName(ChameleonTheme.PANEL_BORDERLESS); usernameLabel = new Label(); login_logout_Button = new Button(); login_logout_Button.addClickListener(this); login_logout_Button.setImmediate(true); HorizontalLayout hl = new HorizontalLayout(); hl.setSpacing(true); hl.addComponent(usernameLabel); hl.addComponent(login_logout_Button); this.setContent(hl); setIds(); build(); }
ret.setImmediate(m_forceImmediate); ret.setLocale(LocaleContextHolder.getLocale()); MessageSourceAccessor messageSourceAccessor = new MessageSourceAccessor(messageSource);
saveButton.setImmediate(true); saveButton.setDescription("Save the comment"); cancelButton.setImmediate(true);
saveButton.setImmediate(true); saveButton.setDescription("Save the comment"); cancelButton.setImmediate(true);
ret.setEnabled(property.isEnabled()); ret.setVisible(property.isVisible()); ret.setImmediate(m_forceImmediate); ret.setLocale(LocaleContextHolder.getLocale()); MessageSourceAccessor messageSourceAccessor = new MessageSourceAccessor(messageSource);
private Button createPinBtn(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); pinBtn.setDescription(getI18n().getMessage(UIMessageIdProvider.TOOLTIP_DISTRIBUTION_SET_PIN)); return pinBtn; }
private Button createPinBtn(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); pinBtn.setDescription(getI18n().getMessage(UIMessageIdProvider.TOOLTIP_DISTRIBUTION_SET_PIN)); return pinBtn; }
cancel.setImmediate(false); cancel.addClickListener(this); save = new Button("Save"); save.setImmediate(false); save.addClickListener(this);
approveButton.setImmediate(true); approveButton.setEnabled(getApproveButtonEnabledState(target));
public GatewaySecurityTokenAuthenticationConfigurationItem( final TenantConfigurationManagement tenantConfigurationManagement, final VaadinMessageSource i18n, final SecurityTokenGenerator securityTokenGenerator) { super(TenantConfigurationKey.AUTHENTICATION_MODE_GATEWAY_SECURITY_TOKEN_ENABLED, tenantConfigurationManagement, i18n); this.securityTokenGenerator = securityTokenGenerator; super.init("label.configuration.auth.gatewaytoken"); configurationEnabled = isConfigEnabled(); detailLayout = new VerticalLayout(); detailLayout.setImmediate(true); final Button gatewaytokenBtn = SPUIComponentProvider.getButton("TODO-ID", "Regenerate Key", "", ValoTheme.BUTTON_TINY + " " + "redicon", true, null, SPUIButtonStyleSmall.class); gatewaytokenBtn.setImmediate(true); gatewaytokenBtn.setIcon(FontAwesome.REFRESH); gatewaytokenBtn.addClickListener(event -> generateGatewayToken()); gatewayTokenkeyLabel = new LabelBuilder().id("gatewaysecuritytokenkey").name("").buildLabel(); gatewayTokenkeyLabel.addStyleName("gateway-token-label"); gatewayTokenkeyLabel.setImmediate(true); final HorizontalLayout keyGenerationLayout = new HorizontalLayout(); keyGenerationLayout.setSpacing(true); keyGenerationLayout.setImmediate(true); keyGenerationLayout.addComponent(gatewayTokenkeyLabel); keyGenerationLayout.addComponent(gatewaytokenBtn); detailLayout.addComponent(keyGenerationLayout); if (isConfigEnabled()) { gatewayTokenkeyLabel.setValue(getSecurityTokenKey()); setDetailVisible(true); } }
public GatewaySecurityTokenAuthenticationConfigurationItem( final TenantConfigurationManagement tenantConfigurationManagement, final VaadinMessageSource i18n, final SecurityTokenGenerator securityTokenGenerator) { super(TenantConfigurationKey.AUTHENTICATION_MODE_GATEWAY_SECURITY_TOKEN_ENABLED, tenantConfigurationManagement, i18n); this.securityTokenGenerator = securityTokenGenerator; super.init("label.configuration.auth.gatewaytoken"); configurationEnabled = isConfigEnabled(); detailLayout = new VerticalLayout(); detailLayout.setImmediate(true); final Button gatewaytokenBtn = SPUIComponentProvider.getButton("TODO-ID", "Regenerate Key", "", ValoTheme.BUTTON_TINY + " " + "redicon", true, null, SPUIButtonStyleSmall.class); gatewaytokenBtn.setImmediate(true); gatewaytokenBtn.setIcon(FontAwesome.REFRESH); gatewaytokenBtn.addClickListener(event -> generateGatewayToken()); gatewayTokenkeyLabel = new LabelBuilder().id("gatewaysecuritytokenkey").name("").buildLabel(); gatewayTokenkeyLabel.addStyleName("gateway-token-label"); gatewayTokenkeyLabel.setImmediate(true); final HorizontalLayout keyGenerationLayout = new HorizontalLayout(); keyGenerationLayout.setSpacing(true); keyGenerationLayout.setImmediate(true); keyGenerationLayout.addComponent(gatewayTokenkeyLabel); keyGenerationLayout.addComponent(gatewaytokenBtn); detailLayout.addComponent(keyGenerationLayout); if (isConfigEnabled()) { gatewayTokenkeyLabel.setValue(getSecurityTokenKey()); setDetailVisible(true); } }