Example usage for com.vaadin.server FontAwesome PLUS_SQUARE

List of usage examples for com.vaadin.server FontAwesome PLUS_SQUARE

Introduction

In this page you can find the example usage for com.vaadin.server FontAwesome PLUS_SQUARE.

Prototype

FontAwesome PLUS_SQUARE

To view the source code for com.vaadin.server FontAwesome PLUS_SQUARE.

Click Source Link

Usage

From source file:uicomponents.ConditionsPanel.java

License:Open Source License

/**
 * Create a new Conditions Panel component to select experimental conditions
 * /*from  w w  w . j  av a 2  s . co m*/
 * @param options List of different possible conditions
 * @param other Name of the "other" condition, which when selected will enable an input field for
 *        free text
 * @param special Name of a "special" condition like species for the entity input, which when
 *        selected will disable the normal species input because there is more than one instance
 * @param specialField the ComboBox containing the options of the special field, will be disabled
 *        when special is chosen as a condition
 * @param nullSelectionAllowed true, if the conditions may be empty
 * @param conditionsSet (empty) option group that makes it possible to listen to the conditions
 *        inside this component from the outside
 * @param specialNumField
 */
public ConditionsPanel(List<String> options, String other, String special, ComboBox specialField,
        boolean nullSelectionAllowed, OptionGroup conditionsSet, TextField specialNumField) {
    this.specialField = specialField;
    this.specialNumField = specialNumField;
    this.options = options;
    this.other = other;
    this.special = special;
    this.nullSelectionAllowed = nullSelectionAllowed;

    this.conditionsSet = conditionsSet;
    this.conditionsSet.addItem("set");

    initListener();

    choosers = new ArrayList<ConditionChooser>();
    ConditionChooser c = new ConditionChooser(options, other, special, nullSelectionAllowed);
    c.addListener(conditionChangeListener);
    choosers.add(c);
    addComponent(c);

    buttonGrid = new GridLayout(1, 2);
    buttonGrid.setSpacing(true);
    add = new Button();
    remove = new Button();
    Styles.iconButton(add, FontAwesome.PLUS_SQUARE);
    Styles.iconButton(remove, FontAwesome.MINUS_SQUARE);
    buttonGrid.addComponent(add);
    buttonGrid.addComponent(remove);
    add.addClickListener(buttonListener);
    remove.addClickListener(buttonListener);
    buttonGridComp = new HorizontalLayout();
    buttonGridComp.addComponent(buttonGrid);
    buttonGridComp = Styles.questionize(buttonGridComp,
            "Choose (optional) experimental variables for this level of your experiment. "
                    + "You can add or remove variables using " + FontAwesome.PLUS_SQUARE.getHtml() + " and "
                    + FontAwesome.MINUS_SQUARE.getHtml() + ".",
            "Experimental Variables");
    addComponent(buttonGridComp);
    setSpacing(true);
}

From source file:uicomponents.TechnologiesPanel.java

License:Open Source License

/**
 * Create a new Conditions Panel component to select experimental conditions
 * //from  ww w .  j a va  2s  . c o  m
 * @param techOptions List of different possible conditions
 * @param conditionsSet (empty) option group that makes it possible to listen to the conditions
 *        inside this component from the outside
 * @param proteinListeners
 */
public TechnologiesPanel(List<String> techOptions, Set<String> persons, OptionGroup conditionsSet,
        ValueChangeListener poolListener, ArrayList<ValueChangeListener> proteinListeners,
        ValueChangeListener mhcLigandListener, ClickListener refreshPeopleListener) {
    this.options = techOptions;
    this.persons = persons;

    this.conditionsSet = conditionsSet;
    this.conditionsSet.addItem("set");
    add = new Button();
    remove = new Button();
    Styles.iconButton(add, FontAwesome.PLUS_SQUARE);
    Styles.iconButton(remove, FontAwesome.MINUS_SQUARE);
    initListener();
    this.poolListener = poolListener;
    this.proteinListeners = proteinListeners;
    this.mhcLigandListener = mhcLigandListener;
    this.refreshPeopleListener = refreshPeopleListener;

    choosers = new ArrayList<TechChooser>();
    TechChooser c = new TechChooser(techOptions, persons);
    c.setImmediate(true);
    c.addPoolListener(poolListener);
    c.addRefreshPeopleListener(refreshPeopleListener);
    for (ValueChangeListener l : proteinListeners)
        c.addProteinListener(l);
    c.addMHCListener(mhcLigandListener);
    choosers.add(c);
    addComponent(c);
    c.showHelpers();

    buttonGrid = new GridLayout(1, 2);
    buttonGrid.setSpacing(true);
    buttonGrid.addComponent(add);
    buttonGrid.addComponent(remove);
    addComponent(buttonGrid);
    setSpacing(true);
}