1
2
3
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
18
19
20
21
22
23 public class PropertySystemButtonProviderImpl implements SystemButtonProvider {
24
25
26
27
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 }