com.vaadin.ui.GridLayout Java Examples

The following examples show how to use com.vaadin.ui.GridLayout. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: WebForm.java    From cuba with Apache License 2.0 6 votes vote down vote up
@Override
public void setColumns(int columns) {
    if (component.getColumns() != columns) {
        try {
            component.setColumns(columns);
        } catch (GridLayout.OutOfBoundsException e) {
            // Replace the default exception with something more meaningful
            throw new IllegalStateException("Can't shrink columns with components within them");
        }

        List<List<ComponentPosition>> oldColumnComponents = columnComponentMapping;
        columnComponentMapping = new ArrayList<>();
        for (int i = 0; i < columns; i++) {
            if (i < oldColumnComponents.size()) {
                columnComponentMapping.add(oldColumnComponents.get(i));
            } else {
                columnComponentMapping.add(new ArrayList<>());
            }
        }
    }
}
 
Example #2
Source File: UploadArtifactView.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
private GridLayout createMainLayout() {
    createDetailsAndUploadLayout();
    mainLayout = new GridLayout(3, 1);
    mainLayout.setSizeFull();
    mainLayout.setSpacing(true);
    mainLayout.setStyleName("fullSize");
    mainLayout.addComponent(filterByTypeLayout, 0, 0);
    mainLayout.addComponent(smTableLayout, 1, 0);
    mainLayout.addComponent(detailAndUploadLayout, 2, 0);

    mainLayout.setRowExpandRatio(0, 1.0F);
    mainLayout.setColumnExpandRatio(1, 0.5F);
    mainLayout.setColumnExpandRatio(2, 0.5F);

    return mainLayout;
}
 
Example #3
Source File: AddUpdateRolloutWindowLayout.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
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;
}
 
Example #4
Source File: StorageAdminPanel.java    From sensorhub with Mozilla Public License 2.0 5 votes vote down vote up
protected Panel newPanel(String title)
{
    Panel panel = new Panel(title);
    GridLayout layout = new GridLayout(2, 2);
    layout.setWidth(100.0f, Unit.PERCENTAGE);
    layout.setMargin(true);
    layout.setSpacing(true);
    layout.setColumnExpandRatio(0, 0.2f);
    layout.setColumnExpandRatio(1, 0.8f);
    layout.setDefaultComponentAlignment(Alignment.TOP_LEFT);
    panel.setContent(layout);
    return panel;
}
 
Example #5
Source File: StorageAdminPanel.java    From sensorhub with Mozilla Public License 2.0 5 votes vote down vote up
protected void buildDataPanel(GridLayout form, IRecordStorageModule<?> storage)
{        
    // measurement outputs
    int i = 1;        
    if (storage.isEnabled())
    {
        for (IRecordStoreInfo dsInfo: storage.getRecordStores().values())
        {
            Panel panel = newPanel("Stream #" + i++);                
            GridLayout panelLayout = ((GridLayout)panel.getContent());
            panelLayout.setSpacing(true);
            
            // stored time period
            double[] timeRange = storage.getRecordsTimeRange(dsInfo.getName());
            Label l = new Label("<b>Time Range:</b> " + new DateTimeFormat().formatIso(timeRange[0], 0)
                                 + " / " + new DateTimeFormat().formatIso(timeRange[1], 0));
            l.setContentMode(ContentMode.HTML);
            panelLayout.addComponent(l, 0, 0, 1, 0);
            
            // time line
            panelLayout.addComponent(buildGantt(storage, dsInfo), 0, 1, 1, 1);
            
            // data structure
            DataComponent dataStruct = dsInfo.getRecordDescription();
            Component sweForm = new SWECommonForm(dataStruct);
            panelLayout.addComponent(sweForm);
            
            // data table
            panelLayout.addComponent(buildTable(storage, dsInfo));
            
            if (oldPanel != null)
                form.replaceComponent(oldPanel, panel);
            else
                form.addComponent(panel);
            oldPanel = panel;
        }
    }
}
 
Example #6
Source File: CommonDialogWindow.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
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();
    }
 
