Java Code Examples for com.vaadin.data.Property.ValueChangeEvent

The following are top voted examples for showing how to use com.vaadin.data.Property.ValueChangeEvent. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: opennmszh   File: NCSViewContribution.java   Source Code and License 11 votes vote down vote up
@Override
public Component getView(final WidgetContext widgetContext) {
	
	Tree tree = new Tree("Services", new FilterableHierarchicalContainer(new NCSServiceContainer(m_ncsComponentRepository)));
	tree.setMultiSelect(true);
	tree.setImmediate(true);
	tree.setItemCaptionMode(Tree.ITEM_CAPTION_MODE_PROPERTY);
	tree.setItemCaptionPropertyId("name");
	tree.addListener(new ValueChangeListener() {
		
		@Override
		public void valueChange(ValueChangeEvent event) {
			Collection<Long> selectedIds = (Collection<Long>) event.getProperty().getValue();
			
			Criteria criteria = NCSEdgeProvider.createCriteria(selectedIds);
			
			widgetContext.getGraphContainer().setCriteria(criteria);
		}
	});
	
	return tree;
}
 
Example 2
Project: hawkbit   File: RepositoryConfigurationView.java   Source Code and License 7 votes vote down vote up
@Override
public void valueChange(final ValueChangeEvent event) {

    if (!(event.getProperty() instanceof CheckBox)) {
        return;
    }

    notifyConfigurationChanged();

    final CheckBox checkBox = (CheckBox) event.getProperty();
    BooleanConfigurationItem configurationItem;

    if (actionAutocloseCheckBox.equals(checkBox)) {
        configurationItem = actionAutocloseConfigurationItem;
    } else {
        return;
    }

    if (checkBox.getValue()) {
        configurationItem.configEnable();
    } else {
        configurationItem.configDisable();
    }
}
 
Example 3
Project: metl   File: EditDeduperPanel.java   Source Code and License 7 votes vote down vote up
protected CheckBox createAttributeCheckBox(final AttributeSettings settings, final String key) {
    final CheckBox checkBox = new CheckBox();
    checkBox.setImmediate(true);
    checkBox.addValueChangeListener(new ValueChangeListener() {
        private static final long serialVersionUID = 1L;
        @Override
        public void valueChange(ValueChangeEvent event) {
            ComponentAttribSetting setting = component.getSingleAttributeSetting(settings.getAttributeId(), key);

            String oldValue = setting == null ? Boolean.FALSE.toString() : setting.getValue();
            if (setting == null) {
                setting = new ComponentAttribSetting(settings.getAttributeId(), component.getId(), key, Boolean.TRUE.toString());
                component.addAttributeSetting(setting);
            }
            setting.setValue(checkBox.getValue().toString());
            if (!oldValue.equals(setting.getValue())) {
                context.getConfigurationService().save(setting);
            }
        }
    });
    checkBox.setReadOnly(readOnly);
    return checkBox;
}
 
Example 4
Project: metl   File: EditMergerPanel.java   Source Code and License 7 votes vote down vote up
private CheckBox createCheckBox(final AttributeSettings settings, final String key) {
    final CheckBox checkBox = new CheckBox();
    checkBox.setImmediate(true);
    checkBox.addValueChangeListener(new ValueChangeListener() {

        @Override
        public void valueChange(ValueChangeEvent event) {
            ComponentAttribSetting setting = component.getSingleAttributeSetting(settings.getAttributeId(), key);

            String oldValue = setting == null ? Boolean.FALSE.toString() : setting.getValue();
            if (setting == null) {
                setting = new ComponentAttribSetting(settings.getAttributeId(), component.getId(), key, Boolean.TRUE.toString());
                component.addAttributeSetting(setting);
            }
            setting.setValue(checkBox.getValue().toString());
            if (!oldValue.equals(setting.getValue())) {
                context.getConfigurationService().save(setting);
            }
        }
    });
    checkBox.setReadOnly(readOnly);
    return checkBox;

}
 
Example 5
Project: osc-core   File: BaseDeploymentSpecWindow.java   Source Code and License 6 votes vote down vote up
@SuppressWarnings("serial")
protected OptionGroup getUserOptions() {
    this.userOption = new OptionGroup("Selection Criterion:");
    this.userOption.addItem(NONE);
    this.userOption.addItem(AVAILABILITY_ZONES);
    this.userOption.addItem(HOST_AGGREGATES);
    this.userOption.addItem(HOSTS);
    this.userOption.select(NONE);
    this.userOption.addValueChangeListener(new ValueChangeListener() {
        @Override
        public void valueChange(ValueChangeEvent event) {
            populateOptionTable();
        }
    });

    return this.userOption;
}
 
