本文整理汇总了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;
}
示例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);
}
}
示例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);
}
}
}
}
示例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();
}
示例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);
}
示例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());
}
}
});
}
示例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());
}
}
});
}
示例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;
}
示例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);
}
}
}
示例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);
}
}
}
示例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;
}
示例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;
}
示例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);
}
}
}
示例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;
}
}
示例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);
}
}