Example #7
Source File: DistributionsView.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private void createMainLayout() {
    mainLayout = new GridLayout(4, 1);
    mainLayout.setSizeFull();
    mainLayout.setSpacing(true);
    mainLayout.setStyleName("fullSize");

    mainLayout.addComponent(filterByDSTypeLayout, 0, 0);
    mainLayout.addComponent(distributionTableLayout, 1, 0);
    mainLayout.addComponent(softwareModuleTableLayout, 2, 0);
    mainLayout.addComponent(filterBySMTypeLayout, 3, 0);
    mainLayout.setRowExpandRatio(0, 1.0F);
    mainLayout.setColumnExpandRatio(1, 0.5F);
    mainLayout.setColumnExpandRatio(2, 0.5F);
}
 
Example #8
Source File: DeploymentView.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private void createMainLayout() {
    mainLayout = new GridLayout();
    layoutWidgets();
    mainLayout.setSizeFull();
    mainLayout.setSpacing(true);
    mainLayout.setRowExpandRatio(0, 1F);
    mainLayout.setStyleName("fullSize");
}
 
Example #9
Source File: AbstractTagLayout.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
protected void buildLayout() {
    mainLayout = new GridLayout(3, 2);
    mainLayout.setSpacing(true);
    colorPickerLayout = new ColorPickerLayout();
    ColorPickerHelper.setRgbSliderValues(colorPickerLayout);
    contentLayout = new VerticalLayout();

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

    formLayout.addComponent(tagName);
    formLayout.addComponent(tagDesc);
    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();
}
 
Example #10
Source File: DefineGroupsLayout.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * 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);

}
 
Example #11
Source File: RolloutConfigurationView.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private void init() {

        final Panel rootPanel = new Panel();
        rootPanel.setSizeFull();

        rootPanel.addStyleName("config-panel");

        final VerticalLayout vLayout = new VerticalLayout();
        vLayout.setMargin(true);
        vLayout.setSizeFull();

        final Label header = new Label(i18n.getMessage("configuration.rollout.title"));
        header.addStyleName("config-panel-header");
        vLayout.addComponent(header);

        final GridLayout gridLayout = new GridLayout(3, 1);
        gridLayout.setSpacing(true);
        gridLayout.setImmediate(true);
        gridLayout.setColumnExpandRatio(1, 1.0F);
        gridLayout.setSizeFull();

        approvalCheckbox = SPUIComponentProvider.getCheckBox("", "", null, false, "");
        approvalCheckbox.setId(UIComponentIdProvider.ROLLOUT_APPROVAL_ENABLED_CHECKBOX);
        approvalCheckbox.setValue(approvalConfigurationItem.isConfigEnabled());
        approvalCheckbox.addValueChangeListener(this);
        approvalConfigurationItem.addChangeListener(this);
        gridLayout.addComponent(approvalCheckbox, 0, 0);
        gridLayout.addComponent(approvalConfigurationItem, 1, 0);

        final Link linkToApprovalHelp = SPUIComponentProvider.getHelpLink(i18n,
                uiProperties.getLinks().getDocumentation().getRollout());
        gridLayout.addComponent(linkToApprovalHelp, 2, 0);
        gridLayout.setComponentAlignment(linkToApprovalHelp, Alignment.BOTTOM_RIGHT);

        vLayout.addComponent(gridLayout);
        rootPanel.setContent(vLayout);
        setCompositionRoot(rootPanel);
    }
 
