Java 类com.vaadin.ui.GridLayout 实例源码

项目:hawkbit    文件:AddUpdateRolloutWindowLayout.java   
private GridLayout createSimpleGroupDefinitionTab() {
    final GridLayout layout = new GridLayout();
    layout.setSpacing(true);
    layout.setColumns(3);
    layout.setRows(4);
    layout.setStyleName("marginTop");

    layout.addComponent(getLabel("caption.rollout.generate.groups"), 0, 0, 2, 0);

    layout.addComponent(getMandatoryLabel("prompt.number.of.groups"), 0, 1);
    layout.addComponent(noOfGroups, 1, 1);
    noOfGroups.addValidator(nullValidator);
    layout.addComponent(groupSizeLabel, 2, 1);

    layout.addComponent(getMandatoryLabel("prompt.tigger.threshold"), 0, 2);
    layout.addComponent(triggerThreshold, 1, 2);
    triggerThreshold.addValidator(nullValidator);
    layout.addComponent(getPercentHintLabel(), 2, 2);

    layout.addComponent(getMandatoryLabel("prompt.error.threshold"), 0, 3);
    layout.addComponent(errorThreshold, 1, 3);
    errorThreshold.addValidator(nullValidator);
    layout.addComponent(errorThresholdOptionGroup, 2, 3);

    return layout;
}
项目:konekti    文件:CalendarCardView.java   
private HorizontalSplitPanel buildHorizontalSplitPanel() {
    // common part: create layout
    horizontalSplitPanel = new HorizontalSplitPanel();
    horizontalSplitPanel.setImmediate(false);
    horizontalSplitPanel.setWidth("100.0%");
    horizontalSplitPanel.setHeight("100.0%");
    horizontalSplitPanel.setMargin(false);

    // gridLayout_1
    gridLayoutCalendar = new GridLayout();
    gridLayoutCalendar.setImmediate(true);
    gridLayoutCalendar.setWidth("100.0%");
    gridLayoutCalendar.setHeight("100.0%");
    gridLayoutCalendar.setMargin(false);
    gridLayoutCalendar.setColumns(4);
    gridLayoutCalendar.setRows(3);
    horizontalSplitPanel.setSecondComponent(gridLayoutCalendar);

    return horizontalSplitPanel;
}
项目:HomeWire-Server    文件:FlowViewPanel.java   
private void generateConditionList(GridLayout panelGrid) {
  VerticalLayout conditionsVerticalLayout = new VerticalLayout();
  conditionsVerticalLayout.setSizeUndefined();

  flowDTO.getConditionList().forEach(
      conditionDTO -> conditionsVerticalLayout
          .addComponent(new ConditionPanel(conditionDTO, conditionWidgetRepository,
              condDto -> {
                if (condDto == null) {
                  flowDTO.removeCondition(conditionDTO);
                  generateConditionList(panelGrid);
                }

                saveIfPossible();
              }
          )));

  panelGrid.removeComponent(0, 3);
  panelGrid.addComponent(conditionsVerticalLayout, 0, 3);
}
项目:HomeWire-Server    文件:FlowViewPanel.java   
private void generateActionList(GridLayout panelGrid) {
  VerticalLayout actionsVerticalLayout = new VerticalLayout();
  actionsVerticalLayout.setSizeUndefined();

  flowDTO.getActionList().forEach(actionDTO -> actionsVerticalLayout.addComponent(
      new ActionPanel(actionDTO, actionWidgetRepository, actDto -> {
        if (actDto == null) {
          flowDTO.removeAction(actionDTO);
          generateActionList(panelGrid);
        }

        saveIfPossible();
      })));

  panelGrid.removeComponent(1, 3);
  panelGrid.addComponent(actionsVerticalLayout, 1, 3);
}
项目:businesshorizon2    文件:DescriptionViewImpl.java   
private VerticalLayout getEingabeMethodeInfo () {
        VerticalLayout vl = new VerticalLayout();
        headline0 = new Label ("<h1>Eingabemethode</h1>");
        headline0.setContentMode(Label.CONTENT_XHTML);
        headline1 = new Label ("<h2>Methode zur Berechnung des Unternehmenswertes</h2>");
        headline1.setContentMode(Label.CONTENT_XHTML);

        gl = new GridLayout (2,6);
        gl.setSizeFull();
        gl.setColumnExpandRatio(1,  1.0f);

        gl.addComponent(iconFCF, 0, 0);
        gl.setComponentAlignment(iconFCF, Alignment.MIDDLE_CENTER);
        gl.addComponent(fcfHeadline, 1, 0);
        gl.addComponent(fcfText, 1, 1);

//      gl.addComponent(iconUKV, 0, 2);
//      gl.setComponentAlignment(iconUKV, Alignment.MIDDLE_CENTER);
//      gl.addComponent(ukvHeadline, 1, 2);
//      gl.addComponent(ukvText, 1, 3);
//      
//      gl.addComponent(iconGKV, 0 , 4);
//      gl.setComponentAlignment(iconGKV, Alignment.MIDDLE_CENTER);
//      gl.addComponent(gkvHeadline, 1, 4);
//      gl.addComponent(gkvText, 1, 5);

        vl.addComponent(headline0);
        vl.addComponent(headline1);
        vl.addComponent(gl);

        return vl;
    }