Example 6
Project: osc-core   File: SummaryLayout.java   Source Code and License 6 votes vote down vote up
@SuppressWarnings("serial")
private CheckBox createCheckBox() {
    this.checkbox = new CheckBox(VmidcMessages.getString(VmidcMessages_.SUMMARY_DOWNLOAD_INCLUDE_DB));
    this.checkbox.setImmediate(true);
    this.checkbox.setValue(false);
    this.checkbox.addValueChangeListener(new ValueChangeListener() {

        @Override
        public void valueChange(ValueChangeEvent event) {
            if (SummaryLayout.this.checkbox.getValue()) {
                SummaryLayout.this.download
                        .setCaption(VmidcMessages.getString(VmidcMessages_.SUMMARY_DOWNLOAD_BUNDLE));
            } else {
                SummaryLayout.this.download
                        .setCaption(VmidcMessages.getString(VmidcMessages_.SUMMARY_DOWNLOAD_LOG));
            }
        }
    });
    return this.checkbox;
}
 
Example 7
Project: osc-core   File: NetworkLayout.java   Source Code and License 6 votes vote down vote up
@SuppressWarnings("serial")
private OptionGroup createOptionGroup() {
    this.mode = new OptionGroup();
    this.mode.addItem("DHCP");
    this.mode.addItem("Static");
    this.mode.addStyleName("network-options");
    this.mode.setImmediate(true);
    this.mode.addValueChangeListener(new ValueChangeListener() {
        @Override
        public void valueChange(ValueChangeEvent event) {
            if (NetworkLayout.this.mode.getValue().equals("DHCP")) {
                NetworkLayout.this.editIPSettings.setEnabled(false);
                populateNetworkTable();
                NetworkLayout.this.mode.setEnabled(true);
            }
            if (NetworkLayout.this.mode.getValue().equals("Static")) {
                NetworkLayout.this.editIPSettings.setEnabled(true);
                NetworkLayout.this.mode.setEnabled(false);
            }

        }
    });
    return this.mode;
}
 
Example 8
Project: osc-core   File: BaseSecurityGroupWindow.java   Source Code and License 6 votes vote down vote up
@SuppressWarnings("serial")
private Component getType() {
    this.protectionTypeOption = new OptionGroup("Selection Type:");
    this.protectionTypeOption.addItem(TYPE_ALL);
    this.protectionTypeOption.addItem(TYPE_SELECTION);
    this.protectionTypeOption.select(TYPE_ALL);
    this.protectionTypeOption.addValueChangeListener(new ValueChangeListener() {
        @Override
        public void valueChange(ValueChangeEvent event) {
            if (BaseSecurityGroupWindow.this.protectionTypeOption.getValue() == TYPE_ALL) {
                enableSelection(false);
            } else if (BaseSecurityGroupWindow.this.protectionTypeOption.getValue() == TYPE_SELECTION) {
                enableSelection(true);
            }
            // Populate to list first and then the from list since we use the 'to' list items to exclude them from
            // the 'from' list
            populateToList();
            populateFromList();
        }
    });

    return this.protectionTypeOption;
}
 
Example 9
Project: incubator-openaz   File: AttributeSelectionWindow.java   Source Code and License 6 votes vote down vote up
protected void initializeOption() {
	//
	// Setup datasource and GUI properties
	//
	this.optionGroupAttribute.setImmediate(true);
	this.optionGroupAttribute.addItem(ATTRIBUTE_OPTION_DICTIONARY);
	this.optionGroupAttribute.addItem(ATTRIBUTE_OPTION_STANDARD);
	this.optionGroupAttribute.addItem(ATTRIBUTE_OPTION_INPUT);
	//
	// Respond to events
	//
	this.optionGroupAttribute.addValueChangeListener(new ValueChangeListener() {
		private static final long serialVersionUID = 1L;

		@Override
		public void valueChange(ValueChangeEvent event) {
			self.resetAttributeOption();
		}
	});
}
 
Example 10
Project: incubator-openaz   File: PIPSQLResolverEditorWindow.java   Source Code and License 6 votes vote down vote up
protected void initializeCheckBox() {
	this.checkBoxShortIds.setValue(true);
	this.checkBoxShortIds.setImmediate(true);
	this.checkBoxShortIds.addValueChangeListener(new ValueChangeListener() {
		private static final long serialVersionUID = 1L;

		@Override
		public void valueChange(ValueChangeEvent event) {
			if (self.checkBoxShortIds.getValue()) {
				self.tableRequiredAttributes.setColumnCollapsed("id", true);
				self.tableRequiredAttributes.setColumnCollapsed("category", true);
				self.tableRequiredAttributes.setColumnCollapsed("datatype", true);
				self.tableRequiredAttributes.setColumnCollapsed("shortId", false);
				self.tableRequiredAttributes.setColumnCollapsed("shortCategory", false);
				self.tableRequiredAttributes.setColumnCollapsed("shortDatatype", false);
			} else {
				self.tableRequiredAttributes.setColumnCollapsed("id", false);
				self.tableRequiredAttributes.setColumnCollapsed("category", false);
				self.tableRequiredAttributes.setColumnCollapsed("datatype", false);
				self.tableRequiredAttributes.setColumnCollapsed("shortId", true);
				self.tableRequiredAttributes.setColumnCollapsed("shortCategory", true);
				self.tableRequiredAttributes.setColumnCollapsed("shortDatatype", true);
			}
		}			
	});
}
 
Example 11
Project: incubator-openaz   File: VariableReferenceEditorWindow.java   Source Code and License 6 votes vote down vote up
protected void initializeSelect(Map<VariableDefinitionType, PolicyType> vars) {
	//
	// Add existing variables into the table
	//
	if (vars != null) {
		for (VariableDefinitionType var : vars.keySet()) {
			this.listSelectVariables.addItem(var.getVariableId());
		}
	}
	//
	// Respond to changes
	//
	this.listSelectVariables.setImmediate(true);
	this.listSelectVariables.addValueChangeListener(new ValueChangeListener() {
		private static final long serialVersionUID = 1L;

		@Override
		public void valueChange(ValueChangeEvent event) {
			Object value = self.listSelectVariables.getValue();
			if (value != null) {
				self.textFieldVariable.setValue(value.toString());
			}
		}			
	});
}
 
Example 12
Project: incubator-openaz   File: PolicyEditor.java   Source Code and License 6 votes vote down vote up
protected void initializeCheckboxes(boolean readOnly) {
	//
	// The readonly check box
	//
	this.checkBoxReadOnly.setImmediate(true);
	this.checkBoxReadOnly.setValue(readOnly);
	this.checkBoxReadOnly.addValueChangeListener(new ValueChangeListener() {
		private static final long serialVersionUID = 1L;

		@Override
		public void valueChange(ValueChangeEvent event) {
			self.resetComponents();
			self.setupCaption();
		}
		
	});
	//
	// The autosave check box
	//
	this.checkBoxAutoSave.setImmediate(true);
	this.checkBoxAutoSave.setValue(true);
}
 
Example 13
Project: hybridbpm   File: GaugeChartConfLayout.java   Source Code and License 6 votes vote down vote up
@Override
public void bindConfigurationValues() {
    super.bindConfigurationValues();
    bindField(minValue, MIN_VALUE, preferences);
    bindField(maxValue, MAX_VALUE, preferences);

    valuesChoiceHandler = new ValueChangeListener() {
        @Override
        public void valueChange(ValueChangeEvent event) {
            checkMaxValue((DiagrammePreferenceValue) event.getProperty().getValue());
        }
    };
    valuesColumnChoice.addValueChangeListener(valuesChoiceHandler);
    minValue.addValueChangeListener(new MinMaxValueChangeListener(minValue));
    maxValue.addValueChangeListener(new MinMaxValueChangeListener(maxValue));
}
 
Example 14
Project: hawkbit   File: AddUpdateRolloutWindowLayout.java   Source Code and License 6 votes vote down vote up
private void onGroupNumberChange(final ValueChangeEvent event) {
    if (editRolloutEnabled) {
        return;
    }
    if (event.getProperty().getValue() != null && noOfGroups.isValid() && totalTargetsCount != null
            && isNumberOfGroups()) {
        groupSizeLabel.setValue(getTargetPerGroupMessage(String.valueOf(getGroupSize())));
        groupSizeLabel.setVisible(true);
        updateGroupsChart(Integer.parseInt(noOfGroups.getValue()));
    } else {
        groupSizeLabel.setVisible(false);
        if (isNumberOfGroups()) {
            updateGroupsChart(0);
        }
    }
}
 
Example 15
Project: hawkbit   File: AutoStartOptionGroupLayout.java   Source Code and License 6 votes vote down vote up
private void addValueChangeListener() {
    autoStartOptionGroup.addValueChangeListener(new ValueChangeListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void valueChange(final ValueChangeEvent event) {
            if (event.getProperty().getValue().equals(AutoStartOption.SCHEDULED)) {
                startAtDateField.setEnabled(true);
                startAtDateField.setRequired(true);
            } else {
                startAtDateField.setEnabled(false);
                startAtDateField.setRequired(false);
            }
        }
    });
}
 
Example 16
Project: hawkbit   File: ActionTypeOptionGroupLayout.java   Source Code and License 6 votes vote down vote up
private void addValueChangeListener() {
    actionTypeOptionGroup.addValueChangeListener(new ValueChangeListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void valueChange(final ValueChangeEvent event) {
            if (event.getProperty().getValue().equals(ActionTypeOption.AUTO_FORCED)) {
                forcedTimeDateField.setEnabled(true);
                forcedTimeDateField.setRequired(true);
            } else {
                forcedTimeDateField.setEnabled(false);
                forcedTimeDateField.setRequired(false);
            }
        }
    });
}
 
Example 17
Project: hawkbit   File: CreateUpdateDistSetTypeLayout.java   Source Code and License 6 votes vote down vote up
/**
 * Listener for option group - Create tag/Update.
 *
 * @param event
 *            ValueChangeEvent
 */
@Override
protected void optionValueChanged(final ValueChangeEvent event) {

    super.optionValueChanged(event);

    if (updateTagStr.equals(event.getProperty().getValue())) {
        selectedTable.getContainerDataSource().removeAllItems();
        getSourceTableData();
        distTypeSelectLayout.setEnabled(false);
    } else {
        distTypeSelectLayout.setEnabled(true);
        selectedTable.setEnabled(true);
        selectedTable.getContainerDataSource().removeAllItems();
        sourceTable.getContainerDataSource().removeAllItems();
        getSourceTableData();
    }
}
 
Example 18
Project: neat-tweaks   File: ConfigStatusViewImpl.java   Source Code and License 6 votes vote down vote up
protected Component buildAndBindList(String key, String caption) {
    ListSelect field = new ListSelect();
    field.setCaption(caption);
    field.setNullSelectionAllowed(false);
    field.addValueChangeListener((ValueChangeEvent event) -> {
        String path = (String) event.getProperty().getValue();
        if (path != null) {
            // open app (subapp)
            Location location = new RerootBrowserLocation("neatconfiguration", "helperBrowser", path, false);
            adminEventBus.fireEvent(new LocationChangedEvent(location));
        }

    });
    dataBindings.put(key, field);
    return field;
}
 
Example 19
Project: KrishnasSpace   File: FilterGrid.java   Source Code and License 6 votes vote down vote up
/**
 * @return
 */
private ValueChangeListener getCategoryFilterListener() {
	return new ValueChangeListener() {

		/**
		 * 
		 */
		private static final long serialVersionUID = -2368474286053602744L;

		@SuppressWarnings("unchecked")
		@Override
		public void valueChange(ValueChangeEvent event) {
			String newValue = (String) event.getProperty().getValue();
			BeanItemContainer<VehicleInfo> container = ((BeanItemContainer<VehicleInfo>) grid
					.getContainerDataSource());
			container.removeContainerFilters(CATEGORY);
			if (null != newValue && !newValue.isEmpty()) {
				container.addContainerFilter(new SimpleStringFilter(
						CATEGORY, newValue, true, true));
			}
		}
	};
}
 
Example 20
Project: Vaadin-Prime-Count   File: DefaultValueChangeListener.java   Source Code and License 6 votes vote down vote up
@Override
public void valueChange(final ValueChangeEvent event)
{
    assert null != event : "Parameter 'event' of method 'valueChange' must not be null";

    /** No need for the following logic - Vaadin performs this check implicitly and does not trigger the event unless the new value is different than the current value*/
    /* final String value = (String) event.getProperty().getValue(); //NOPMD
     if (null == this.currentValue)
     {
         this.currentValue = new String(Constants.EMPTY);
     }
     if (null != value && 0 == value.compareTo(this.currentValue))
     {
         return;
     }
     this.currentValue = value;*/
    ((IVisitor) this.cleanVisitor).visitOutcomeUserStory(); //NOPMD
    ((AbstractUserStoryProgressive.IVisitor) this.cleanVisitor).visitUserStoryProgressive();//NOPMD
    
}
 
Example 21
Project: SecureBPMN   File: DatabasePage.java   Source Code and License 6 votes vote down vote up
@Override
protected Table createList() {
  final Table tableList = new Table();
  
  // Listener to change right panel when clicked on a task
  tableList.addListener(new Property.ValueChangeListener() {
    private static final long serialVersionUID = 8811553575319455854L;
    public void valueChange(ValueChangeEvent event) {
      // The itemId of the table list is the tableName
      String tableName = (String) event.getProperty().getValue();
      setDetailComponent(new DatabaseDetailPanel(tableName));
     
     // Update URL
     ExplorerApp.get().setCurrentUriFragment(
       new UriFragment(DatabaseNavigator.TABLE_URI_PART, tableName));
    }
  });
  
  // Create column headers
  tableList.addContainerProperty("icon", Embedded.class, null);
  tableList.setColumnWidth("icon", 22);
  tableList.addContainerProperty("tableName", String.class, null);
  tableList.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
  
  return tableList;
}
 
Example 22
Project: SecureBPMN   File: TaskPage.java   Source Code and License 6 votes vote down vote up
protected ValueChangeListener getListSelectionListener() {
  return new Property.ValueChangeListener() {
    private static final long serialVersionUID = 1L;
    public void valueChange(ValueChangeEvent event) {
      Item item = taskTable.getItem(event.getProperty().getValue()); // the value of the property is the itemId of the table entry
      
      if(item != null) {
        String id = (String) item.getItemProperty("id").getValue();
        setDetailComponent(createDetailComponent(id));
        
        UriFragment taskFragment = getUriFragment(id);
        ExplorerApp.get().setCurrentUriFragment(taskFragment);
      } else {
        // Nothing is selected
        setDetailComponent(null);
        ExplorerApp.get().setCurrentUriFragment(getUriFragment(null));
      }
    }
  };
}
 
Example 23
Project: flightservice   File: FlightMaintenanceView.java   Source Code and License 6 votes vote down vote up
private Table createTable() {
	Table table = new Table();
	table.setContainerDataSource(flightContainer);
	table.setSizeFull();
	table.setSelectable(true);
	table.setImmediate(true);
	table.addValueChangeListener(new ValueChangeListener() {

		private static final long serialVersionUID = 1L;

		@Override
		public void valueChange(ValueChangeEvent event) {
			Flight flight = (Flight) event.getProperty().getValue();
			onFlighSelect(flight);
		}

	});
	table.setVisibleColumns(new Object[] { "number", "airline", "departureAirportCity", "destinationAirportCity", "price", "date" });
	return table;
}
 
Example 24
Project: sensorhub   File: ValueEntryPopup.java   Source Code and License 6 votes vote down vote up
@SuppressWarnings("serial")
public ValueEntryPopup(int width, final ValueCallback callback)
{
    super("New Value");
    VerticalLayout layout = new VerticalLayout();
    
    TextField text = new TextField();
    text.setWidth(width, Unit.PIXELS);
    layout.addComponent(text);
    text.focus();
    
    text.addValueChangeListener(new ValueChangeListener() {
        @Override
        public void valueChange(ValueChangeEvent event)
        {
            ValueEntryPopup.this.close();
            callback.newValue((String)event.getProperty().getValue());
        }
    });
    
    setContent(layout);
    center();
}
 
Example 25
Project: metl   File: EditAgentDeploymentPanel.java   Source Code and License 6 votes vote down vote up
protected ComboBox getLogLevelComponent() {
    final ComboBox combo = new ComboBox("Log Level");
    combo.setNullSelectionAllowed(false);
    combo.setWidth(200, Unit.PIXELS);
    LogLevel[] levels = LogLevel.values();
    for (LogLevel logLevel : levels) {
        combo.addItem(logLevel.name());
    }
    combo.setValue(agentDeployment.getLogLevel());
    combo.addValueChangeListener(new ValueChangeListener() {
        public void valueChange(ValueChangeEvent event) {
            agentDeployment.setLogLevel((String) combo.getValue());
            saveAgentDeployment(agentDeployment);
        }
    });
    return combo;
}
 
Example 26
Project: metl   File: EditAgentDeploymentPanel.java   Source Code and License 6 votes vote down vote up
protected ComboBox getStartTypeComponent() {
    startTypeCombo = new ComboBox("Start Type");
    startTypeCombo.setWidth(200, Unit.PIXELS);
    startTypeCombo.setNullSelectionAllowed(false);
    StartType[] values = StartType.values();
    for (StartType value : values) {
        startTypeCombo.addItem(value.name());
    }
    startTypeCombo.setValue(agentDeployment.getStartType());
    startTypeCombo.addValueChangeListener(new ValueChangeListener() {
        public void valueChange(ValueChangeEvent event) {
            agentDeployment.setStartType((String) startTypeCombo.getValue());
            updateScheduleEnable();
            for (int i = 0; i < 7; i++) {
                ListSelect listSelect = ((ListSelect) cronLayout.getComponent(i));
                for (Object itemId : listSelect.getItemIds()) {
                    listSelect.unselect(itemId);
                }
                listSelect.select(listSelect.getItemIds().iterator().next());
            }
            String startExpression = null;
            if (agentDeployment.getStartType().equals(StartType.SCHEDULED_CRON.name())) {
                startExpression = "0 0 0 * * ?";
            }
            startExpressionTextField.setValue(startExpression);
            agentDeployment.setStartExpression(startExpression);
            updateScheduleFields();
            saveAgentDeployment(agentDeployment);
        }
    });
    return startTypeCombo;
}
 
