diff --git a/Bench4Q-Share/src/main/java/org/bench4q/share/models/master/plugin/BehaviorInfoModel.java b/Bench4Q-Share/src/main/java/org/bench4q/share/models/master/plugin/BehaviorInfoModel.java index 35a804d2..fd69529d 100644 --- a/Bench4Q-Share/src/main/java/org/bench4q/share/models/master/plugin/BehaviorInfoModel.java +++ b/Bench4Q-Share/src/main/java/org/bench4q/share/models/master/plugin/BehaviorInfoModel.java @@ -7,31 +7,10 @@ import javax.xml.bind.annotation.XmlElementWrapper; import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement -public class BehaviorInfoModel { - - private List paramInfoModels; +public class BehaviorInfoModel extends ParamsContainerModel { private String behaviorType; - private String name; - - @XmlElementWrapper - @XmlElement(name = "paramInfoModel", type = ParamInfoModel.class) - public List getParamInfoModels() { - return paramInfoModels; - } - - public void setParamInfoModels(List paramInfoModels) { - this.paramInfoModels = paramInfoModels; - } - - @XmlElement - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } + private List groupModels; @XmlElement public String getBehaviorType() { @@ -42,4 +21,14 @@ public class BehaviorInfoModel { this.behaviorType = behaviorType; } + @XmlElementWrapper(name = "groups") + @XmlElement(name = "group", type = GroupModel.class) + public List getGroupModels() { + return groupModels; + } + + public void setGroupModels(List groupModels) { + this.groupModels = groupModels; + } + } diff --git a/Bench4Q-Share/src/main/java/org/bench4q/share/models/master/plugin/DateModel.java b/Bench4Q-Share/src/main/java/org/bench4q/share/models/master/plugin/DateModel.java new file mode 100644 index 00000000..f5c8ef73 --- /dev/null +++ b/Bench4Q-Share/src/main/java/org/bench4q/share/models/master/plugin/DateModel.java @@ -0,0 +1,22 @@ +package org.bench4q.share.models.master.plugin; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + + +@XmlRootElement +public class DateModel extends ParamTypeModel { + private int size; + @XmlElement + public int getSize() { + return size; + } + + public void setSize(int size) { + this.size = size; + } + + + + +} diff --git a/Bench4Q-Share/src/main/java/org/bench4q/share/models/master/plugin/GroupModel.java b/Bench4Q-Share/src/main/java/org/bench4q/share/models/master/plugin/GroupModel.java new file mode 100644 index 00000000..74603d85 --- /dev/null +++ b/Bench4Q-Share/src/main/java/org/bench4q/share/models/master/plugin/GroupModel.java @@ -0,0 +1,8 @@ +package org.bench4q.share.models.master.plugin; + +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement +public class GroupModel extends ParamsContainerModel { + +} diff --git a/Bench4Q-Share/src/main/java/org/bench4q/share/models/master/plugin/ParamsContainerModel.java b/Bench4Q-Share/src/main/java/org/bench4q/share/models/master/plugin/ParamsContainerModel.java new file mode 100644 index 00000000..d6269fa0 --- /dev/null +++ b/Bench4Q-Share/src/main/java/org/bench4q/share/models/master/plugin/ParamsContainerModel.java @@ -0,0 +1,36 @@ +package org.bench4q.share.models.master.plugin; + +import java.util.List; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElementWrapper; +import javax.xml.bind.annotation.XmlRootElement; + + + +@XmlRootElement +public class ParamsContainerModel { + private String name; + private List paramInfoModels; + + @XmlElement + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @XmlElementWrapper + @XmlElement(name="paramInfoModel",type=ParamInfoModel.class) + public List getParamInfoModels() { + return paramInfoModels; + } + + public void setParamInfoModels( + List paramInfoModels) { + this.paramInfoModels = paramInfoModels; + } + +} diff --git a/Bench4Q-Share/src/main/java/org/bench4q/share/models/master/plugin/PluginInfoModel.java b/Bench4Q-Share/src/main/java/org/bench4q/share/models/master/plugin/PluginInfoModel.java index e8e98cf9..8c940f70 100644 --- a/Bench4Q-Share/src/main/java/org/bench4q/share/models/master/plugin/PluginInfoModel.java +++ b/Bench4Q-Share/src/main/java/org/bench4q/share/models/master/plugin/PluginInfoModel.java @@ -5,31 +5,18 @@ import java.util.List; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElementWrapper; import javax.xml.bind.annotation.XmlRootElement; + @XmlRootElement -public class PluginInfoModel { +public class PluginInfoModel extends ParamsContainerModel { + private List groupModels; - private String name; - private List paramInfoModels; - - @XmlElement - public String getName() { - return name; + @XmlElementWrapper(name = "groups") + @XmlElement(name = "group", type = GroupModel.class) + public List getGroupModels() { + return groupModels; } - public void setName(String name) { - this.name = name; + public void setGroupModels(List groupModels) { + this.groupModels = groupModels; } - - @XmlElementWrapper - @XmlElement(name="paramInfoModel",type=ParamInfoModel.class) - public List getParamInfoModels() { - return paramInfoModels; - } - - public void setParamInfoModels( - List paramInfoModels) { - this.paramInfoModels = paramInfoModels; - } - - } diff --git a/Bench4Q-Share/src/main/java/org/bench4q/share/models/master/plugin/SelectModel.java b/Bench4Q-Share/src/main/java/org/bench4q/share/models/master/plugin/SelectModel.java new file mode 100644 index 00000000..16e05737 --- /dev/null +++ b/Bench4Q-Share/src/main/java/org/bench4q/share/models/master/plugin/SelectModel.java @@ -0,0 +1,32 @@ +package org.bench4q.share.models.master.plugin; + +import java.util.Set; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElementWrapper; +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement +public class SelectModel extends ParamTypeModel { + private Set options; + private int size; + @XmlElementWrapper(name = "options") + @XmlElement(name = "option", type = String.class) + public Set getOptions() { + return options; + } + + public void setOptions(Set options) { + this.options = options; + } + + @XmlElement + public int getSize() { + return size; + } + + public void setSize(int size) { + this.size = size; + } + +} diff --git a/Bench4Q-Web/src/main/webapp/css/script-editor.css b/Bench4Q-Web/src/main/webapp/css/script-editor.css new file mode 100644 index 00000000..10de32eb --- /dev/null +++ b/Bench4Q-Web/src/main/webapp/css/script-editor.css @@ -0,0 +1,261 @@ +label { + display: inline; + margin-right: 30px; +} + +button { + margin-right: 5px; + + width: 70px; +} + +.editor { + background-color: #f5f5f5; + border-top-color: #dcdcdc; + width: 400px; + border: 1px solid #d5d5d5; + margin-left: 10px; + margin-top: 10px; + padding-left: 30px; + padding-right: 30px; + padding-top: 10px; + padding-bottom: 10px; + margin-bottom: 10px; +} + +.editor div { + +} + +table tr td { + text-align: center; + width:10px; +} + +.editor p { + font-weight: bold; + margin-bottom: 10px; + margin-top: 10px; +} + +.editor button { + margin-top: 10px; +} + +.inset { + width: 85%; + height: 80%; + align: center; + margin: 5px; +} + +.scroll { + overflow-x: hidden; + overflow-y: auto; +} + +.button-div { + margin-top: 50px; + padding-left: 20px; +} + +.button-div div { + margin-top: 10px; +} + +.behavior_box { + border: 1px inset; + width: 200px; + height: 300px; + margin-right: 0px; + margin-left: 0px; +} + +.table-margin { + margin-top: 10px; + padding-top: 5px; + padding-left: 20px; + padding-bottom: 10px; +} + +.sample_frame { + padding: 10px; + margin: 5px 5px 5px 5px; + border: #E8F2FE solid thin; +} + +.sample_sub_frame { + border: #F0ECE0 solid thin; + margin-top: 5px; + margin-bottom: 5px; + margin-left: 10px; + margin-right: 10px; +} + +.btn-width { + width: 85px; +} + +.btn-large { + width: 25%; +} + +.listArea { + height: 340px; + margin-bottom: 15px; + outline-style: outset; + outline-color: #A0D0EC; + /* color: black; */ +} + +.behavior-box { + height: 400px; + border: 1px solid #3689BB; + margin-left: 5px; +} + +#myModal_Behavior { + width: 800px; + left: 40%; +} + +.listArea,#insertPluginAreaPlugins,#pluginMethod p,a { + padding-top: 10px; + padding-left: 20px; +} + +#pluginMethod { + padding-top: 10px; + padding-left: 20px; +} + +a { + color: #4E9BCB; + /* border-bottom: 1px solid #F0ECE0; */ +} + +#submitBehaviors p { + margin-top: 10px; + margin-left: 10px; +} + +.visited { + background-color: #E8F2FE; +} + +.tab .nav li a:hover,.nav>li>a:focus { + text-decoration: none; + background-color: #E5E3E9; +} + +.tab .nav-tabs { + border-bottom: 1px solid #F7F5FA; + margin-bottom: 15px; +} + +.tab .nav { + list-style: none; +} + +.tab { + background-color: #F7F5FA; + margin-bottom: 15px; + padding-bottom: 5px; + padding-top: -10px; +} + +.tab ul { + /* zoom: 1; */ + clear: both; +} + +.tab ul:after { + display: block; + height: 0px; + visibility: hidden; + clear: both; + content: ""; +} + +.tab ul li { + margin-bottom: -10px; + text-align: center; + line-height: 100%; + width: 20%; + display: inline; + float: left; + height: 26px; + color: #fff; + text-align: center; +} + +.tab ul li.on { + color: black; +} + +.tabContent .span10 { + margin-left: -25px; +} + +.help_step_box { + background: #f1f7e4; + height: 55px; + overflow: hidden; + border-top: 1px solid #FFF; +} + +.help_step_item { + float: left; + height: 55px; + line-height: 55px; + padding: 0 25px 0 45px; + cursor: pointer; + position: relative; + font-size: 14px; + font-weight: bold; +} + +.help_step_num { + width: 19px; + height: 19px; + line-height: 19px; + position: absolute; + text-align: center; + top: 18px; + left: 20px; + font-size: 16px; + font-weight: bold; + background: url(http://www.codefans.net/jscss/demoimg/201011/num.png); + color: #156600; +} + +.help_step_set { + background: #27a806; + color: #FFF; +} + +.help_step_set .help_step_left { + width: 8px; + height: 55px; + background: url(http://www.codefans.net/jscss/demoimg/201011/bak.jpg) + left top no-repeat; + position: absolute; + left: 0; + top: 0; +} + +.help_step_set .help_step_right { + width: 8px; + height: 55px; + background: url(http://www.codefans.net/jscss/demoimg/201011/bak.jpg) + left bottom no-repeat; + position: absolute; + right: -8px; + top: 0; +} + +.btn-page { + background-color: #50A8DC; + margin-top: 20px; + margin-bottom: 20px; +} \ No newline at end of file diff --git a/Bench4Q-Web/src/main/webapp/script/device/EditorFactory.js b/Bench4Q-Web/src/main/webapp/script/device/EditorFactory.js index d453aa21..f6a0a499 100644 --- a/Bench4Q-Web/src/main/webapp/script/device/EditorFactory.js +++ b/Bench4Q-Web/src/main/webapp/script/device/EditorFactory.js @@ -28,7 +28,7 @@ function createFieldLine(size, name) { $(fieldName).html(name + ":"); var field = document.createElement("input"); $(field).attr("type", "text"); - $(field).attr("size", size); + $(field).attr("width", size); $(fieldDiv).append(fieldName.outerHTML + field.outerHTML); return fieldDiv; } @@ -66,7 +66,7 @@ function createFileEditor(label, name, size, id) { $(fieldName).html(name + ":"); var file = document.createElement("input"); $(file).attr("type", "file"); - $(file).attr("size", size); + $(file).attr("width", size); $(fileEditor).append(fieldName.outerHTML + file.outerHTML); $(div).append(fileEditor); return div; @@ -103,7 +103,7 @@ function createTableEditor(label, name, cols, id) { function getHeaders(col) { var headers = new Array(); - headers.push("name"); + headers.push("name:"); var cols = col.split(";"); for ( var i = 0; i < cols.length; i++) { headers.push(cols[i]); @@ -130,17 +130,17 @@ function createTableEditor(label, name, cols, id) { var tr = document.createElement("tr"); for ( var i = 0; i < headers.length; i++) { var th = document.createElement("th"); - th.appendChild(document.createTextNode(headers[i])); - tr.appendChild(th); + $(th).append(document.createTextNode(headers[i])); + $(tr).append(th); } return tr; } function createTr(headers, name) { var tr = document.createElement("tr"); var td = document.createElement("td"); - $(td).html(name); + $(td).html(name+":"); $(tr).append(td); - for ( var i = 0; i < headers.length; i++) { + for ( var i = 1; i < headers.length; i++) { var input = document.createElement("input"); $(input).attr("type", "text"); var td = document.createElement("td"); @@ -153,15 +153,14 @@ function createTableEditor(label, name, cols, id) { } - function createContainer(id, name) { var div = document.createElement("div"); - + $(div).attr("id", id); $(div).append(createMultiField("test", "name", 10, "test")); $(div).append(createFileEditor("file", "file name", 10, "file")); $(div).append(createField("field", "field name", 10, "field")); - $(div).append(createTableEditor("table","input","td1;td1;td3","id")); + $(div).append(createTableEditor("table", "input", "td1;td1;td3", "id")); return div; } diff --git a/Bench4Q-Web/src/main/webapp/test/testAddField.html b/Bench4Q-Web/src/main/webapp/test/testAddField.html index cc1b5b2b..31dac468 100644 --- a/Bench4Q-Web/src/main/webapp/test/testAddField.html +++ b/Bench4Q-Web/src/main/webapp/test/testAddField.html @@ -12,14 +12,12 @@ - + -
- - + \ No newline at end of file