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 gboat2.web.action.MetadataAction;
11 import net.sf.json.JSONArray;
12 import net.sf.json.JSONObject;
13
14
15
16
17
18
19
20
21
22
23 public class MetadataEditSystemButtonProviderImpl implements SystemButtonProvider {
24
25
26
27
28
29 @Override
30 public JSONArray getSystemButtons(BaseActionSupport action, String invokeMethod) {
31
32 JSONArray jsonArr = new JSONArray();
33
34 JSONObject designBtn = new JSONObject();
35 designBtn.put("code", "design");
36 designBtn.put("text", "设计");
37 designBtn.put("system", true);
38 designBtn.put("tooltip", "页面设计");
39 designBtn.put("uri", "metadata!design.do");
40 designBtn.put("clientValidation", false);
41 designBtn.put("actionName",MetadataAction.class.getName());
42
43 if (ActionUtil.isListPage(invokeMethod,action)) {
44
45 designBtn.put("action", "relayout");
46 designBtn.put("icon", "static/gboat2.web/themes/default/images/shared/icons/16/cog_edit.png");
47 designBtn.put("target", "_blank");
48 } else if (ActionUtil.isFormPage(invokeMethod,action)) {
49
50 designBtn.put("handler", "createNewWin");
51 }
52
53 JSONObject param = new JSONObject();
54 param.accumulate("actionName", action.getClass().getName());
55 param.accumulate("invokeMethod", invokeMethod);
56 designBtn.accumulate("params", param);
57
58 jsonArr.add(designBtn);
59 return jsonArr;
60 }
61 }