当前位置: 首页>>代码示例>>Java>>正文


Java ComboBox.addListener方法代码示例

本文整理汇总了Java中com.vaadin.ui.ComboBox.addListener方法的典型用法代码示例。如果您正苦于以下问题:Java ComboBox.addListener方法的具体用法?Java ComboBox.addListener怎么用?Java ComboBox.addListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.vaadin.ui.ComboBox的用法示例。


在下文中一共展示了ComboBox.addListener方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: attach

import com.vaadin.ui.ComboBox; //导入方法依赖的package包/类
@Override
public void attach() {
    setHeight(TAB_HEIGHT);
    setMargin(false, true, true, true);
    setSpacing(false);

    // メインフォーム
    Form mainForm = new Form();
    addComponent(mainForm);

    // 監視プロトコル
    checkProtocolSelect = new ComboBox(ViewProperties.getCaption("field.checkProtocol"));
    checkProtocolSelect.setWidth(TEXT_WIDTH);
    checkProtocolSelect.setImmediate(true);
    checkProtocolSelect.setNullSelectionAllowed(false);
    checkProtocolSelect.addListener(new Property.ValueChangeListener() {
        @Override
        public void valueChange(Property.ValueChangeEvent event) {
            checkProtocolValueChange(event);
        }
    });
    mainForm.getLayout().addComponent(checkProtocolSelect);

    // 監視ポート
    checkPortField = new TextField(ViewProperties.getCaption("field.checkPort"));
    checkPortField.setWidth(TEXT_WIDTH);
    mainForm.getLayout().addComponent(checkPortField);

    // 監視Path
    checkPathField = new TextField(ViewProperties.getCaption("field.checkPath"));
    checkPathField.setImmediate(true);
    mainForm.getLayout().addComponent(checkPathField);

    // ヘルスチェック詳細設定パネル
    Panel panel = new Panel(ViewProperties.getCaption("field.healthCheckDetail"));
    ((Layout) panel.getContent()).setMargin(false, false, false, true);
    ((Layout) panel.getContent()).setHeight("200px");
    ((Layout) panel.getContent()).setWidth("315px");
    mainForm.getLayout().addComponent(panel);

    // サブフォーム
    Form subForm = new Form();
    subForm.setStyleName("panel-healthcheck-setting");
    subForm.getLayout().setMargin(false, false, false, false);
    panel.addComponent(subForm);

    // タイムアウト時間
    checkTimeoutField = new TextField(ViewProperties.getCaption("field.checkTimeout"));
    checkTimeoutField.setWidth(TEXT_WIDTH);
    subForm.getLayout().addComponent(checkTimeoutField);

    // ヘルスチェック間隔
    checkIntervalField = new TextField(ViewProperties.getCaption("field.checkInterval"));
    checkIntervalField.setWidth(TEXT_WIDTH);
    subForm.getLayout().addComponent(checkIntervalField);

    // 障害閾値
    unhealthyThresholdField = new TextField(ViewProperties.getCaption("field.checkDownThreshold"));
    unhealthyThresholdField.setWidth(TEXT_WIDTH);
    subForm.getLayout().addComponent(unhealthyThresholdField);

    // 復帰閾値
    healthyThresholdField = new TextField(ViewProperties.getCaption("field.checkRecoverThreshold"));
    healthyThresholdField.setWidth(TEXT_WIDTH);
    subForm.getLayout().addComponent(healthyThresholdField);

    // UltraMonkeyロードバランサの場合、復帰閾値は設定できない
    if (PCCConstant.LOAD_BALANCER_ULTRAMONKEY.equals(loadBalancerType)) {
        healthyThresholdField.setEnabled(false);
    }

    initValidation();
}
 
开发者ID:primecloud-controller-org,项目名称:primecloud-controller,代码行数:74,代码来源:WinLoadBalancerEdit.java

示例2: attach

