Java Code Examples for com.vaadin.ui.CheckBox#setImmediate()

The following examples show how to use com.vaadin.ui.CheckBox#setImmediate() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DistributionSetSelectWindow.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
private VerticalLayout initView() {
    final Label label = new Label(i18n.getMessage(UIMessageIdProvider.LABEL_AUTO_ASSIGNMENT_DESC));

    checkBox = new CheckBox(i18n.getMessage(UIMessageIdProvider.LABEL_AUTO_ASSIGNMENT_ENABLE));
    checkBox.setId(UIComponentIdProvider.DIST_SET_SELECT_ENABLE_ID);
    checkBox.setImmediate(true);
    checkBox.addValueChangeListener(
            event -> switchAutoAssignmentInputsVisibility((boolean) event.getProperty().getValue()));

    actionTypeOptionGroupLayout = new ActionTypeOptionGroupAutoAssignmentLayout(i18n);
    dsCombo = new DistributionSetSelectComboBox(i18n);

    final VerticalLayout verticalLayout = new VerticalLayout();
    verticalLayout.addComponent(label);
    verticalLayout.addComponent(checkBox);
    verticalLayout.addComponent(actionTypeOptionGroupLayout);
    verticalLayout.addComponent(dsCombo);

    return verticalLayout;
}
 
Example 2
Source File: ServiceButtonsTop.java    From primecloud-controller with GNU General Public License v2.0 6 votes vote down vote up
private void stopAllButtonClick(ClickEvent event) {
    // ダイアログの表示オプション
    HorizontalLayout optionLayout = new HorizontalLayout();
    final CheckBox checkBox = new CheckBox(ViewMessages.getMessage("IUI-000033"), false);
    checkBox.setImmediate(true);
    optionLayout.addComponent(checkBox);

    // 確認ダイアログを表示
    String message = ViewMessages.getMessage("IUI-000010");
    DialogConfirm dialog = new DialogConfirm(ViewProperties.getCaption("dialog.confirm"), message,
            Buttons.OKCancelConfirm, optionLayout);
    dialog.setCallback(new DialogConfirm.Callback() {
        @Override
        public void onDialogResult(Result result) {
            if (result != Result.OK) {
                return;
            }

            boolean stopInstance = (Boolean) checkBox.getValue();
            stopAll(stopInstance);
        }
    });
    getApplication().getMainWindow().addWindow(dialog);
}
 
Example 3
Source File: AttributeSelectionWindow.java    From XACML with MIT License 5 votes vote down vote up
@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(true);
	verticalLayout_2.setSpacing(true);
	
	// textFieldIssuer
	textFieldIssuer = new TextField();
	textFieldIssuer.setCaption("Issuer");
	textFieldIssuer.setImmediate(false);
	textFieldIssuer.setWidth("-1px");
	textFieldIssuer.setHeight("-1px");
	verticalLayout_2.addComponent(textFieldIssuer);
	
	// checkBoxMustBePresent
	checkBoxMustBePresent = new CheckBox();
	checkBoxMustBePresent.setCaption("Attribute Must Be Present");
	checkBoxMustBePresent.setImmediate(false);
	checkBoxMustBePresent.setWidth("-1px");
	checkBoxMustBePresent.setHeight("-1px");
	verticalLayout_2.addComponent(checkBoxMustBePresent);
	
	return verticalLayout_2;
}
 
Example 4
Source File: BasicModel.java    From chipster with MIT License 5 votes vote down vote up
private void initElements() {
	
	lbName = new Label("Display name:");
	lbId = new Label();
	lbDescription = new Label("Description:");
	lbOptional = new Label("Optional:");
	
	name = new TextField();
	name.setWidth(WIDTH);
	name.setDescription("Display name for the element");
	name.setImmediate(true);
	name.addTextChangeListener(new CSCTextChangeListener(this));
	
	id = new TextField();
	id.setDescription("file name or unique identification");
	id.setImmediate(true);
	id.setRequired(true);
	id.setRequiredError(REQUIRED_TEXT);
	id.setWidth(WIDTH);
	id.addTextChangeListener(new CSCTextChangeListener(this, true));
	
	description = new TextArea();
	description.setWidth(WIDTH);
	description.setDescription("Short description");
	
	layout = new HorizontalLayout();
	
	prefix = new TextField();
	postfix = new TextField();
	
	layout.addComponent(prefix);
	layout.addComponent(new Label(MULTI_FILE_TEXT));
	layout.addComponent(postfix);
	
	optional = new CheckBox();
	optional.setDescription("Is this element optional");
	optional.setImmediate(true);
}
 
