當前位置: 首頁>>代碼示例>>Java>>正文


Java Panel類代碼示例

本文整理匯總了Java中com.vaadin.ui.Panel的典型用法代碼示例。如果您正苦於以下問題:Java Panel類的具體用法?Java Panel怎麽用?Java Panel使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Panel類屬於com.vaadin.ui包,在下文中一共展示了Panel類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: init

import com.vaadin.ui.Panel; //導入依賴的package包/類
@Override
protected void init(VaadinRequest request) {
	final VerticalLayout root = new VerticalLayout();
	root.setSizeFull();
	root.setMargin(true);
	root.setSpacing(true);
	setContent(root);
	MHorizontalLayout horizontalLayout = new MHorizontalLayout();
	for (MenuEntry menuEntry : menuEntries) {
		horizontalLayout.addComponent(new MButton(menuEntry.getName(), event -> {
			navigator.navigateTo(menuEntry.getNavigationTarget());
		}));
	}
	root.addComponent(horizontalLayout);
	springViewDisplay = new Panel();
	springViewDisplay.setSizeFull();
	root.addComponent(springViewDisplay);
	root.setExpandRatio(springViewDisplay, 1.0f);

}
 
開發者ID:dve,項目名稱:spring-boot-plugins-example,代碼行數:21,代碼來源:VaadinUI.java

示例2: init

import com.vaadin.ui.Panel; //導入依賴的package包/類
@Override
protected void init(VaadinRequest request) {
    final VerticalLayout rootLayout = new VerticalLayout();
    rootLayout.setSizeFull();
    setContent(rootLayout);

    final CssLayout navigationBar = new CssLayout();
    navigationBar.addStyleName(ValoTheme.LAYOUT_COMPONENT_GROUP);
    navigationBar.addComponent(createNavigationButton("Demo View (Default)",
            Constants.VIEW_DEFAULT));
    navigationBar.addComponent(createNavigationButton("Stream View",
            Constants.VIEW_STREAM));
    rootLayout.addComponent(navigationBar);

    springViewDisplay = new Panel();
    springViewDisplay.setSizeFull();
    
    rootLayout.addComponent(springViewDisplay);
    rootLayout.setExpandRatio(springViewDisplay, 1.0f);

}
 
開發者ID:MikeQin,項目名稱:spring-boot-vaadin-rabbitmq-pipeline-demo,代碼行數:22,代碼來源:NavigatorUI.java

示例3: getOptionTable

import com.vaadin.ui.Panel; //導入依賴的package包/類
@SuppressWarnings("serial")
protected Panel getOptionTable() {
    this.optionTable = new Table();
    this.optionTable.setPageLength(3);
    this.optionTable.setSizeFull();
    this.optionTable.setImmediate(true);
    this.optionTable.addGeneratedColumn("Enabled", new CheckBoxGenerator());
    this.optionTable.addContainerProperty("Name", String.class, null);
    this.optionTable.addItemClickListener(new ItemClickListener() {
        @Override
        public void itemClick(ItemClickEvent event) {
            optionTableClicked(event);
        }
    });

    this.optionPanel = new Panel();
    this.optionPanel.addStyleName(StyleConstants.FORM_PANEL);
    this.optionPanel.setWidth(100, Sizeable.Unit.PERCENTAGE);
    this.optionPanel.setContent(this.optionTable);

    return this.optionPanel;

}
 
開發者ID:opensecuritycontroller,項目名稱:osc-core,代碼行數:24,代碼來源:BaseDeploymentSpecWindow.java

示例4: 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

示例5: getAttributesPanel

import com.vaadin.ui.Panel; //導入依賴的package包/類
protected Panel getAttributesPanel() {

        this.sharedKey = new PasswordField();
        this.sharedKey.setRequiredError("shared secret key cannot be empty");
        this.sharedKey.setRequired(true);
        // best show/hide this conditionally based on Manager type.
        this.sharedKey.setValue("dummy1234");

        this.attributes = new Table();
        this.attributes.setPageLength(0);
        this.attributes.setSelectable(true);
        this.attributes.setSizeFull();
        this.attributes.setImmediate(true);

        this.attributes.addContainerProperty("Attribute Name", String.class, null);
        this.attributes.addContainerProperty("Value", PasswordField.class, null);
        this.attributes.addItem(new Object[] { "Shared Secret key", this.sharedKey }, new Integer(1));
        // creating panel to store attributes table
        this.attributePanel = new Panel("Common Appliance Configuration Attributes:");
        this.attributePanel.addStyleName("form_Panel");
        this.attributePanel.setWidth(100, Sizeable.Unit.PERCENTAGE);
        this.attributePanel.setContent(this.attributes);

        return this.attributePanel;
    }
 
