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


Java ItemClickEvent类代码示例

本文整理汇总了Java中com.vaadin.event.ItemClickEvent的典型用法代码示例。如果您正苦于以下问题:Java ItemClickEvent类的具体用法?Java ItemClickEvent怎么用?Java ItemClickEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: getOptionTable

import com.vaadin.event.ItemClickEvent; //导入依赖的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;

}
 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:24,代码来源:BaseDeploymentSpecWindow.java

示例2: optionTableClicked

import com.vaadin.event.ItemClickEvent; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private void optionTableClicked(ItemClickEvent event) {
    if (this.userOption.getValue() == NONE) {
        return;
    }
    Object itemId = 0L;
    if (this.userOption.getValue() == AVAILABILITY_ZONES) {
        itemId = event.getItemId();
    } else if (this.userOption.getValue() == HOSTS) {
        itemId = event.getItemId();
    } else if (this.userOption.getValue() == HOST_AGGREGATES) {
        itemId = event.getItemId();
    }
    if (this.optionTable.getContainerProperty(itemId, "Enabled").getValue().equals(true)) {
        this.optionTable.getContainerProperty(itemId, "Enabled").setValue(false);
    } else {
        this.optionTable.getContainerProperty(itemId, "Enabled").setValue(true);
    }
}
 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:20,代码来源:BaseDeploymentSpecWindow.java

示例3: itemClick

import com.vaadin.event.ItemClickEvent; //导入依赖的package包/类
@Override
public void itemClick(ItemClickEvent event) {
    if (event.getButton() == MouseEventDetails.MouseButton.LEFT) {
        Folder folder = (Folder) event.getItemId();
        if (getItemClickable(folder)) {
            openFolder((AbstractSearchFolder) event.getItemId());
        } else if (isItemExpandable(folder)) {
            Component tree = event.getComponent();
            if (tree instanceof Tree) {
                if (((Tree) tree).isExpanded(folder))
                    ((Tree) tree).collapseItem(folder);
                else
                    ((Tree) tree).expandItem(folder);
            }
        }
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:18,代码来源:CubaFoldersPane.java

示例4: ActionStatusMsgGrid

import com.vaadin.event.ItemClickEvent; //导入依赖的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();
}
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:31,代码来源:ActionStatusMsgGrid.java

示例5: LTabWindow

import com.vaadin.event.ItemClickEvent; //导入依赖的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);
}
 
开发者ID:mi9rom,项目名称:VaadHL,代码行数:26,代码来源:LTabWindow.java

示例6: addRightClickSelect

import com.vaadin.event.ItemClickEvent; //导入依赖的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());
			}
		}
	});
}
 
开发者ID:rlsutton1,项目名称:VaadinUtils,代码行数:21,代码来源:EntityTable.java

示例7: addRightClickSelect

import com.vaadin.event.ItemClickEvent; //导入依赖的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());
			}
		}
	});
}
 
开发者ID:rlsutton1,项目名称:VaadinUtils,代码行数:22,代码来源:SearchableSelectableEntityTable.java

示例8: createSelectedGrid

import com.vaadin.event.ItemClickEvent; //导入依赖的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;
}
 
开发者ID:rlsutton1,项目名称:VaadinUtils,代码行数:27,代码来源:TwinColumnSelect.java

示例9: itemClick

import com.vaadin.event.ItemClickEvent; //导入依赖的package包/类
@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);
		}
	}
}
 
开发者ID:chipster,项目名称:chipster,代码行数:23,代码来源:TreeToolEditor.java

示例10: itemClick

import com.vaadin.event.ItemClickEvent; //导入依赖的package包/类
/**
 * {@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);
		}
	}
}
 
开发者ID:chelu,项目名称:jdal,代码行数:27,代码来源:TableComponent.java

示例11: fromClickEvent

import com.vaadin.event.ItemClickEvent; //导入依赖的package包/类
private static MouseEventDetails fromClickEvent(ItemClickEvent event) {
	MouseEventDetails d = new MouseEventDetails();
	d.setButton(event.getButton());
	d.setAltKey(event.isAltKey());
	d.setCtrlKey(event.isCtrlKey());
	d.setShiftKey(event.isShiftKey());
	d.setType(event.isDoubleClick() ? 0x00002 : 0);
	d.setClientX(event.getClientX());
	d.setClientY(event.getClientY());
	d.setRelativeX(event.getRelativeX());
	d.setRelativeY(event.getRelativeY());
	return d;
}
 
开发者ID:holon-platform,项目名称:holon-vaadin7,代码行数:14,代码来源:DefaultItemListing.java

示例12: getVirtualSystemPanel

import com.vaadin.event.ItemClickEvent; //导入依赖的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;
}
 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:36,代码来源:BaseDAWindow.java

示例13: itemClick

import com.vaadin.event.ItemClickEvent; //导入依赖的package包/类
@Override
public void itemClick(ItemClickEvent event) {
    MenuItem item = (MenuItem) event.getItemId();
    if (item.isMenu()) {
        Component tree = event.getComponent();
        if (tree instanceof Tree) {
            switchExpandState((Tree) tree, item);
        }
    } else {
        if (event.getButton() == MouseEventDetails.MouseButton.LEFT) {
            tree.select(item);
            openWindow(item);
        }
    }
}
 
开发者ID:cuba-platform,项目名称:sampler,代码行数:16,代码来源:SamplerFoldersPane.java

示例14: onTableDoubleCLick

import com.vaadin.event.ItemClickEvent; //导入依赖的package包/类
protected void onTableDoubleCLick(ItemClickEvent event) {
	switch (getDoubleClickAc()) {
	case DETAILS:
		details(event.getItemId());
		break;
	case VIEW:
		view(event.getItemId());
		break;
	case EDIT:
		edit(event.getItemId());
		break;
	case DELETE:
		delete(event.getItemId());
		break;
	case CREATE:
		add();
		break;
	case CHOOSE:
		if (getChooseMode() == ChoosingMode.NO_CHOOSE)
			closeExit();
		else {
			// if (getChooseMode() == ChoosingMode.SINGLE_CHOOSE)
			table.select(event.getItemId());
			closeChoose();
		}
		break;

	default:
		break;

	}

}
 
开发者ID:mi9rom,项目名称:VaadHL,代码行数:34,代码来源:LTabWindow.java

示例15: rowClicked

import com.vaadin.event.ItemClickEvent; //导入依赖的package包/类
protected void rowClicked(ItemClickEvent event) {
    ReleasePackage object =  (ReleasePackage)event.getItemId();
    if (grid.getSelectedRows().contains(object)) {
        grid.deselect(object);
    } else if (event.isCtrlKey() || event.isAltKey() || event.isShiftKey()) {
        grid.select(object);
    } else {
        grid.deselectAll();
        grid.select(object);
    }
}
 
开发者ID:JumpMind,项目名称:metl,代码行数:12,代码来源:ReleasesView.java


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