com.vaadin.ui.Button.setPrimaryStyleName()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(11.1k)|赞(0)|评价(0)|浏览(92)

本文整理了Java中com.vaadin.ui.Button.setPrimaryStyleName()方法的一些代码示例,展示了Button.setPrimaryStyleName()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Button.setPrimaryStyleName()方法的具体详情如下:
包路径:com.vaadin.ui.Button
类名称:Button
方法名:setPrimaryStyleName

Button.setPrimaryStyleName介绍

暂无

代码示例

代码示例来源:origin: org.opencms/opencms-core

/**
 * Adds a menu entry button.<p>
 *
 * @param entryButton the entry button
 */
public void addMenuEntry(Button entryButton) {
  entryButton.setPrimaryStyleName(OpenCmsTheme.VERTICAL_MENU_ITEM);
  addComponent(entryButton);
}

代码示例来源:origin: com.vaadin/vaadin-server

resize.setWidth("100%");
resize.setHeight("10px");
resize.setPrimaryStyleName("resize-button");
layout.addComponent(resize);

代码示例来源:origin: org.opencms/opencms-core

/**
   * Adds an entry to the menu, returns the entry button.<p>
   *
   * @param label the label
   * @param icon the icon
   *
   * @return the entry button
   */
  public Button addMenuEntry(String label, Resource icon) {

    Button button = new Button(label, icon);
    button.setPrimaryStyleName(OpenCmsTheme.VERTICAL_MENU_ITEM);
    addComponent(button);
    return button;
  }
}

代码示例来源:origin: vaadin/material-theme-fw8

public Button addTab(String text) {
  Button button = new Button(text);
  button.setPrimaryStyleName(lightTheme ? Styles.Tabs.Text.LIGHT : Styles.Tabs.Text.DARK);
  button.addClickListener(event -> selectTab(button));
  buttons.add(button);
  addComponent(button);
  return button;
}

代码示例来源:origin: vaadin/material-theme-fw8

public Button addToggleButton(Resource icon) {
  Button button = new Button(icon);
  button.setPrimaryStyleName(Styles.Buttons.Toggle.BUTTON);
  button.addClickListener(event -> selectToggleButton(button));
  buttons.add(button);
  addComponent(button);
  return button;
}

代码示例来源:origin: vaadin/material-theme-fw8

public Button addTab(MaterialIcons icon) {
  Button button = new Button();
  button.setPrimaryStyleName(lightTheme ? Styles.Tabs.Icon.LIGHT : Styles.Tabs.Icon.DARK);
  button.setIcon(icon);
  button.addClickListener(event -> selectTab(button));
  buttons.add(button);
  addComponent(button);
  return button;
}

代码示例来源:origin: kingbbode/spring-boot-ehcache-monitor

/**
 * Creates a navigation button to the view identified by {@code name} using
 * {@code caption} and {@code icon}.
 *
 * @param name    view name
 * @param caption view caption in the menu
 * @param icon    view icon in the menu
 */
public void addViewButton(final String name, String caption,
             Resource icon) {
  Button button = new Button(caption, (Button.ClickListener) event -> navigator.navigateTo("detail/" + CACHE_PARAMETER_KEY + "=" + name));
  button.setPrimaryStyleName(ValoTheme.MENU_ITEM);
  button.setIcon(icon);
  menuItemsLayout.addComponent(button);
  viewButtons.put(name, button);
}

代码示例来源:origin: vaadin/material-theme-fw8

public Button addTab(MaterialIcons icon, String text) {
  Button button = new Button(text);
  button.setPrimaryStyleName(lightTheme ? Styles.Tabs.IconText.LIGHT : Styles.Tabs.IconText.DARK);
  button.setIcon(icon);
  button.addClickListener(event -> selectTab(button));
  buttons.add(button);
  addComponent(button);
  return button;
}

代码示例来源:origin: vaadin/material-theme-fw8

public DatePickerFooter(InlineDateField field, boolean lightTheme) {
  setAlignItems(FlexLayout.AlignItems.CENTER);
  setJustifyContent(FlexLayout.JustifyContent.FLEX_END);
  addStyleName(Paddings.All.SMALL);
  addStyleName(Spacings.Right.SMALL);
  addStyleName(FlexItem.FlexShrink.SHRINK_0);
  cancel = new Button("Cancel");
  cancel.setPrimaryStyleName(lightTheme ? Styles.Buttons.Flat.LIGHT : Styles.Buttons.Flat.DARK);
  ok = new Button("OK");
  ok.setPrimaryStyleName(lightTheme ? Styles.Buttons.Flat.LIGHT : Styles.Buttons.Flat.DARK);
  ok.setEnabled(field.getValue() != null);
  this.field = field;
  this.field.addValueChangeListener(event -> ok.setEnabled(this.field.getValue() != null));
  addComponents(cancel, ok);
}

代码示例来源:origin: vaadin/material-theme-fw8

