|
|
|
package com.fr.plugin.event.manager.data;
|
|
|
|
|
|
|
|
import com.fr.design.designer.creator.XCreator;
|
|
|
|
import com.fr.design.designer.creator.XCreatorUtils;
|
|
|
|
import com.fr.form.ui.Widget;
|
|
|
|
|
|
|
|
import javax.swing.Icon;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 树的节点,包含一个控件对象
|
|
|
|
* 因为树节点可能是纯目录型的,比如sheet,block,也可能是带有控件的
|
|
|
|
* @author Joe
|
|
|
|
* Created by Joe on 12/14/2020
|
|
|
|
*/
|
|
|
|
public class MyWidget extends MyNode {
|
|
|
|
private Widget widget;
|
|
|
|
|
|
|
|
// 是否含有事件
|
|
|
|
private boolean hasEvent = false;
|
|
|
|
|
|
|
|
public MyWidget(Widget widget) {
|
|
|
|
this.widget = widget;
|
|
|
|
this.nodeName = widget.getWidgetName();
|
|
|
|
XCreator creator = XCreatorUtils.createXCreator(widget);
|
|
|
|
this.icon = XCreatorUtils.getCreatorIcon(creator);
|
|
|
|
}
|
|
|
|
|
|
|
|
public Widget getWidget() {
|
|
|
|
return widget;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setWidget(Widget widget) {
|
|
|
|
this.widget = widget;
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean isHasEvent() {
|
|
|
|
return hasEvent;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setHasEvent(boolean hasEvent) {
|
|
|
|
this.hasEvent = hasEvent;
|
|
|
|
}
|
|
|
|
}
|