Example usage for com.vaadin.ui CheckBox CheckBox

List of usage examples for com.vaadin.ui CheckBox CheckBox

Introduction

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

Prototype

public CheckBox() 

Source Link

Document

Creates a new checkbox.

Usage

From source file:info.magnolia.ui.form.field.CheckBoxField.java

License:Open Source License

public CheckBoxField() {
    checkBox = new CheckBox();
}

From source file:kn.uni.gis.ui.GameComposite.java

License:Apache License

private void addToTable(final Player fox2) {

    LOGGER.info("adding player: {}", fox2.getName());
    CheckBox comboBox = new CheckBox();
    comboBox.setValue(true);//from  w  w w  . ja  v  a 2 s  . co m
    comboBox.setImmediate(true);
    comboBox.addListener(new ClickListener() {

        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(ClickEvent event) {
            boolean dings = (Boolean) event.getButton().getValue();
            LOGGER.info("setting player: {} to {}", fox2.getName(), dings);
            layer.setPlayerVisible(fox2, dings);
        }
    });
    gamerTable.addItem(new Object[] { fox2.getName(), comboBox }, fox2);
}

From source file:kn.uni.gis.ui.GameComposite.java

License:Apache License

@AutoGenerated
private VerticalLayout buildVerticalLayout_2() {
    // common part: create layout
    verticalLayout_2 = new VerticalLayout();
    verticalLayout_2.setImmediate(false);
    verticalLayout_2.setWidth("-1px");
    verticalLayout_2.setHeight("-1px");
    verticalLayout_2.setMargin(false);/*from ww  w.  j  a v a2  s. co  m*/

    // annimated
    annimated = new CheckBox();
    annimated.setCaption("Animated");
    annimated.setImmediate(false);
    annimated.setWidth("-1px");
    annimated.setHeight("-1px");
    verticalLayout_2.addComponent(annimated);

    // label_1
    label_1 = new Label();
    label_1.setCaption("Time");
    label_1.setImmediate(false);
    label_1.setWidth("-1px");
    label_1.setHeight("-1px");
    label_1.setValue("Label");
    verticalLayout_2.addComponent(label_1);

    // timeSlider
    timeSlider = new Slider();
    timeSlider.setCaption("TimeBar");
    timeSlider.setImmediate(false);
    timeSlider.setWidth("200px");
    timeSlider.setHeight("-1px");
    verticalLayout_2.addComponent(timeSlider);

    // speedSlider
    speedSlider = new Slider();
    speedSlider.setCaption("Animation speed");
    speedSlider.setImmediate(false);
    speedSlider.setWidth("200px");
    speedSlider.setHeight("-1px");
    verticalLayout_2.addComponent(speedSlider);

    return verticalLayout_2;
}

From source file:model.DatasetBean.java

License:Open Source License

public void setSelected(boolean isSelected) {
    this.isSelected = new CheckBox();
    this.isSelected.setValue(isSelected);
}

From source file:nz.co.senanque.vaadinsupport.HintsImpl.java

License:Apache License

public AbstractField getBooleanField(MaduraPropertyWrapper property) {
    return new CheckBox();
}

From source file:org.activiti.editor.ui.DeployModelPopupWindow.java

License:Apache License

public DeployModelPopupWindow(Model modelData) {
    setWidth(400, UNITS_PIXELS);/*from   ww  w.j av a  2s.  co  m*/
    setModal(true);
    setResizable(false);

    addStyleName(Reindeer.PANEL_LIGHT);

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

    I18nManager i18nManager = ExplorerApp.get().getI18nManager();
    setCaption(i18nManager.getMessage(Messages.MODEL_DEPLOY_POPUP_CAPTION));

    // Process name
    Label nameLabel = new Label(i18nManager.getMessage(Messages.MODEL_DEPLOY_NAME));
    layout.addComponent(nameLabel, 0, 0);

    processNameTextField = new TextField();
    if (modelData.getName() != null) {
        processNameTextField.setValue(modelData.getName());
    }
    processNameTextField.focus();
    layout.addComponent(processNameTextField, 1, 0);

    // Generate reports
    Label generateReportsLabel = new Label(i18nManager.getMessage(Messages.MODEL_DEPLOY_GENERATE_REPORTS));
    layout.addComponent(generateReportsLabel, 0, 1);

    generateReportsCheckBox = new CheckBox();
    generateReportsCheckBox.setValue(true);
    layout.addComponent(generateReportsCheckBox, 1, 1);

    // Buttons
    initButtons(i18nManager);
}

