本文整理了Java中com.vaadin.ui.Button.getStyleName()
方法的一些代码示例,展示了Button.getStyleName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Button.getStyleName()
方法的具体详情如下:
包路径:com.vaadin.ui.Button
类名称:Button
方法名:getStyleName
暂无
代码示例来源: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.opennms.features.topology/org.opennms.features.topology.app
@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: 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: vaadin/material-theme-fw8
public void selectTab(Button button) {
if (!buttons.contains(button)) return;
for (Button b : buttons) {
b.removeStyleName(SELECTED);
}
if (button.getStyleName().contains(SELECTED)) {
button.removeStyleName(SELECTED);
} else {
button.addStyleName(SELECTED);
}
}
}
代码示例来源:origin: vaadin/material-theme-fw8
public void selectToggleButton(Button button) {
if (!buttons.contains(button)) return;
if (this.mode == SelectionMode.SINGLE) {
for (Button b : buttons) {
b.removeStyleName(ACTIVE);
}
}
if (button.getStyleName().contains(ACTIVE)) {
button.removeStyleName(ACTIVE);
} else {
button.addStyleName(ACTIVE);
}
for (Button btn : buttons) {
if (btn.getStyleName().contains(ACTIVE)) {
addStyleName("card");
return;
}
removeStyleName("card");
}
}
代码示例来源: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: 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: OpenNMS/opennms
layerButton.setDescription("Layers");
layerButton.addClickListener((event) -> {
boolean isCollapsed = layerButton.getStyleName().contains(Styles.EXPANDED);
setLayerLayoutVisible(!isCollapsed);
});
代码示例来源:origin: org.opennms.features.topology/org.opennms.features.topology.app
layerButton.setDescription("Layers");
layerButton.addClickListener((event) -> {
boolean isCollapsed = layerButton.getStyleName().contains(Styles.EXPANDED);
setLayerLayoutVisible(!isCollapsed);
});
内容来源于网络,如有侵权,请联系作者删除!