W3Cschool
恭喜您成為首批注冊(cè)用戶
獲得88經(jīng)驗(yàn)值獎(jiǎng)勵(lì)
在為組件編寫(xiě)事件時(shí),如果需要引用頁(yè)面當(dāng)中的組件,那么可以直接通過(guò)使用view.id(組件名)實(shí)現(xiàn),如果要引用實(shí)體對(duì)應(yīng)的DataSet,可使用規(guī)則“dataSet+實(shí)體名”實(shí)現(xiàn),比如引用實(shí)體Employee對(duì)應(yīng)的DataSet,那么可以采用如下方式編寫(xiě)事件:
var ds=view.id("dataSetEmployee")
這樣就可以獲取到Employee實(shí)體對(duì)象對(duì)應(yīng)的DataSet,如果要獲取動(dòng)作的引用,同樣直接用view.id(動(dòng)作名)就行。
package com.bstek.bdf2.rapido.component;
import java.util.Collection;
import com.bstek.bdf2.rapido.component.property.PropertySupport;
import com.bstek.bdf2.rapido.domain.ComponentInfo;
import com.bstek.bdf2.rapido.domain.ComponentProperty;
import com.bstek.bdf2.rapido.domain.Entity;
/**
* 用于定義組件顯示信息
* @author jacky.gao@bstek.com
* @since 2012-8-25
*/
public interface ISupport {
/**
* 組件的顯示名稱
* @return 具體要顯示的名稱
*/
String getDisplayName();
/**
* Dorado7中該組件類的完全限定名
* @return 類全名
*/
String getFullClassName();
/**
* 組件顯示圖標(biāo)
* @return 圖標(biāo)地址
*/
String getIcon();
/**
* 對(duì)組件支持的某些屬性進(jìn)行特殊處理
* @return PropertySupport對(duì)象的集合
*/
Collection<PropertySupport> getPropertySupports();
/**
* 當(dāng)前組件下可以使用哪些子組件
* @return ISupport對(duì)象集合
*/
Collection<ISupport> getChildren();
/**
* 根據(jù)選擇的實(shí)體自動(dòng)創(chuàng)建子組件
* @param entity 選擇的實(shí)體對(duì)象
* @return 子組件集合
*/
Collection<ComponentInfo> createChildrenByEntity(Entity entity);
/**
* 根據(jù)組件ID創(chuàng)建組件常用屬性
* @param componentId 組件ID
* @return 組件屬性集合
*/
Collection<ComponentProperty> createComponentPropertysByComponentId(String componentId);
/**
* @return 是否支持實(shí)體
*/
boolean isSupportEntity();
/**
* @return 是否支持布局
*/
boolean isSupportLayout();
/**
* @return 是否支持動(dòng)作
*/
boolean isSupportAction();
/**
* @return 是否為容器類型組件
*/
boolean isContainer();
/**
* @return 是否可以獨(dú)立存在
*/
boolean isAlone();
}
package com.bstek.bdf2.rapido.xml;
import org.dom4j.Element;
import com.bstek.bdf2.rapido.domain.ComponentInfo;
import com.bstek.dorado.idesupport.model.RuleSet;
/**
* 用于view.xml頁(yè)面生成時(shí),輸出組件對(duì)應(yīng)的xml信息
* @author jacky.gao@bstek.com
* @since 2012-8-25
*/
public interface IConverter{
/**
* 根據(jù)給定的組件信息生成組件對(duì)應(yīng)的XML
* @param component 組件信息
* @param ruleSet 組件對(duì)應(yīng)的Dorado7的規(guī)則信息
* @param rootElement view.xml文檔的根
* @return 返回組件的Dom4j的Element對(duì)象
* @throws Exception
*/
Element convert(ComponentInfo component,RuleSet ruleSet,Element rootElement) throws Exception;
/**
* 當(dāng)前Converter是否支持給定的組件
* @param component 給定要判斷的組件
* @return 是否支持
*/
boolean support(ComponentInfo component);
}
Copyright©2021 w3cschool編程獅|閩ICP備15016281號(hào)-3|閩公網(wǎng)安備35020302033924號(hào)
違法和不良信息舉報(bào)電話:173-0602-2364|舉報(bào)郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號(hào)
聯(lián)系方式:
更多建議: