本文整理汇总了Java中com.vaadin.ui.Panel.setWidth方法的典型用法代码示例。如果您正苦于以下问题:Java Panel.setWidth方法的具体用法?Java Panel.setWidth怎么用?Java Panel.setWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vaadin.ui.Panel
的用法示例。
在下文中一共展示了Panel.setWidth方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: SimplePageLayout
import com.vaadin.ui.Panel; //导入方法依赖的package包/类
public SimplePageLayout(CaoNode res) {
this.res = res;
p = new Panel();
un = new Panel();
h = new HorizontalLayout();
v = new VerticalLayout();
p.setContent(v);
// setSizeFull();
h.setWidth("100%");
p.addStyleName("v-scrollable");
p.setHeight("100%");
un.addStyleName("v-scrollable");
un.setHeight("100%");
un.setWidth("250px");
addComponent(p);
addComponent(un);
setExpandRatio(p, 1);
}
示例2: AbstractDialog
import com.vaadin.ui.Panel; //导入方法依赖的package包/类
/**
* Constructor
*/
public AbstractDialog() {
super();
// defaults
setModal(true);
setResizable(false);
setDraggable(false);
setClosable(false);
// style name
addStyleName("h-dialog");
// build
content = new Panel();
content.setWidth("100%");
content.addStyleName(ValoTheme.PANEL_BORDERLESS);
content.addStyleName("h-dialog-content");
actions = new HorizontalLayout();
actions.setWidth("100%");
actions.setSpacing(true);
actions.addStyleName(ValoTheme.WINDOW_BOTTOM_TOOLBAR);
actions.addStyleName("h-dialog-actions");
root = new VerticalLayout();
root.addComponent(content);
root.addComponent(actions);
setContent(root);
}
示例3: layout
import com.vaadin.ui.Panel; //导入方法依赖的package包/类
protected void layout(Panel panel) {
createUpload();
this.verLayout.setSpacing(true);
panel.setWidth("100%");
panel.setContent(this.verLayout);
this.verLayout.addComponent(this.upload);
this.verLayout.addStyleName(StyleConstants.COMPONENT_SPACING);
}
示例4: getVirtualSystemPanel
import com.vaadin.ui.Panel; //导入方法依赖的package包/类
/**
* @return AZ Panel
*/
@SuppressWarnings("serial")
protected Panel getVirtualSystemPanel() {
try {
this.vsTable = new Table();
this.vsTable.setPageLength(5);
this.vsTable.setImmediate(true);
this.vsTable.addGeneratedColumn("Enabled", new CheckBoxGenerator());
this.vsTable.addItemClickListener(new ItemClickListener() {
@Override
public void itemClick(ItemClickEvent event) {
vsTableClicked((Long) event.getItemId());
}
});
// populating VS table
populateVirtualSystem();
Panel vsPanel = new Panel("Virtualization System:");
vsPanel.addStyleName("form_Panel");
vsPanel.setWidth(100, Sizeable.Unit.PERCENTAGE);
vsPanel.setContent(this.vsTable);
return vsPanel;
} catch (Exception e) {
log.error("Error while creating DA's VS panel", e);
}
return null;
}
示例5: UMLDemoView
import com.vaadin.ui.Panel; //导入方法依赖的package包/类
public UMLDemoView() {
component = new VizComponent();
graphName = "\"Class diagram\"";
Label label = new Label(
"This example show an (simplified) UML diagram of a (tiny) part of the Vaadin framework. "
+ "Nodes with HTML content is used for the classes. "
+ "When a class is clicked more detailed (here dummy) information is shown at the right of the diagram");
HorizontalLayout layout = new HorizontalLayout();
Panel panel = new Panel("Graph " + graphName);
panel.setHeight("600px");
panel.setWidth("800px");
panel.setContent(component);
layout.addComponent(panel);
classInfo = new Label("<h1> Class info </h1>", ContentMode.HTML);
layout.addComponent(classInfo);
layout.setSpacing(true);
layout.setComponentAlignment(panel, Alignment.TOP_LEFT);
layout.setComponentAlignment(classInfo, Alignment.TOP_LEFT);
addComponent(label);
addComponent(layout);
setMargin(true);
setSpacing(true);
createAndRenderGraph(width, height);
}
示例6: buildPanelTester
import com.vaadin.ui.Panel; //导入方法依赖的package包/类
@AutoGenerated
private Panel buildPanelTester() {
// common part: create layout
panelTester = new Panel();
panelTester.setCaption("Test The Expression");
panelTester.setImmediate(false);
panelTester.setWidth("-1px");
panelTester.setHeight("-1px");
// verticalLayout_2
verticalLayout_2 = buildVerticalLayout_2();
panelTester.setContent(verticalLayout_2);
return panelTester;
}
示例7: buildPanelTester
import com.vaadin.ui.Panel; //导入方法依赖的package包/类
@AutoGenerated
private Panel buildPanelTester() {
// common part: create layout
panelTester = new Panel();
panelTester.setCaption("Test Range Values");
panelTester.setImmediate(true);
panelTester.setWidth("-1px");
panelTester.setHeight("-1px");
// verticalLayout_2
verticalLayout_2 = buildVerticalLayout_2();
panelTester.setContent(verticalLayout_2);
return panelTester;
}
示例8: addHtmlContent
import com.vaadin.ui.Panel; //导入方法依赖的package包/类
protected void addHtmlContent(String html) {
Panel panel = new Panel();
panel.setWidth(800, UNITS_PIXELS);
panel.setHeight(300, UNITS_PIXELS);
content = new Label(html, Label.CONTENT_XHTML);
content.setHeight(100, UNITS_PERCENTAGE);
panel.addComponent(content);
addComponent(panel);
}
示例9: initImage
import com.vaadin.ui.Panel; //导入方法依赖的package包/类
protected void initImage() {
processImageContainer = new VerticalLayout();
Label processTitle = new Label(i18nManager.getMessage(Messages.PROCESS_HEADER_DIAGRAM));
processTitle.addStyleName(ExplorerLayout.STYLE_H3);
processImageContainer.addComponent(processTitle);
if(processDefinition.getDiagramResourceName() != null) {
StreamResource diagram = new ProcessDefinitionImageStreamResourceBuilder()
.buildStreamResource(processDefinition, repositoryService);
Embedded embedded = new Embedded(null, diagram);
embedded.setType(Embedded.TYPE_IMAGE);
embedded.setSizeUndefined();
Panel imagePanel = new Panel(); // using panel for scrollbars
imagePanel.addStyleName(Reindeer.PANEL_LIGHT);
imagePanel.setWidth(100, UNITS_PERCENTAGE);
imagePanel.setHeight(400, UNITS_PIXELS);
HorizontalLayout panelLayout = new HorizontalLayout();
panelLayout.setSizeUndefined();
imagePanel.setContent(panelLayout);
imagePanel.addComponent(embedded);
processImageContainer.addComponent(imagePanel);
} else {
Label noImageAvailable = new Label(i18nManager.getMessage(Messages.PROCESS_NO_DIAGRAM));
processImageContainer.addComponent(noImageAvailable);
}
addComponent(processImageContainer);
}
示例10: JobsArchiverPanel
import com.vaadin.ui.Panel; //导入方法依赖的package包/类
public JobsArchiverPanel(ArchiveLayout parentLayout, ArchiveServiceApi archiveService,
GetJobsArchiveServiceApi getJobsArchiveService, UpdateJobsArchiveServiceApi updateJobsArchiveService) {
super();
this.parentLayout = parentLayout;
this.archiveService = archiveService;
this.getJobsArchiveService = getJobsArchiveService;
this.updateJobsArchiveService = updateJobsArchiveService;
try {
this.dto = populateJobsArchiveDto().getDto();
// create frequency layout component
VerticalLayout freqLayout = new VerticalLayout();
freqLayout.addComponent(createLastTriggerLabel());
freqLayout.addComponent(createAutoSchedCheckBox());
freqLayout.addComponent(createFrequencyOptionGroup());
freqLayout.addStyleName(StyleConstants.COMPONENT_SPACING);
freqLayout.setSpacing(true);
// create triggering panel component
Panel triggerPanel = new Panel();
triggerPanel.setWidth("50%");
triggerPanel.setContent(freqLayout);
// create threshold layout component
HorizontalLayout thresLayout = new HorizontalLayout();
thresLayout.addComponent(this.thresholdLabel);
thresLayout.addComponent(createArchiveThreshold());
thresLayout.addComponent(createThresholdOptionGroup());
thresLayout.addStyleName(StyleConstants.COMPONENT_SPACING);
thresLayout.setSpacing(true);
// add all components to container
this.container = new VerticalLayout();
this.container.addStyleName(StyleConstants.COMPONENT_SPACING);
this.container.addComponent(this.triggerLabel);
this.container.addComponent(triggerPanel);
this.container.addComponent(thresLayout);
// add buttons component to container
HorizontalLayout buttonLayout = new HorizontalLayout();
buttonLayout.addComponent(createOnDemandScheduleButton());
buttonLayout.addComponent(createUpdateScheduleButton());
buttonLayout.setSpacing(true);
this.container.addComponent(buttonLayout);
// add container to root panel
this.container.setSpacing(true);
this.panel.setWidth("100%");
this.panel.setContent(this.container);
setCompositionRoot(this.panel);
} catch (Exception ex) {
log.error("Failed to init archiver panel", ex);
}
}
示例11: addJobState
import com.vaadin.ui.Panel; //导入方法依赖的package包/类
protected void addJobState() {
Label processDefinitionHeader = new Label(i18nManager.getMessage(Messages.JOB_HEADER_EXECUTION));
processDefinitionHeader.addStyleName(ExplorerLayout.STYLE_H3);
processDefinitionHeader.addStyleName(ExplorerLayout.STYLE_DETAIL_BLOCK);
processDefinitionHeader.setWidth(100, UNITS_PERCENTAGE);
addComponent(processDefinitionHeader);
VerticalLayout layout = new VerticalLayout();
layout.setSpacing(true);
layout.setSizeFull();
layout.setMargin(true,false, true, false);
addDetailComponent(layout);
setDetailExpandRatio(layout, 1.0f);
// Exceptions
if(job.getExceptionMessage() != null) {
// Number of retries
Label retrieslabel = new Label(getRetriesLabel(job));
layout.addComponent(retrieslabel);
// Exception
Label exceptionMessageLabel = new Label(i18nManager.getMessage(Messages.JOB_ERROR)
+ ": " + job.getExceptionMessage());
exceptionMessageLabel.addStyleName(ExplorerLayout.STYLE_JOB_EXCEPTION_MESSAGE);
layout.addComponent(exceptionMessageLabel);
// Add Exception stacktrace
String stack = managementService.getJobExceptionStacktrace(job.getId());
Label stackTraceLabel = new Label(stack);
stackTraceLabel.setContentMode(Label.CONTENT_PREFORMATTED);
stackTraceLabel.addStyleName(ExplorerLayout.STYLE_JOB_EXCEPTION_TRACE);
stackTraceLabel.setSizeFull();
Panel stackPanel = new Panel();
stackPanel.setWidth(100, UNITS_PERCENTAGE);
stackPanel.setSizeFull();
stackPanel.setScrollable(true);
stackPanel.addComponent(stackTraceLabel);
layout.addComponent(stackPanel);
layout.setExpandRatio(stackPanel, 1.0f);
} else {
Label noException = new Label(i18nManager.getMessage(Messages.JOB_NOT_EXECUTED));
layout.addComponent(noException);
layout.setExpandRatio(noException, 1.0f);
}
}