Leaf.java 文件源码

java
阅读 22 收藏 0 点赞 0 评论 0

项目:EasyML 作者:
/**
 * Create a leaf node for the Tree
 *
 * @param name   name of the TreeItem
 * @param module Attached moduleId for the TreeItem
 */
public Leaf(String name,
        T module,
        String style) {
    // add context menu
    this.menu = new ContextMenu();
    label = new Label(name);
    this.setWidget(label);

    label.addMouseDownHandler(new MouseDownHandler() {
        @Override
        public void onMouseDown(MouseDownEvent event) {
            // display the context menu when right click
            if (event.getNativeButton() == NativeEvent.BUTTON_RIGHT) {
                menu.setPopupPosition(event.getClientX(), event.getClientY());
                menu.show();
            }
        }
    });

    // set moduleId
    this.module = module;
    this.addStyleName("bda-treeleaf");
    if (!style.equals(""))
        this.addStyleName(style);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号