開發者ID:opensecuritycontroller,項目名稱:osc-core,代碼行數:26,代碼來源:BaseDAWindow.java

示例6: init

import com.vaadin.ui.Panel; //導入依賴的package包/類
@Override
protected void init(VaadinRequest request) {
	log.info("Levanto la pagina UI");
	
	final VerticalLayout root = new VerticalLayout();
       root.setSizeFull();
       root.setMargin(true);
       root.setSpacing(true);
       setContent(root);
	
       final Panel viewContainer = new Panel();
       viewContainer.setSizeFull();
       root.addComponent(viewContainer);
       root.setExpandRatio(viewContainer, 1.0f);
       
       Navigator navigator = new Navigator(this, viewContainer);
       //Navigator navigator = new Navigator(this, this);
       navigator.addProvider(viewProvider);
       
       log.info("Termina de levantar la pagina UI");

}
 
開發者ID:damiancom,項目名稱:garantia,代碼行數:23,代碼來源:LoginUI.java

示例7: FlowViewPanel

import com.vaadin.ui.Panel; //導入依賴的package包/類
public FlowViewPanel(FlowDTO flowDTO,
                     ConditionWidgetRepository conditionWidgetRepository,
                     ActionWidgetRepository actionWidgetRepository) {
  this.flowDTO = flowDTO;
  this.innerPanel = new Panel(flowDTO.getName());
  this.conditionWidgetRepository = conditionWidgetRepository;
  this.actionWidgetRepository = actionWidgetRepository;

  StackPanel stackPanel = StackPanel.extend(innerPanel);
  stackPanel.setToggleIconsEnabled(false);
  stackPanel.close();

  innerPanel.setContent(getPanelGrid());

  setCompositionRoot(innerPanel);
}
 
開發者ID:daergoth,項目名稱:HomeWire-Server,代碼行數:17,代碼來源:FlowViewPanel.java

示例8: ConditionPanel

import com.vaadin.ui.Panel; //導入依賴的package包/類
public ConditionPanel(ConditionDTO conditionDTO,
                      ConditionWidgetRepository conditionWidgetRepository,
                      Consumer<ConditionDTO> changeListener) {
  this.conditionWidgetRepository = conditionWidgetRepository;
  this.conditionDTO = conditionDTO;

  this.mainPanel = new Panel("Condition");
  this.mainTypeComboBox = new ComboBox("Type");

  this.currentConditionWidget = conditionWidgetRepository
      .getFactory(TypeViewDTO.ConditionTypes.ofConditionDto(conditionDTO))
      .createWidget(conditionDTO);
  currentConditionWidget.setChangeListener(changeListener);

  this.changeListener = changeListener;

  setupPanel();

  setCompositionRoot(mainPanel);
  setSizeUndefined();
}
 
開發者ID:daergoth,項目名稱:HomeWire-Server,代碼行數:22,代碼來源:ConditionPanel.java

示例9: ActionPanel

import com.vaadin.ui.Panel; //導入依賴的package包/類
public ActionPanel(ActionDTO actionDTO,
                   ActionWidgetRepository actionWidgetRepository,
                   Consumer<ActionDTO> changeListener) {
  this.actionWidgetRepository = actionWidgetRepository;
  this.actionDTO = actionDTO;

  this.mainPanel = new Panel("Action");
  this.mainTypeComboBox = new ComboBox("Type");

  this.currentActionWidget = actionWidgetRepository
      .getFactory(TypeViewDTO.ActionTypes.ofActionDto(actionDTO))
      .createWidget(actionDTO);
  currentActionWidget.setChangeListener(changeListener);

  this.changeListener = changeListener;

  setupPanel();

  setCompositionRoot(mainPanel);
  setSizeUndefined();
}
 
開發者ID:daergoth,項目名稱:HomeWire-Server,代碼行數:22,代碼來源:ActionPanel.java

示例10: createSensorList

import com.vaadin.ui.Panel; //導入依賴的package包/類
private Component createSensorList() {
  VerticalLayout listLayout = new VerticalLayout();
  //listLayout.setWidth(25, Unit.PERCENTAGE);

  deviceSetupService.getSensorDtosGroupedByType().forEach((groupName, sensorDTOS) -> {
    VerticalLayout sensorList = new VerticalLayout();

    sensorDTOS.forEach(sensorDTO -> {
      CheckBox c = new CheckBox(sensorDTO.getName());

      c.addValueChangeListener(event -> {
        updateChart(sensorDTO.getType() + sensorDTO.getDevId(),
            (Boolean) event.getProperty().getValue());
      });

      sensorList.addComponent(c);
    });

    Panel typePanel = new Panel(groupName.substring(0, 1).toUpperCase() + groupName.substring(1));
    typePanel.setContent(sensorList);
    listLayout.addComponent(typePanel);
  });

  return listLayout;
}
 