Example 27
Project: Plugins   File: RelationalFromSqlVaadinDialog.java   Source Code and License 6 votes vote down vote up
/**
 * Change listener for database value type
 * If database type changes, some optional specific fields can be shown / hidden
 * Default database port is automatically filled in when database type changes
 */
private ValueChangeListener createDatabaseTypeChangeListener() {
    ValueChangeListener listener = new ValueChangeListener() {

        private static final long serialVersionUID = 1L;

        @SuppressWarnings("unqualified-field-access")
        @Override
        public void valueChange(ValueChangeEvent event) {
            DatabaseInfo dbInfo = (DatabaseInfo) databaseType.getValue();
            txtDatabasePort.setValue(String.valueOf(dbInfo.getDefaultPort()));
            if (dbInfo.getDatabaseType() == DatabaseType.ORACLE) {
                txtDatabaseName.setCaption(ctx.tr("dialog.extractdb.dbsid"));
            } else {
                txtDatabaseName.setCaption(ctx.tr("dialog.extractdb.dbname"));
            }

            if (dbInfo.getDatabaseType() == DatabaseType.MSSQL) {
                txtInstanceName.setVisible(true);
            } else {
                txtInstanceName.setVisible(false);
            }
        }
    };
    return listener;
}
 
Example 28
Project: Plugins   File: RelationalFromSqlVaadinDialog.java   Source Code and License 6 votes vote down vote up
/**
 * Change listener for SSL checkbox. If checked, optional truststore configuration fields are shown
 */
private ValueChangeListener createSslValueChangeListener() {
    ValueChangeListener listener = new ValueChangeListener() {

        private static final long serialVersionUID = 1L;

        @SuppressWarnings("unqualified-field-access")
        @Override
        public void valueChange(ValueChangeEvent event) {
            txtTruststoreLocation.setVisible(chckUseSsl.getValue());
            txtTruststorePassword.setVisible(chckUseSsl.getValue());
        }
    };

    return listener;
}
 
Example 29
Project: ilves   File: Grid.java   Source Code and License 6 votes vote down vote up
/**
 * Sets the filter definitions.
 * @param filterDefinitions the filterDefinitions to set
 */
public final void setFilters(final List<FilterDescriptor> filterDefinitions) {
    this.filters = filterDefinitions;
    if (filterLayout != null) {
        filterLayout.removeAllComponents();
        for (final FilterDescriptor filterDefinition : filterDefinitions) {
            filterDefinition.getField().setWidth(filterDefinition.getWidth() + "px");
            filterDefinition.getField().setCaption(filterDefinition.getLabel());
            filterDefinition.getField().setValue(filterDefinition.getDefaultValue());
            ((AbstractComponent) filterDefinition.getField()).setImmediate(true);
            filterDefinition.getField().addValueChangeListener(new Property.ValueChangeListener() {
                private static final long serialVersionUID = 1L;

                @Override
                public void valueChange(final ValueChangeEvent event) {
                    refresh();
                }
            });
            filterLayout.addComponent(filterDefinition.getField());
        }
    }
}
 
Example 30
Project: GPIO_Vaadin_Project   File: Rpi_gpio_controllerApplication.java   Source Code and License 6 votes vote down vote up
private void createAnimationSelector(final AbstractOrderedLayout parentLayout) {		
	ArrayList<Animation> animations = Animator.INSTANCE.getRegisteredAnimations();
	
	mAnimationSelector = new NativeSelect("Animation");
	mAnimationSelector.addItem(AnimationName_Random);
       for (int i = 0; i < animations.size(); ++i) {
       	mAnimationSelector.addItem(animations.get(i).getName());
       }

       mAnimationSelector.setNullSelectionAllowed(false);
       mAnimationSelector.setValue(AnimationName_Random);
       mAnimationSelector.setImmediate(true);
       mAnimationSelector.addListener(new Property.ValueChangeListener () {
       	public void valueChange(ValueChangeEvent event) {
           }
       });

       parentLayout.addComponent(mAnimationSelector);
       parentLayout.setComponentAlignment(mAnimationSelector, Alignment.MIDDLE_CENTER);
}
 
