View Javadoc
1   /**
2    * Copyright By Grandsoft Company Limited.  
3    * 2013-8-4 下午09:44:40
4    */
5   package gboat2.web.service.impl;
6   
7   import gboat2.base.core.util.ActionUtil;
8   import gboat2.base.core.web.BaseActionSupport;
9   import gboat2.base.core.web.SystemButtonProvider;
10  import net.sf.json.JSONArray;
11  import net.sf.json.JSONObject;
12  
13  
14  /**
15   * 
16   * 查看页面属性的系统级操作
17   * @author lysming
18   * @since jdk1.6
19   * @date 2013-8-4
20   *  
21   */
22  
23  public class PropertySystemButtonProviderImpl implements SystemButtonProvider {
24  
25  	/** 
26  	  * {@inheritDoc}   
27  	  * @see gboat2.base.core.web.SystemButtonProvider#getSystemButtons(gboat2.base.core.web.BaseActionSupport, java.lang.String) 
28  	  */
29  	@Override
30  	public JSONArray getSystemButtons(BaseActionSupport action, String invokeMethod) {
31  		JSONArray arr = new JSONArray();
32  		JSONObject opera = new JSONObject();
33  		opera.put("code", "view");
34  		opera.put("text", "属性");
35  		opera.put("system", true);
36  		opera.put("tooltip", "查看页面属性");
37  		opera.put("clientValidation", false);
38  		opera.put("uri", "property!view.do");
39  		if (ActionUtil.isListPage(invokeMethod,action)) {
40  			opera.put("target", "_blank");
41  		} else if (ActionUtil.isFormPage(invokeMethod,action)) {
42  			opera.put("handler", "createNewWin");
43  		}
44  		JSONObject param = new JSONObject();
45  		param.accumulate("actionName", action.getClass().getName());
46  		param.accumulate("invokeMethod", invokeMethod);
47  		opera.accumulate("params", param);
48  		arr.add(opera);
49  		return arr;
50  	}
51  }