当前位置: 首页>>代码示例>>Java>>正文


Java Panel.setContent方法代码示例

本文整理汇总了Java中com.vaadin.ui.Panel.setContent方法的典型用法代码示例。如果您正苦于以下问题:Java Panel.setContent方法的具体用法?Java Panel.setContent怎么用?Java Panel.setContent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.vaadin.ui.Panel的用法示例。


在下文中一共展示了Panel.setContent方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ManageLayout

import com.vaadin.ui.Panel; //导入方法依赖的package包/类
public ManageLayout(BackupServiceApi backupService, RestoreServiceApi restoreService,
        ServerApi server, ValidationApi validator) {
    super();
    this.backupService = backupService;
    this.validator = validator;

    VerticalLayout backupContainer = new VerticalLayout();
    VerticalLayout restoreContainer = new VerticalLayout();

    DbRestorer restorer = new DbRestorer(restoreService, server, validator);
    restorer.setSizeFull();

    // Component to Backup Database
    Panel bkpPanel = new Panel();
    bkpPanel.setContent(createBackup());

    backupContainer.addComponent(ViewUtil.createSubHeader("Backup Database", null));
    backupContainer.addComponent(bkpPanel);

    restoreContainer.addComponent(ViewUtil.createSubHeader("Restore Database", null));
    restoreContainer.addComponent(restorer);

    addComponent(backupContainer);
    addComponent(restoreContainer);
}
 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:26,代码来源:ManageLayout.java

示例2: DetailPanel

import com.vaadin.ui.Panel; //导入方法依赖的package包/类
public DetailPanel() {
  setSizeFull();
  addStyleName(ExplorerLayout.STYLE_DETAIL_PANEL);
  setMargin(true);
  
  CssLayout cssLayout = new CssLayout(); // Needed for rounded corners
  cssLayout.addStyleName(ExplorerLayout.STYLE_DETAIL_PANEL);
  cssLayout.setSizeFull();
  super.addComponent(cssLayout);
  
  mainPanel = new Panel();
  mainPanel.addStyleName(Reindeer.PANEL_LIGHT);
  mainPanel.setSizeFull();
  cssLayout.addComponent(mainPanel);
  
  // Use default layout
  VerticalLayout verticalLayout = new VerticalLayout();
  verticalLayout.setWidth(100, UNITS_PERCENTAGE);
  verticalLayout.setMargin(true);
  mainPanel.setContent(verticalLayout);
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:22,代码来源:DetailPanel.java

示例3: createTab

import com.vaadin.ui.Panel; //导入方法依赖的package包/类
private VerticalLayout createTab(String caption, String title, FormLayout content, String guid) {
    VerticalLayout tabSheet = new VerticalLayout();
    tabSheet.setCaption(caption);
    tabSheet.setStyleName(StyleConstants.TAB_SHEET);
    Panel panel = new Panel();
    // creating subHeader inside panel
    panel.setContent(content);
    panel.setSizeFull();
    tabSheet.addComponent(ViewUtil.createSubHeader(title, guid));
    tabSheet.addComponent(panel);
    return tabSheet;
}
 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:13,代码来源:MaintenanceView.java

示例4: ArchiveLayout

import com.vaadin.ui.Panel; //导入方法依赖的package包/类
public ArchiveLayout(ArchiveServiceApi archiveService, GetJobsArchiveServiceApi getJobsArchiveService,
        UpdateJobsArchiveServiceApi updateJobsArchiveService) {
    super();

    VerticalLayout downloadContainer = new VerticalLayout();
    VerticalLayout archiveContainer = new VerticalLayout();

    // Component to Archive Jobs
    JobsArchiverPanel archiveConfigurator = new JobsArchiverPanel(this, archiveService,
            getJobsArchiveService, updateJobsArchiveService);
    archiveConfigurator.setSizeFull();

    archiveContainer.addComponent(ViewUtil.createSubHeader("Archive Jobs/Alerts", null));
    archiveContainer.addComponent(archiveConfigurator);

    downloadContainer.addComponent(ViewUtil.createSubHeader("Download Archive", null));
    // Component to download archive

    this.archiveTable = new Table();
    this.archiveTable.setSizeFull();
    this.archiveTable.setPageLength(5);
    this.archiveTable.setImmediate(true);
    this.archiveTable.addContainerProperty("Name", String.class, null);
    this.archiveTable.addContainerProperty("Date", Date.class, null);
    this.archiveTable.addContainerProperty("Size", Long.class, null);
    this.archiveTable.addContainerProperty("Download", Link.class, null);
    this.archiveTable.addContainerProperty("Delete", Button.class, null);
    buildArchivesTable();

    Panel archiveTablePanel = new Panel();
    archiveTablePanel.setContent(this.archiveTable);

    addComponent(archiveContainer);
    addComponent(archiveTablePanel);
}
 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:36,代码来源:ArchiveLayout.java

示例5: SslConfigurationLayout

import com.vaadin.ui.Panel; //导入方法依赖的package包/类
public SslConfigurationLayout(DeleteSslCertificateServiceApi deleteSslCertificate,
        ListSslCertificatesServiceApi listSslCertificateService,
        X509TrustManagerApi trustManager, BundleContext ctx) {
    super();

    this.deleteSslCertificateService = deleteSslCertificate;
    this.listSslCertificateService = listSslCertificateService;

    SslCertificateUploader certificateUploader = new SslCertificateUploader(trustManager);
    VerticalLayout sslUploadContainer = makeSslUploadContainer(certificateUploader, getString(CERTIFICATE_UPLOAD_TITLE));
    InternalCertReplacementUploader internalCertReplacementUploader = new InternalCertReplacementUploader(trustManager);
    VerticalLayout sslReplaceInternalContainer = makeSslUploadContainer(internalCertReplacementUploader, getString(KEYPAIR_UPLOAD_TITLE));

    VerticalLayout sslListContainer = new VerticalLayout();
    sslListContainer.addComponent(createHeaderForSslList());

    this.sslConfigTable = new Table();
    this.sslConfigTable.setSizeFull();
    this.sslConfigTable.setImmediate(true);
    this.sslConfigTable.addContainerProperty("Alias", String.class, null);
    this.sslConfigTable.addContainerProperty("SHA1 fingerprint", String.class, null);
    this.sslConfigTable.addContainerProperty("Issuer", String.class, null);
    this.sslConfigTable.addContainerProperty("Valid from", Date.class, null);
    this.sslConfigTable.addContainerProperty("Valid until", Date.class, null);
    this.sslConfigTable.addContainerProperty("Algorithm type", String.class, null);
    this.sslConfigTable.addContainerProperty("Delete", Button.class, null);
    this.sslConfigTable.setColumnWidth("Issuer", 200);
    buildSslConfigurationTable();

    Panel sslConfigTablePanel = new Panel();
    sslConfigTablePanel.setContent(this.sslConfigTable);
    sslListContainer.addComponent(sslConfigTablePanel);

    addComponent(sslReplaceInternalContainer);
    addComponent(sslUploadContainer);
    addComponent(sslListContainer);

    this.registration = ctx.registerService(TruststoreChangedListener.class, this, null);
}
 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:40,代码来源:SslConfigurationLayout.java

示例6: 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);
}
 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:11,代码来源:SslCertificateUploader.java

示例7: createComponent

import com.vaadin.ui.Panel; //导入方法依赖的package包/类
private VerticalLayout createComponent(String caption, String title, FormLayout content, String guid) {
    VerticalLayout tabSheet = new VerticalLayout();
    Panel panel = new Panel();
    // creating subHeader inside panel
    panel.setContent(content);
    panel.setSizeFull();
    tabSheet.addComponent(ViewUtil.createSubHeader(title, guid));
    tabSheet.addComponent(panel);
    return tabSheet;
}
 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:11,代码来源:PluginView.java

示例8: 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;
}
 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:36,代码来源:BaseDAWindow.java

示例9: getAddonComponent

import com.vaadin.ui.Panel; //导入方法依赖的package包/类
@Override
public Component getAddonComponent() {
    Window w = new Window("Medium Editor in window");
    w.setWidth(500, Unit.PIXELS);
    w.setHeight(400, Unit.PIXELS);
    
    
    Panel p = new Panel();
    p.addStyleName(ValoTheme.PANEL_WELL);
    p.setSizeFull();

    MediumEditor editor = new MediumEditor();
    editor.setSizeFull();
    editor.setFocusOutlineEnabled(false);
    editor.setJsLoggingEnabled(true);
    editor.setContent(Lorem.getHtmlParagraphs(3, 5));
    editor.configure(
            editor.options()
            .toolbar()
            .buttons(Buttons.BOLD, Buttons.ITALIC, 
                    Buttons.JUSTIFY_CENTER, 
                    Buttons.ANCHOR)
            .done()
            .autoLink(true)
            .imageDragging(false)
            .done()
            );
    editors.add(editor);
    p.setContent(editor);
    w.setContent(p);

    Button b = new Button("Open Window");
    b.addClickListener(e -> {
        w.setPosition(e.getClientX(), e.getClientY());
        UI.getCurrent().addWindow(w);
    });


    return b; 
}
 
开发者ID:moberwasserlechner,项目名称:vaadin-medium-editor,代码行数:41,代码来源:WindowEditorView.java

示例10: buildMenu

import com.vaadin.ui.Panel; //导入方法依赖的package包/类
private Component buildMenu() {
    Panel menuPanel = new Panel();
    menuPanel.setSizeFull();
    menuPanel.addStyleName(ValoTheme.PANEL_BORDERLESS);
    menuPanel.addStyleName("addon-menu");

    VerticalLayout vl = new VerticalLayout();
    vl.setWidth(100, Unit.PERCENTAGE);

    for (EditorStructure editorStructure : EditorStructure.values()) {
        List<MenuItem> children = new ArrayList<>();
        for (MenuItem i : menuItems) {
            if (i.getType() == editorStructure) {
                children.add(i);
            }
        }

        Label section = new Label();
        section.addStyleName(ValoTheme.LABEL_SUCCESS);
        section.setSizeFull();
        section.setValue(editorStructure.toString());
        vl.addComponent(section);

        for (MenuItem menuItem : children) {
            Button b = new Button(menuItem.getLabel());
            b.setSizeFull();
            b.addClickListener(e -> {
                getUI().getNavigator().navigateTo(menuItem.getViewName());
                vl.forEach(c -> c.removeStyleName(ValoTheme.BUTTON_PRIMARY));
                b.addStyleName(ValoTheme.BUTTON_PRIMARY);
            });
            vl.addComponent(b);
        }
    }
    menuPanel.setContent(vl);
    return menuPanel;
}
 
开发者ID:moberwasserlechner,项目名称:vaadin-medium-editor,代码行数:38,代码来源:AddonDemoUI.java

示例11: 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);

    }
 
开发者ID:pontusbostrom,项目名称:VaadinGraphvizComponent,代码行数:35,代码来源:UMLDemoView.java

示例12: 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);
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:32,代码来源:ProcessDefinitionInfoComponent.java

示例13: init

import com.vaadin.ui.Panel; //导入方法依赖的package包/类
/**
 * Init method adds all Configuration Views to the list of Views.
 */
@PostConstruct
public void init() {
    if (defaultDistributionSetTypeLayout.getComponentCount() > 0) {
        configurationViews.add(defaultDistributionSetTypeLayout);
    }
    configurationViews.add(repositoryConfigurationView);

    configurationViews.add(authenticationConfigurationView);
    configurationViews.add(pollingConfigurationView);
    if (customConfigurationViews != null) {
        configurationViews.addAll(
                customConfigurationViews.stream().filter(ConfigurationGroup::show).collect(Collectors.toList()));
    }

    final Panel rootPanel = new Panel();
    rootPanel.setStyleName("tenantconfig-root");

    final VerticalLayout rootLayout = new VerticalLayout();
    rootLayout.setSizeFull();
    rootLayout.setMargin(true);
    rootLayout.setSpacing(true);

    configurationViews.forEach(rootLayout::addComponent);

    final HorizontalLayout buttonContent = saveConfigurationButtonsLayout();
    rootLayout.addComponent(buttonContent);
    rootLayout.setComponentAlignment(buttonContent, Alignment.BOTTOM_LEFT);
    rootPanel.setContent(rootLayout);
    setCompositionRoot(rootPanel);

    configurationViews.forEach(view -> view.addChangeListener(this));
}
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:36,代码来源:TenantConfigurationDashboardView.java

示例14: buildLayout

import com.vaadin.ui.Panel; //导入方法依赖的package包/类
private void buildLayout() {
    setSizeFull();
    setSpacing(true);
    setMargin(false);
    setStyleName("group");
    final VerticalLayout tableHeaderLayout = new VerticalLayout();
    tableHeaderLayout.setSizeFull();
    tableHeaderLayout.setSpacing(false);
    tableHeaderLayout.setMargin(false);

    tableHeaderLayout.setStyleName("table-layout");
    tableHeaderLayout.addComponent(tableHeader);

    tableHeaderLayout.setComponentAlignment(tableHeader, Alignment.TOP_CENTER);
    if (isShortCutKeysRequired()) {
        final Panel tablePanel = new Panel();
        tablePanel.setStyleName("table-panel");
        tablePanel.setHeight(100.0F, Unit.PERCENTAGE);
        tablePanel.setContent(table);
        tablePanel.addActionHandler(getShortCutKeysHandler());
        tablePanel.addStyleName(ValoTheme.PANEL_BORDERLESS);
        tableHeaderLayout.addComponent(tablePanel);
        tableHeaderLayout.setComponentAlignment(tablePanel, Alignment.TOP_CENTER);
        tableHeaderLayout.setExpandRatio(tablePanel, 1.0F);
    } else {
        tableHeaderLayout.addComponent(table);
        tableHeaderLayout.setComponentAlignment(table, Alignment.TOP_CENTER);
        tableHeaderLayout.setExpandRatio(table, 1.0F);
    }

    addComponent(tableHeaderLayout);
    addComponent(detailsLayout);
    setComponentAlignment(tableHeaderLayout, Alignment.TOP_CENTER);
    setComponentAlignment(detailsLayout, Alignment.TOP_CENTER);
    setExpandRatio(tableHeaderLayout, 1.0F);
}
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:37,代码来源:AbstractTableLayout.java

示例15: addChart

import com.vaadin.ui.Panel; //导入方法依赖的package包/类
/**
 * Adds the chart.
 *
 * @param content
 *            the content
 * @param caption
 *            the caption
 * @param chart
 *            the chart
 * @param fullPage
 *            the full page
 */
protected final void addChart(final AbstractOrderedLayout content,final String caption, final DCharts chart, final boolean fullPage) {
	final HorizontalLayout horizontalLayout = new HorizontalLayout();

	final int browserWindowWidth = getChartWindowWidth();

	final int browserWindowHeight = getChartWindowHeight(fullPage);

	horizontalLayout.setWidth(browserWindowWidth, Unit.PIXELS);
	horizontalLayout.setHeight(browserWindowHeight, Unit.PIXELS);
	horizontalLayout.setMargin(true);
	horizontalLayout.setSpacing(false);
	horizontalLayout.addStyleName("v-layout-content-overview-panel-level1");

	final Panel formPanel = new Panel();
	formPanel.setSizeFull();
	formPanel.setContent(horizontalLayout);
	formPanel.setCaption(caption);

	content.addComponent(formPanel);
	content.setExpandRatio(formPanel, ContentRatio.LARGE);


	chart.setWidth(100, Unit.PERCENTAGE);
	chart.setHeight(100, Unit.PERCENTAGE);
	chart.setMarginRight(CHART_RIGHT_MARGIN);
	chart.setMarginLeft(CHART_LEFT_MARGIN);
	chart.setMarginBottom(CHART_BOTTOM_MARGIN_SIZE);
	chart.setMarginTop(CHART_TOP_MARGIN_SIZE);

	horizontalLayout.addComponent(chart);
	chart.setCaption(caption);
}
 
开发者ID:Hack23,项目名称:cia,代码行数:45,代码来源:AbstractChartDataManagerImpl.java


注:本文中的com.vaadin.ui.Panel.setContent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。