From source file:org.activiti.explorer.ui.process.simple.editor.table.PropertyTable.java

License:Apache License

protected void addPropertyRow(Object itemId, String propertyName, String propertyType, Boolean required) {
    Object newItemId = null;//from   w  w  w . j av a  2  s .c  o  m
    if (itemId == null) { // add at the end of list
        newItemId = addItem();
    } else {
        newItemId = addItemAfter(itemId);
    }
    Item newItem = getItem(newItemId);

    // name
    newItem.getItemProperty(ID_PROPERTY_NAME)
            .setValue(propertyName == null ? DEFAULT_PROPERTY_NAME : propertyName);

    // type
    ComboBox typeComboBox = new ComboBox("", Arrays.asList("text", "number", "date"));
    typeComboBox.setNullSelectionAllowed(false);
    if (propertyType == null) {
        typeComboBox.setValue(typeComboBox.getItemIds().iterator().next());
    } else {
        typeComboBox.setValue(propertyType);
    }
    newItem.getItemProperty(ID_PROPERTY_TYPE).setValue(typeComboBox);

    // required
    CheckBox requiredCheckBox = new CheckBox();
    requiredCheckBox.setValue(required == null ? false : required);
    newItem.getItemProperty(ID_PROPERTY_REQUIRED).setValue(requiredCheckBox);

    // actions
    HorizontalLayout actionButtons = new HorizontalLayout();

    Button deleteRowButton = new Button("-");
    deleteRowButton.setData(newItemId);
    deleteRowButton.addListener(new DeletePropertyClickListener(this));
    actionButtons.addComponent(deleteRowButton);

    Button addRowButton = new Button("+");
    addRowButton.setData(newItemId);
    addRowButton.addListener(new AddPropertyClickListener(this));
    actionButtons.addComponent(addRowButton);

    newItem.getItemProperty(ID_PROPERTY_ACTIONS).setValue(actionButtons);
}

From source file:org.activiti.explorer.ui.task.CustomerInboxPage.java

License:Apache License

@Override
protected Table createList() {
    showEvents = true;//from   ww w.j ava  2  s . c o m
    taskTable = new Table();
    taskTable.addStyleName(ExplorerLayout.STYLE_TASK_LIST);
    taskTable.addStyleName(ExplorerLayout.STYLE_SCROLLABLE);

    // Listener to change right panel when clicked on a task
    taskTable.addListener(getListSelectionListener());

    this.lazyLoadingQuery = createLazyLoadingQuery();
    this.taskListContainer = new LazyLoadingContainer(lazyLoadingQuery, 50);
    taskTable.setContainerDataSource(taskListContainer);

    // Create column header
    taskTable.addGeneratedColumn("icon", new ThemeImageColumnGenerator(Images.TASK_22));
    taskTable.setColumnWidth("icon", 22);

    taskTable.addContainerProperty("name", String.class, null);
    taskTable.addContainerProperty("customerName", String.class, "",
            i18nManager.getMessage(Constants.CUSTOMER_NAME), null, Table.ALIGN_LEFT);
    taskTable.addContainerProperty("customerGroup", String.class, "",
            i18nManager.getMessage(Constants.CUSTOMER_GROUP), null, Table.ALIGN_LEFT);
    taskTable.addContainerProperty("totalAmount", Double.class, "",
            i18nManager.getMessage(Constants.CUSTOMER_DEBIT), null, Table.ALIGN_LEFT);
    taskTable.addContainerProperty("customerStatus", String.class, "",
            i18nManager.getMessage(Constants.CUSTOMER_STATUS), null, Table.ALIGN_LEFT);
    taskTable.addContainerProperty("customerType", String.class, "",
            i18nManager.getMessage(Constants.CUSTOMER_TYPE), null, Table.ALIGN_LEFT);
    // taskTable.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);

    mapCheckBox = new HashMap<Object, CheckBox>();

    taskTable.addGeneratedColumn("checkbox", new ColumnGenerator() {

        public Object generateCell(Table source, Object itemId, Object columnId) {
            Field field = new CheckBox();
            ((AbstractComponent) field).setImmediate(true);
            mapCheckBox.put(itemId, (CheckBox) field);
            return field;
        }
    });

    HeaderClickListener headerClickListener = new HeaderClickListener() {

        @Override
        public void headerClick(HeaderClickEvent event) {
            // TODO Auto-generated method stub
            LinkedList<Integer> container = (LinkedList<Integer>) taskTable.getVisibleItemIds();
            System.out.println(container);
            for (Integer intIds : container) {

                CheckBox check = mapCheckBox.get(intIds);
                check.setValue(!checked);
                System.out.println(check);
            }
            checked = !checked;

        }
    };

    taskTable.addListener(headerClickListener);
    return taskTable;
}