Example 31
Project: FiWare-Template-Handler   File: TaskPage.java   Source Code and License 6 votes vote down vote up
protected ValueChangeListener getListSelectionListener() {
  return new Property.ValueChangeListener() {
    private static final long serialVersionUID = 1L;
    public void valueChange(ValueChangeEvent event) {
      Item item = taskTable.getItem(event.getProperty().getValue()); // the value of the property is the itemId of the table entry
      
      if(item != null) {
        String id = (String) item.getItemProperty("id").getValue();
        setDetailComponent(createDetailComponent(id));
        
        UriFragment taskFragment = getUriFragment(id);
        ExplorerApp.get().setCurrentUriFragment(taskFragment);
      } else {
        // Nothing is selected
        setDetailComponent(null);
        ExplorerApp.get().setCurrentUriFragment(getUriFragment(null));
      }
    }
  };
}
 
Example 32
Project: XACML   File: PIPSQLResolverEditorWindow.java   Source Code and License 6 votes vote down vote up
protected void initializeCheckBox() {
	this.checkBoxShortIds.setValue(true);
	this.checkBoxShortIds.setImmediate(true);
	this.checkBoxShortIds.addValueChangeListener(new ValueChangeListener() {
		private static final long serialVersionUID = 1L;

		@Override
		public void valueChange(ValueChangeEvent event) {
			if (self.checkBoxShortIds.getValue()) {
				self.tableRequiredAttributes.setColumnCollapsed("id", true);
				self.tableRequiredAttributes.setColumnCollapsed("category", true);
				self.tableRequiredAttributes.setColumnCollapsed("datatype", true);
				self.tableRequiredAttributes.setColumnCollapsed("shortId", false);
				self.tableRequiredAttributes.setColumnCollapsed("shortCategory", false);
				self.tableRequiredAttributes.setColumnCollapsed("shortDatatype", false);
			} else {
				self.tableRequiredAttributes.setColumnCollapsed("id", false);
				self.tableRequiredAttributes.setColumnCollapsed("category", false);
				self.tableRequiredAttributes.setColumnCollapsed("datatype", false);
				self.tableRequiredAttributes.setColumnCollapsed("shortId", true);
				self.tableRequiredAttributes.setColumnCollapsed("shortCategory", true);
				self.tableRequiredAttributes.setColumnCollapsed("shortDatatype", true);
			}
		}			
	});
}
 
Example 33
Project: XACML   File: VariableReferenceEditorWindow.java   Source Code and License 6 votes vote down vote up
protected void initializeSelect(Map<VariableDefinitionType, PolicyType> vars) {
	//
	// Add existing variables into the table
	//
	if (vars != null) {
		for (VariableDefinitionType var : vars.keySet()) {
			this.listSelectVariables.addItem(var.getVariableId());
		}
	}
	//
	// Respond to changes
	//
	this.listSelectVariables.setImmediate(true);
	this.listSelectVariables.addValueChangeListener(new ValueChangeListener() {
		private static final long serialVersionUID = 1L;

		@Override
		public void valueChange(ValueChangeEvent event) {
			Object value = self.listSelectVariables.getValue();
			if (value != null) {
				self.textFieldVariable.setValue(value.toString());
			}
		}			
	});
}
 
Example 34
Project: XACML   File: PolicyEditor.java   Source Code and License 6 votes vote down vote up
protected void initializeCheckboxes(boolean readOnly) {
	//
	// The readonly check box
	//
	this.checkBoxReadOnly.setImmediate(true);
	this.checkBoxReadOnly.setValue(readOnly);
	this.checkBoxReadOnly.addValueChangeListener(new ValueChangeListener() {
		private static final long serialVersionUID = 1L;

		@Override
		public void valueChange(ValueChangeEvent event) {
			self.resetComponents();
			self.setupCaption();
		}
		
	});
	//
	// The autosave check box
	//
	this.checkBoxAutoSave.setImmediate(true);
	this.checkBoxAutoSave.setValue(true);
}
 
Example 35
Project: FiWare-Template-Handler   File: DatabasePage.java   Source Code and License 6 votes vote down vote up
@Override
protected Table createList() {
  final Table tableList = new Table();
  
  // Listener to change right panel when clicked on a task
  tableList.addListener(new Property.ValueChangeListener() {
    private static final long serialVersionUID = 8811553575319455854L;
    public void valueChange(ValueChangeEvent event) {
      // The itemId of the table list is the tableName
      String tableName = (String) event.getProperty().getValue();
      setDetailComponent(new DatabaseDetailPanel(tableName));
     
     // Update URL
     ExplorerApp.get().setCurrentUriFragment(
       new UriFragment(DatabaseNavigator.TABLE_URI_PART, tableName));
    }
  });
  
  // Create column headers
  tableList.addContainerProperty("icon", Embedded.class, null);
  tableList.setColumnWidth("icon", 22);
  tableList.addContainerProperty("tableName", String.class, null);
  tableList.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
  
  return tableList;
}
 
Example 36
Project: holon-vaadin7   File: ItemPropertyValueChangeListener.java   Source Code and License 5 votes vote down vote up
@Override
public void valueChange(ValueChangeEvent event) {
	Item itm = item.get();
	if (itm != null) {
		itemStore.setItemModified(itm);
	}
}
 
Example 37
Project: osc-core   File: BaseAlarmWindow.java   Source Code and License 5 votes vote down vote up
@SuppressWarnings("serial")
private void initListeners() {

    this.actionChangedListener = new ValueChangeListener() {

        @Override
        public void valueChange(ValueChangeEvent event) {
            if (BaseAlarmWindow.this.alarmAction.getValue().equals(AlarmAction.EMAIL)) {
                BaseAlarmWindow.this.email.setVisible(true);
            } else {
                BaseAlarmWindow.this.email.setVisible(false);
            }
        }
    };
}
 
Example 38
Project: osc-core   File: BindSecurityGroupWindow.java   Source Code and License 5 votes vote down vote up
@Override
public Object generateCell(Table source, final Object itemId, Object columnId) {
	Property<?> prop = source.getItem(itemId).getItemProperty(columnId);
	CheckBox checkBox = new CheckBox(null, prop);
	checkBox.addValueChangeListener(new ValueChangeListener() {

		@Override
		public void valueChange(ValueChangeEvent event) {
			serviceTableClicked((long) itemId);
		}
	});
	return checkBox;
}
 
Example 39
Project: osc-core   File: BaseDAWindow.java   Source Code and License 5 votes vote down vote up
/**
 * @return MC ComboBox
 */
@SuppressWarnings("serial")
protected ComboBox getManagerConnector() {
    try {
        ListResponse<ApplianceManagerConnectorDto> res = this.listApplianceManagerConnectorService.dispatch(new BaseRequest<>());

        BeanItemContainer<ApplianceManagerConnectorDto> mcList = new BeanItemContainer<ApplianceManagerConnectorDto>(
                ApplianceManagerConnectorDto.class, res.getList());
        this.managerConnector = new ComboBox("Manager Connector");
        this.managerConnector.setTextInputAllowed(false);
        this.managerConnector.setNullSelectionAllowed(false);
        this.managerConnector.setContainerDataSource(mcList);
        this.managerConnector.setItemCaptionPropertyId("name");

        if (mcList.size() > 0) {
            this.managerConnector.select(mcList.getIdByIndex(0));
        }

        this.managerConnector.setImmediate(true);
        this.managerConnector.setRequired(true);
        this.managerConnector.setRequiredError("Manager Connector cannot be empty");

        this.managerConnector.addValueChangeListener(new ValueChangeListener() {

            @Override
            public void valueChange(ValueChangeEvent event) {
                ApplianceManagerConnectorDto mcDto = (ApplianceManagerConnectorDto) BaseDAWindow.this.managerConnector
                        .getValue();
                updateAppliances();
                updateDomains(mcDto);
            }
        });

    } catch (Exception e) {
        log.error("Error populating MC combobox", e);
    }

    return this.managerConnector;

}
 
Example 40
Project: businesshorizon2   File: MethodScreenViewImpl.java   Source Code and License 5 votes vote down vote up
public void switchRadiobuttonEnablement(ValueChangeEvent event) {
		if(event.getProperty().getValue().equals("fte")){
			eingabeGroup.setItemEnabled(InputType.UMSATZKOSTENVERFAHREN, false);
			eingabeGroup.setItemEnabled(InputType.GESAMTKOSTENVERFAHREN, false);
			eingabeGroup.setValue(InputType.DIRECT);
//			presenter.setInputMethod(InputType.DIRECT, deterministic);
		}else{
			eingabeGroup.setItemEnabled(InputType.UMSATZKOSTENVERFAHREN, true);
			eingabeGroup.setItemEnabled(InputType.GESAMTKOSTENVERFAHREN, true);
		}
	}