Example #12
Source File: TimeLogComp.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
protected TimeLogComp() {
    this.itemTimeLoggingService = AppContextUtil.getSpringBean(ItemTimeLoggingService.class);
    this.withMargin(false);

    HorizontalLayout header = new MHorizontalLayout().withStyleName("info-hdr");
    header.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);

    ELabel dateInfoHeader = ELabel.html(VaadinIcons.CLOCK.getHtml() + " " +
            UserUIContext.getMessage(TimeTrackingI18nEnum.SUB_INFO_TIME));
    header.addComponent(dateInfoHeader);

    if (hasEditPermission()) {
        MButton editBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_EDIT), clickEvent ->
                showEditTimeWindow(beanItem)).withStyleName(WebThemes.BUTTON_LINK);
        header.addComponent(editBtn);
    }
    header.addComponent(ELabel.fontIcon(VaadinIcons.QUESTION_CIRCLE).withDescription(UserUIContext.getMessage
            (TimeTrackingI18nEnum.TIME_EXPLAIN_HELP)).withStyleName(WebThemes.INLINE_HELP));

    this.addComponent(header);

    layout = new GridLayout(2, 3);
    layout.setSpacing(true);
    layout.setWidth("100%");
    layout.setMargin(new MarginInfo(false, false, false, true));
    layout.setColumnExpandRatio(1, 1.0f);
    this.addComponent(layout);
}
 
Example #13
Source File: AgentForm.java    From doecode with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
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);
}
 
Example #14
Source File: DateInfoComp.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
public void displayEntryDateTime(ValuedBean bean) {
    this.removeAllComponents();
    this.withMargin(false);
    Label dateInfoHeader = ELabel.html(VaadinIcons.CALENDAR.getHtml() + " " +
            UserUIContext.getMessage(ProjectCommonI18nEnum.SUB_INFO_DATES)).withStyleName("info-hdr");
    this.addComponent(dateInfoHeader);

    GridLayout layout = new GridLayout(2, 2);
    layout.setSpacing(true);
    layout.setWidth("100%");
    layout.setMargin(new MarginInfo(false, false, false, true));
    layout.setColumnExpandRatio(1, 1.0f);

    try {
        LocalDateTime createdDate = (LocalDateTime) PropertyUtils.getProperty(bean, "createdtime");
        layout.addComponent(new ELabel(UserUIContext.getMessage(ProjectCommonI18nEnum.ITEM_CREATED_DATE)).withStyleName(WebThemes.META_COLOR).withUndefinedWidth(), 0, 0);
        layout.addComponent(new ELabel(UserUIContext.formatPrettyTime(createdDate)).withDescription(UserUIContext.formatDateTime(createdDate)), 1, 0);


        LocalDateTime updatedDate = (LocalDateTime) PropertyUtils.getProperty(bean, "lastupdatedtime");
        layout.addComponent(new ELabel(UserUIContext.getMessage(ProjectCommonI18nEnum.ITEM_UPDATED_DATE)).withStyleName(WebThemes.META_COLOR).withUndefinedWidth(), 0, 1);
        layout.addComponent(new ELabel(UserUIContext.formatPrettyTime(updatedDate)).withDescription(UserUIContext.formatDateTime(updatedDate)), 1, 1);

        this.addComponent(layout);
    } catch (Exception e) {
        LOG.error("Get date is failed {}", BeanUtility.printBeanObj(bean));
    }
}
 
