本文整理汇总了Java中com.vaadin.event.ItemClickEvent.getButton方法的典型用法代码示例。如果您正苦于以下问题:Java ItemClickEvent.getButton方法的具体用法?Java ItemClickEvent.getButton怎么用?Java ItemClickEvent.getButton使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vaadin.event.ItemClickEvent
的用法示例。
在下文中一共展示了ItemClickEvent.getButton方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
}
}
}
示例2: 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);
}
}
}
示例3: itemClick
import com.vaadin.event.ItemClickEvent; //导入方法依赖的package包/类
public void itemClick(ItemClickEvent event) {
if (event.getButton() == MouseButton.LEFT) {
Object value = event.getItemId();
if (value != null) {
String id = value.toString();
Component panel = null;
if (id.equals("Users")) {
panel = new UserPanel(context, tabbedPanel);
} else if (id.equals("Groups")) {
panel = new GroupPanel(context, tabbedPanel);
} else if (id.equals("REST")) {
panel = new ApiPanel(context, tabbedPanel);
} else if (id.equals("General Settings")) {
panel = new GeneralSettingsPanel(context, tabbedPanel);
} else if (id.equals("Mail Server")) {
panel = new MailServerPanel(context, tabbedPanel);
} else if (id.equals("Notifications")) {
panel = new NotificationPanel(context, tabbedPanel);
} else if (id.equals("Logging")) {
panel = new LoggingPanel(context, tabbedPanel);
} else if (id.equals("Plugin Repositories")) {
panel = new PluginRepositoriesPanel(context, tabbedPanel);
} else if (id.equals("About")) {
panel = new AboutPanel(context, tabbedPanel);
} else if (id.equals("Plugins")) {
panel = new PluginsPanel(context, tabbedPanel);
} else if (id.equals("Active Users")) {
panel = new ActiveUsersPanel(context, tabbedPanel);
} else if (id.equals("Audit Events")) {
panel = new AuditEventPanel(context, tabbedPanel);
}
tabbedPanel.addCloseableTab(id, id, table.getItemIcon(id), panel);
}
}
}