public AppBar() {
  super();
  setPrimaryStyleName("md-appbar");
  addStyleName(MaterialColor.BLUE_500.getBackgroundColorStyle());
  naviIcon.setIcon(MaterialIcons.MENU);
  naviIcon.setPrimaryStyleName(Styles.Buttons.NAV_ICON);
  Label appBarTitle = new Label("Material Design");
  appBarTitle.setPrimaryStyleName(Typography.Light.Title.PRIMARY);
  appBarTitle.setSizeUndefined();
  addComponents(naviIcon, appBarTitle);
}

代码示例来源:origin: org.opennms.features/vaadin-surveillance-views

@Override
  public Object generateCell(Table table, Object itemId, Object propertyId) {
    final SurveillanceViewService.NodeRtc nodeRtc = (SurveillanceViewService.NodeRtc) itemId;
    Button button = new Button(nodeRtc.getNode().getLabel());
    button.setPrimaryStyleName(BaseTheme.BUTTON_LINK);
    button.setEnabled(m_enabled);
    button.addStyleName("white");
    button.addClickListener(new Button.ClickListener() {
      @Override
      public void buttonClick(Button.ClickEvent clickEvent) {
        final URI currentLocation = Page.getCurrent().getLocation();
        final String contextRoot = VaadinServlet.getCurrent().getServletContext().getContextPath();
        final String redirectFragment = contextRoot + "/element/node.jsp?quiet=true&node=" + nodeRtc.getNode().getId();
        LOG.debug("node {} clicked, current location = {}, uri = {}", nodeRtc.getNode().getId(), currentLocation, redirectFragment);
        try {
          SurveillanceViewNodeRtcTable.this.getUI().addWindow(new InfoWindow(new URL(currentLocation.toURL(), redirectFragment), new InfoWindow.LabelCreator() {
            @Override
            public String getLabel() {
              return "Node Info " + nodeRtc.getNode().getId();
            }
          }));
        } catch (MalformedURLException e) {
          LOG.error(e.getMessage(), e);
        }
      }
    });
    return button;
  }
});

代码示例来源:origin: OpenNMS/opennms

@Override
  public Object generateCell(Table table, Object itemId, Object propertyId) {
    final SurveillanceViewService.NodeRtc nodeRtc = (SurveillanceViewService.NodeRtc) itemId;
    Button button = new Button(nodeRtc.getNode().getLabel());
    button.setPrimaryStyleName(BaseTheme.BUTTON_LINK);
    button.setEnabled(m_enabled);
    button.addStyleName("white");
    button.addClickListener(new Button.ClickListener() {
      @Override
      public void buttonClick(Button.ClickEvent clickEvent) {
        final URI currentLocation = getUI().getPage().getLocation();
        final String contextRoot = VaadinServlet.getCurrent().getServletContext().getContextPath();
        final String redirectFragment = contextRoot + "/element/node.jsp?quiet=true&node=" + nodeRtc.getNode().getId();
        LOG.debug("node {} clicked, current location = {}, uri = {}", nodeRtc.getNode().getId(), currentLocation, redirectFragment);
        try {
          SurveillanceViewNodeRtcTable.this.getUI().addWindow(new InfoWindow(new URL(currentLocation.toURL(), redirectFragment), new InfoWindow.LabelCreator() {
            @Override
            public String getLabel() {
              return "Node Info " + nodeRtc.getNode().getId();
            }
          }));
        } catch (MalformedURLException e) {
          LOG.error(e.getMessage(), e);
        }
      }
    });
    return button;
  }
});

代码示例来源:origin: org.ikasan/ikasan-dashboard-jar

private Component buildToggleButton() 
{
   showMenuButton.addClickListener(new ClickListener() 
   {
     @Override
     public void buttonClick(final ClickEvent event) 
     {
       if(menu.getStyleName().contains("valo-menu-visible")) 
       {
         menu.setVisible(false);	
        menu.removeStyleName("valo-menu-visible");
       } 
       else 	
       {
         menu.setVisible(true);	
         menu.addStyleName("valo-menu-visible");
       }
     }
   });
  menu.setVisible(false);
  showMenuButton.addStyleName(ValoTheme.BUTTON_PRIMARY);
  showMenuButton.addStyleName(ValoTheme.BUTTON_SMALL);
  showMenuButton.setIcon(FontAwesome.LIST);
  showMenuButton.setPrimaryStyleName("valo-menu-item");
  menu.setStyleName("valo-menu-visible");
     return showMenuButton;
}

代码示例来源:origin: vaadin/material-theme-fw8

public SimpleDialog(String title, String message, boolean lightTheme) {
  super(title);
  addStyleName(lightTheme ? Styles.Windows.LIGHT : Styles.Windows.DARK);
  label = new Label(message);
  label.setPrimaryStyleName(lightTheme ? Typography.Dark.Subheader.SECONDARY : Typography.Light.Subheader.SECONDARY);
  label.addStyleName(Paddings.Horizontal.LARGE + " " + Paddings.Bottom.LARGE);
  // Footer
  cancel = new Button("Cancel");
  cancel.setPrimaryStyleName(lightTheme ? Styles.Buttons.Flat.LIGHT : Styles.Buttons.Flat.DARK);
  cancel.addClickListener(e -> close());
  ok = new Button("OK");
  ok.setPrimaryStyleName(lightTheme ? Styles.Buttons.Flat.LIGHT : Styles.Buttons.Flat.DARK);
  ok.addClickListener(e -> close());
  footer = new FlexLayout(cancel, ok);
  footer.setJustifyContent(FlexLayout.JustifyContent.FLEX_END);
  footer.addStyleName(Paddings.All.SMALL + " " + Spacings.Right.SMALL + " " + FlexItem.FlexShrink.SHRINK_0);
  footer.setWidth(100, Unit.PERCENTAGE);
  // Content wrapper
  content = new FlexLayout(FlexLayout.FlexDirection.COLUMN, label, footer);
  setContent(content);
}

代码示例来源:origin: info.magnolia.ui/magnolia-ui-vaadin-common-widgets

private void construct() {
  mainLayout.setPrimaryStyleName("switcher");
  mainLayout.addStyleName(VARIATION_GREEN.equals(colorVariation) ? cssGreenVariationClassname : cssBlackVariationClassname);
  // back-arrow
  back = new Button("");
  back.setPrimaryStyleName(cssSwitcherArrowClassname);
  back.addStyleName("icon-arrow2_w");
  mainLayout.addComponent(back);
  // combobox with descriptionLabel below wrapped in verticalLayout
  //
  comboLayout.setWidth(100, Unit.PERCENTAGE);
  combobox.setWidth(100, Unit.PERCENTAGE);
  comboLayout.addComponent(combobox);
  // descriptionLabel
  descriptionLabel = new Label("");
  descriptionLabel.setPrimaryStyleName("switcherItemDescription");
  descriptionLabel.addStyleName("descriptionLabel");
  comboLayout.addComponent(descriptionLabel);
  mainLayout.addComponent(comboLayout);
  mainLayout.setExpandRatio(comboLayout, 1.0f);
  // forward arrow
  forward = new Button("");
  forward.setPrimaryStyleName(cssSwitcherArrowClassname);
  forward.addStyleName("icon-arrow2_e");
  mainLayout.addComponent(forward);
  updateButtonState(getValue());
  updateItemDescription();
}

代码示例来源:origin: vaadin/material-theme-fw8

public ScrollableDialog(String title, boolean lightTheme) {
  super(title);
  setPrimaryStyleName(lightTheme ? Styles.Windows.LIGHT : Styles.Windows.DARK);
  addStyleName(Styles.Windows.SCROLLABLE);
  scrollableLayout = new FlexLayout(FlexLayout.FlexDirection.COLUMN);
  scrollableLayout.setOverflow(FlexLayout.Overflow.AUTO);
  scrollableLayout.addStyleName(Paddings.Horizontal.LARGE);
  scrollableLayout.addStyleName(FlexItem.FlexGrow.GROW_1);
  // Footer
  cancel = new Button("Cancel");
  cancel.setPrimaryStyleName(lightTheme ? Styles.Buttons.Flat.LIGHT : Styles.Buttons.Flat.DARK);
  cancel.addClickListener(e -> close());
  ok = new Button("OK");
  ok.setPrimaryStyleName(lightTheme ? Styles.Buttons.Flat.LIGHT : Styles.Buttons.Flat.DARK);
  ok.addClickListener(e -> close());
  footer = new FlexLayout(cancel, ok);
  footer.setJustifyContent(FlexLayout.JustifyContent.FLEX_END);
  footer.addStyleName(Paddings.All.SMALL + " " + Spacings.Right.SMALL + " " + FlexItem.FlexShrink.SHRINK_0);
  footer.addStyleName(lightTheme ? Borders.Light.TOP : Borders.Dark.TOP);
  footer.setWidth(100, Sizeable.Unit.PERCENTAGE);
  // Content wrapper
  content = new FlexLayout(FlexLayout.FlexDirection.COLUMN, scrollableLayout, footer);
  content.addStyleName(MaxHeights.MH_FULL);
  setContent(content);
}

代码示例来源:origin: OpenNMS/opennms

button.setPrimaryStyleName(BaseTheme.BUTTON_LINK);
button.setEnabled(m_enabled);

代码示例来源:origin: OpenNMS/opennms

button.setPrimaryStyleName(BaseTheme.BUTTON_LINK);
button.setEnabled(m_enabled);

代码示例来源:origin: org.opennms.features/vaadin-surveillance-views

button.setPrimaryStyleName(BaseTheme.BUTTON_LINK);
button.setEnabled(m_enabled);

代码示例来源:origin: org.opennms.features/vaadin-surveillance-views

button.setPrimaryStyleName(BaseTheme.BUTTON_LINK);
button.setEnabled(m_enabled);

相关文章