Example #15
Source File: UserBulkInviteViewImpl.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public void display() {
    removeAllComponents();
    ELabel titleLbl = ELabel.h2(UserUIContext.getMessage(UserI18nEnum.BULK_INVITE));
    MButton cancelBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_CANCEL), (Button.ClickListener) clickEvent -> {
        EventBusFactory.getInstance().post(new UserEvent.GotoList(this, null));
    }).withStyleName(WebThemes.BUTTON_OPTION);
    MButton saveBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_SAVE), (Button.ClickListener) clickEvent -> {
        sendInviteBulkUsers();
    }).withStyleName(WebThemes.BUTTON_ACTION);

    this.with(new MHorizontalLayout(titleLbl, cancelBtn, saveBtn).withExpand(titleLbl, 1.0f).withFullWidth());

    roleComboBox = new RoleComboBox();
    roleComboBox.addValueChangeListener((HasValue.ValueChangeListener<SimpleRole>) valueChangeEvent -> {
        displayRolePermission(valueChangeEvent.getSource().getValue());
    });
    this.with(new MHorizontalLayout(ELabel.html(UserUIContext.getMessage(RoleI18nEnum.SINGLE)).withStyleName(WebThemes.META_COLOR), roleComboBox).alignAll(Alignment.TOP_LEFT));
    ResponsiveLayout mainLayout = new ResponsiveLayout().withStyleName(WebThemes.MARGIN_TOP);

    ResponsiveRow mainRow = mainLayout.addRow();
    bulkInviteUsersLayout = new GridLayout(3, 1);
    bulkInviteUsersLayout.setSpacing(true);
    ResponsiveColumn column1 = new ResponsiveColumn(12, 12, 6, 6).withComponent(bulkInviteUsersLayout);
    ResponsiveColumn column2 = new ResponsiveColumn(12, 12, 6, 6).withVisibilityRules(false, false, true, true)
            .withComponent(rolePermissionDisplayLayout);

    mainRow.addColumn(column1);
    mainRow.addColumn(column2);

    bulkInviteUsersLayout.addComponent(ELabel.h3(UserUIContext.getMessage(GenericI18Enum.FORM_EMAIL)).withWidth("220px"), 0, 0);
    bulkInviteUsersLayout.addComponent(ELabel.h3(UserUIContext.getMessage(ShellI18nEnum.FORM_PASSWORD)), 1, 0);

    this.with(mainLayout);
    displayRolePermission(roleComboBox.getValue());

    buildInviteUserBlock();
}
 
Example #16
Source File: UserBulkInviteViewImpl.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
private void buildInviteUserBlock() {
    EmailField emailField = new EmailField().withPlaceholder(UserUIContext.getMessage(GenericI18Enum.FORM_EMAIL)).withWidth("220px");
    PasswordField passwordField = new PasswordField();
    passwordField.setPlaceholder(UserUIContext.getMessage(UserI18nEnum.FORM_PASSWORD_HINT));
    passwordField.setDescription(UserUIContext.getMessage(UserI18nEnum.FORM_PASSWORD_HINT));

    MHorizontalLayout actionLayout = new MHorizontalLayout();
    MButton addBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_ADD), (Button.ClickListener) event -> {
        buildInviteUserBlock();
    }).withStyleName(WebThemes.BUTTON_ACTION);
    actionLayout.with(addBtn);

    if (bulkInviteUsersLayout.getRows() >= 2) {
        MButton removeBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_DELETE), (Button.ClickListener) event -> {
            GridLayout.Area area = bulkInviteUsersLayout.getComponentArea(actionLayout);
            int row1 = area.getRow1();
            bulkInviteUsersLayout.removeRow(row1);
        }).withStyleName(WebThemes.BUTTON_OPTION);
        actionLayout.with(removeBtn);
    }

    int rows = bulkInviteUsersLayout.getRows();
    bulkInviteUsersLayout.insertRow(rows);

    bulkInviteUsersLayout.addComponent(emailField, 0, rows);
    bulkInviteUsersLayout.addComponent(passwordField, 1, rows);
    bulkInviteUsersLayout.addComponent(actionLayout, 2, rows);
}
 
Example #17
Source File: ElementCollectionField.java    From viritin with Apache License 2.0 4 votes vote down vote up
@Override
public GridLayout getLayout() {
    return layout;
}
 
Example #18
Source File: ElementCollectionField.java    From viritin with Apache License 2.0 4 votes vote down vote up
@Override
public GridLayout getLayout() {
    return layout;
}
 