Example 5
Source File: WinServerAttachService.java    From primecloud-controller with GNU General Public License v2.0 4 votes vote down vote up
public void show(List<ComponentDto> components) {
    this.components = components;

    removeAllItems();

    if (components == null) {
        return;
    }

    for (ComponentDto component : components) {
        // チェックボックス
        CheckBox checkBox = new CheckBox();
        checkBox.setImmediate(true);
        checkBox.setEnabled(false);
        if (selectedComponentNos.contains(component.getComponent().getComponentNo())) {
            checkBox.setValue(true);
        } else {
            checkBox.setValue(false);
        }

        checkBox.addListener(new Property.ValueChangeListener() {
            @Override
            public void valueChange(Property.ValueChangeEvent event) {
                // チェックボックスの有効/無効を制御
                changeCheckEnabled();

                // テーブル再描画
                requestRepaint();
            }
        });

        // サービス名
        String serviceName = component.getComponent().getComponentName();
        if (StringUtils.isNotEmpty(component.getComponent().getComment())) {
            serviceName = component.getComponent().getComment() + "\n[" + serviceName + "]";
        }
        Label serviceNameLabel = new Label(serviceName, Label.CONTENT_PREFORMATTED);
        serviceNameLabel.setHeight(COLUMN_HEIGHT);

        // ステータス
        String status = null;
        if (instance != null) {
            for (ComponentInstanceDto componentInstance : instance.getComponentInstances()) {
                if (componentInstance.getComponentInstance().getComponentNo()
                        .equals(component.getComponent().getComponentNo())) {
                    status = componentInstance.getComponentInstance().getStatus();
                    break;
                }
            }
        }
        if (StringUtils.isEmpty(status)) {
            status = "Stopped";
        } else {
            status = StringUtils.capitalize(StringUtils.lowerCase(status));
        }

        Icons statusIcon = Icons.fromName(status);
        Label statusLabel = new Label(IconUtils.createImageTag(getApplication(), statusIcon, status),
                Label.CONTENT_XHTML);
        statusLabel.setHeight(COLUMN_HEIGHT);

        addItem(new Object[] { checkBox, serviceNameLabel, statusLabel },
                component.getComponent().getComponentNo());
    }

    changeCheckEnabled();
}
 
Example 6
Source File: PIPSQLResolverEditorWindow.java    From XACML with MIT License 4 votes vote down vote up
@AutoGenerated
private VerticalLayout buildMainLayout() {
	// common part: create layout
	mainLayout = new VerticalLayout();
	mainLayout.setImmediate(false);
	mainLayout.setWidth("-1px");
	mainLayout.setHeight("-1px");
	mainLayout.setMargin(true);
	mainLayout.setSpacing(true);
	
	// top-level component properties
	setWidth("-1px");
	setHeight("-1px");
	
	// textAreaSelect
	textAreaSelect = new TextArea();
	textAreaSelect.setCaption("SQL Select Statement");
	textAreaSelect.setImmediate(false);
	textAreaSelect.setWidth("100.0%");
	textAreaSelect.setHeight("-1px");
	textAreaSelect.setInvalidAllowed(false);
	textAreaSelect.setRequired(true);
	mainLayout.addComponent(textAreaSelect);
	mainLayout.setExpandRatio(textAreaSelect, 1.0f);
	
	// textFieldBase
	textFieldBase = new TextField();
	textFieldBase.setCaption("Base DN");
	textFieldBase.setImmediate(false);
	textFieldBase.setWidth("-1px");
	textFieldBase.setHeight("-1px");
	mainLayout.addComponent(textFieldBase);
	
	// textFieldFilter
	textFieldFilter = new TextField();
	textFieldFilter.setCaption("Filter");
	textFieldFilter.setImmediate(false);
	textFieldFilter.setWidth("-1px");
	textFieldFilter.setHeight("-1px");
	mainLayout.addComponent(textFieldFilter);
	
	// checkBoxShortIds
	checkBoxShortIds = new CheckBox();
	checkBoxShortIds.setCaption("Display short id’s.");
	checkBoxShortIds.setImmediate(false);
	checkBoxShortIds.setWidth("-1px");
	checkBoxShortIds.setHeight("-1px");
	mainLayout.addComponent(checkBoxShortIds);
	
	// tableRequiredAttributes
	tableRequiredAttributes = new Table();
	tableRequiredAttributes.setCaption("Attributes Returned");
	tableRequiredAttributes.setImmediate(false);
	tableRequiredAttributes.setWidth("-1px");
	tableRequiredAttributes.setHeight("-1px");
	mainLayout.addComponent(tableRequiredAttributes);
	
	// tableAttributes
	tableAttributes = new Table();
	tableAttributes.setCaption("Parameters - Attributes Needed (i.e. ?)");
	tableAttributes.setImmediate(false);
	tableAttributes.setWidth("-1px");
	tableAttributes.setHeight("-1px");
	tableAttributes.setInvalidAllowed(false);
	tableAttributes.setRequired(true);
	mainLayout.addComponent(tableAttributes);
	
	return mainLayout;
}
 