import com.vaadin.ui.ComboBox; //导入方法依赖的package包/类
@Override
public void attach() {
    // メインフォーム
    Form mainForm = new Form();
    Layout mainLayout = mainForm.getLayout();
    addComponent(mainForm);

    // ロードバランサ名
    nameField = new TextField(ViewProperties.getCaption("field.loadBalancerName"));
    nameField.setReadOnly(true);
    mainLayout.addComponent(nameField);

    // サービス名
    serviceField = new TextField(ViewProperties.getCaption("field.loadBalancerService"));
    serviceField.setReadOnly(true);
    mainLayout.addComponent(serviceField);

    // ロードバランサ設定パネル
    Panel panel = new Panel(ViewProperties.getCaption("field.loadBalancerConfig"));
    ((Layout) panel.getContent()).setMargin(false, false, false, true);
    mainLayout.addComponent(panel);

    // サブフォーム
    subForm = new Form();
    FormLayout sublayout = (FormLayout) this.subForm.getLayout();
    sublayout.setMargin(false);
    sublayout.setSpacing(false);
    panel.getContent().addComponent(subForm);
    subForm.setHeight("200px");

    // ロードバランサポート
    loadBalancerPortField = new TextField(ViewProperties.getCaption("field.loadBalancerPort"));
    loadBalancerPortField.setWidth(TEXT_WIDTH);
    sublayout.addComponent(loadBalancerPortField);

    // サービスポート
    servicePortField = new TextField(ViewProperties.getCaption("field.loadBalancerServicePort"));
    servicePortField.setWidth(TEXT_WIDTH);
    sublayout.addComponent(servicePortField);

    // プロトコル
    protocolSelect = new ComboBox(ViewProperties.getCaption("field.loadBalancerProtocol"));
    protocolSelect.setWidth(TEXT_WIDTH);
    protocolSelect.setImmediate(true);
    sublayout.addComponent(protocolSelect);
    protocolSelect.addListener(new Property.ValueChangeListener() {
        @Override
        public void valueChange(Property.ValueChangeEvent event) {
            protocolValueChange(event);
        }
    });

    // SSLキー
    sslKeySelect = new ComboBox(ViewProperties.getCaption("field.loadBalancerSSLKey"));
    sslKeySelect.setWidth(TEXT_WIDTH);
    sslKeySelect.addContainerProperty(SSLKEY_CAPTION_ID, String.class, null);
    sslKeySelect.setItemCaptionMode(AbstractSelect.ITEM_CAPTION_MODE_PROPERTY);
    sslKeySelect.setItemCaptionPropertyId(SSLKEY_CAPTION_ID);
    sublayout.addComponent(sslKeySelect);

    initValidation();
}
 
开发者ID:primecloud-controller-org,项目名称:primecloud-controller,代码行数:63,代码来源:WinLoadBalancerConfigListener.java

示例3: setupAddFilterWindow

import com.vaadin.ui.ComboBox; //导入方法依赖的package包/类
private void setupAddFilterWindow(Window window) {
	// General variables

	// Layouts
	GridLayout mainLayout = new GridLayout(1, 3);
	HorizontalLayout axisLayout = new HorizontalLayout();
	HorizontalLayout criteriaLayout = new HorizontalLayout();
	HorizontalLayout buttonLayout = new HorizontalLayout();
	hznCriteria = criteriaLayout;

	// Buttons
	ExpressZipButton btnAdd = new ExpressZipButton("Add", Style.ACTION);
	btnAdd.setClickShortcut(KeyCode.ENTER);
	btnAdd.addStyleName("primary");
	ExpressZipButton btnCancel = new ExpressZipButton("Cancel", Style.ACTION);

	// Fields
	ComboBox cmbAxis = new ComboBox();
	cmbAxis.setTextInputAllowed(false);
	cmbAxis.setNullSelectionAllowed(false);

	// Labels
	Label lblAxis = new Label("Axis");

	btnAdd.addListener(filterButtonListener);
	btnCancel.addListener(filterButtonListener);

	for (Filter.AxisFilters f : Filter.axisArray) {
		cmbAxis.addItem(filter.getNameOfFilter(f));
	}
	cmbAxis.setImmediate(true);
	cmbAxis.addListener(axisSelectedListener);
	cmbAxis.setValue(filter.getNameOfFilter(Filter.axisArray[0]));

	mainLayout.addComponent(axisLayout, 0, 0);
	mainLayout.addComponent(criteriaLayout, 0, 1);
	mainLayout.addComponent(buttonLayout, 0, 2);
	mainLayout.setSpacing(true);

	axisLayout.setSpacing(true);

	axisLayout.addComponent(lblAxis);
	axisLayout.addComponent(cmbAxis);
	axisLayout.setExpandRatio(lblAxis, .2f);
	axisLayout.setExpandRatio(cmbAxis, .8f);
	axisLayout.setComponentAlignment(lblAxis, Alignment.MIDDLE_LEFT);
	axisLayout.setComponentAlignment(cmbAxis, Alignment.MIDDLE_LEFT);
	axisLayout.setSizeFull();

	criteriaLayout.setSizeFull();

	buttonLayout.setSpacing(true);
	buttonLayout.addComponent(btnAdd);
	buttonLayout.addComponent(btnCancel);
	buttonLayout.setComponentAlignment(btnAdd, Alignment.BOTTOM_RIGHT);
	buttonLayout.setComponentAlignment(btnCancel, Alignment.BOTTOM_RIGHT);
	buttonLayout.setExpandRatio(btnAdd, 1f);
	buttonLayout.setExpandRatio(btnCancel, 0f);
	buttonLayout.setSizeFull();

	mainLayout.setRowExpandRatio(0, 1f);
	mainLayout.setRowExpandRatio(1, 1f);
	mainLayout.setRowExpandRatio(2, 1f);
	mainLayout.setSizeFull();

	window.addComponent(mainLayout);
	window.getContent().setSizeFull();
}
 
开发者ID:lizardtechblog,项目名称:ExpressZip,代码行数:69,代码来源:FindLayersViewComponent.java


注:本文中的com.vaadin.ui.ComboBox.addListener方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。