Example #19
Source File: SensorAdminPanel.java    From sensorhub with Mozilla Public License 2.0 4 votes vote down vote up
@Override
public void build(final MyBeanItem<ModuleConfig> beanItem, final ISensorModule<?> module)
{
    super.build(beanItem, module);       
    
    // add section label
    final GridLayout form = new GridLayout();
    form.setWidth(100.0f, Unit.PERCENTAGE);
    form.setMargin(false);
    form.setSpacing(true);
    
    // section title
    form.addComponent(new Label(""));
    HorizontalLayout titleBar = new HorizontalLayout();
    titleBar.setSpacing(true);
    Label sectionLabel = new Label("Inputs/Outputs");
    sectionLabel.addStyleName(STYLE_H3);
    sectionLabel.addStyleName(STYLE_COLORED);
    titleBar.addComponent(sectionLabel);
    titleBar.setComponentAlignment(sectionLabel, Alignment.MIDDLE_LEFT);
    
    // refresh button to show latest record
    Button refreshButton = new Button("Refresh");
    refreshButton.setDescription("Load latest data from sensor");
    refreshButton.setIcon(REFRESH_ICON);
    refreshButton.addStyleName(STYLE_QUIET);
    titleBar.addComponent(refreshButton);
    titleBar.setComponentAlignment(refreshButton, Alignment.MIDDLE_LEFT);
    refreshButton.addClickListener(new ClickListener() {
        private static final long serialVersionUID = 1L;
        @Override
        public void buttonClick(ClickEvent event)
        {
            rebuildSwePanels(form, module);
        }
    });
            
    form.addComponent(titleBar);
    
    // add I/O panel
    rebuildSwePanels(form, module);
    addComponent(form);
}
 
Example #20
Source File: WebFieldGroupTest.java    From cuba with Apache License 2.0 4 votes vote down vote up
@Override
protected int getGridRows(FieldGroup fieldGroup) {
    return fieldGroup.unwrap(GridLayout.class).getRows();
}
 
Example #21
Source File: StorageAdminPanel.java    From sensorhub with Mozilla Public License 2.0 4 votes vote down vote up
@Override
public void build(final MyBeanItem<ModuleConfig> beanItem, final IRecordStorageModule<?> storage)
{
    super.build(beanItem, storage);       
    
    if (storage != null)
    {            
        // section layout
        final GridLayout form = new GridLayout();
        form.setWidth(100.0f, Unit.PERCENTAGE);
        form.setMargin(false);
        form.setSpacing(true);
        
        // section title
        form.addComponent(new Label(""));
        HorizontalLayout titleBar = new HorizontalLayout();
        titleBar.setSpacing(true);
        Label sectionLabel = new Label("Data Store Content");
        sectionLabel.addStyleName(STYLE_H3);
        sectionLabel.addStyleName(STYLE_COLORED);
        titleBar.addComponent(sectionLabel);
        titleBar.setComponentAlignment(sectionLabel, Alignment.MIDDLE_LEFT);
        
        // refresh button to show latest record
        Button refreshButton = new Button("Refresh");
        refreshButton.setDescription("Reload data from storage");
        refreshButton.setIcon(REFRESH_ICON);
        refreshButton.addStyleName(STYLE_QUIET);
        titleBar.addComponent(refreshButton);
        titleBar.setComponentAlignment(refreshButton, Alignment.MIDDLE_LEFT);
        refreshButton.addClickListener(new ClickListener() {
            private static final long serialVersionUID = 1L;
            @Override
            public void buttonClick(ClickEvent event)
            {
                buildDataPanel(form, storage);
            }
        });
                
        form.addComponent(titleBar);
        
        // add I/O panel
        buildDataPanel(form, storage);
        addComponent(form);
    }
}
 
Example #22
Source File: AbstractTagLayout.java    From hawkbit with Eclipse Public License 1.0 4 votes vote down vote up
protected GridLayout getMainLayout() {
    return mainLayout;
}
 
