wangting
2024-12-26 fa261e8c1220b31af54e8167e4de9c3320b1af27
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
package com.vci.client.uif.engine.client;
 
import java.awt.Component;
import java.util.HashMap;
import java.util.Map;
 
import com.vci.client.portal.utility.PLDefination;
import com.vci.client.ui.swing.components.VCIJPanel;
import com.vci.client.uif.engine.client.event.UIBaseEventContainer;
import com.vci.client.uif.engine.common.CBOHelper;
import com.vci.client.uif.engine.common.IDataNode;
import com.vci.corba.portal.data.PLPageDefination;
import com.vci.corba.portal.data.PLTabPage;
 
public abstract class AbstractRegionPanel extends VCIJPanel implements IRegionPanel {
 
    /**
     * 
     */
    private static final long serialVersionUID = -4386384547114079714L;
    
    private String type = "";
    private String context = "";
    public IDataModel dataModel = null;
    private PLDefination defination = null;
    private PLPageDefination pageDefinition = null;
    private boolean built = false;
    private String tabId = "";
    private PLTabPage tabPage = null;
    private Map<String, String> fromDataMap = new HashMap<String, String>();
    private UIBaseLayoutPanel baseLayoutPanel = null;
    private UIBaseEventContainer eventContainer;
    private boolean isCancel = false;
    private boolean isFinish = false;
    /*private IDataNode sourceData = null;*/
    
    private Component componentPanel = null;//new VCIJPanel(); by zhonggy 2015-07
    
    @Override
    public void preInit(String type, String context) {
        setType(type);
        setContext(context);
    }
 
    @Override
    public void setType(String type) {
        this.type = type;
    }
 
    @Override
    public String getType() {
        return this.type;
    }
 
    @Override
    public void setContext(String context) {
        this.context = context;
    }
 
    @Override
    public String getContext() {
        return this.context;
    }
 
    @Override
    public void setDataModel(IDataModel dataModel){
        this.dataModel = dataModel;
    }
    
    @Override
    public IDataModel getDataModel(){
        return this.dataModel;
    }
    
    @Override
    public void setDefination(PLDefination defination){
        this.defination = defination; 
    }
    
    @Override
    public PLDefination getDefination(){
        return this.defination;
    }
    @Override
    public void setPageDefinition(PLPageDefination pageDefinition){
        this.pageDefinition = pageDefinition;
    }
    @Override
    public PLPageDefination getPageDefinition(){
        return this.pageDefinition;
    }
    @Override
    public boolean isBuilt(){
        return this.built;
    }
    
    protected void setBuilt(boolean built){
        this.built = built;
    }
    
    @Override
    public Component getComponentPanel() {
        if (componentPanel != null) {
            return this.componentPanel;
        }else {
            return this;    //by zhonggy 2015-07
        }
    }
    
    protected void setComponentPanel(Component componentPanel){
        this.componentPanel = componentPanel;
    }
    
    @Override
    public void setTabId(String tabId){
        this.tabId = tabId;
    }
    
    @Override
    public String getTabId(){
        return this.tabId;
    }
 
    @Override
    public void setTab(PLTabPage tabPage) {
        this.tabPage = tabPage;
    }
 
    @Override
    public PLTabPage getTabPage() {
        return this.tabPage;
    }
    public void setFromDataMap(Map<String, String> fromDataMap){
        this.fromDataMap = fromDataMap;
    }
    public Map<String, String> getFromDataMap(){
        return this.fromDataMap;
    }
    
    /**
     * 返回此IRegion所在的UILayout对象
     * @return 此IRegion所在的UILayout对象
     */
    public UIBaseLayoutPanel getBaseLayoutPanel() {
        return baseLayoutPanel;
    }
    /**
     * 返回此IRegionPanel所在的UIBaseLayoutPanel对象
     * @return baseLayoutPanel 此IRegion所在的UIBaseLayoutPanel对象
     */
    public void setBaseLayoutPanel(UIBaseLayoutPanel baseLayoutPanel) {
        this.baseLayoutPanel = baseLayoutPanel;
    }
 
    public UIBaseEventContainer getEventContainer() {
        return eventContainer;
    }
    
    public boolean isCancel() {
        return isCancel;
    }
 
    public void setCancel(boolean isCancel) {
        this.isCancel = isCancel;
    }
    
    public boolean isFinish() {
        return isFinish;
    }
 
    public void setFinish(boolean isFinish) {
        this.isFinish = isFinish;
    }
 
    public void loadEvent() {
        //TODO 增加事件加载的代码
    }
    
    /**
     * 返回 此IRegionPanel初始时、唯一恒定不变的SourceData对象
     * @return 此IRegionPanel初始时、唯一恒定不变的SourceData对象
     */
    public IDataNode getSourceData() {
        //return sourceData;
        return getDataModel().getSourceData();
    }
    
    /**
     * 设置此IRegionPanel初始时、唯一恒定不变的SourceData对象
     * @param sourceData 此IRegionPanel初始时、唯一恒定不变的SourceData对象
     *//*
    public void setSourceData(IDataNode sourceData) {
        this.sourceData = sourceData;
    }*/
    
    /**
     * 根据传入的DataNode获取其上bo对象的OID
     * @return
     */
    @Override
    public String getBusinessObjectOid(IDataNode dataNode) {
        if (dataNode == null)
            return "";
        
        return CBOHelper.getBusinessObjectOid(dataNode);
    }
    
    /**
     * 根据传入的DataNode获取其上bo对象的type
     * @return
     */
    @Override
    public String getBusinessObjectType(IDataNode dataNode) {
        return CBOHelper.getBusinessObjectType(dataNode);
    }
    
    @Override
    public String getLinkObjectOid(IDataNode dataNode) {
        return CBOHelper.getLinkObjectOid(dataNode);
    }
//    /**
//     * @Title        :默认的界面刷新 by zhonggy 2015-07
//     * @Description    :
//     */
//    public void refreshUI(){
//        //TODO:为了防止继承该抽象类的IRegionPanel对象不出现编译问题在此增加实现;具体应该具体的UI控件去实现!!!
//    }
}