com.vaadin.event.ItemClickEvent Java Examples

The following examples show how to use com.vaadin.event.ItemClickEvent. 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: ActionStatusMsgGrid.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Constructor.
 *
 * @param i18n
 * @param eventBus
 */
protected ActionStatusMsgGrid(final VaadinMessageSource i18n, final UIEventBus eventBus) {
    super(i18n, eventBus, null);
    noMsgText = createNoMessageProxy(i18n);

    setSingleSelectionSupport(new SingleSelectionSupport());
    setDetailsSupport(new DetailsSupport());

    alignGenerator = new AlignCellStyleGenerator(null, null, rightAlignedColumns);
    addStyleName(SPUIStyleDefinitions.ACTION_HISTORY_MESSAGE_GRID);

    setDetailsGenerator(new MessageDetailsGenerator());

    this.addItemClickListener(new ItemClickListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void itemClick(final ItemClickEvent event) {
            final Object itemId = event.getItemId();
            setDetailsVisible(itemId, !isDetailsVisible(itemId));
        }
    });

    init();
}
 
Example #2
Source File: TreeToolEditor.java    From chipster with MIT License 6 votes vote down vote up
@Override
public void itemClick(ItemClickEvent event) {
	Object itemId = event.getItemId();
	if(itemId instanceof Input || itemId instanceof Output || itemId instanceof Parameter) {
		root.getToolEditor().removeAllComponents();
		root.getToolEditor().addComponent((BasicModel)itemId);
	} else {
		root.getToolEditor().removeAllComponents();
		if(itemId.equals(TOOL)) {
			root.getToolEditor().addComponent(tool);
			addAllChildrenToToolEditor(INPUTS);
			addAllChildrenToToolEditor(OUTPUTS);
			addAllChildrenToToolEditor(PARAMETERS);
		} else if(itemId.equals(INPUTS)) {
			addAllChildrenToToolEditor(INPUTS);
		} else if(itemId.equals(OUTPUTS)) {
			addAllChildrenToToolEditor(OUTPUTS);
		} else if(itemId.equals(PARAMETERS)) {
			addAllChildrenToToolEditor(PARAMETERS);
		}
	}
}
 
Example #3
Source File: TableComponent.java    From jdal with Apache License 2.0 6 votes vote down vote up
/**
 * {@inheritDoc}
 */
public void itemClick(ItemClickEvent event) {
	if (event.isDoubleClick()) {
		VaadinView<T> editor = getEditorView();
		if (editor != null) {
			Item item = event.getItem();
			editor.setModel(getBean(item));
			editor.refresh();
			
			editor.addEditorListener(new EditorListener() {
				
				public void modelChanged(EditorEvent e) {
					refresh();
					fireEditorEvent(e);
				}
			});
			
			ViewDialog dlg =  this.guiFactory.newViewDialog(editor, this.dialog);
			dlg.init();
			dlg.center();
			this.getUI().addWindow(dlg);
		}
	}
}
 
Example #4
Source File: PIPSQLResolverEditorWindow.java    From XACML with MIT License 4 votes vote down vote up
protected void initializeSourceTable(String fields) {
	//
	// Add data into the container
	//
	this.populateData(this.fieldPrefix, fields, this.fieldsContainer);
	//
	// Set GUI properties
	//
	this.tableRequiredAttributes.setContainerDataSource(this.fieldsContainer);
	this.tableRequiredAttributes.setPageLength((this.fieldsContainer.size() == 0 ? 3 : this.fieldsContainer.size() + 1));
	this.tableRequiredAttributes.setSizeFull();
	this.tableRequiredAttributes.setColumnCollapsingAllowed(true);
	this.tableRequiredAttributes.setVisibleColumns(new Object[] {"identifier", "id", "category", "datatype", "shortId", "shortCategory", "shortDatatype"});
	this.tableRequiredAttributes.setColumnHeaders(new String[] {"Field", "Attribute Id", "Category", "Data Type", "Attribute Id", "Category", "Data Type"});
	this.tableRequiredAttributes.setColumnCollapsed("id", true);
	this.tableRequiredAttributes.setColumnCollapsed("category", true);
	this.tableRequiredAttributes.setColumnCollapsed("datatype", true);
	this.tableRequiredAttributes.setSelectable(true);
	//
	// Setup its handler
	//
	this.tableRequiredAttributes.addActionHandler(this);
	//
	// Respond to events
	//
	this.tableRequiredAttributes.addItemClickListener(new ItemClickListener() {
		private static final long serialVersionUID = 1L;

		@Override
		public void itemClick(ItemClickEvent event) {
			if (event.isDoubleClick()) {
				Object id = event.getItemId();
				if (id == null) {
					//
					// Really shouldn't get here
					//
					return;
				}
				BeanItem<ResolverAttribute> beanItem = self.fieldsContainer.getItem(id);
				if (beanItem == null) {
					//
					// Again, shouldn't get here
					//
					return;
				}
				self.editAttribute(self.tableRequiredAttributes, beanItem.getBean());
			}
		}
	});
}
 
Example #5
Source File: PIPSQLResolverEditorWindow.java    From XACML with MIT License 4 votes vote down vote up
protected void initializeAttributeTable(String parameters) {
	//
	// Add data into the container
	//
	this.populateData(this.parameterPrefix, parameters, this.parametersContainer);
	//
	// setup gui properties
	//
	this.tableAttributes.setContainerDataSource(this.parametersContainer);
	this.tableAttributes.setPageLength(this.parametersContainer.size() + 1);
	this.tableAttributes.setSizeFull();
	this.tableAttributes.setColumnCollapsingAllowed(true);
	this.tableAttributes.setVisibleColumns(new Object[] {"identifier", "id", "category", "datatype", "shortId", "shortCategory", "shortDatatype"});
	this.tableAttributes.setColumnHeaders(new String[] {"Position", "Attribute Id", "Category", "Data Type", "Attribute Id", "Category", "Data Type"});
	this.tableAttributes.setColumnCollapsed("id", true);
	this.tableAttributes.setColumnCollapsed("category", true);
	this.tableAttributes.setColumnCollapsed("datatype", true);
	this.tableAttributes.setSelectable(true);
	//
	// Setup its handler
	//
	this.tableAttributes.addActionHandler(this);
	//
	// Respond to events
	//
	this.tableAttributes.addItemClickListener(new ItemClickListener() {
		private static final long serialVersionUID = 1L;

		@Override
		public void itemClick(ItemClickEvent event) {
			if (event.isDoubleClick()) {
				Object id = event.getItemId();
				if (id == null) {
					//
					// Really shouldn't get here
					//
					return;
				}
				BeanItem<ResolverAttribute> beanItem = self.parametersContainer.getItem(id);
				if (beanItem == null) {
					//
					// Again, shouldn't get here
					//
					return;
				}
				self.editAttribute(self.tableAttributes, beanItem.getBean());
			}
		}
	});
}