📄 edittemplate.java
字号:
package com.ejsun.entapps.presentation.pages.simpleoa;
import org.apache.tapestry.IRequestCycle;
import org.apache.tapestry.PageRedirectException;
import org.apache.tapestry.form.IPropertySelectionModel;
import org.apache.tapestry.form.StringPropertySelectionModel;
import com.ejsun.entapps.domain.simpleoa.Attribute;
import com.ejsun.entapps.domain.simpleoa.Template;
import com.ejsun.entapps.domain.simpleoa.TemplateAttribute;
import com.ejsun.entapps.presentation.pages.Protected;
import com.ejsun.entapps.service.simpleoa.TemplateService;
/**
* @author Quake Wang
* @since 2004-6-1
* @version $Revision: 1.3 $
*
**/
public abstract class EditTemplate extends Protected {
public static final IPropertySelectionModel AVAILABLE_TYPE_MODEL =
new StringPropertySelectionModel(
new String[] { Attribute.STRING_TYPE, Attribute.TEXT_TYPE, Attribute.DATE_TYPE });
public abstract Template getTemplate();
public abstract void setTemplate(Template template);
public abstract TemplateAttribute getEachAttribute();
public abstract TemplateService getTemplateService();
public void deleteAttribute(IRequestCycle cycle) {
getTemplate().removeAttribute(((Integer) cycle.getServiceParameters()[0]).intValue());
}
public void addAttribute(IRequestCycle cycle) {
getTemplate().addAttribute(((Integer) cycle.getServiceParameters()[0]).intValue(), new TemplateAttribute());
}
public void createTemplate(IRequestCycle cycle) {
getTemplateService().createTemplate(getTemplate());
throw new PageRedirectException("TemplateList");
}
public void updateTemplate(IRequestCycle cycle) {
getTemplateService().updateTemplate(getTemplate());
throw new PageRedirectException("TemplateList");
}
public void previewTemplate(IRequestCycle cycle) {
PreviewTemplate page = (PreviewTemplate) cycle.getPage("PreviewTemplate");
page.setForm(getTemplate().generateForm());
cycle.activate(page);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -