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

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

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

Button.addStyleName介绍

暂无

代码示例

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

private void selectButton(Button button) {
  if (selectedButton != null) {
    selectedButton.removeStyleName("caption-bold");
  }
  selectedButton = button;
  if (selectedButton != null) {
    selectedButton.addStyleName("caption-bold");
  }
}

代码示例来源:origin: org.activiti/activiti-explorer

public void setActive(boolean active) {
 if(this.active != active) {
  this.active = active;
  if(active) {
   titleButton.addStyleName(ExplorerLayout.STYLE_ACTIVE);
   countButton.addStyleName(ExplorerLayout.STYLE_ACTIVE);
  } else {
   titleButton.removeStyleName(ExplorerLayout.STYLE_ACTIVE);
   countButton.removeStyleName(ExplorerLayout.STYLE_ACTIVE);
  }
 }
}

代码示例来源:origin: info.magnolia.ui/magnolia-ui-framework

private List<Component> createPrimaryActions() {
  return subAppDescriptor.getActions().entrySet().stream()
      .map((action) -> {
        Button button = new Button(action.getKey(), e -> actionExecutionService.executeAction(action.getKey(), action.getValue()));
        button.addStyleName(action.getKey());
        return button;
      })
      // move commit button to the top
      .sorted(comparing(button -> button.getStyleName().contains("commit")))
      .collect(toList());
}

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

@Override
  public void buttonClick(Button.ClickEvent event) {
    m_panBtn.addStyleName(Styles.SELECTED);
    m_selectBtn.removeStyleName(Styles.SELECTED);
    controller.setActiveTool(ActiveTool.pan);
  }
});

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

@Override
  public void buttonClick(Button.ClickEvent event) {
    m_selectBtn.addStyleName(Styles.SELECTED);
    m_panBtn.removeStyleName(Styles.SELECTED);
    controller.setActiveTool(ActiveTool.select);
  }
});

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

private void setLayerLayoutVisible(boolean show) {
  if (show) {
    layerButton.addStyleName(Styles.EXPANDED);
    layerButton.addStyleName(Styles.SELECTED);
    addComponent(layerLayout);
  } else {
    layerButton.removeStyleName(Styles.EXPANDED);
    layerButton.removeStyleName(Styles.SELECTED);
    removeComponent(layerLayout);
  }
}

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

@Override
public void selectionChanged(SelectionContext selectionContext) {
  // After selection always set the pantool back to active tool
  if(m_panBtn != null && !m_panBtn.getStyleName().contains(Styles.SELECTED)) {
    m_panBtn.addStyleName(Styles.SELECTED);
  }
  if(m_selectBtn != null && m_selectBtn.getStyleName().contains(Styles.SELECTED)) {
    m_selectBtn.removeStyleName(Styles.SELECTED);
  }
}

代码示例来源:origin: org.activiti/activiti-explorer

protected void initCountComponent() {
 countButton = new Button(count + "");
 countButton.addStyleName(Reindeer.BUTTON_LINK);
 countButton.addStyleName(ExplorerLayout.STYLE_TOOLBAR_COUNT);
 
 // Initially hidden
 countButton.setVisible(false);
 
 layout.addComponent(countButton);
 layout.setComponentAlignment(countButton, Alignment.MIDDLE_LEFT);
}

代码示例来源:origin: org.opennms.features.topology/org.opennms.features.topology.app

@Override
  public void buttonClick(Button.ClickEvent event) {
    m_selectBtn.addStyleName(Styles.SELECTED);
    m_panBtn.removeStyleName(Styles.SELECTED);
    controller.setActiveTool(ActiveTool.select);
  }
});

代码示例来源:origin: org.opennms.features.topology/org.opennms.features.topology.app

private void setLayerLayoutVisible(boolean show) {
  if (show) {
    layerButton.addStyleName(Styles.EXPANDED);
    layerButton.addStyleName(Styles.SELECTED);
    addComponent(layerLayout);
  } else {
    layerButton.removeStyleName(Styles.EXPANDED);
    layerButton.removeStyleName(Styles.SELECTED);
    removeComponent(layerLayout);
  }
}

代码示例来源:origin: peholmst/vaadin4spring

private Button createNavigationButton(String caption, final String viewName) {
  Button button = new Button(caption);
  button.addStyleName(ValoTheme.BUTTON_SMALL);
  button.addClickListener(new Button.ClickListener() {
    @Override
    public void buttonClick(Button.ClickEvent event) {
      getUI().getNavigator().navigateTo(viewName);
    }
  });
  return button;
}

