APISonar


com.vaadin.tests.util.Log.log

> com > vaadin > tests > util > Log > log
com APIs vaadin APIs tests APIs util APIs Log APIs log APIs

Example 1
private Log log = new Log(20);

    public void log(Component c) {
        Class<?> cls = c.getClass();
        if (cls.isAnonymousClass()) {
            cls = cls.getSuperclass();
        }
        log.log(cls.getName() + " '" + c.getCaption()
                + "' attached to application");
    }
Example 2
private Log log = new Log(5);

    protected void logExpandCollapse(Object itemId, String operation) {
        File file = (File) itemId;
        // do not use the variable part (path) of file name
        log.log("Row " + file.getName() + " " + operation + ". Row index: "
                + indexOfId(treeTable, itemId));

    }
Example 3
private Log log = new Log(10);

    public void buttonClick(ClickEvent event) {
        log.log("Click on " + event.getButton().getCaption());

    }
Example 4
private final Log log = new Log(5);

    protected void setup(VaadinRequest request) {
        addComponent(log);
        addComponent(new PopupView("PopupView",
                new Button("Button", new Button.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        log.log("Button clicked");
                    }
                })));
    }
Example 5
private final Log log = new Log(16);

    private void reportStatus(String phase, VaadinSession application, UI uI) {
        log.log(getState(application, this) + " app in " + phase);
        log.log(getState(uI, mainWindow) + " root in " + phase);
    }
Example 6
private Log log = new Log(5);

    protected Table createTable(boolean useCustomConverters, Locale locale) {
        Table t = new Table("Persons");
        t.setLocale(locale);
        t.setContainerDataSource(personBeanItemContainer);
        t.setSortDisabled(false);
        if (useCustomConverters) {
            addConverters(t);
        }
        t.setSelectable(true);
        t.setImmediate(true);
        t.addValueChangeListener(event -> log
                .log("Value is now: " + event.getProperty().getValue()));
        return t;
    }
Example 7
private Log log;

    private void checkEmpty() {
        log.log("DateField value is now " + df.getValue());
        log.log("isEmpty: " + df.isEmpty() + ", isValid: " + df.isValid());
    }
Example 8
private final Log log = new Log(5);

    public void setup() {
        TextField tf = new TextField();
        tf.setTextChangeEventMode(TextChangeEventMode.TIMEOUT);
        tf.setTextChangeTimeout(500);
        tf.addListener(new TextChangeListener() {
            public void textChange(TextChangeEvent event) {
                log.log("TextChangeEvent: " + event.getText());
            }
        });
        getMainWindow().addActionHandler(new MyHandler());

        addComponent(log);
        addComponent(tf);
    }
Example 9
private Log log;

    private void printState() {
        log.log("Date. Field: " + f(dateField.getValue()) + " Property: "
                + f(dateProperty.getValue()));
        log.log("Integer: Field: " + integerField.getValue() + " Property: "
                + integerProperty.getValue());
    }
Example 10
private Log log;

    public void error(com.vaadin.server.ErrorEvent event) {
        String logMsg = "Exception occured, "
                + event.getThrowable().getClass().getName();

        String exceptionMsg = event.getThrowable().getMessage();
        if (exceptionMsg != null && exceptionMsg.length() > 0) {
            logMsg += exceptionMsg;
        }
        log.log(logMsg);
        final Throwable t = event.getThrowable();
        if (t != null) {
            t.printStackTrace();
        }

    }
Example 11
private Log log = new Log(5);

    protected void setup() {
        addComponent(log);
        final SlowComboBox cb = new SlowComboBox();
        cb.setImmediate(true);
        for (int i = 0; i <= 1000; i++) {
            cb.addItem("Item " + i);
        }
        cb.addListener(new ValueChangeListener() {
            @Override
            public void valueChange(ValueChangeEvent event) {
                log.log("Value changed to " + cb.getValue());
            }
        });
        addComponent(cb);
    }
Example 12
private final Log log = new Log(6);

    public void detach() {
        super.detach();
        log.log("Detach of " + this + " (" + getUIId() + ")");
        boolean correctUI = (UI.getCurrent() == this);
        boolean correctPage = (Page.getCurrent() == getPage());
        boolean correctVaadinSession = (VaadinSession.getCurrent() == getSession());
        boolean correctVaadinService = (VaadinService.getCurrent() == getSession()
                .getService());
        log.log("UI.current correct in detach: " + correctUI);
        log.log("Page.current correct in detach: " + correctPage);
        log.log("VaadinSession.current correct in detach: "
                + correctVaadinSession);
        log.log("VaadinService.current correct in detach: "
                + correctVaadinService);
    }
Example 13
private Log log;

    public void error(com.vaadin.server.ErrorEvent event) {
        final Throwable throwable = DefaultErrorHandler
                .findRelevantThrowable(event.getThrowable());

        log.log("Exception occured, " + throwable.getClass().getName() + ": "
                + throwable.getMessage());
        throwable.printStackTrace();
    }
Example 14
private Log log = new Log(5);

    protected void setup(VaadinRequest request) {
        final ComboBox<String> select = new ComboBox<>("ComboBox");
        select.setItemCaptionGenerator(
                item -> item.startsWith("one") ? "One" : "Two");
        select.setItems("one-1", "one-2", "two");
        select.setEmptySelectionAllowed(false);
        select.addValueChangeListener(
                event -> log.log("Item " + select.getValue() + " selected"));

        addComponent(log);
        addComponent(select);
    }