本文整理汇总了Java中com.vaadin.event.ItemClickEvent.ItemClickListener类的典型用法代码示例。如果您正苦于以下问题:Java ItemClickListener类的具体用法?Java ItemClickListener怎么用?Java ItemClickListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ItemClickListener类属于com.vaadin.event.ItemClickEvent包,在下文中一共展示了ItemClickListener类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getOptionTable
import com.vaadin.event.ItemClickEvent.ItemClickListener; //导入依赖的package包/类
@SuppressWarnings("serial")
protected Panel getOptionTable() {
this.optionTable = new Table();
this.optionTable.setPageLength(3);
this.optionTable.setSizeFull();
this.optionTable.setImmediate(true);
this.optionTable.addGeneratedColumn("Enabled", new CheckBoxGenerator());
this.optionTable.addContainerProperty("Name", String.class, null);
this.optionTable.addItemClickListener(new ItemClickListener() {
@Override
public void itemClick(ItemClickEvent event) {
optionTableClicked(event);
}
});
this.optionPanel = new Panel();
this.optionPanel.addStyleName(StyleConstants.FORM_PANEL);
this.optionPanel.setWidth(100, Sizeable.Unit.PERCENTAGE);
this.optionPanel.setContent(this.optionTable);
return this.optionPanel;
}
示例2: ActionStatusMsgGrid
import com.vaadin.event.ItemClickEvent.ItemClickListener; //导入依赖的package包/类
/**
* 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();
}
示例3: LTabWindow
import com.vaadin.event.ItemClickEvent.ItemClickListener; //导入依赖的package包/类
public LTabWindow(String winId, String caption,
IWinPermChecker masterPermChecker, ChoosingMode chooseMode,
boolean readOnly, IAppContext appContext,ICustomizeLWMultiMode forceCustomize) {
super(winId, caption, masterPermChecker, chooseMode, readOnly,
appContext, forceCustomize);
if (approvedToOpen == false)
return;
if (table == null) {
throw new RuntimeException("VHL-019: " + getI18S("MVHL-019"));
}
tableHelper = new TableHelper(table, getMsgs());
table.addItemClickListener(new ItemClickListener() {
private static final long serialVersionUID = 881449509470779229L;
@Override
public void itemClick(ItemClickEvent event) {
onTableCLick(event);
}
});
makeContextMenu().setAsContextMenuOf(table);
}
示例4: KursList
import com.vaadin.event.ItemClickEvent.ItemClickListener; //导入依赖的package包/类
public KursList(KurseZuordnen kurseZuordnen) {
this.app = kurseZuordnen.app;
buildContainer();
addGeneratedColumn(FachContainer.DYNAMIC_GENERATED_COLUMN_ZUGEWIESENE_SCHUELER_DER_KLASSE, new ColumnGenerator() {
private static final long serialVersionUID = 3266221651368747559L;
public Object generateCell(Table source, Object itemId, Object columnId) {
KlasseLaso klasse = KlasseContainer.getKlasseByLehrer(app.getLoginLehrer());
if (klasse == null) {
return 0;
}
FachLaso fach = (FachLaso) itemId;
BeanItemContainer<SchuelerPojo> relevanteSchueler = new BeanItemContainer<SchuelerPojo>(SchuelerPojo.class);
for (SchuelerPojo schueler: ZuordnungFachSchuelerContainer.getAllSchuelerOfFach(fach.getPojo()).getItemIds()) {
if (schueler.getKlasse().getId().equals(klasse.getId())) {
relevanteSchueler.addBean(schueler);
}
}
return relevanteSchueler.size();
}
});
initialize();
addListener((ItemClickListener) kurseZuordnen);
}
示例5: addRightClickSelect
import com.vaadin.event.ItemClickEvent.ItemClickListener; //导入依赖的package包/类
/**
* Adds a listener to select the right clicked item in the table. This is
* needed by ContextMenus.
*/
private void addRightClickSelect()
{
this.addItemClickListener(new ItemClickListener()
{
private static final long serialVersionUID = 1L;
@Override
public void itemClick(ItemClickEvent event)
{
if (event.getButton() == MouseButton.RIGHT)
{
EntityTable.this.setValue(event.getItemId());
}
}
});
}
示例6: addRightClickSelect
import com.vaadin.event.ItemClickEvent.ItemClickListener; //导入依赖的package包/类
/**
* Adds a listener to select the right clicked item in the table. This is
* needed by ContextMenus.
*/
private void addRightClickSelect()
{
selectableTable.addItemClickListener(new ItemClickListener()
{
private static final long serialVersionUID = 1L;
@Override
@SuppressWarnings("deprecation")
public void itemClick(ItemClickEvent event)
{
if (event.getButton() == MouseButton.RIGHT)
{
selectableTable.setValue(event.getItemId());
}
}
});
}
示例7: createSelectedGrid
import com.vaadin.event.ItemClickEvent.ItemClickListener; //导入依赖的package包/类
private void createSelectedGrid()
{
selectedGrid = new Grid();
selectedGrid.setContainerDataSource(createSelectedContainer());
selectedGrid.setWidth(DEFAULT_COLUMN_WIDTH, Unit.PIXELS);
selectedGrid.setHeight(DEFAULT_COLUMN_HEIGHT, Unit.PIXELS);
selectedGrid.addItemClickListener(new ItemClickListener()
{
private static final long serialVersionUID = 1L;
@Override
public void itemClick(ItemClickEvent event)
{
if (event.isDoubleClick())
{
removeButton.click();
}
}
});
createSelectedHeadings().applyToGrid(selectedGrid);
// initialised = true;
}
示例8: getVirtualSystemPanel
import com.vaadin.event.ItemClickEvent.ItemClickListener; //导入依赖的package包/类
/**
* @return AZ Panel
*/
@SuppressWarnings("serial")
protected Panel getVirtualSystemPanel() {
try {
this.vsTable = new Table();
this.vsTable.setPageLength(5);
this.vsTable.setImmediate(true);
this.vsTable.addGeneratedColumn("Enabled", new CheckBoxGenerator());
this.vsTable.addItemClickListener(new ItemClickListener() {
@Override
public void itemClick(ItemClickEvent event) {
vsTableClicked((Long) event.getItemId());
}
});
// populating VS table
populateVirtualSystem();
Panel vsPanel = new Panel("Virtualization System:");
vsPanel.addStyleName("form_Panel");
vsPanel.setWidth(100, Sizeable.Unit.PERCENTAGE);
vsPanel.setContent(this.vsTable);
return vsPanel;
} catch (Exception e) {
log.error("Error while creating DA's VS panel", e);
}
return null;
}
示例9: KlassenList
import com.vaadin.event.ItemClickEvent.ItemClickListener; //导入依赖的package包/类
public KlassenList(RolpApplication app, FossaWindow window, String[] naturalColOrder, String[] colHeaders) {
this.naturalColOrder = naturalColOrder;
this.colHeaders = colHeaders;
this.app = app;
buildContainer(app);
initialize();
addListener((ItemClickListener) window);
}
示例10: init
import com.vaadin.event.ItemClickEvent.ItemClickListener; //导入依赖的package包/类
@PostConstruct
public void init() {
beanContainer = new BeanItemContainer<Job>(Job.class, jobService.getJobs());
jobTable.setContainerDataSource(beanContainer);
jobTable.setVisibleColumns(new String[]{"id"});
jobTable.setColumnWidth("id", 225);
jobTable.addGeneratedColumn("Name", new Table.ColumnGenerator() {
@Override
public com.vaadin.ui.Component generateCell(Table source, Object itemId, Object columnId) {
Label label = new Label(((Job) itemId).getMetadata().getName());
label.setDescription(((Job) itemId).getMetadata().getDescription());
return label;
}
});
jobTable.setSizeFull();
jobTable.setSelectable(true);
jobTable.addListener(new ItemClickListener() {
@Override
public void itemClick(ItemClickEvent event) {
final Job job = (Job) event.getItemId();
showPipelineInfo(job);
}
});
addComponent(jobTable);
jobInfo.setSizeFull();
jobInfo.setRowExpandRatio(1, 3);
jobInfo.setRowExpandRatio(2, 3);
addComponent(jobInfo);
setSizeFull();
setSplitPosition(35, UNITS_PERCENTAGE);
}
示例11: TwinColumnSearchableSelect
import com.vaadin.event.ItemClickEvent.ItemClickListener; //导入依赖的package包/类
public TwinColumnSearchableSelect(final String fieldName, final SingularAttribute<C, ?> listField,
final SingularAttribute<C, Long> beanIdField, String itemLabel, final boolean isAscending)
{
this.setCaption(fieldName);
mainLayout = new HorizontalLayout();
this.isAscending = isAscending;
this.listField = listField;
beans = new BeanContainer<>(listField.getDeclaringType().getJavaType());
if (beanIdField == null)
{
Metamodel metaModel = EntityManagerProvider.getEntityManager().getMetamodel();
EntityType<C> type = metaModel.entity(listField.getDeclaringType().getJavaType());
this.beanIdField = type.getDeclaredId(Long.class);
}
else
{
this.beanIdField = beanIdField;
}
availableContainer = JpaBaseDao.getGenericDao(listField.getDeclaringType().getJavaType())
.createVaadinContainer();
availableContainer.sort(new Object[]
{ listField.getName() }, new boolean[]
{ isAscending });
if (itemLabel == null)
{
itemLabel = listField.getName();
}
this.itemLabel = itemLabel;
selectedTable = new Table();
selectedTable.setContainerDataSource(createBeanContainer());
if (!selectedTable.getContainerPropertyIds().contains(itemLabel))
{
logger.error("you need to define a getter for the field {} in {}, valid fields are {}", itemLabel,
listField.getDeclaringType().getJavaType(),
Arrays.toString(selectedTable.getContainerPropertyIds().toArray()));
}
selectedTable.addItemClickListener(new ItemClickListener()
{
private static final long serialVersionUID = 1L;
@Override
public void itemClick(ItemClickEvent event)
{
if (event.isDoubleClick())
{
removeButton.click();
}
}
});
selectedTable.setVisibleColumns(itemLabel);
selectedTable.setColumnHeaders("Selected");
selectedTable.setWidth(200, Unit.PIXELS);
selectedTable.setHeight(300, Unit.PIXELS);
selectedTable.setSelectable(true);
selectedTable.setMultiSelect(true);
// setting value of header here so that subclasses can
// modify header if needed
setAvailableColumnHeader(assignAvailableHeaderValue());
createAvailableTable();
addSelectedColumnTooltip();
addNewButton.setVisible(false);
refreshSelected();
}
示例12: initializeSourceTable
import com.vaadin.event.ItemClickEvent.ItemClickListener; //导入依赖的package包/类
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());
}
}
});
}
示例13: initializeAttributeTable
import com.vaadin.event.ItemClickEvent.ItemClickListener; //导入依赖的package包/类
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());
}
}
});
}
示例14: addItemClickListener
import com.vaadin.event.ItemClickEvent.ItemClickListener; //导入依赖的package包/类
public void addItemClickListener(ItemClickListener listener) {
tree.addItemClickListener(listener);
}
示例15: PflichtfaecherList
import com.vaadin.event.ItemClickEvent.ItemClickListener; //导入依赖的package包/类
public PflichtfaecherList(RolpApplication app, PflichtfaecherlisteAnzeigen pflichtfaecherlisteAnzeigen) {
this.app = app;
buildContainer();
initialize();
addListener((ItemClickListener) pflichtfaecherlisteAnzeigen);
}