代码示例来源:origin: com.haulmont.cuba/cuba-web

public void setFileNameButtonCaption(String title) {
  this.fileName = title;
  if (StringUtils.isNotEmpty(title)) {
    fileNameButton.setCaption(title);
    fileNameButton.removeStyleName(EMPTY_VALUE_STYLENAME);
  } else {
    fileNameButton.setCaption(fileNotSelectedMessage);
    fileNameButton.addStyleName(EMPTY_VALUE_STYLENAME);
  }
}

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

public void buttonClick(ClickEvent event) {
  Button b = event.getButton();
  boolean pressed = b.getStyleName().contains(OpenCmsTheme.BUTTON_PRESSED);
  if (pressed) {
    b.removeStyleName(OpenCmsTheme.BUTTON_PRESSED);
  } else {
    b.addStyleName(OpenCmsTheme.BUTTON_PRESSED);
  }
  m_codeMirror.setTabsVisible(!pressed);
}

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

public void buttonClick(ClickEvent event) {
  Button b = event.getButton();
  boolean pressed = b.getStyleName().contains(OpenCmsTheme.BUTTON_PRESSED);
  if (pressed) {
    b.removeStyleName(OpenCmsTheme.BUTTON_PRESSED);
  } else {
    b.addStyleName(OpenCmsTheme.BUTTON_PRESSED);
  }
  m_codeMirror.setHighlighting(!pressed);
}

代码示例来源:origin: info.magnolia.ui/magnolia-ui-framework

protected Button createContentViewIcon(final String viewType, final String icon) {
  Button button = new Button(MagnoliaIcons.forCssClass(icon).orElse(MagnoliaIcons.VIEW_LIST),
      clickEvent -> workbenchContext.displayedContentViewId().set(viewType));
  button.addStyleName(ResurfaceTheme.BUTTON_ICON);
  return button;
}

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

private void setButtonEnabled(Button button, boolean isEnabled) {
  if (isEnabled) {
    button.removeStyleName("disabled");
    button.removeStyleName("v-button-disabled");
    button.removeStyleName("switcher-back-disabled");
  } else {
    button.addStyleName("disabled");
  }
}

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

public void buttonClick(ClickEvent event) {
  Button b = event.getButton();
  boolean pressed = b.getStyleName().contains(OpenCmsTheme.BUTTON_PRESSED);
  if (pressed) {
    b.removeStyleName(OpenCmsTheme.BUTTON_PRESSED);
  } else {
    b.addStyleName(OpenCmsTheme.BUTTON_PRESSED);
  }
  m_codeMirror.setLineWrapping(!pressed);
}

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

public void buttonClick(ClickEvent event) {
  Button b = event.getButton();
  boolean pressed = b.getStyleName().contains(OpenCmsTheme.BUTTON_PRESSED);
  if (pressed) {
    b.removeStyleName(OpenCmsTheme.BUTTON_PRESSED);
  } else {
    b.addStyleName(OpenCmsTheme.BUTTON_PRESSED);
  }
  m_codeMirror.setCloseBrackets(!pressed);
}

代码示例来源:origin: com.haulmont.cuba/cuba-web

protected void onLinkClick() {
  int count = adapter.getCount();
  component.getCountButton().setCaption(String.valueOf(count)); // todo rework with datatype
  component.getCountButton().addStyleName("c-paging-count-number");
  component.getCountButton().setEnabled(false);
}

代码示例来源:origin: eclipse/hawkbit

private Button customFilterDetailButton(final Long itemId) {
  final Item row1 = getItem(itemId);
  final String tfName = (String) row1.getItemProperty(SPUILabelDefinitions.NAME).getValue();
  final Button updateIcon = SPUIComponentProvider.getButton(getDetailLinkId(tfName), tfName,
      i18n.getMessage(UIMessageIdProvider.TOOLTIP_UPDATE_CUSTOM_FILTER), null, false, null,
      SPUIButtonStyleNoBorder.class);
  updateIcon.setData(tfName);
  updateIcon.addStyleName(ValoTheme.LINK_SMALL + " " + "on-focus-no-border link");
  updateIcon.addClickListener(this::onClickOfDetailButton);
  return updateIcon;
}

相关文章