From source file:org.activiti.kickstart.ui.table.PropertyTable.java

License:Apache License

protected void addPropertyRow(Object itemId, String propertyName, String propertyType, Boolean required) {
    Object newItemId = null;/*  w  w w  .  ja  v a 2 s .  c  om*/
    if (itemId == null) { // add at the end of list
        newItemId = addItem();
    } else {
        newItemId = addItemAfter(itemId);
    }
    Item newItem = getItem(newItemId);

    // name
    newItem.getItemProperty("property").setValue(propertyName == null ? "My Property" : propertyName);

    // type
    ComboBox typeComboBox = new ComboBox("types", Arrays.asList("text", "number", "date"));
    if (propertyType == null) {
        typeComboBox.setValue(typeComboBox.getItemIds().iterator().next());
        typeComboBox.setNullSelectionAllowed(false);
    } else {
        typeComboBox.setValue(propertyType);
    }
    newItem.getItemProperty("type").setValue(typeComboBox);

    // required
    CheckBox requiredCheckBox = new CheckBox();
    requiredCheckBox.setValue(required == null ? false : required);
    newItem.getItemProperty("required").setValue(requiredCheckBox);

    // actions
    HorizontalLayout actionButtons = new HorizontalLayout();

    Button deleteRowButton = new Button("-");
    deleteRowButton.setData(newItemId);
    deleteRowButton.addListener(new DeletePropertyClickListener(this));
    actionButtons.addComponent(deleteRowButton);

    Button addRowButton = new Button("+");
    addRowButton.setData(newItemId);
    addRowButton.addListener(new AddPropertyClickListener(this));
    actionButtons.addComponent(addRowButton);

    newItem.getItemProperty("actions").setValue(actionButtons);
}

From source file:org.apache.openaz.xacml.admin.components.PolicyEditor.java

License:Apache License

@AutoGenerated
private HorizontalLayout buildHorizontalLayoutToolbar() {
    // common part: create layout
    horizontalLayoutToolbar = new HorizontalLayout();
    horizontalLayoutToolbar.setImmediate(false);
    horizontalLayoutToolbar.setWidth("-1px");
    horizontalLayoutToolbar.setHeight("-1px");
    horizontalLayoutToolbar.setMargin(true);
    horizontalLayoutToolbar.setSpacing(true);

    // checkBoxReadOnly
    checkBoxReadOnly = new CheckBox();
    checkBoxReadOnly.setCaption("Read Only");
    checkBoxReadOnly.setImmediate(false);
    checkBoxReadOnly.setDescription("Check this to turn-off policy editing.");
    checkBoxReadOnly.setWidth("-1px");
    checkBoxReadOnly.setHeight("-1px");
    horizontalLayoutToolbar.addComponent(checkBoxReadOnly);

    // checkBoxAutoSave
    checkBoxAutoSave = new CheckBox();
    checkBoxAutoSave.setCaption("Auto Save");
    checkBoxAutoSave.setImmediate(false);
    checkBoxAutoSave.setDescription("Check this to turn-on automatic saving of policy when a change occurs.");
    checkBoxAutoSave.setWidth("-1px");
    checkBoxAutoSave.setHeight("-1px");
    horizontalLayoutToolbar.addComponent(checkBoxAutoSave);

    // buttonSave
    buttonSave = new Button();
    buttonSave.setCaption("Save");
    buttonSave.setImmediate(true);//from  www. ja  v  a 2s  .c  om
    buttonSave.setDescription("Click to save the policy.");
    buttonSave.setWidth("-1px");
    buttonSave.setHeight("-1px");
    horizontalLayoutToolbar.addComponent(buttonSave);

    // buttonViewXML
    buttonViewXML = new Button();
    buttonViewXML.setCaption("View XML");
    buttonViewXML.setImmediate(true);
    buttonViewXML.setWidth("-1px");
    buttonViewXML.setHeight("-1px");
    horizontalLayoutToolbar.addComponent(buttonViewXML);

    // buttonExport
    buttonExport = new Button();
    buttonExport.setCaption("Export Policy");
    buttonExport.setImmediate(false);
    buttonExport.setWidth("-1px");
    buttonExport.setHeight("-1px");
    horizontalLayoutToolbar.addComponent(buttonExport);

    return horizontalLayoutToolbar;
}