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


Java ItemClickEvent.getButton方法代码示例

本文整理汇总了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);
            }
        }
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:18,代码来源:CubaFoldersPane.java

示例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);
        }
    }
}
 
开发者ID:cuba-platform,项目名称:sampler,代码行数:16,代码来源:SamplerFoldersPane.java

示例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);
        }
    }
}
 
开发者ID:JumpMind,项目名称:metl,代码行数:36,代码来源:AdminView.java


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