📄 componentaction.java
字号:
package cn.myapps.core.dynaform.component.action;
import java.util.Collection;
import java.util.Iterator;
import cn.myapps.core.deploy.application.ejb.ApplicationProcess;
import cn.myapps.core.deploy.application.ejb.ApplicationVO;
import cn.myapps.core.dynaform.component.ejb.Component;
import cn.myapps.core.dynaform.form.action.FormAction;
import cn.myapps.core.dynaform.form.ejb.FormField;
import cn.myapps.util.ProcessFactory;
import cn.myapps.util.text.TemplateContext;
public class ComponentAction extends FormAction {
/**
*
*/
private static final long serialVersionUID = 1395964549692071142L;
private Collection fieldList;
public ComponentAction() throws ClassNotFoundException {
super(new Component());
}
public String doSelectList() throws Exception {
return super.doList();
}
public String doFieldList() throws Exception {
String id = (String) getParams().getParameter("id");
Component comp = (Component) proxy.doView(id);
if (comp != null) {
fieldList = comp.getFields();
for (Iterator iter = fieldList.iterator(); iter.hasNext();) {
FormField field = (FormField) iter.next();
TemplateContext context = TemplateContext
.parse(field.getName());
field.setName(context.toText());
}
} else {
addFieldError("",
"Could not find the component,please make sure it has already existed!");
}
return SUCCESS;
}
public String get_applicationid() {
Component content = (Component) getContent();
if (content.getApplication() != null) {
return content.getApplication().getId();
} else {
return null;
}
}
public void set_applicationid(String _applicationid) throws Exception {
Component content = (Component) getContent();
if (_applicationid != null) {
ApplicationProcess ap = (ApplicationProcess) ProcessFactory
.createProcess(ApplicationProcess.class);
ApplicationVO app = (ApplicationVO) ap.doView(_applicationid);
content.setApplication(app);
} else {
content.setApplication(null);
}
}
public Collection getFieldList() {
return fieldList;
}
public void setFieldList(Collection fieldList) {
this.fieldList = fieldList;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -