com.vaadin.data.Property.ValueChangeListener Java Examples
The following examples show how to use
com.vaadin.data.Property.ValueChangeListener.
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: ActionTypeOptionGroupAssignmentLayout.java From hawkbit with Eclipse Public License 1.0 | 6 votes |
private void addValueChangeListener() { actionTypeOptionGroup.addValueChangeListener(new ValueChangeListener() { private static final long serialVersionUID = 1L; @Override // Vaadin is returning object so "==" might not work @SuppressWarnings("squid:S4551") 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 #2
Source File: VariableReferenceEditorWindow.java From XACML with MIT License | 6 votes |
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 #3
Source File: PIPSQLResolverEditorWindow.java From XACML with MIT License | 6 votes |
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 #4
Source File: AttributeSelectionWindow.java From XACML with MIT License | 6 votes |
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 #5
Source File: PolicyEditor.java From XACML with MIT License | 6 votes |
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 #6
Source File: AutoStartOptionGroupLayout.java From hawkbit with Eclipse Public License 1.0 | 6 votes |
private void addValueChangeListener() { autoStartOptionGroup.addValueChangeListener(new ValueChangeListener() { private static final long serialVersionUID = 1L; @Override // Vaadin is returning object, so "==" might not work @SuppressWarnings("squid:S4551") 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 #7
Source File: ValueEntryPopup.java From sensorhub with Mozilla Public License 2.0 | 6 votes |
@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 #8
Source File: InputOutputUI.java From chipster with MIT License | 5 votes |
protected void initElements() { type2 = new ComboBox(); type2.setImmediate(true); type2.setWidth(WIDTH); lbMeta = new Label("Meta:"); cbMeta = new CheckBox(); cbMeta.setDescription("Is this element Meta data"); optional.setWidth(WIDTH); type = new ComboBox(); type.setWidth(WIDTH); type.setNullSelectionAllowed(false); type.setImmediate(true); type.addItem(SINGLE_FILE); type.addItem(MULTI_FILE); type.select(SINGLE_FILE); type.addValueChangeListener(new ValueChangeListener() { private static final long serialVersionUID = -1134955257251483403L; @Override public void valueChange(ValueChangeEvent event) { if(type.getValue().toString().contentEquals(SINGLE_FILE)) { getSingleFileUI(); } else if(type.getValue().toString().contentEquals(MULTI_FILE)){ getMultipleFilesUI(); } } }); }
Example #9
Source File: ObadviceDictionary.java From XACML with MIT License | 5 votes |
protected void initializeCombo() { // // Add filter values // this.comboBoxFilter.addItem(Obadvice.OBLIGATION); this.comboBoxFilter.addItem(Obadvice.ADVICE); // // Initialize GUI properties // this.comboBoxFilter.setImmediate(true); this.comboBoxFilter.setNullSelectionAllowed(true); // // this.comboBoxFilter.addValueChangeListener(new ValueChangeListener() { private static final long serialVersionUID = 1L; @Override public void valueChange(ValueChangeEvent event) { // // Remove filters // self.obadvice.removeAllContainerFilters(); // // What was selected? // Object id = self.comboBoxFilter.getValue(); if (id != null) { // // Add filter // if (id.equals(Obadvice.OBLIGATION)) { self.obadvice.addContainerFilter(new Compare.Equal("type", Obadvice.OBLIGATION)); } else if (id.equals(Obadvice.ADVICE)) { self.obadvice.addContainerFilter(new Compare.Equal("type", Obadvice.ADVICE)); } } } }); }
Example #10
Source File: ObadviceDictionary.java From XACML with MIT License | 5 votes |
protected void initializeTable(boolean isReadOnly) { // // Set our container // this.table.setContainerDataSource(this.obadvice); // // Initialize GUI properties // this.table.setVisibleColumns(visibleColumns); this.table.setColumnHeaders(columnHeaders); this.table.setImmediate(true); this.table.setColumnCollapsingAllowed(true); // // Is read only // if (isReadOnly) { return; } this.table.setSelectable(true); // // Respond to selections // this.table.addValueChangeListener(new ValueChangeListener() { private static final long serialVersionUID = 1L; @Override public void valueChange(ValueChangeEvent event) { self.buttonRemove.setEnabled(self.table.getValue() != null); self.buttonClone.setEnabled(self.table.getValue() != null); } }); }
Example #11
Source File: AttributeDictionarySelectorComponent.java From XACML with MIT License | 5 votes |
protected void initializeCategoryFilter() { // // Remove any filters // AttributeDictionarySelectorComponent.categories.removeAllContainerFilters(); // // Initialize data source and GUI properties // this.comboBoxCategoryFilter.setContainerDataSource(AttributeDictionarySelectorComponent.categories); this.comboBoxCategoryFilter.setItemCaptionMode(ItemCaptionMode.PROPERTY); this.comboBoxCategoryFilter.setItemCaptionPropertyId("xacmlId"); this.comboBoxCategoryFilter.setImmediate(true); // // Respond to events // this.comboBoxCategoryFilter.addValueChangeListener(new ValueChangeListener() { private static final long serialVersionUID = 1L; @Override public void valueChange(ValueChangeEvent event) { // // Clear any existing filters // AttributeDictionarySelectorComponent.attributes.removeAllContainerFilters(); // // Get the current selection // Object id = self.comboBoxCategoryFilter.getValue(); // // Is anything currently selected? // if (id != null) { // // Yes - add the new filter into the container // AttributeDictionarySelectorComponent.attributes.addContainerFilter(new Compare.Equal("categoryBean", AttributeDictionarySelectorComponent.categories.getItem(id).getEntity())); } } }); }
Example #12
Source File: CustomPIPConfigurationComponent.java From XACML with MIT License | 5 votes |
protected void initializeText() { this.textFieldClassname.setRequired(true); this.textFieldClassname.setRequiredError("You must declare the Java classname for the PIP Factory Loader"); this.textFieldClassname.setImmediate(true); final Object entity = this.entity.getEntity(); if (entity instanceof PIPConfiguration) { this.textFieldClassname.setValue(((PIPConfiguration)entity).getClassname()); } else if (entity instanceof PIPResolver) { this.textFieldClassname.setValue(((PIPResolver)entity).getClassname()); } // // Respond to events // this.textFieldClassname.addValueChangeListener(new ValueChangeListener() { private static final long serialVersionUID = 1L; @Override public void valueChange(ValueChangeEvent event) { if (entity instanceof PIPConfiguration) { ((PIPConfiguration) entity).setClassname(self.textFieldClassname.getValue()); } else if (entity instanceof PIPResolver) { ((PIPResolver) entity).setClassname(self.textFieldClassname.getValue()); } self.fireFormChangedEvent(); } }); }
Example #13
Source File: FormUtils.java From jdal with Apache License 2.0 | 5 votes |
/** * Add a link on primary and dependent ComboBoxes by property name. * When selection changes on primary use propertyName to get a Collection and fill dependent ComboBox with it * @param primary ComboBox when selection changes * @param dependent ComboBox that are filled with collection * @param propertyName the property name for get the collection from primary selected item * @param addNull if true, add a null as first combobox item */ @SuppressWarnings("rawtypes") public static void link(final ComboBox primary, final ComboBox dependent, final String propertyName, final boolean addNull) { primary.addValueChangeListener(new ValueChangeListener() { public void valueChange(ValueChangeEvent event) { Object selected = event.getProperty().getValue(); if (selected != null) { BeanWrapper wrapper = PropertyAccessorFactory.forBeanPropertyAccess(selected); if (wrapper.isReadableProperty(propertyName)) { Collection items = (Collection) wrapper.getPropertyValue(propertyName); dependent.removeAllItems(); if (addNull) dependent.addItem(null); for (Object item : items) dependent.addItem(item); } else { log.error("Can't write on propety '" + propertyName + "' of class: '" + selected.getClass() + "'"); } } } }); }
Example #14
Source File: AttributeStandardSelectorComponent.java From XACML with MIT License | 5 votes |
private void initializeAttributes() { // // Initialize GUI properties // this.tableAttributes.setImmediate(true); this.tableAttributes.setNullSelectionAllowed(false); this.tableAttributes.setPageLength(10); // // Setup // this.tableAttributes.setContainerDataSource(this.container); this.tableAttributes.setVisibleColumns(new Object[] {"attributeId"}); this.tableAttributes.setColumnHeaders(new String[] {"Attribute Id"}); this.tableAttributes.setSelectable(true); this.setupAttributeIDs(); // // Respond // this.tableAttributes.addValueChangeListener(new ValueChangeListener() { private static final long serialVersionUID = 1L; @Override public void valueChange(ValueChangeEvent event) { self.fireAttributeChanged(self.getAttribute()); } }); }
Example #15
Source File: AttributeStandardSelectorComponent.java From XACML with MIT License | 5 votes |
private void initializeCategories() { // // Remove any filters // AttributeStandardSelectorComponent.categories.removeAllContainerFilters(); // // Initialize data source & GUI properties // this.comboBoxCategories.setContainerDataSource(AttributeStandardSelectorComponent.categories); this.comboBoxCategories.setItemCaptionMode(ItemCaptionMode.PROPERTY); this.comboBoxCategories.setItemCaptionPropertyId("xacmlId"); this.comboBoxCategories.setImmediate(true); this.comboBoxCategories.setNullSelectionAllowed(false); // // Set default selection // Category defaultCategory; if (this.attribute == null || this.attribute.getCategoryBean() == null) { defaultCategory = JPAUtils.findCategory(XACML3.ID_SUBJECT_CATEGORY_ACCESS_SUBJECT); } else { defaultCategory = this.attribute.getCategoryBean(); } if (defaultCategory != null) { this.comboBoxCategories.select(defaultCategory.getId()); } // // Respond to events // this.comboBoxCategories.addValueChangeListener(new ValueChangeListener() { private static final long serialVersionUID = 1L; @Override public void valueChange(ValueChangeEvent event) { self.setupAttributeIDs(); self.fireAttributeChanged(self.getAttribute()); } }); }
Example #16
Source File: AttributeSimpleCreatorComponent.java From XACML with MIT License | 5 votes |
private void initializeCategories() { // // Remove any filters // AttributeSimpleCreatorComponent.categories.removeAllContainerFilters(); // // Initialize data source & GUI properties // this.tableCategory.setContainerDataSource(AttributeSimpleCreatorComponent.categories); this.tableCategory.setVisibleColumns(new Object[] {"xacmlId"}); this.tableCategory.setColumnHeaders(new String[] {"XACML ID"}); this.tableCategory.setImmediate(true); this.tableCategory.setNullSelectionAllowed(false); this.tableCategory.setPageLength(10); this.tableCategory.setSelectable(true); // // Default selection // Category defaultCategory; if (this.attribute == null || this.attribute.getCategoryBean() == null || this.attribute.getCategoryBean().getIdentifer() == null) { defaultCategory = JPAUtils.findCategory(XACML3.ID_SUBJECT_CATEGORY_ACCESS_SUBJECT); assert(defaultCategory != null); } else { defaultCategory = JPAUtils.findCategory(this.attribute.getCategoryBean().getIdentifer()); } if (defaultCategory != null) { this.tableCategory.select(defaultCategory.getId()); } // // Respond to changes // this.tableCategory.addValueChangeListener(new ValueChangeListener() { private static final long serialVersionUID = 1L; @Override public void valueChange(ValueChangeEvent event) { self.fireAttributeChanged(self.getAttribute()); } }); }
Example #17
Source File: RegexpEditorComponent.java From XACML with MIT License | 5 votes |
private void initializeTextField() { // // Find our reg expression value if it exists // for (ConstraintValue value : this.attribute.getConstraintValues()) { if (value.getProperty().equals(ConstraintType.REGEXP_TYPE)) { if (this.value == null) { this.textFieldExpression.setValue(value.getValue()); this.value = value; } else { logger.warn("Multiple regexp constraint values: " + value); value.setAttribute(null); this.attribute.removeConstraintValue(value); } } else { value.setAttribute(null); this.attribute.removeConstraintValue(value); } } // // Was something found? // if (this.value == null) { ConstraintValue newValue = new ConstraintValue(ConstraintType.REGEXP_TYPE, ""); newValue.setAttribute(this.attribute); this.attribute.addConstraintValue(newValue); this.value = newValue; } // // Save the values when they changes // this.textFieldExpression.addValueChangeListener(new ValueChangeListener() { private static final long serialVersionUID = 1L; @Override public void valueChange(ValueChangeEvent event) { self.value.setValue(self.textFieldExpression.getValue()); } }); }
Example #18
Source File: ExpressionBuilderComponent.java From XACML with MIT License | 5 votes |
protected void initializeCheckbox() { this.checkBoxShortName.setValue(true); this.checkBoxShortName.setImmediate(true); this.checkBoxShortName.addValueChangeListener(new ValueChangeListener() { private static final long serialVersionUID = 1L; @Override public void valueChange(ValueChangeEvent event) { self.treeExpressions.setColumnCollapsed(ExpressionContainer.PROPERTY_ID, self.checkBoxShortName.getValue()); self.treeExpressions.setColumnCollapsed(ExpressionContainer.PROPERTY_DATATYPE, self.checkBoxShortName.getValue()); self.treeExpressions.setColumnCollapsed(ExpressionContainer.PROPERTY_ID_SHORT, ! self.checkBoxShortName.getValue()); self.treeExpressions.setColumnCollapsed(ExpressionContainer.PROPERTY_DATATYPE_SHORT, ! self.checkBoxShortName.getValue()); } }); }
Example #19
Source File: PolicyUploadWindow.java From XACML with MIT License | 5 votes |
/** * The constructor should first build the main layout, set the * composition root and then do any custom initialization. * * The constructor will not be automatically regenerated by the * visual editor. * @param directory */ public PolicyUploadWindow(Path directory) { buildMainLayout(); // // Create our main layout // this.setContent(mainLayout); // // Finish setting up the main layout // this.mainLayout.setSpacing(true); this.mainLayout.setMargin(true); this.checkBoxImportAdvice.setValue(true); this.checkBoxIgnoreStandard.setValue(true); this.checkBoxImportAttributes.setValue(true); this.checkBoxImportObligations.setValue(true); this.directory = directory; this.upload.addSucceededListener(this); this.upload.setReceiver(this); this.checkBoxImportAttributes.addValueChangeListener(new ValueChangeListener() { private static final long serialVersionUID = 1L; @Override public void valueChange(ValueChangeEvent event) { if (self.checkBoxImportAttributes.getValue()) { self.checkBoxIgnoreStandard.setEnabled(true); } else { self.checkBoxIgnoreStandard.setEnabled(false); } } }); }
Example #20
Source File: SelectPDPGroupWindow.java From XACML with MIT License | 5 votes |
private void initializeSelect(Set<PDPGroup> groups) { // // Initialize GUI properties // this.listSelectPDPGroup.setImmediate(true); this.listSelectPDPGroup.setItemCaptionMode(ItemCaptionMode.EXPLICIT); this.listSelectPDPGroup.setNullSelectionAllowed(false); this.listSelectPDPGroup.setNewItemsAllowed(false); this.listSelectPDPGroup.setMultiSelect(false); // // Add items // for (PDPGroup group : groups) { this.listSelectPDPGroup.addItem(group); this.listSelectPDPGroup.setItemCaption(group, group.getName()); } // // Listen to events // this.listSelectPDPGroup.addValueChangeListener(new ValueChangeListener() { private static final long serialVersionUID = 1L; @Override public void valueChange(ValueChangeEvent event) { self.setupButtons(); } }); }
Example #21
Source File: ObadviceEditorWindow.java From XACML with MIT License | 5 votes |
private void initializeOptions() { self.setIDCaption(); this.typeOption.addValueChangeListener(new ValueChangeListener() { private static final long serialVersionUID = 1L; @Override public void valueChange(ValueChangeEvent event) { self.setIDCaption(); } }); }
Example #22
Source File: WinServerEdit.java From primecloud-controller with GNU General Public License v2.0 | 4 votes |
public DataDiskTable() { //テーブル基本設定 setCaption(ViewProperties.getCaption("table.diskData")); setWidth("100%"); setPageLength(3); setSortDisabled(true); setColumnHeaderMode(COLUMN_HEADER_MODE_EXPLICIT); setColumnReorderingAllowed(false); setColumnCollapsingAllowed(false); setSelectable(true); setMultiSelect(false); setNullSelectionAllowed(false); setImmediate(true); addStyleName("win-server-edit-datadisk"); //カラム設定 addContainerProperty(PID_UNIT_NO, String.class, null); addContainerProperty(PID_DISK_SIZE, Integer.class, null); //ヘッダー設定 setColumnHeaders(new String[] { ViewProperties.getCaption("field.unitNo"), ViewProperties.getCaption("field.diskSize") }); //ヘッダーサイズ設定 setColumnWidth(PID_UNIT_NO, WIDTH_UNIT_NO); setColumnWidth(PID_DISK_SIZE, WIDTH_DISK_SIZE); //テーブルのカラムに対してStyleNameを設定 setCellStyleGenerator(new StandardCellStyleGenerator()); // 行が選択されたときのイベント addListener(new Property.ValueChangeListener() { @Override public void valueChange(Property.ValueChangeEvent event) { DataDiskDto selectDto = (DataDiskDto) getValue(); if (selectDto == null) { dataDiskTableButtons.btnEdit.setEnabled(false); dataDiskTableButtons.btnDelete.setEnabled(false); } else { dataDiskTableButtons.btnEdit.setEnabled(true); dataDiskTableButtons.btnDelete.setEnabled(true); } } }); }
Example #23
Source File: WinServerEdit.java From primecloud-controller with GNU General Public License v2.0 | 4 votes |
public NetworkTable() { //テーブル基本設定 setWidth("100%"); setPageLength(3); setSortDisabled(true); setColumnHeaderMode(COLUMN_HEADER_MODE_EXPLICIT); setColumnReorderingAllowed(false); setColumnCollapsingAllowed(false); setSelectable(true); setMultiSelect(false); setNullSelectionAllowed(false); setImmediate(true); addStyleName("win-server-edit-network"); //カラム設定 addContainerProperty(PID_NETWORK_NAME, String.class, null); addContainerProperty(PID_IP_MODE, String.class, null); addContainerProperty(PID_IP_ADDRESS, String.class, null); addContainerProperty(PID_PRIMARY, Label.class, null); //ヘッダー設定 setColumnHeaders(new String[] { ViewProperties.getCaption("field.networkName"), ViewProperties.getCaption("field.ipMode"), ViewProperties.getCaption("field.ipAddress"), ViewProperties.getCaption("field.primary") }); //ヘッダーサイズ設定 setColumnWidth(PID_NETWORK_NAME, WIDTH_NETWORK_NAME); setColumnWidth(PID_IP_MODE, WIDTH_IP_MOD); setColumnWidth(PID_IP_ADDRESS, WIDTH_IP_ADDRESS); setColumnWidth(PID_PRIMARY, WIDTH_PRIMARY); //テーブルのカラムに対してStyleNameを設定 setCellStyleGenerator(new StandardCellStyleGenerator()); // 行が選択されたときのイベント addListener(new Property.ValueChangeListener() { @Override public void valueChange(Property.ValueChangeEvent event) { InstanceNetworkDto selectDto = (InstanceNetworkDto) getValue(); if (selectDto == null) { networkTableButtons.btnEdit.setEnabled(false); networkTableButtons.btnDelete.setEnabled(false); } else { networkTableButtons.btnEdit.setEnabled(true); //PCCネットワークまたはプライマリの場合は削除不可 networkTableButtons.btnDelete .setEnabled((!selectDto.isRequired() && !selectDto.isPrimary())); } } }); }
Example #24
Source File: ServerPanel.java From primecloud-controller with GNU General Public License v2.0 | 4 votes |
@Override public void attach() { setSizeFull(); addStyleName(Reindeer.PANEL_LIGHT); VerticalLayout layout = (VerticalLayout) getContent(); layout.setSizeFull(); layout.addStyleName("server-tab"); layout.setSpacing(false); layout.setMargin(false); // スプリットパネル SplitPanel splitPanel = new SplitPanel(); splitPanel.setOrientation(SplitPanel.ORIENTATION_VERTICAL); splitPanel.setSplitPosition(40); splitPanel.setSizeFull(); layout.addComponent(splitPanel); // スプリットパネル上段 VerticalLayout upperLayout = new VerticalLayout(); upperLayout.setSizeFull(); upperLayout.setSpacing(false); upperLayout.setMargin(false); serverButtonsTop = new ServerButtonsTop(sender); upperLayout.addComponent(serverButtonsTop); serverTable = new ServerTable(sender); serverTable.setContainerDataSource(new InstanceDtoContainer()); upperLayout.addComponent(serverTable); serverTable.addListener(new ValueChangeListener() { @Override public void valueChange(ValueChangeEvent event) { tableRowSelected(event); } }); serverButtonsBottom = new ServerButtonsBottom(sender); upperLayout.addComponent(serverButtonsBottom); upperLayout.setExpandRatio(serverTable, 10); splitPanel.addComponent(upperLayout); // スプリットパネル下段 serverDesc = new ServerDesc(sender); splitPanel.addComponent(serverDesc); }
Example #25
Source File: AttributeDictionary.java From XACML with MIT License | 4 votes |
protected void initializeDatatypeComboFilter() { // // Set data source // this.comboBoxFilterDatatype.setContainerDataSource(self.datatypes); this.comboBoxFilterDatatype.setItemCaptionMode(ItemCaptionMode.PROPERTY); this.comboBoxFilterDatatype.setItemCaptionPropertyId("xacmlId"); // // Initialize GUI properties // this.comboBoxFilterDatatype.setNullSelectionAllowed(true); this.comboBoxFilterDatatype.setImmediate(true); // // Respond to value changes // this.comboBoxFilterDatatype.addValueChangeListener(new ValueChangeListener() { private static final long serialVersionUID = 1L; Filter currentFilter = null; @Override public void valueChange(ValueChangeEvent event) { // // Remove filter // if (currentFilter != null) { self.attributes.removeContainerFilter(this.currentFilter); this.currentFilter = null; } // // Set the new one // Object id = self.comboBoxFilterDatatype.getValue(); if (id == null) { return; } Datatype cat = self.datatypes.getItem(id).getEntity(); this.currentFilter = new Compare.Equal("datatypeBean", cat); self.attributes.addContainerFilter(this.currentFilter); } }); }
Example #26
Source File: AttributeDictionary.java From XACML with MIT License | 4 votes |
protected void initializeCategoryComboFilter() { // // Set data source // this.comboBoxFilterCategory.setContainerDataSource(self.categories); this.comboBoxFilterCategory.setItemCaptionMode(ItemCaptionMode.PROPERTY); this.comboBoxFilterCategory.setItemCaptionPropertyId("xacmlId"); // // Initialize GUI properties // this.comboBoxFilterCategory.setNullSelectionAllowed(true); this.comboBoxFilterCategory.setImmediate(true); // // Respond to value changes // this.comboBoxFilterCategory.addValueChangeListener(new ValueChangeListener() { private static final long serialVersionUID = 1L; Filter currentFilter = null; @Override public void valueChange(ValueChangeEvent event) { // // Remove filter // if (currentFilter != null) { self.attributes.removeContainerFilter(this.currentFilter); this.currentFilter = null; } // // Set the new one // Object id = self.comboBoxFilterCategory.getValue(); if (id == null) { return; } Category cat = self.categories.getItem(id).getEntity(); this.currentFilter = new Compare.Equal("categoryBean", cat); self.attributes.addContainerFilter(this.currentFilter); } }); }
Example #27
Source File: ServicePanel.java From primecloud-controller with GNU General Public License v2.0 | 4 votes |
@Override public void attach() { setSizeFull(); addStyleName(Reindeer.PANEL_LIGHT); VerticalLayout layout = (VerticalLayout) getContent(); layout.setSizeFull(); layout.addStyleName("service-tab"); layout.setSpacing(false); layout.setMargin(false); // スプリットパネル SplitPanel splitPanel = new SplitPanel(); splitPanel.setOrientation(SplitPanel.ORIENTATION_VERTICAL); splitPanel.setSplitPosition(40); splitPanel.setSizeFull(); layout.addComponent(splitPanel); layout.setExpandRatio(splitPanel, 10); // スプリットパネル上段 VerticalLayout upperLayout = new VerticalLayout(); upperLayout.setSizeFull(); upperLayout.setSpacing(false); upperLayout.setMargin(false); serviceButtonsTop = new ServiceButtonsTop(sender); upperLayout.addComponent(serviceButtonsTop); serviceTable = new ServiceTable(sender); serviceTable.setContainerDataSource(new ComponentDtoContainer()); upperLayout.addComponent(serviceTable); serviceTable.addListener(new ValueChangeListener() { @Override public void valueChange(ValueChangeEvent event) { tableRowSelected(event); } }); serviceButtonsBottom = new ServiceButtonsBottom(sender); upperLayout.addComponent(serviceButtonsBottom); upperLayout.setExpandRatio(serviceTable, 10); splitPanel.addComponent(upperLayout); // スプリットパネル下段 serviceDesc = new ServiceDesc(sender); splitPanel.addComponent(serviceDesc); }
Example #28
Source File: LoadBalancerPanel.java From primecloud-controller with GNU General Public License v2.0 | 4 votes |
@Override public void attach() { setSizeFull(); addStyleName(Reindeer.PANEL_LIGHT); VerticalLayout layout = (VerticalLayout) getContent(); layout.setSizeFull(); layout.addStyleName("loadbalancer-tab"); layout.setSpacing(false); layout.setMargin(false); // スプリットパネル SplitPanel splitPanel = new SplitPanel(); splitPanel.setOrientation(SplitPanel.ORIENTATION_VERTICAL); splitPanel.setSplitPosition(40); splitPanel.setSizeFull(); layout.addComponent(splitPanel); // スプリットパネル上段 VerticalLayout upperLayout = new VerticalLayout(); upperLayout.setSizeFull(); upperLayout.setSpacing(false); upperLayout.setMargin(false); CssLayout upperTopLayout = new CssLayout(); Label label = new Label(ViewProperties.getCaption("label.loadbalancer")); upperTopLayout.setWidth("100%"); upperTopLayout.setMargin(true); upperTopLayout.addStyleName("loadbalancer-table-label"); upperTopLayout.addComponent(label); upperTopLayout.setHeight("28px"); upperLayout.addComponent(upperTopLayout); loadBalancerTable = new LoadBalancerTable(sender); loadBalancerTable.setContainerDataSource(new LoadBalancerDtoContainer()); upperLayout.addComponent(loadBalancerTable); loadBalancerTable.addListener(new ValueChangeListener() { @Override public void valueChange(ValueChangeEvent event) { tableRowSelected(event); } }); loadBalancerButtonsBottom = new LoadBalancerButtonsBottom(sender); upperLayout.addComponent(loadBalancerButtonsBottom); upperLayout.setExpandRatio(loadBalancerTable, 10); splitPanel.addComponent(upperLayout); // スプリットパネル下段 loadBalancerDesc = new LoadBalancerDesc(sender); splitPanel.addComponent(loadBalancerDesc); }
Example #29
Source File: AttributeDictionarySelectorComponent.java From XACML with MIT License | 4 votes |
protected void initializeAttributes() { // // Remove any filters // AttributeDictionarySelectorComponent.attributes.removeAllContainerFilters(); // // Initialize data source and GUI properties // this.listSelectAttribute.setContainerDataSource(AttributeDictionarySelectorComponent.attributes); this.listSelectAttribute.setItemCaptionMode(ItemCaptionMode.PROPERTY); this.listSelectAttribute.setItemCaptionPropertyId("xacmlId"); this.listSelectAttribute.setImmediate(true); this.listSelectAttribute.setHeight(7, Unit.EM); // // Filter by datatype // if (this.datatype != null) { AttributeDictionarySelectorComponent.attributes.addContainerFilter(new Compare.Equal("datatypeBean", this.datatype)); } // // Is there a default selection? // if (this.initialAttribute != null) { // // Make sure it has an id. Do I really need to check? // if (this.initialAttribute.getId() != 0) { this.listSelectAttribute.select(this.initialAttribute.getId()); } } // // Respond to events // this.listSelectAttribute.addValueChangeListener(new ValueChangeListener() { private static final long serialVersionUID = 1L; @Override public void valueChange(ValueChangeEvent event) { self.fireAttributeChanged(self.getAttribute()); } }); }
Example #30
Source File: AttributeStandardSelectorComponent.java From XACML with MIT License | 4 votes |
private void initializeDatatypes() { // // Remove any filters // AttributeStandardSelectorComponent.datatypes.removeAllContainerFilters(); // // Initialize data source & GUI properties // this.tableDatatypes.setContainerDataSource(AttributeStandardSelectorComponent.datatypes); this.tableDatatypes.setVisibleColumns(new Object[] {"shortName", "xacmlId"}); this.tableDatatypes.setColumnHeaders(new String[] {"Short Name", "XACML Data Type ID"}); this.tableDatatypes.setImmediate(true); this.tableDatatypes.setNullSelectionAllowed(false); this.tableDatatypes.setPageLength(10); // // Are we restricted to a certain datatype? // if (this.datatype != null) { // // Datatype restricted // this.tableDatatypes.select(this.datatype.getId()); this.tableDatatypes.setEnabled(false); return; } this.tableDatatypes.setSelectable(true); // // Select a default // Datatype defaultDatatype; if (this.attribute == null || this.attribute.getDatatypeBean() == null) { defaultDatatype = JPAUtils.findDatatype(XACML3.ID_DATATYPE_STRING); } else { defaultDatatype = this.attribute.getDatatypeBean(); } if (defaultDatatype != null) { this.tableDatatypes.select(defaultDatatype.getId()); } // // Respond to events // this.tableDatatypes.addValueChangeListener(new ValueChangeListener() { private static final long serialVersionUID = 1L; @Override public void valueChange(ValueChangeEvent event) { self.fireAttributeChanged(self.getAttribute()); } }); }