functionIconStyleList.jsp 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <%--
  2. update---Author:chenj Date:20160729 for:增加图标样式预览页面
  3. --%>
  4. <%@ page language="java" contentType="text/html; charset=utf-8"
  5. pageEncoding="utf-8"%>
  6. <%@ page import = "java.io.*" %>
  7. <%@ page import = "java.util.ArrayList,java.util.List" %>
  8. <%@include file="/context/mytags.jsp"%>
  9. <%
  10. String param = request.getParameter("style");
  11. List<String> list =new ArrayList<String>();
  12. //File file = new File("E:/marsWS/jeecg-framework/src/main/webapp/plug-in/ace/assets/css/font-awesome.min.css");
  13. BufferedReader reader = null;
  14. if(param!=null&&param.equals("ace")){
  15. String filePath = application.getRealPath("/") + "/plug-in/ace/assets/css/font-awesome.min.css";
  16. File file = new File(filePath);
  17. reader = new BufferedReader(new FileReader(file));
  18. }
  19. //update-start--Author: chenj Date:20160815 for:TASK #1040 【UI按钮标签ace样式】列表后面的操作按钮支持按钮标签样式设置,
  20. if(param!=null&&param.equals("urlfont")){
  21. String filePath = application.getRealPath("/") + "/plug-in/ace/css/font-awesome.css";
  22. File file = new File(filePath);
  23. reader = new BufferedReader(new FileReader(file));
  24. }
  25. //update-start--Author: chenj Date:20160815 for:TASK #1040 【UI按钮标签ace样式】列表后面的操作按钮支持按钮标签样式设置,
  26. //返回读取指定资源的输入流
  27. if(param!=null&&param.equals("hplus")){
  28. //filePath = application.getRealPath("/") + "/plug-in/hplus/font-awesome.css";
  29. InputStream is=this.getClass().getResourceAsStream("/plug-in-ui/hplus/css/font-awesome.css");
  30. reader=new BufferedReader(new InputStreamReader(is));
  31. }
  32. try {
  33. //System.out.println("以行为单位读取文件内容,一次读一整行:");
  34. String tempString = null;
  35. int line = 1;
  36. // 一次读入一行,直到读入null为文件结束
  37. while ((tempString = reader.readLine()) != null) {
  38. // 显示行号
  39. //System.out.println("line " + line + ": " + tempString);
  40. if(tempString !=null&&!tempString.trim().equals("")){
  41. if(tempString.indexOf(":before")>-1&&tempString.indexOf(".")>-1){
  42. int start = tempString.indexOf(".");
  43. int end = tempString.indexOf(":before");
  44. String subStr = tempString.substring(start+1, end);
  45. if(param!=null&&(param.equals("hplus")||param.equals("urlfont"))){
  46. subStr = "fa "+subStr;
  47. }
  48. //out.println("start:"+start);
  49. //out.println("end:"+end);
  50. //out.println("subStr:"+subStr);
  51. if(param!=null&&(param.equals("ace"))&&tempString.indexOf("content:")==-1)
  52. {
  53. continue;
  54. }
  55. list.add(subStr);
  56. }
  57. }
  58. line++;
  59. }
  60. reader.close();
  61. } catch (IOException e) {
  62. e.printStackTrace();
  63. } finally {
  64. if (reader != null) {
  65. try {
  66. reader.close();
  67. } catch (IOException e1) {
  68. }
  69. }
  70. }
  71. %>
  72. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  73. <html>
  74. <head>
  75. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  76. <%
  77. if(param!=null&&param.equals("ace")){
  78. %>
  79. <link rel="stylesheet" href="<%=basePath %>/plug-in/ace/assets/css/font-awesome.min.css" />
  80. <%}else if(param!=null&&param.equals("hplus")){ %>
  81. <link rel="stylesheet" href="<%=basePath %>/plug-in-ui/hplus/css/font-awesome.min.css?v=4.4.0" />
  82. <%}else if(param!=null&&param.equals("urlfont")){ %>
  83. <link rel="stylesheet" href="<%=basePath %>/plug-in/ace/css/font-awesome.css" />
  84. <%} %>
  85. <title>菜单图标样式</title>
  86. </head>
  87. <body>
  88. <h1><%=param%>图标样式</h1>
  89. <table>
  90. <%
  91. if(list.size()>0){
  92. for(String style:list){
  93. String c = style;
  94. if(param!=null&&(param.equals("hplus")||param.equals("urlfont"))){
  95. c = style.replace("fa ","");
  96. }
  97. %>
  98. <tr><td><i class=" <%=style%>"></i></td> <td><%=c %></td></tr>
  99. <%
  100. }
  101. }
  102. %>
  103. </table>
  104. </body>
  105. </html>