setName('setupchecks') ->setDescription('Run setup checks and output the results') ; } protected function execute(InputInterface $input, OutputInterface $output): int { $results = $this->setupCheckManager->runAll(); switch ($input->getOption('output')) { case self::OUTPUT_FORMAT_JSON: case self::OUTPUT_FORMAT_JSON_PRETTY: $this->writeArrayInOutputFormat($input, $output, $results); break; default: foreach ($results as $category => $checks) { $output->writeln("\t{$category}:"); foreach ($checks as $check) { $styleTag = match ($check->getSeverity()) { 'success' => 'info', 'error' => 'error', 'warning' => 'comment', default => null, }; $emoji = match ($check->getSeverity()) { 'success' => '✓', 'error' => '✗', 'warning' => '⚠', default => 'ℹ', }; $verbosity = ($check->getSeverity() === 'error' ? OutputInterface::VERBOSITY_QUIET : OutputInterface::VERBOSITY_NORMAL); $description = $check->getDescription(); $descriptionParameters = $check->getDescriptionParameters(); if ($description !== null && $descriptionParameters !== null) { $description = $this->richTextFormatter->richToParsed($description, $descriptionParameters); } $output->writeln( "\t\t" . ($styleTag !== null ? "<{$styleTag}>" : '') . "{$emoji} " . ($check->getName() ?? $check::class) . ($description !== null ? ': ' . $description : '') . ($styleTag !== null ? "" : ''), $verbosity ); } } } foreach ($results as $category => $checks) { foreach ($checks as $check) { if ($check->getSeverity() !== 'success') { return self::FAILURE; } } } return self::SUCCESS; } } -8.28.1'>changelog-8.28.1 Vaadin 6, 7, 8 is a Java framework for modern Java web applications: https://github.com/vaadin/frameworkwww-data
aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/main/java/com/vaadin/tests/integration/IntegrationTestApplication.java
blob: 9878d10bc626cb4742e8f14e0f46975942b250af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package com.vaadin.tests.integration;

import com.vaadin.server.ClassResource;
import com.vaadin.server.LegacyApplication;
import com.vaadin.server.Resource;
import com.vaadin.ui.Label;
import com.vaadin.ui.LegacyWindow;
import com.vaadin.v7.data.Item;
import com.vaadin.v7.ui.Table;

public class IntegrationTestApplication extends LegacyApplication {

    @Override
    public void init() {
        LegacyWindow window = new LegacyWindow("Vaadin Application");
        setMainWindow(window);

        final Table table = new Table();
        table.addContainerProperty("icon", Resource.class, null);
        table.setItemIconPropertyId("icon");
        table.addContainerProperty("country", String.class, null);
        table.setRowHeaderMode(Table.ROW_HEADER_MODE_ICON_ONLY);
        table.setImmediate(true);
        table.setSelectable(true);
        table.setVisibleColumns(new Object[] { "country" });
        window.addComponent(table);

        Item item = table.addItem("FI");
        item.getItemProperty("icon").setValue(new ClassResource("fi.gif"));
        item.getItemProperty("country").setValue("Finland");
        item = table.addItem("SE");
        item.getItemProperty("icon").setValue(new FlagSeResource());
        item.getItemProperty("country").setValue("Sweden");

        final Label selectedLabel = new Label();
        table.addValueChangeListener(event -> selectedLabel
                .setValue(String.valueOf(table.getValue())));
        window.addComponent(selectedLabel);
    }
}