Example usage for com.vaadin.ui HorizontalLayout addComponent

List of usage examples for com.vaadin.ui HorizontalLayout addComponent

Introduction

In this page you can find the example usage for com.vaadin.ui HorizontalLayout addComponent.

Prototype

@Override
public void addComponent(Component c) 

Source Link

Document

Add a component into this container.

Usage

From source file:cb_server.SettingsWindow.java

License:Open Source License

private Component getEncryptedStringView(final SettingEncryptedString sB, int backgroundChanger) {
    com.vaadin.ui.HorizontalLayout box = new HorizontalLayout();
    box.setWidth(100, Unit.PERCENTAGE);// ww w.  java 2  s. c o m
    com.vaadin.ui.TextField input = new TextField(sB.getName(), String.valueOf(sB.getEncryptedValue()));
    input.setWidth(50, Unit.PERCENTAGE);
    input.addTextChangeListener(new TextChangeListener() {
        private static final long serialVersionUID = -634498493292006581L;

        @Override
        public void textChange(TextChangeEvent event) {
            sB.setEncryptedValue(event.getText());
        }
    });

    box.addComponent(input);
    return box;
}

From source file:cb_server.SettingsWindow.java

License:Open Source License

private Component getEnumView(SettingEnum<?> sB, int backgroundChanger) {
    com.vaadin.ui.HorizontalLayout box = new HorizontalLayout();
    com.vaadin.ui.Label label = new com.vaadin.ui.Label();
    label.setCaption(sB.getName());//from   w  w  w .  j a v  a2 s .  co m
    box.addComponent(label);

    return box;
}

From source file:cb_server.SettingsWindow.java

License:Open Source License

private Component getFileView(final SettingFile sB, int backgroundChanger) {
    com.vaadin.ui.HorizontalLayout box = new HorizontalLayout();
    box.setWidth(100, Unit.PERCENTAGE);//from   w  ww  .j  a v a  2 s  . com
    com.vaadin.ui.TextField input = new TextField(sB.getName(), String.valueOf(sB.getValue()));
    input.setWidth(50, Unit.PERCENTAGE);
    input.addTextChangeListener(new TextChangeListener() {
        private static final long serialVersionUID = -634498493292006581L;

        @Override
        public void textChange(TextChangeEvent event) {
            sB.setValue(event.getText());
        }
    });

    box.addComponent(input);

    return box;
}

From source file:cb_server.SettingsWindow.java

License:Open Source License

private Component getFolderView(final SettingFolder sB, int backgroundChanger) {
    com.vaadin.ui.HorizontalLayout box = new HorizontalLayout();
    box.setWidth(100, Unit.PERCENTAGE);/* w  ww  .  j a  v a  2 s.  co m*/
    com.vaadin.ui.TextField input = new TextField(sB.getName(), String.valueOf(sB.getValue()));
    input.setWidth(50, Unit.PERCENTAGE);
    input.addTextChangeListener(new TextChangeListener() {
        private static final long serialVersionUID = -634498493292006581L;

        @Override
        public void textChange(TextChangeEvent event) {
            sB.setValue(event.getText());
        }
    });

    box.addComponent(input);
    return box;
}

From source file:cb_server.SettingsWindow.java

License:Open Source License

private Component getFloatView(final SettingFloat sB, int backgroundChanger) {
    com.vaadin.ui.HorizontalLayout box = new HorizontalLayout();
    com.vaadin.ui.TextField input = new TextField(sB.getName(), String.valueOf(sB.getValue()));
    input.setWidth(50, Unit.PERCENTAGE);
    input.addTextChangeListener(new TextChangeListener() {
        private static final long serialVersionUID = -634498493292006581L;

        @Override//  w w  w .j a v a2 s  .  c  om
        public void textChange(TextChangeEvent event) {
            sB.setValue(Float.parseFloat(event.getText()));
        }
    });

    box.addComponent(input);
    return box;
}

From source file:cb_server.SettingsWindow.java

License:Open Source License

private Component getDblView(final SettingDouble sB, int backgroundChanger) {
    com.vaadin.ui.HorizontalLayout box = new HorizontalLayout();
    com.vaadin.ui.TextField input = new TextField(sB.getName(), String.valueOf(sB.getValue()));
    input.setWidth(50, Unit.PERCENTAGE);
    input.addTextChangeListener(new TextChangeListener() {
        private static final long serialVersionUID = -634498493292006581L;

        @Override//from  w  w  w  .j  a  v  a 2  s . c  om
        public void textChange(TextChangeEvent event) {
            sB.setValue(Double.parseDouble(event.getText()));
        }
    });

    box.addComponent(input);
    return box;
}

From source file:cb_server.SettingsWindow.java

License:Open Source License

private Component getIntView(final SettingInt sB, int backgroundChanger) {
    com.vaadin.ui.HorizontalLayout box = new HorizontalLayout();
    com.vaadin.ui.TextField input = new TextField(sB.getName(), String.valueOf(sB.getValue()));
    input.setWidth(50, Unit.PERCENTAGE);
    input.addTextChangeListener(new TextChangeListener() {
        private static final long serialVersionUID = -634498493292006581L;

        @Override/*from  w  w w  .ja v  a  2  s  . com*/
        public void textChange(TextChangeEvent event) {

            int newValue = Integer.parseInt(event.getText());
            sB.setValue(newValue);
        }
    });

    box.addComponent(input);
    return box;
}

From source file:cb_server.SettingsWindow.java

License:Open Source License

private Component getTimeView(SettingTime sB, int backgroundChanger) {
    com.vaadin.ui.HorizontalLayout box = new HorizontalLayout();
    com.vaadin.ui.Label label = new com.vaadin.ui.Label();
    label.setCaption(sB.getName());//from   ww w .j a va  2s .com
    box.addComponent(label);

    return box;
}

From source file:cb_server.SettingsWindow.java

License:Open Source License

private Component getStringArrayView(SettingStringArray sB, int backgroundChanger) {
    com.vaadin.ui.HorizontalLayout box = new HorizontalLayout();
    com.vaadin.ui.Label label = new com.vaadin.ui.Label();
    label.setCaption(sB.getName());/*from   ww  w . j  a va 2  s .c om*/
    box.addComponent(label);

    return box;
}

From source file:cb_server.SettingsWindow.java

License:Open Source License

private Component getIntArrayView(SettingIntArray sB, int backgroundChanger) {
    com.vaadin.ui.HorizontalLayout box = new HorizontalLayout();
    com.vaadin.ui.Label label = new com.vaadin.ui.Label();
    label.setCaption(sB.getName());/*from  w ww. ja  v a 2s. com*/
    box.addComponent(label);

    return box;
}