Example 7
Source File: ApplyEditorWindow.java    From XACML with MIT License 4 votes vote down vote up
@AutoGenerated
private HorizontalLayout buildHorizontalLayout_1() {
	// common part: create layout
	horizontalLayout_1 = new HorizontalLayout();
	horizontalLayout_1.setImmediate(false);
	horizontalLayout_1.setWidth("-1px");
	horizontalLayout_1.setHeight("-1px");
	horizontalLayout_1.setMargin(false);
	horizontalLayout_1.setSpacing(true);
	
	// textAreaDescription
	textAreaDescription = new TextArea();
	textAreaDescription.setCaption("Enter A Description");
	textAreaDescription.setImmediate(false);
	textAreaDescription.setWidth("50.0%");
	textAreaDescription.setHeight("-1px");
	horizontalLayout_1.addComponent(textAreaDescription);
	
	// textFieldFilter
	textFieldFilter = new TextField();
	textFieldFilter.setCaption("Filter Function By ID");
	textFieldFilter.setImmediate(false);
	textFieldFilter.setWidth("-1px");
	textFieldFilter.setHeight("-1px");
	horizontalLayout_1.addComponent(textFieldFilter);
	horizontalLayout_1.setComponentAlignment(textFieldFilter,
			new Alignment(9));
	
	// comboBoxDatatypeFilter
	comboBoxDatatypeFilter = new ComboBox();
	comboBoxDatatypeFilter.setCaption("Filter By Data Type");
	comboBoxDatatypeFilter.setImmediate(false);
	comboBoxDatatypeFilter.setWidth("-1px");
	comboBoxDatatypeFilter.setHeight("-1px");
	horizontalLayout_1.addComponent(comboBoxDatatypeFilter);
	horizontalLayout_1.setComponentAlignment(comboBoxDatatypeFilter,
			new Alignment(9));
	
	// checkBoxFilterIsBag
	checkBoxFilterIsBag = new CheckBox();
	checkBoxFilterIsBag.setCaption("Is Bag Filter");
	checkBoxFilterIsBag.setImmediate(false);
	checkBoxFilterIsBag.setWidth("-1px");
	checkBoxFilterIsBag.setHeight("-1px");
	horizontalLayout_1.addComponent(checkBoxFilterIsBag);
	horizontalLayout_1.setComponentAlignment(checkBoxFilterIsBag,
			new Alignment(9));
	
	return horizontalLayout_1;
}
 
Example 8
Source File: PolicyUploadWindow.java    From XACML with MIT License 4 votes vote down vote up
@AutoGenerated
private VerticalLayout buildMainLayout() {
	// common part: create layout
	mainLayout = new VerticalLayout();
	mainLayout.setImmediate(false);
	mainLayout.setWidth("-1px");
	mainLayout.setHeight("-1px");
	mainLayout.setMargin(true);
	mainLayout.setSpacing(true);
	
	// top-level component properties
	setWidth("-1px");
	setHeight("-1px");
	
	// upload
	upload = new Upload();
	upload.setCaption("Upload Xacml Policy File");
	upload.setImmediate(false);
	upload.setWidth("-1px");
	upload.setHeight("-1px");
	mainLayout.addComponent(upload);
	
	// checkBoxImportAttributes
	checkBoxImportAttributes = new CheckBox();
	checkBoxImportAttributes
			.setCaption("Import attributes into attribute dictionary.");
	checkBoxImportAttributes.setImmediate(false);
	checkBoxImportAttributes.setWidth("-1px");
	checkBoxImportAttributes.setHeight("-1px");
	mainLayout.addComponent(checkBoxImportAttributes);
	
	// checkBoxIgnoreStandard
	checkBoxIgnoreStandard = new CheckBox();
	checkBoxIgnoreStandard.setCaption("Ignore Standard Attributes");
	checkBoxIgnoreStandard.setImmediate(false);
	checkBoxIgnoreStandard.setWidth("-1px");
	checkBoxIgnoreStandard.setHeight("-1px");
	mainLayout.addComponent(checkBoxIgnoreStandard);
	mainLayout.setComponentAlignment(checkBoxIgnoreStandard, new Alignment(
			20));
	
	// checkBoxImportObligations
	checkBoxImportObligations = new CheckBox();
	checkBoxImportObligations
			.setCaption("Import obligations into obligation dictionary.");
	checkBoxImportObligations.setImmediate(false);
	checkBoxImportObligations.setWidth("-1px");
	checkBoxImportObligations.setHeight("-1px");
	mainLayout.addComponent(checkBoxImportObligations);
	
	// checkBoxImportAdvice
	checkBoxImportAdvice = new CheckBox();
	checkBoxImportAdvice
			.setCaption("Import advice into advice dictionary.");
	checkBoxImportAdvice.setImmediate(false);
	checkBoxImportAdvice.setWidth("-1px");
	checkBoxImportAdvice.setHeight("-1px");
	mainLayout.addComponent(checkBoxImportAdvice);
	
	return mainLayout;
}
 
Example 9
Source File: ExpressionBuilderComponent.java    From XACML with MIT License 4 votes vote down vote up
@AutoGenerated
private HorizontalLayout buildHorizontalLayout_1() {
	// common part: create layout
	horizontalLayout_1 = new HorizontalLayout();
	horizontalLayout_1.setImmediate(false);
	horizontalLayout_1.setWidth("-1px");
	horizontalLayout_1.setHeight("-1px");
	horizontalLayout_1.setMargin(false);
	horizontalLayout_1.setSpacing(true);
	
	// buttonAddExpression
	buttonAddExpression = new Button();
	buttonAddExpression.setCaption("Add Expression");
	buttonAddExpression.setImmediate(true);
	buttonAddExpression.setWidth("-1px");
	buttonAddExpression.setHeight("-1px");
	horizontalLayout_1.addComponent(buttonAddExpression);
	
	// buttonDeleteExpression
	buttonDeleteExpression = new Button();
	buttonDeleteExpression.setCaption("Delete Expression");
	buttonDeleteExpression.setImmediate(true);
	buttonDeleteExpression.setWidth("-1px");
	buttonDeleteExpression.setHeight("-1px");
	horizontalLayout_1.addComponent(buttonDeleteExpression);
	
	// buttonClearAll
	buttonClearAll = new Button();
	buttonClearAll.setCaption("Clear All");
	buttonClearAll.setImmediate(true);
	buttonClearAll.setDescription("Clears all the expressions.");
	buttonClearAll.setWidth("-1px");
	buttonClearAll.setHeight("-1px");
	horizontalLayout_1.addComponent(buttonClearAll);
	
	// checkBoxShortName
	checkBoxShortName = new CheckBox();
	checkBoxShortName.setCaption("Display Short XACML ID's");
	checkBoxShortName.setImmediate(false);
	checkBoxShortName
			.setDescription("If checked, the right-most string of the function and datatype URI's will only be displayed.");
	checkBoxShortName.setWidth("-1px");
	checkBoxShortName.setHeight("-1px");
	horizontalLayout_1.addComponent(checkBoxShortName);
	
	return horizontalLayout_1;
}
 
Example 10
Source File: PolicyEditor.java    From XACML with MIT License 4 votes vote down vote up
@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);
	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;
}