本文整理汇总了Java中com.vaadin.ui.HorizontalSplitPanel.setMaxSplitPosition方法的典型用法代码示例。如果您正苦于以下问题:Java HorizontalSplitPanel.setMaxSplitPosition方法的具体用法?Java HorizontalSplitPanel.setMaxSplitPosition怎么用?Java HorizontalSplitPanel.setMaxSplitPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vaadin.ui.HorizontalSplitPanel
的用法示例。
在下文中一共展示了HorizontalSplitPanel.setMaxSplitPosition方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createMainComponent
import com.vaadin.ui.HorizontalSplitPanel; //导入方法依赖的package包/类
private void createMainComponent() {
VerticalLayout main = new VerticalLayout();
main.setMargin(false);
main.setSizeFull();
main.addComponent(createToolbar());
mainSplitPanel = new HorizontalSplitPanel();
mainSplitPanel.setMargin(false);
mainSplitPanel.setMaxSplitPosition(80f, HorizontalSplitPanel.UNITS_PERCENTAGE);
mainSplitPanel.setMinSplitPosition(20f, HorizontalSplitPanel.UNITS_PERCENTAGE);
mainSplitPanel.setSizeFull();
mainSplitPanel.setSplitPosition(30f, HorizontalSplitPanel.UNITS_PERCENTAGE);
taskTable = createTable();
mainSplitPanel.setFirstComponent(taskTable);
displayEmptyTask();
main.addComponent(mainSplitPanel);
main.setExpandRatio(mainSplitPanel, 1.0f);
mainComponent = main;
}
示例2: SubSetSelectorDraggable
import com.vaadin.ui.HorizontalSplitPanel; //导入方法依赖的package包/类
public SubSetSelectorDraggable(String caption, List<ET> options) {
availableLayout = new VerticalLayout();
availableLayout.setMargin(false);
availableLayout.setSpacing(false);
valueLayout = new VerticalLayout();
valueLayout.setMargin(false);
valueLayout.setSpacing(false);
splitPanel = new HorizontalSplitPanel(availableLayout, valueLayout);
splitPanel.setMinSplitPosition(20, Unit.PERCENTAGE);
splitPanel.setMaxSplitPosition(80, Unit.PERCENTAGE);
splitPanel.setCaption(caption);
verticalLayout = new VerticalLayout();
verticalLayout.setHeight(100, Unit.PERCENTAGE);
verticalLayout.addComponentsAndExpand(splitPanel);
availableDragSource = new ArrayList<>();
buttonStyles = new ArrayList<>();
addDropTarget(valueLayout, false);
addDropTarget(availableLayout, true);
setHeight(500, Unit.PIXELS);
setDraggableHeight(45);
valueLayout.setHeight(getDraggableAreaHeight(), Unit.PIXELS);
setStyle();
setItems(options);
}
示例3: init
import com.vaadin.ui.HorizontalSplitPanel; //导入方法依赖的package包/类
@Override
protected void init(VaadinRequest request) {
HorizontalSplitPanel split = new HorizontalSplitPanel();
setContent(split);
split.setSplitPosition(50, Unit.PERCENTAGE);
split.setMinSplitPosition(100, Unit.PIXELS);
split.setMaxSplitPosition(1200, Unit.PIXELS);
CssLayout grid = new CssLayout();
grid.setWidth("100%");
grid.addStyleName("grid");
split.addComponent(grid);
for (int i = 1; i < 10; i++) {
Label l = new Label("" + i);
l.setSizeUndefined();
grid.addComponent(l);
}
Label description = new Label(
"<h3>This application demonstrates the Responsive add-on for Vaadin.</h3>"
+ "<p>Drag the splitter to see how the boxes on the left side adapt to "
+ "different widths. They maintain a width of 100-200px, and always "
+ "span the entire width of the container.</p><p>This label will "
+ "adapt its font size and line height for different widths.</p>"
+ "<p><a href=\"http://vaadin.com/addon/vaadin-responsive\">Download the "
+ "Responsive add-on</a></p>", ContentMode.HTML);
description.addStyleName("description");
split.addComponent(description);
// Add the responsive capabilities to the components
new Responsive(grid);
new Responsive(description);
}