Example #23
Source File: RepositoryConfigurationView.java    From hawkbit with Eclipse Public License 1.0 4 votes vote down vote up
private void init() {

        final Panel rootPanel = new Panel();
        rootPanel.setSizeFull();

        rootPanel.addStyleName("config-panel");

        final VerticalLayout vLayout = new VerticalLayout();
        vLayout.setMargin(true);
        vLayout.setSizeFull();

        final Label header = new Label(i18n.getMessage("configuration.repository.title"));
        header.addStyleName("config-panel-header");
        vLayout.addComponent(header);

        final GridLayout gridLayout = new GridLayout(3, 3);
        gridLayout.setSpacing(true);
        gridLayout.setImmediate(true);
        gridLayout.setColumnExpandRatio(1, 1.0F);
        gridLayout.setSizeFull();

        final boolean isMultiAssignmentsEnabled = multiAssignmentsConfigurationItem.isConfigEnabled();

        actionAutocloseCheckBox = SPUIComponentProvider.getCheckBox("", DIST_CHECKBOX_STYLE, null, false, "");
        actionAutocloseCheckBox.setId(UIComponentIdProvider.REPOSITORY_ACTIONS_AUTOCLOSE_CHECKBOX);
        actionAutocloseCheckBox.setEnabled(!isMultiAssignmentsEnabled);
        actionAutocloseConfigurationItem.setEnabled(!isMultiAssignmentsEnabled);
        actionAutocloseCheckBox.setValue(actionAutocloseConfigurationItem.isConfigEnabled());
        actionAutocloseCheckBox.addValueChangeListener(this);
        actionAutocloseConfigurationItem.addChangeListener(this);
        gridLayout.addComponent(actionAutocloseCheckBox, 0, 0);
        gridLayout.addComponent(actionAutocloseConfigurationItem, 1, 0);

        multiAssignmentsCheckBox = SPUIComponentProvider.getCheckBox("", DIST_CHECKBOX_STYLE, null, false, "");
        multiAssignmentsCheckBox.setId(UIComponentIdProvider.REPOSITORY_MULTI_ASSIGNMENTS_CHECKBOX);
        multiAssignmentsCheckBox.setValue(multiAssignmentsConfigurationItem.isConfigEnabled());
        multiAssignmentsCheckBox.addValueChangeListener(this);
        multiAssignmentsCheckBox.setEnabled(!isMultiAssignmentsEnabled);
        multiAssignmentsConfigurationItem.setEnabled(!isMultiAssignmentsEnabled);
        multiAssignmentsConfigurationItem.addChangeListener(this);
        gridLayout.addComponent(multiAssignmentsCheckBox, 0, 1);
        gridLayout.addComponent(multiAssignmentsConfigurationItem, 1, 1);

        actionAutocleanupCheckBox = SPUIComponentProvider.getCheckBox("", DIST_CHECKBOX_STYLE, null, false, "");
        actionAutocleanupCheckBox.setId(UIComponentIdProvider.REPOSITORY_ACTIONS_AUTOCLEANUP_CHECKBOX);
        actionAutocleanupCheckBox.setValue(actionAutocleanupConfigurationItem.isConfigEnabled());
        actionAutocleanupCheckBox.addValueChangeListener(this);
        actionAutocleanupConfigurationItem.addChangeListener(this);
        gridLayout.addComponent(actionAutocleanupCheckBox, 0, 2);
        gridLayout.addComponent(actionAutocleanupConfigurationItem, 1, 2);

        final Link linkToProvisioningHelp = SPUIComponentProvider.getHelpLink(i18n,
                uiProperties.getLinks().getDocumentation().getProvisioningStateMachine());
        gridLayout.addComponent(linkToProvisioningHelp, 2, 2);
        gridLayout.setComponentAlignment(linkToProvisioningHelp, Alignment.BOTTOM_RIGHT);

        vLayout.addComponent(gridLayout);
        rootPanel.setContent(vLayout);
        setCompositionRoot(rootPanel);
    }
 
Example #24
Source File: AuthenticationConfigurationView.java    From hawkbit with Eclipse Public License 1.0 4 votes vote down vote up
private void init() {

        final Panel rootPanel = new Panel();
        rootPanel.setSizeFull();

        rootPanel.addStyleName("config-panel");

        final VerticalLayout vLayout = new VerticalLayout();
        vLayout.setMargin(true);
        vLayout.setSizeFull();

        final Label header = new Label(i18n.getMessage("configuration.authentication.title"));
        header.addStyleName("config-panel-header");
        vLayout.addComponent(header);

        final GridLayout gridLayout = new GridLayout(3, 4);
        gridLayout.setSpacing(true);
        gridLayout.setImmediate(true);
        gridLayout.setSizeFull();
        gridLayout.setColumnExpandRatio(1, 1.0F);

        certificateAuthCheckbox = SPUIComponentProvider.getCheckBox("", DIST_CHECKBOX_STYLE, null, false, "");
        certificateAuthCheckbox.setValue(certificateAuthenticationConfigurationItem.isConfigEnabled());
        certificateAuthCheckbox.addValueChangeListener(this);
        certificateAuthenticationConfigurationItem.addChangeListener(this);
        gridLayout.addComponent(certificateAuthCheckbox, 0, 0);
        gridLayout.addComponent(certificateAuthenticationConfigurationItem, 1, 0);

        targetSecTokenCheckBox = SPUIComponentProvider.getCheckBox("", DIST_CHECKBOX_STYLE, null, false, "");
        targetSecTokenCheckBox.setValue(targetSecurityTokenAuthenticationConfigurationItem.isConfigEnabled());
        targetSecTokenCheckBox.addValueChangeListener(this);
        targetSecurityTokenAuthenticationConfigurationItem.addChangeListener(this);
        gridLayout.addComponent(targetSecTokenCheckBox, 0, 1);
        gridLayout.addComponent(targetSecurityTokenAuthenticationConfigurationItem, 1, 1);

        gatewaySecTokenCheckBox = SPUIComponentProvider.getCheckBox("", DIST_CHECKBOX_STYLE, null, false, "");
        gatewaySecTokenCheckBox.setId("gatewaysecuritycheckbox");
        gatewaySecTokenCheckBox.setValue(gatewaySecurityTokenAuthenticationConfigurationItem.isConfigEnabled());
        gatewaySecTokenCheckBox.addValueChangeListener(this);
        gatewaySecurityTokenAuthenticationConfigurationItem.addChangeListener(this);
        gridLayout.addComponent(gatewaySecTokenCheckBox, 0, 2);
        gridLayout.addComponent(gatewaySecurityTokenAuthenticationConfigurationItem, 1, 2);

        downloadAnonymousCheckBox = SPUIComponentProvider.getCheckBox("", DIST_CHECKBOX_STYLE, null, false, "");
        downloadAnonymousCheckBox.setId(UIComponentIdProvider.DOWNLOAD_ANONYMOUS_CHECKBOX);
        downloadAnonymousCheckBox.setValue(anonymousDownloadAuthenticationConfigurationItem.isConfigEnabled());
        downloadAnonymousCheckBox.addValueChangeListener(this);
        anonymousDownloadAuthenticationConfigurationItem.addChangeListener(this);
        gridLayout.addComponent(downloadAnonymousCheckBox, 0, 3);
        gridLayout.addComponent(anonymousDownloadAuthenticationConfigurationItem, 1, 3);

        final Link linkToSecurityHelp = SPUIComponentProvider.getHelpLink(i18n,
                uiProperties.getLinks().getDocumentation().getSecurity());
        gridLayout.addComponent(linkToSecurityHelp, 2, 3);
        gridLayout.setComponentAlignment(linkToSecurityHelp, Alignment.BOTTOM_RIGHT);

        vLayout.addComponent(gridLayout);
        rootPanel.setContent(vLayout);
        setCompositionRoot(rootPanel);
    }
 
Example #25
Source File: DefaultGridLayoutDropHandler.java    From cuba with Apache License 2.0 4 votes vote down vote up
@Override
public Class<GridLayout> getTargetLayoutType() {
    return GridLayout.class;
}
 
Example #26
Source File: WebFieldGroupTest.java    From cuba with Apache License 2.0 4 votes vote down vote up
@Override
protected Object getGridCellComposition(FieldGroup fieldGroup, int col, int row) {
    return fieldGroup.unwrap(GridLayout.class).getComponent(col, row);
}
 
Example #27
Source File: WebFieldGroupTest.java    From cuba with Apache License 2.0 4 votes vote down vote up
@Override
protected int getGridColumns(FieldGroup fieldGroup) {
    return fieldGroup.unwrap(GridLayout.class).getColumns();
}
 
Example #28
Source File: BasicModel.java    From chipster with MIT License votes vote down vote up
public abstract GridLayout createUI();