项目:businesshorizon2    文件:MoreScenarioResultViewImpl.java   
public void createLayout() {
    logger.debug ("createLayout");

    grid = new GridLayout(2, 4);
    planningLabel = new Label("Planungsprämissen:");
    companyValueLabel = new Label("Unternehmenswert:");
    planningLayout = new GridLayout();
    companyValue = new Label("30.000.000€");

    grid.setSizeFull();
    grid.setColumnExpandRatio(1, 5);

    grid.addComponent(planningLabel, 0, 0);
    grid.addComponent(planningLayout, 1, 0);
    grid.addComponent(companyValueLabel, 0, 1);
    grid.addComponent(companyValue, 1, 1);

    addComponent(grid);

}
项目:hawkbit    文件:AbstractCreateUpdateTagLayout.java   
protected void buildLayout() {

        mainLayout = new GridLayout(3, 2);
        mainLayout.setSpacing(true);
        comboLayout = new VerticalLayout();
        colorPickerLayout = new ColorPickerLayout();
        ColorPickerHelper.setRgbSliderValues(colorPickerLayout);
        contentLayout = new VerticalLayout();

        final HorizontalLayout colorLabelLayout = new HorizontalLayout();
        colorLabelLayout.setMargin(false);
        colorLabelLayout.addComponents(colorLabel, tagColorPreviewBtn);

        formLayout.addComponent(optiongroup);
        formLayout.addComponent(comboLayout);
        formLayout.addComponent(tagName);
        formLayout.addComponent(tagDesc);
        formLayout.addStyleName("form-lastrow");
        formLayout.setSizeFull();

        contentLayout.addComponent(formLayout);
        contentLayout.addComponent(colorLabelLayout);
        contentLayout.setComponentAlignment(formLayout, Alignment.MIDDLE_CENTER);
        contentLayout.setComponentAlignment(colorLabelLayout, Alignment.MIDDLE_LEFT);
        contentLayout.setSizeUndefined();

        mainLayout.setSizeFull();
        mainLayout.addComponent(contentLayout, 0, 0);

        colorPickerLayout.setVisible(false);
        mainLayout.addComponent(colorPickerLayout, 1, 0);
        mainLayout.setComponentAlignment(colorPickerLayout, Alignment.MIDDLE_CENTER);

        setCompositionRoot(mainLayout);
        tagName.focus();
    }
项目:hawkbit    文件:UploadArtifactView.java   
private GridLayout createMainLayout() {
    createDetailsAndUploadLayout();
    createUploadButtonLayout();
    mainLayout = new GridLayout(3, 2);
    mainLayout.setSizeFull();
    mainLayout.setSpacing(true);
    mainLayout.addComponent(filterByTypeLayout, 0, 0);
    mainLayout.addComponent(smTableLayout, 1, 0);
    mainLayout.addComponent(detailAndUploadLayout, 2, 0);
    mainLayout.addComponent(deleteActionsLayout, 1, 1);
    mainLayout.addComponent(uplaodButtonsLayout, 2, 1);
    mainLayout.setRowExpandRatio(0, 1.0F);
    mainLayout.setColumnExpandRatio(1, 0.5F);
    mainLayout.setColumnExpandRatio(2, 0.5F);
    mainLayout.setComponentAlignment(deleteActionsLayout, Alignment.BOTTOM_CENTER);
    mainLayout.setComponentAlignment(uplaodButtonsLayout, Alignment.BOTTOM_CENTER);
    return mainLayout;
}
项目:SecureBPMN    文件:ChangePasswordPopupWindow.java   
protected void initPasswordFields() {
  inputGrid = new GridLayout(2, 2);
  inputGrid.setSpacing(true);
  layout.addComponent(inputGrid);
  layout.setComponentAlignment(inputGrid, Alignment.MIDDLE_CENTER);

  Label newPasswordLabel = new Label(i18nManager.getMessage(Messages.PROFILE_NEW_PASSWORD));
  inputGrid.addComponent(newPasswordLabel);
  passwordField1 = new PasswordField();
  passwordField1.setWidth(150, UNITS_PIXELS);
  inputGrid.addComponent(passwordField1);
  passwordField1.focus();

  Label confirmPasswordLabel = new Label(i18nManager.getMessage(Messages.PROFILE_CONFIRM_PASSWORD));
  inputGrid.addComponent(confirmPasswordLabel);
  passwordField2 = new PasswordField();
  passwordField2.setWidth(150, UNITS_PIXELS);
  inputGrid.addComponent(passwordField2);
}
项目:SecureBPMN    文件:ConfirmationDialogPopupWindow.java   
public ConfirmationDialogPopupWindow(String title, String description) {
  setWidth(400, UNITS_PIXELS);
  setModal(true);
  setResizable(false);

  addStyleName(Reindeer.PANEL_LIGHT);

  layout = new GridLayout(2,2);
  layout.setMargin(true);
  layout.setSpacing(true);
  layout.setSizeFull();

  setContent(layout);

  I18nManager i18nManager = ExplorerApp.get().getI18nManager();
  if(title != null) {
    setCaption(title);
  } else {
    setCaption(i18nManager.getMessage(Messages.CONFIRMATION_DIALOG_DEFAULT_TITLE));
  }

  initLabel(description);
  initButtons(i18nManager);
}
项目:SecureBPMN    文件:TaskEventsPanel.java   
protected void addTaskEventText(final org.activiti.engine.task.Event taskEvent, final GridLayout eventGrid) {
  VerticalLayout layout = new VerticalLayout();
  layout.addStyleName(ExplorerLayout.STYLE_TASK_EVENT);
  layout.setWidth("100%");
  eventGrid.addComponent(layout);

  // Actual text
  Label text = taskEventTextResolver.resolveText(taskEvent);
  text.setWidth("100%");
  layout.addComponent(text);

  // Time
  Label time = new Label(new HumanTime(i18nManager).format(taskEvent.getTime()));
  time.setSizeUndefined();
  time.addStyleName(ExplorerLayout.STYLE_TASK_EVENT_TIME);
  layout.addComponent(time);

}
项目:Plugins    文件:PropertyNamedCell.java   
public PropertyNamedCell(GridLayout propertiesLayout) {
    this.txtName = new TextField();
    this.txtName.setWidth("100%");
    this.txtName.setNullSettingAllowed(false);
    propertiesLayout.addComponent(this.txtName);

    this.txtColumn = new TextField();
    this.txtColumn.setWidth("100%");
    this.txtColumn.setNullSettingAllowed(false);
    propertiesLayout.addComponent(this.txtColumn);

    this.txtRow = new TextField();
    this.txtRow.setWidth("100%");
    this.txtRow.setNullSettingAllowed(false);
    propertiesLayout.addComponent(this.txtRow);
}
项目:abstractform    文件:VaadinFormToolkit.java   
private AbstractComponentContainer buildSubForm(SubForm subForm, Map<String, AbstractComponent> mapComponents,
        List<String> fieldIdList, Map<String, Object> extraObjects) {
    //panel.setCaption(formEditor.getName());
    GridLayout layout = new GridLayout(subForm.getColumns(), subForm.getRows());
    layout.setWidth("100%");
    layout.setSpacing(true);
    for (int row = 0; row < subForm.getRows(); row++) {
        for (int column = 0; column < subForm.getColumns(); column++) {
            Component component = subForm.getField(row, column);
            if (component == null) {
                layout.addComponent(new Label("&nbsp;", Label.CONTENT_XHTML));
            } else if (component instanceof Field) {
                Field editor = (Field) component;
                if (editor != null) {
                    layout.addComponent(buildField(editor, mapComponents, fieldIdList, extraObjects));
                }
            } else {
                buildComponent(component, mapComponents, fieldIdList, extraObjects);
            }
        }
    }
    return layout;
}
项目:vaadinInvoiceGenerator    文件:InvoiceRowPanel.java   
private void setLayout() {
    VerticalLayout mainLayout = new VerticalLayout();
    GridLayout buttonsAndTotalLayout = new GridLayout(3,1);
    HorizontalLayout buttonsLayout = new HorizontalLayout();
    VerticalLayout secondLayout = new VerticalLayout();
    HorizontalLayout totalLayout = new HorizontalLayout();
    mainLayout.addComponent(createTable());
    buttonsLayout.addComponent(addRowButton);
    buttonsLayout.addComponent(editButton);
    secondLayout.setSizeFull();
    totalLayout.setSizeFull();
    totalLayout.addComponent(createTotal());

    buttonsAndTotalLayout.setHeight(100, Unit.PIXELS);
    buttonsAndTotalLayout.addComponent(buttonsLayout, 0, 0);
    buttonsAndTotalLayout.setComponentAlignment(buttonsLayout, Alignment.TOP_LEFT);
    buttonsAndTotalLayout.addComponent(totalLayout,2,0);
    buttonsAndTotalLayout.setComponentAlignment(totalLayout, Alignment.MIDDLE_RIGHT);
    buttonsLayout.setMargin(true);
    buttonsAndTotalLayout.setSizeFull();
    mainLayout.addComponent(buttonsAndTotalLayout);
    setContent(mainLayout);
    mainLayout.setSizeFull();
    mainLayout.setSpacing(true);

}
项目:ilves    文件:AuditLogEntryFlowlet.java   
@Override
public void initialize() {
    entityManager = getSite().getSiteContext().getObject(EntityManager.class);

    final GridLayout gridLayout = new GridLayout(1, 2);
    gridLayout.setSizeFull();
    gridLayout.setMargin(false);
    gridLayout.setSpacing(true);
    gridLayout.setRowExpandRatio(1, 1f);
    setViewContent(gridLayout);

    auditLogEntryEditor = new ValidatingEditor(FieldSetDescriptorRegister.getFieldSetDescriptor(
            AuditLogEntry.class).getFieldDescriptors());
    auditLogEntryEditor.setReadOnly(true);
    auditLogEntryEditor.setCaption("AuditLogEntry");
    auditLogEntryEditor.addListener(this);
    gridLayout.addComponent(auditLogEntryEditor, 0, 0);

    final HorizontalLayout buttonLayout = new HorizontalLayout();
    buttonLayout.setSpacing(true);
    gridLayout.addComponent(buttonLayout, 0, 1);

}
项目:xaadin    文件:GridLayoutElementFactoryTest.java   
@Test
public void testAddComponentToParentFixedColumns() throws Exception {
    GridLayout layout = new GridLayout();
    layout.setColumns(2);

    VisualTreeNode node = new VisualTreeNodeImpl(layout);

    Button b1 = new Button();
    Button b2 = new Button();
    Button b3 = new Button();
    factory.addComponentToParent(node, new VisualTreeNodeImpl(b1));
    factory.addComponentToParent(node, new VisualTreeNodeImpl(b2));
    factory.addComponentToParent(node, new VisualTreeNodeImpl(b3));
    assertThat(layout.getComponent(0, 0)).isSameAs(b1);
    assertThat(layout.getComponent(1, 0)).isSameAs(b2);
    assertThat(layout.getComponent(0, 1)).isSameAs(b3);
}
项目:xaadin    文件:GridLayoutElementFactoryTest.java   
@Test
  public void testAddComponentToParentColspan() throws Exception {
      GridLayout layout = new GridLayout();
      layout.setColumns(2);

      VisualTreeNode node = new VisualTreeNodeImpl(layout);

      Button b1 = new Button();
      VisualTreeNode b1node = new VisualTreeNodeImpl(b1);
b1node.setAdditionalParameter("grid.columnSpan", "2");
Button b2 = new Button();
      Button b3 = new Button();
      factory.addComponentToParent(node, b1node);
      factory.addComponentToParent(node, new VisualTreeNodeImpl(b2));
      factory.addComponentToParent(node, new VisualTreeNodeImpl(b3));
      assertThat(layout.getComponent(0, 0)).isSameAs(b1);
      assertThat(layout.getComponent(1, 0)).isSameAs(b1);
      assertThat(layout.getComponent(0, 1)).isSameAs(b2);
      assertThat(layout.getComponent(1, 1)).isSameAs(b3);
  }
项目:xaadin    文件:GridLayoutElementFactoryTest.java   
@Test
  @Ignore("TODO we need to fix this matter somehow... needs more thinking")
  public void testAddComponentToParentRowspan() throws Exception {
      GridLayout layout = new GridLayout();
      layout.setColumns(2);

      VisualTreeNode node = new VisualTreeNodeImpl(layout);

      Button b1 = new Button();
      VisualTreeNode b1node = new VisualTreeNodeImpl(b1);
b1node.setAdditionalParameter("grid.rowSpan", "2");
Button b2 = new Button();
      Button b3 = new Button();
      factory.addComponentToParent(node, b1node);
      factory.addComponentToParent(node, new VisualTreeNodeImpl(b2));
      factory.addComponentToParent(node, new VisualTreeNodeImpl(b3));
      assertThat(layout.getComponent(0, 0)).isSameAs(b1);
      assertThat(layout.getComponent(0, 1)).isSameAs(b1);
      assertThat(layout.getComponent(1, 0)).isSameAs(b2);
      assertThat(layout.getComponent(1, 1)).isSameAs(b3);
  }
项目:xaadin    文件:GridLayoutElementFactoryTest.java   
@Test
  public void testAddComponentToParentFixedItemPlaces() throws Exception {
      GridLayout layout = new GridLayout();
      VisualTreeNode node = new VisualTreeNodeImpl(layout);
      Button b1 = new Button();
      VisualTreeNode b1node = new VisualTreeNodeImpl(b1);
b1node.setAdditionalParameter("grid.row", "1");
b1node.setAdditionalParameter("grid.column", "1");
Button b2 = new Button();
      VisualTreeNode b2node = new VisualTreeNodeImpl(b2);
b2node.setAdditionalParameter("grid.row", "2");
b2node.setAdditionalParameter("grid.column", "2");
Button b3 = new Button();
      VisualTreeNode b3node = new VisualTreeNodeImpl(b3);
b3node.setAdditionalParameter("grid.row", "5");
b3node.setAdditionalParameter("grid.column", "3");
factory.addComponentToParent(node, b1node);
      factory.addComponentToParent(node, b2node);
      factory.addComponentToParent(node, b3node);
      assertThat(layout.getRows()).isEqualTo(6);
      assertThat(layout.getColumns()).isEqualTo(4);
      assertThat(layout.getComponent(1, 1)).isSameAs(b1);
      assertThat(layout.getComponent(2, 2)).isSameAs(b2);
      assertThat(layout.getComponent(3, 5)).isSameAs(b3);
  }
项目:FiWare-Template-Handler    文件:ChangePasswordPopupWindow.java   
protected void initPasswordFields() {
  inputGrid = new GridLayout(2, 2);
  inputGrid.setSpacing(true);
  layout.addComponent(inputGrid);
  layout.setComponentAlignment(inputGrid, Alignment.MIDDLE_CENTER);

  Label newPasswordLabel = new Label(i18nManager.getMessage(Messages.PROFILE_NEW_PASSWORD));
  inputGrid.addComponent(newPasswordLabel);
  passwordField1 = new PasswordField();
  passwordField1.setWidth(150, UNITS_PIXELS);
  inputGrid.addComponent(passwordField1);
  passwordField1.focus();

  Label confirmPasswordLabel = new Label(i18nManager.getMessage(Messages.PROFILE_CONFIRM_PASSWORD));
  inputGrid.addComponent(confirmPasswordLabel);
  passwordField2 = new PasswordField();
  passwordField2.setWidth(150, UNITS_PIXELS);
  inputGrid.addComponent(passwordField2);
}
项目:FiWare-Template-Handler    文件:ConfirmationDialogPopupWindow.java   
public ConfirmationDialogPopupWindow(String title, String description) {
  setWidth(400, UNITS_PIXELS);
  setModal(true);
  setResizable(false);

  addStyleName(Reindeer.PANEL_LIGHT);

  layout = new GridLayout(2,2);
  layout.setMargin(true);
  layout.setSpacing(true);
  layout.setSizeFull();

  setContent(layout);

  I18nManager i18nManager = ExplorerApp.get().getI18nManager();
  if(title != null) {
    setCaption(title);
  } else {
    setCaption(i18nManager.getMessage(Messages.CONFIRMATION_DIALOG_DEFAULT_TITLE));
  }

  initLabel(description);
  initButtons(i18nManager);
}
项目:FiWare-Template-Handler    文件:TaskEventsPanel.java   
protected void addTaskEventText(final org.activiti.engine.task.Event taskEvent, final GridLayout eventGrid) {
  VerticalLayout layout = new VerticalLayout();
  layout.addStyleName(ExplorerLayout.STYLE_TASK_EVENT);
  layout.setWidth("100%");
  eventGrid.addComponent(layout);

  // Actual text
  Label text = taskEventTextResolver.resolveText(taskEvent);
  text.setWidth("100%");
  layout.addComponent(text);

  // Time
  Label time = new Label(new HumanTime(i18nManager).format(taskEvent.getTime()));
  time.setSizeUndefined();
  time.addStyleName(ExplorerLayout.STYLE_TASK_EVENT_TIME);
  layout.addComponent(time);

}
项目:mvpcalculator    文件:CalculatorViewImpl.java   
@Override
public void enter(ViewChangeEvent event) {
    GridLayout layout  = new GridLayout(4, 6);

    // Create a result label that spans over all
    // the 4 columns in the first row
    layout.addComponent(display, 0, 0, 3, 0);

    // The operations for the calculator in the order
    // they appear on the screen (left to right, top
    // to bottom)
    String[] operations = new String[] {
        "7", "8", "9", "/", "4", "5", "6",
        "*", "1", "2", "3", "-", "0", "=", "C", "+" };

    // Add buttons and have them send click events
    // to this class
    for (String caption: operations)
        layout.addComponent(new Button(caption, this));

    Button button = new Button("Go To OtherView");
    button.addClickListener(this);
    layout.addComponent(button,0,5,3,5);
    setCompositionRoot(layout);

}
项目:hypothesis    文件:SlideContainerFactoryImpl.java   
private void addContainerComponents(SingleComponentContainer container, List<Element> elements,
        SlideContainerPresenter presenter) {
    elements.stream().map(m -> createComponentFromElement(m, presenter)).filter(Objects::nonNull).forEach(e -> {
        Component component = e.getComponent();

        if (elements.size() == 1 && component instanceof Layout) {
            container.setContent((Layout) component);
        } else {
            GridLayout gridLayout = new GridLayout(1, 1);
            gridLayout.setSizeFull();
            container.setContent(gridLayout);
            gridLayout.addComponent(component);
            gridLayout.setComponentAlignment(component, e.getAlignment());
        }
    });
}
项目:vaadin-diagram    文件:Toolbar.java   
public Toolbar(int columns, final int rows) {
    super("Tools");
    setModal(false);
    setClosable(false);
    setResizable(false);
    setDraggable(true);
    addStyleName("diagram-toolbar");

    this.columns = columns;
    this.rows = rows;

    this.layout = new GridLayout(this.columns, 1);
    layout.setSizeFull();
    layout.setDefaultComponentAlignment(Alignment.MIDDLE_CENTER);
    setContent(layout);
    setImageLength(IMAGE_LENGTH);

}
项目:VaadinUtils    文件:OrderingListSelect.java   
public OrderingListSelect(String caption)
{
    final GridLayout layout = new GridLayout(2, 1);
    listSelect = new ListSelect();
    final VerticalLayout buttonLayout = new VerticalLayout();
    buttonLayout.setSpacing(true);
    layout.addComponent(listSelect, 0, 0);
    layout.addComponent(buttonLayout, 1, 0);
    layout.setComponentAlignment(buttonLayout, Alignment.MIDDLE_CENTER);
    upButton = new Button("▲");
    downButton = new Button("▼");
    buttonLayout.addComponent(upButton);
    buttonLayout.addComponent(downButton);
    setButtonClickListeners();

    listSelect.setCaption(caption);

    setCompositionRoot(layout);
}
项目:md-stepper    文件:VerticalStepper.java   
private RowLayout(Step step) {
  this.step = step;

  label = getLabelProvider().getStepLabel(step);

  divider = new CssLayout();
  divider.addStyleName(STYLE_DIVIDER);
  divider.setHeight(100, Unit.PERCENTAGE);

  contentContainer = new Panel();
  contentContainer.addStyleName(STYLE_CONTENT_CONTAINER);
  contentContainer.addStyleName(ValoTheme.PANEL_BORDERLESS);
  contentContainer.setSizeFull();

  buttonBar = new HorizontalLayout();
  buttonBar.addStyleName(STYLE_BUTTON_BAR);
  buttonBar.setMargin(false);
  buttonBar.setSpacing(true);
  buttonBar.setWidth(100, Unit.PERCENTAGE);
  buttonBar.setMargin(new MarginInfo(false, false, !isLastStep(step), false));

  rootLayout = new GridLayout(2, 3);
  rootLayout.setSizeFull();
  rootLayout.setMargin(false);
  rootLayout.setSpacing(false);
  rootLayout.setColumnExpandRatio(1, 1);
  rootLayout.setRowExpandRatio(1, 1);
  rootLayout.addComponent(label, 0, 0, 1, 0);
  rootLayout.addComponent(divider, 0, 1, 0, 2);
  rootLayout.addComponent(contentContainer, 1, 1, 1, 1);
  rootLayout.addComponent(buttonBar, 1, 2, 1, 2);

  setCompositionRoot(rootLayout);
  addStyleName(STYLE_COMPONENT);
  setWidth(100, Unit.PERCENTAGE);
  setActive(false);
}
项目:md-stepper    文件:DemoUI.java   
private GridLayout getRootLayout() {
  GridLayout layout = new GridLayout(3, 2);
  layout.setDefaultComponentAlignment(Alignment.TOP_LEFT);
  layout.setMargin(new MarginInfo(false, true, true, true));
  layout.setSpacing(true);
  layout.setSizeFull();
  layout.setRowExpandRatio(1, 1);
  layout.setColumnExpandRatio(2, 1);
  return layout;
}
项目:HomeWire-Server    文件:ConditionPanel.java   
private void setupPanel() {
  mainPanel.setSizeUndefined();

  GridLayout mainGridLayout = new GridLayout(2, 1);

  mainTypeComboBox.setContainerDataSource(new BeanItemContainer<>(
      TypeViewDTO.ConditionTypes.class,
      Arrays.asList(TypeViewDTO.ConditionTypes.values())
  ));
  mainTypeComboBox.setNullSelectionAllowed(false);
  mainTypeComboBox.select(TypeViewDTO.ConditionTypes.ofConditionDto(conditionDTO));
  mainTypeComboBox.addValueChangeListener(event -> {
    TypeViewDTO.ConditionTypes selected =
        (TypeViewDTO.ConditionTypes) event.getProperty().getValue();

    currentConditionWidget = conditionWidgetRepository
        .getFactory(selected)
        .createWidget(conditionDTO);
    currentConditionWidget.setChangeListener(changeListener);

    mainGridLayout.removeComponent(1, 0);
    mainGridLayout.addComponent(currentConditionWidget, 1, 0);
  });

  Button deleteButton = new Button("Delete", event -> {
    changeListener.accept(null);
  });

  mainGridLayout.addComponent(new VerticalLayout(mainTypeComboBox, deleteButton), 0, 0);

  mainGridLayout.addComponent(currentConditionWidget, 1, 0);

  mainPanel.setContent(mainGridLayout);
}
项目:HomeWire-Server    文件:ActionPanel.java   
private void setupPanel() {
  mainPanel.setSizeUndefined();

  GridLayout mainGridLayout = new GridLayout(2, 1);

  mainTypeComboBox.setContainerDataSource(new BeanItemContainer<>(
      TypeViewDTO.ActionTypes.class,
      Arrays.asList(TypeViewDTO.ActionTypes.values())
  ));
  mainTypeComboBox.setNullSelectionAllowed(false);
  mainTypeComboBox.select(TypeViewDTO.ActionTypes.ofActionDto(actionDTO));
  mainTypeComboBox.addValueChangeListener(event -> {
    TypeViewDTO.ActionTypes selected =
        (TypeViewDTO.ActionTypes) event.getProperty().getValue();

    currentActionWidget = actionWidgetRepository
        .getFactory(selected)
        .createWidget(actionDTO);
    currentActionWidget.setChangeListener(changeListener);

    mainGridLayout.removeComponent(1, 0);
    mainGridLayout.addComponent(currentActionWidget, 1, 0);
  });

  Button deleteButton = new Button("Delete", event -> {
    changeListener.accept(null);
  });

  mainGridLayout.addComponent(new VerticalLayout(mainTypeComboBox, deleteButton), 0, 0);

  mainGridLayout.addComponent(currentActionWidget, 1, 0);

  mainPanel.setContent(mainGridLayout);
}
项目:businesshorizon2    文件:DescriptionViewImpl.java   
private VerticalLayout getPrognoseMethodenInfos () {
    VerticalLayout vl = new VerticalLayout();
    infoText0 = new Label ("<h1>Prognosemethode</h1>");
    infoText0.setContentMode(Label.CONTENT_XHTML);
    infoText1 = new Label ("<h2>Methode zur Parametereingabe</h2>");
    infoText1.setContentMode(Label.CONTENT_XHTML);

    gl = new GridLayout(2,4);
    gl.setSizeFull();
    gl.setColumnExpandRatio(1, 1.0f);

    gl.addComponent(iconStochastic, 0, 0);
    gl.setComponentAlignment(iconStochastic, Alignment.MIDDLE_CENTER);
    gl.addComponent(stochasticHeadline, 1, 0);
    gl.addComponent(stochasticText, 1,1);

    gl.addComponent(iconDeterministic,0, 2);
    gl.setComponentAlignment(iconDeterministic, Alignment.MIDDLE_CENTER);
    gl.addComponent(deterministicHeadline, 1,2);
    gl.addComponent(deterministicText, 1, 3);

    vl.addComponent(infoText0);
    vl.addComponent(infoText1);
    vl.addComponent(gl);

    return vl;
}
项目:businesshorizon2    文件:DescriptionViewImpl.java   
private VerticalLayout getBerechnungsMethodeInfo () {
        VerticalLayout vl = new VerticalLayout();
        headline0 = new Label ("<h1>Berechnungsmethoden</h1>");
        headline0.setContentMode(Label.CONTENT_XHTML);
        headline1 = new Label ("<h2>Methode zur Prognoseerstellung</h2>");
        headline1.setContentMode(Label.CONTENT_XHTML);

        gl = new GridLayout (2,6);
        gl.setSizeFull();
        gl.setColumnExpandRatio(1,  1.0f);

        gl.addComponent(iconAPV, 0, 0);
        gl.setComponentAlignment(iconAPV, Alignment.MIDDLE_CENTER);
        gl.addComponent(apvHeadline, 1, 0);
        gl.addComponent(apvText, 1, 1);

//      gl.addComponent(iconFTE, 0, 2);
//      gl.setComponentAlignment(iconFTE, Alignment.MIDDLE_CENTER);
//      gl.addComponent(fteHeadline, 1, 2);
//      gl.addComponent(fteText, 1, 3);
//      
//      gl.addComponent(iconWACC, 0 , 4);
//      gl.setComponentAlignment(iconWACC, Alignment.MIDDLE_CENTER);
//      gl.addComponent(waccHeadline, 1, 4);
//      gl.addComponent(waccText, 1, 5);

        vl.addComponent(headline0);
        vl.addComponent(headline1);
        vl.addComponent(gl);

        return vl;
    }
项目:businesshorizon2    文件:MoreScenarioResultViewImpl.java   
/**
 * Diese Methode fügt die 3. Spalte der Tabelle mit den Daten zum Szenario 3 hinzu.
 * 
 * @author Tobias Lindner
 */
public void addScenario3ToLayout () {
    planningTable.addContainerProperty("scenario3", GridLayout.class, null);
    planningTable.setColumnHeader("scenario3", "Szenario 3");

    row1.getItemProperty("scenario3").setValue(planningGridScenario3);
    row2.getItemProperty("scenario3").setValue(companyValueLayoutScenario3);
    row3.getItemProperty("scenario3").setValue(capitalStructureChartScenario3);

}
项目:doecode    文件:AgentForm.java   
public AgentForm(RepositoryForm form) {
    this.parent = form;

    setSizeUndefined();

    GridLayout formContainer = new GridLayout(2,5);
    formContainer.setSpacing(true);

    agentTypeCode.addItems(Agent.agentTypes);
    agentTypeSpecific.addItems(Agent.specificTypes);

    Validator phoneValidator = new RegexpValidator("^((\\d{3}-|\\(\\d{3}\\)\\s?)?\\d{3}-|^\\d{3}(\\.)?\\d{3}\\3)\\d{4}$", "Please enter a valid phone number.");
    phoneNumber.addValidator(phoneValidator);

    formContainer.addComponent(firstName);
    formContainer.addComponent(lastName);
    formContainer.addComponent(agentTypeCode,0,1);
    formContainer.addComponent(agentTypeSpecific,1,1);
    formContainer.addComponent(email,0,2);
    formContainer.addComponent(affiliation,1,2);
    formContainer.addComponent(orcid,0,3);
    formContainer.addComponent(phoneNumber,1,3);

    HorizontalLayout buttons = new HorizontalLayout();
    buttons.setSpacing(true);
    buttons.addComponents(save, delete);

    save.setStyleName(ValoTheme.BUTTON_FRIENDLY);
    delete.setStyleName(ValoTheme.BUTTON_DANGER);

    save.setEnabled(false);
    delete.setEnabled(false);

    save.addClickListener(e->this.save());
    delete.addClickListener(e->this.delete());

    formContainer.addComponent(buttons, 0,4,1,4);

    addComponent(formContainer);
}
项目:hawkbit    文件:DefineGroupsLayout.java   
/**
 * Adds this group row to a grid layout
 * 
 * @param layout
 *            the grid layout
 * @param rowIndex
 *            the row of the grid layout
 */
public void addToGridRow(final GridLayout layout, final int rowIndex) {
    layout.addComponent(groupName, 0, rowIndex);
    if (populated) {
        layout.addComponent(targetFilterQuery, 1, rowIndex);
    } else {
        layout.addComponent(targetFilterQueryCombo, 1, rowIndex);
    }
    layout.addComponent(targetPercentage, 2, rowIndex);
    layout.addComponent(triggerThreshold, 3, rowIndex);
    layout.addComponent(errorThreshold, 4, rowIndex);
    layout.addComponent(optionsLayout, 5, rowIndex);

}
项目:hawkbit    文件:DeploymentView.java   
private void createMainLayout() {
    mainLayout = new GridLayout();
    layoutWidgets();
    mainLayout.setSizeFull();
    mainLayout.setSpacing(true);
    mainLayout.setRowExpandRatio(0, 1F);
}
项目:hawkbit    文件:DistributionsView.java   
private void createMainLayout() {
    mainLayout = new GridLayout(4, 2);
    mainLayout.setSizeFull();
    mainLayout.setSpacing(true);
    mainLayout.addComponent(filterByDSTypeLayout, 0, 0);
    mainLayout.addComponent(distributionTableLayout, 1, 0);
    mainLayout.addComponent(softwareModuleTableLayout, 2, 0);
    mainLayout.addComponent(filterBySMTypeLayout, 3, 0);
    mainLayout.addComponent(deleteActionsLayout, 1, 1, 2, 1);
    mainLayout.setRowExpandRatio(0, 1.0F);
    mainLayout.setColumnExpandRatio(1, 0.5F);
    mainLayout.setColumnExpandRatio(2, 0.5F);
    mainLayout.setComponentAlignment(deleteActionsLayout, Alignment.BOTTOM_CENTER);
}
项目:hawkbit    文件:CommonDialogWindow.java   
private final void init() {

        if (content instanceof AbstractOrderedLayout) {
            ((AbstractOrderedLayout) content).setSpacing(true);
            ((AbstractOrderedLayout) content).setMargin(true);
        }
        if (content instanceof GridLayout) {
            addStyleName("marginTop");
        }

        if (content != null) {
            mainLayout.addComponent(content);
            mainLayout.setExpandRatio(content, 1.0F);
        }

        createMandatoryLabel();

        final HorizontalLayout buttonLayout = createActionButtonsLayout();
        mainLayout.addComponent(buttonLayout);
        mainLayout.setComponentAlignment(buttonLayout, Alignment.TOP_CENTER);

        setCaption(caption);
        setCaptionAsHtml(true);
        setContent(mainLayout);
        setResizable(false);
        center();
        setModal(true);
        addStyleName("fontsize");
        setOrginaleValues();
        addComponentListeners();
    }
项目:SecureBPMN    文件:ProfilePanel.java   
protected GridLayout createInfoSectionLayout(int columns, int rows) {
  GridLayout layout = new GridLayout(columns, rows);
  layout.setSpacing(true);
  layout.setWidth(100, UNITS_PERCENTAGE);
  layout.setMargin(true, false, true, false);
  infoPanelLayout.addComponent(layout);
  return layout;
}
项目:SecureBPMN    文件:ProfilePanel.java   
protected void addProfileEntry(GridLayout layout, Component name, Component value) {
  name.addStyleName(ExplorerLayout.STYLE_PROFILE_FIELD);
  name.setSizeUndefined();
  layout.addComponent(name);

  value.setSizeUndefined();
  layout.addComponent(value);
}