本文整理汇总了Java中com.vaadin.ui.OptionGroup.addStyleName方法的典型用法代码示例。如果您正苦于以下问题:Java OptionGroup.addStyleName方法的具体用法?Java OptionGroup.addStyleName怎么用?Java OptionGroup.addStyleName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vaadin.ui.OptionGroup
的用法示例。
在下文中一共展示了OptionGroup.addStyleName方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createOptionGroup
import com.vaadin.ui.OptionGroup; //导入方法依赖的package包/类
/**
* create option group with Create tag/Update tag based on permissions.
*/
protected void createOptionGroup(final boolean hasCreatePermission, final boolean hasUpdatePermission) {
optiongroup = new OptionGroup("Select Action");
optiongroup.setId(UIComponentIdProvider.OPTION_GROUP);
optiongroup.addStyleName(ValoTheme.OPTIONGROUP_SMALL);
optiongroup.addStyleName("custom-option-group");
optiongroup.setNullSelectionAllowed(false);
if (hasCreatePermission) {
optiongroup.addItem(createTagStr);
}
if (hasUpdatePermission) {
optiongroup.addItem(updateTagStr);
}
setOptionGroupDefaultValue(hasCreatePermission, hasUpdatePermission);
}
示例2: buildPossibleTargetVersions
import com.vaadin.ui.OptionGroup; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
protected Panel buildPossibleTargetVersions(ProjectVersion targetProjectVersion) {
Panel possibleTargetVersionsPanel = new Panel("Available Target Versions");
possibleTargetVersionsPanel.addStyleName(ValoTheme.PANEL_SCROLL_INDICATOR);
possibleTargetVersionsPanel.setSizeFull();
IndexedContainer container = new IndexedContainer();
optionGroup = new OptionGroup("Project Version", container);
optionGroup.addStyleName(ValoTheme.OPTIONGROUP_SMALL);
optionGroup.setItemCaptionMode(ItemCaptionMode.PROPERTY);
optionGroup.setItemCaptionPropertyId("versionLabel");
optionGroup.addStyleName("indent");
List<ProjectVersion> projectVersions = configService.findProjectVersionsByProject(targetProjectVersion.getProject());
container.addContainerProperty("versionLabel", String.class, null);
for (ProjectVersion version : projectVersions) {
Item item = container.addItem(version.getId());
item.getItemProperty("versionLabel").setValue(version.getVersionLabel());
if (targetProjectVersion.getId().equalsIgnoreCase(version.getId())) {
optionGroup.setItemEnabled(version.getId(), false);
}
}
possibleTargetVersionsPanel.setContent(optionGroup);
return possibleTargetVersionsPanel;
}
示例3: createErrorThresholdOptionGroup
import com.vaadin.ui.OptionGroup; //导入方法依赖的package包/类
private OptionGroup createErrorThresholdOptionGroup() {
final OptionGroup errorThresoldOptions = new OptionGroup();
for (final ERRORTHRESOLDOPTIONS option : ERRORTHRESOLDOPTIONS.values()) {
errorThresoldOptions.addItem(option.getValue());
}
errorThresoldOptions.setId(UIComponentIdProvider.ROLLOUT_ERROR_THRESOLD_OPTION_ID);
errorThresoldOptions.addStyleName(ValoTheme.OPTIONGROUP_HORIZONTAL);
errorThresoldOptions.addStyleName(SPUIStyleDefinitions.ROLLOUT_OPTION_GROUP);
errorThresoldOptions.setSizeUndefined();
errorThresoldOptions.addValueChangeListener(this::listenerOnErrorThresoldOptionChange);
return errorThresoldOptions;
}
示例4: assignOptionGroupByValues
import com.vaadin.ui.OptionGroup; //导入方法依赖的package包/类
private void assignOptionGroupByValues(final List<String> tagOptions) {
assignOptiongroup = new OptionGroup("", tagOptions);
assignOptiongroup.setStyleName(ValoTheme.OPTIONGROUP_SMALL);
assignOptiongroup.addStyleName("custom-option-group");
assignOptiongroup.setNullSelectionAllowed(false);
assignOptiongroup.setId(SPUIDefinitions.ASSIGN_OPTION_GROUP_SOFTWARE_MODULE_TYPE_ID);
assignOptiongroup.select(tagOptions.get(0));
}
示例5: buildOptionGroup
import com.vaadin.ui.OptionGroup; //导入方法依赖的package包/类
protected OptionGroup buildOptionGroup(String caption, String name, List<Component> components) {
OptionGroup optionGroup = new OptionGroup(caption);
optionGroup.addStyleName(ValoTheme.OPTIONGROUP_HORIZONTAL);
optionGroup.setImmediate(true);
optionGroup.addItem("ON");
optionGroup.addItem("OFF");
optionGroup.addValueChangeListener((event) -> saveSetting(name, optionGroup, components));
return optionGroup;
}
示例6: buildProjectsAndVersions
import com.vaadin.ui.OptionGroup; //导入方法依赖的package包/类
protected Panel buildProjectsAndVersions(String releasePackageId) {
Panel projectsAndVersionsPanel = new Panel("Projects and Branches");
projectsAndVersionsPanel.addStyleName(ValoTheme.PANEL_SCROLL_INDICATOR);
projectsAndVersionsPanel.setSizeFull();
VerticalLayout projectLayout = new VerticalLayout();
projectLayout.setMargin(true);
projectCheckboxes.clear();
projectVersionOptionGroups.clear();
List<Project> projects = configurationService.findProjects();
for (Project project : projects) {
//first allow the user to select or unselect a project
CheckBox checkBox = new CheckBox(project.getName());
checkBox.setData(project.getId());
if (releasePackage.isReleased()) {
checkBox.setEnabled(false);
}
projectLayout.addComponent(checkBox);
//now put the project version options for each project
OptionGroup optionGroup = new OptionGroup();
optionGroup.addStyleName("indent");
List<Rppv> rppvs = configurationService.findReleasePackageProjectVersions(releasePackageId);
Set<String> projectVersionsInReleasePackage = getListOfProjectVersionsInReleasePackages(rppvs);
for (ProjectVersion projectVersion : project.getProjectVersions()) {
optionGroup.addStyleName(ValoTheme.OPTIONGROUP_SMALL);
optionGroup.addItem(projectVersion.getId());
optionGroup.setEnabled(false);
optionGroup.setItemCaption(projectVersion.getId(),projectVersion.getName());
if (projectVersionsInReleasePackage.contains(projectVersion.getId())) {
checkBox.setValue(true);
optionGroup.select(projectVersion.getId());
if (!releasePackage.isReleased()) {
optionGroup.setEnabled(true);
}
}
projectVersionOptionGroups.put(project.getId(), optionGroup);
projectLayout.addComponent(optionGroup);
}
projectCheckboxes.add(checkBox);
checkBox.addValueChangeListener(e -> projectSelectionListener(e));
}
projectsAndVersionsPanel.setContent(projectLayout);
return projectsAndVersionsPanel;
}
示例7: DeployDialog
import com.vaadin.ui.OptionGroup; //导入方法依赖的package包/类
public DeployDialog(ApplicationContext context, EditAgentPanel parentPanel) {
super("Deploy");
this.context = context;
this.configurationService = context.getConfigurationService();
this.operationsService = context.getOperationsSerivce();
this.parentPanel = parentPanel;
this.context = context;
final float DESIRED_WIDTH = 1000;
float width = DESIRED_WIDTH;
float maxWidth = (float) (Page.getCurrent().getBrowserWindowWidth() * .8);
if (maxWidth < DESIRED_WIDTH) {
width = maxWidth;
}
setWidth(width, Unit.PIXELS);
setHeight(600.0f, Unit.PIXELS);
VerticalLayout layout = new VerticalLayout();
layout.setMargin(true);
layout.setSizeFull();
addComponent(layout, 1);
deployByOptionGroup = new OptionGroup("Deployment Type:");
deployByOptionGroup.addStyleName(ValoTheme.OPTIONGROUP_HORIZONTAL);
deployByOptionGroup.addItem(DEPLOY_BY_PACKAGE);
deployByOptionGroup.addItem(DEPLOY_BY_FLOW);
layout.addComponent(deployByOptionGroup);
selectDeploymentLayout = new VerticalLayout();
selectDeploymentLayout.setSizeFull();
selectDeploymentLayout.setMargin(new MarginInfo(true, false));
layout.addComponent(selectDeploymentLayout);
layout.setExpandRatio(selectDeploymentLayout, 1);
backButton = new Button("Cancel", e -> back());
actionButton = new Button("Deploy", e -> takeAction());
actionButton.addStyleName(ValoTheme.BUTTON_PRIMARY);
actionButton.setClickShortcut(KeyCode.ENTER);
addComponent(buildButtonFooter(backButton, actionButton));
deployByOptionGroup.addValueChangeListener(e -> deployByChanged());
deployByOptionGroup.setValue(DEPLOY_BY_PACKAGE);
}