開發者ID:daergoth,項目名稱:HomeWire-Server,代碼行數:26,代碼來源:StatisticView.java

示例11: MovieDetailsWindow

import com.vaadin.ui.Panel; //導入依賴的package包/類
private MovieDetailsWindow(final Movie movie, final Date startTime,
        final Date endTime) {
    addStyleName("moviedetailswindow");
    Responsive.makeResponsive(this);

    setCaption(movie.getTitle());
    center();
    setCloseShortcut(KeyCode.ESCAPE, null);
    setResizable(false);
    setClosable(false);
    setHeight(90.0f, Unit.PERCENTAGE);

    VerticalLayout content = new VerticalLayout();
    content.setSizeFull();
    setContent(content);

    Panel detailsWrapper = new Panel(buildMovieDetails(movie, startTime,
            endTime));
    detailsWrapper.setSizeFull();
    detailsWrapper.addStyleName(ValoTheme.PANEL_BORDERLESS);
    detailsWrapper.addStyleName("scroll-divider");
    content.addComponent(detailsWrapper);
    content.setExpandRatio(detailsWrapper, 1f);

    content.addComponent(buildFooter());
}
 
開發者ID:mcollovati,項目名稱:vaadin-vertx-samples,代碼行數:27,代碼來源:MovieDetailsWindow.java

示例12: ImageSelector

import com.vaadin.ui.Panel; //導入依賴的package包/類
public ImageSelector() {
    images = new LinkedList<DSImage>();
    visibleImages = new HashMap<Integer, Image>();
    loadedImages = new LinkedList<Image>();

    mainPanel = new Panel();
    imageLayout = new HorizontalLayout();
    layout = new HorizontalLayout();

    imageMaxWidth = 110;
    imageMaxHeight = 110;

    leftButton = new Button("<", e -> scrollLeft());
    rightButton = new Button(">", e -> scrollRight());
    leftButton.setEnabled(false);
    rightButton.setEnabled(false);
}
 
開發者ID:viydaag,項目名稱:dungeonstory-java,代碼行數:18,代碼來源:ImageSelector.java

示例13: MultiColumnFormLayout

import com.vaadin.ui.Panel; //導入依賴的package包/類
public MultiColumnFormLayout(int columns, String caption) {
    if (columns < 1) {
        throw new IllegalArgumentException("column number must be greater than 1");
    }
    hLayout = new HorizontalLayout();
    hLayout.setWidth(100, Unit.PERCENTAGE);
    for (int i = 0; i < columns; i++) {
        FormLayout form = new FormLayout();
        hLayout.addComponent(form, i);
    }
    
    if (caption != null) {
        hLayout.setMargin(new MarginInfo(false, true));
        Panel panel = new Panel(caption, hLayout);
        setCompositionRoot(panel);
    } else {
        setCompositionRoot(hLayout);
    }
    
}
 
開發者ID:viydaag,項目名稱:dungeonstory-java,代碼行數:21,代碼來源:MultiColumnFormLayout.java

示例14: 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

示例15: initLayout

import com.vaadin.ui.Panel; //導入依賴的package包/類
private void initLayout() {
	final VerticalLayout root = new VerticalLayout();
	root.setSizeFull();
	root.setMargin(true);
	root.setSpacing(true);
	setContent(root);

	final CssLayout navigationBar = new CssLayout();
	navigationBar.addStyleName(ValoTheme.LAYOUT_COMPONENT_GROUP);

	navigationBar.addComponent(createNavigationButton("Default View",
               DefaultView.VIEW_NAME));		
       navigationBar.addComponent(createNavigationButton("MongoDB View",
               MongoDBUIView.VIEW_NAME));
       navigationBar.addComponent(createNavigationButton("Combobox Example View",
               CityComboboxView.VIEW_NAME));
       
	root.addComponent(navigationBar);

	springViewDisplay = new Panel();
       springViewDisplay.setSizeFull();
       root.addComponent(springViewDisplay);
       root.setExpandRatio(springViewDisplay, 1.0f);

}
 
開發者ID:theMightyFly,項目名稱:demo-spring-vaadin,代碼行數:26,代碼來源:MyVaadinUI.java


注:本文中的com.vaadin.ui.Panel類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。