From 443bd9aad83017df36859b656aed26106fa0757c Mon Sep 17 00:00:00 2001 From: Heiko Braun Date: Thu, 2 Aug 2012 12:09:40 +0200 Subject: [PATCH] distinguish runtime attributes --- .../console/client/tools/DescriptionView.java | 18 ++++++++++++------ .../jboss/as/console/client/tools/FXForm.java | 2 +- .../as/console/client/tools/FormProxy.java | 2 +- .../as/console/client/tools/FormView.java | 2 +- .../tools/mapping/DescriptionMapper.java | 16 ++++++++++++++-- .../java/org/jboss/as/console/public/lab.css | 6 +++++- 6 files changed, 34 insertions(+), 12 deletions(-) diff --git a/gui/src/main/java/org/jboss/as/console/client/tools/DescriptionView.java b/gui/src/main/java/org/jboss/as/console/client/tools/DescriptionView.java index 3096a36a01..616e09e496 100644 --- a/gui/src/main/java/org/jboss/as/console/client/tools/DescriptionView.java +++ b/gui/src/main/java/org/jboss/as/console/client/tools/DescriptionView.java @@ -66,8 +66,9 @@ Widget asWidget() { SafeHtmlBuilder helpText = new SafeHtmlBuilder(); helpText.appendHtmlConstant(""); StaticHelpPanel help = new StaticHelpPanel(helpText.toSafeHtml()); inner.add(help.asWidget()); @@ -113,23 +114,28 @@ public void updateDescription(ModelNode address, ModelNode description) SafeHtmlBuilder childrenBuilder = new SafeHtmlBuilder(); @Override - public void onAttribute(String name, String description, String type, boolean required, boolean expressions) { + public void onAttribute(String name, String description, String type, boolean required, boolean expressions, boolean runtime) { attributeBuilder.appendHtmlConstant(""); attributeBuilder.appendHtmlConstant(""); attributeBuilder.appendEscaped(name); attributeBuilder.appendHtmlConstant(""); + attributeBuilder.appendHtmlConstant(""); attributeBuilder.appendEscaped(type); String requiredSuffix = required ? " (*)" : ""; attributeBuilder.appendEscaped(requiredSuffix); - String expressionSuffix = expressions? " ($)" : ""; - attributeBuilder.appendEscaped(expressionSuffix); attributeBuilder.appendHtmlConstant(""); attributeBuilder.appendHtmlConstant(""); attributeBuilder.appendHtmlConstant(""); - attributeBuilder.appendHtmlConstant("").appendEscaped(description).appendHtmlConstant(""); + attributeBuilder.appendHtmlConstant("").appendEscaped(description).appendHtmlConstant(""); + attributeBuilder.appendHtmlConstant(""); + String expressionSuffix = expressions? " +expression" : ""; + attributeBuilder.appendEscaped(expressionSuffix); + String runtimeSuffix = runtime? " runtime" : ""; + attributeBuilder.appendEscaped(runtimeSuffix); + attributeBuilder.appendHtmlConstant(""); attributeBuilder.appendHtmlConstant(""); } diff --git a/gui/src/main/java/org/jboss/as/console/client/tools/FXForm.java b/gui/src/main/java/org/jboss/as/console/client/tools/FXForm.java index 760d01647b..02a7e6ac6a 100644 --- a/gui/src/main/java/org/jboss/as/console/client/tools/FXForm.java +++ b/gui/src/main/java/org/jboss/as/console/client/tools/FXForm.java @@ -130,7 +130,7 @@ private void buildFromDescription() mapper.map(new DescriptionMapper.Mapping() { @Override - public void onAttribute(String name, String description, String type, boolean required, boolean expressions) { + public void onAttribute(String name, String description, String type, boolean required, boolean expressions, boolean runtime) { if("STRING".equals(type)) { diff --git a/gui/src/main/java/org/jboss/as/console/client/tools/FormProxy.java b/gui/src/main/java/org/jboss/as/console/client/tools/FormProxy.java index 713fcd1eee..0d694061b6 100644 --- a/gui/src/main/java/org/jboss/as/console/client/tools/FormProxy.java +++ b/gui/src/main/java/org/jboss/as/console/client/tools/FormProxy.java @@ -46,7 +46,7 @@ private void createForm(ModelNode description) { List items = new LinkedList(); @Override - public void onAttribute(String name, String description, String type, boolean required, boolean expressions) { + public void onAttribute(String name, String description, String type, boolean required, boolean expressions, boolean runtime) { // whitelist if(model.getFieldNames().size()>0 diff --git a/gui/src/main/java/org/jboss/as/console/client/tools/FormView.java b/gui/src/main/java/org/jboss/as/console/client/tools/FormView.java index a4b41d3c39..0a311d1ff0 100644 --- a/gui/src/main/java/org/jboss/as/console/client/tools/FormView.java +++ b/gui/src/main/java/org/jboss/as/console/client/tools/FormView.java @@ -57,7 +57,7 @@ public void updateDescription(ModelNode address, ModelNode description) mapper.map(new DescriptionMapper.Mapping() { @Override - public void onAttribute(String name, String description, String type, boolean required, boolean expressions) { + public void onAttribute(String name, String description, String type, boolean required, boolean expressions, boolean runtime) { if("STRING".equals(type)) { diff --git a/gui/src/main/java/org/jboss/as/console/client/tools/mapping/DescriptionMapper.java b/gui/src/main/java/org/jboss/as/console/client/tools/mapping/DescriptionMapper.java index 5e9eaf20ed..e7a6a8a1a8 100644 --- a/gui/src/main/java/org/jboss/as/console/client/tools/mapping/DescriptionMapper.java +++ b/gui/src/main/java/org/jboss/as/console/client/tools/mapping/DescriptionMapper.java @@ -3,6 +3,8 @@ import org.jboss.dmr.client.ModelNode; import org.jboss.dmr.client.Property; +import java.util.Collections; +import java.util.Comparator; import java.util.LinkedList; import java.util.List; @@ -21,7 +23,7 @@ public DescriptionMapper(ModelNode address, ModelNode description) { } public interface Mapping { - void onAttribute(String name, String description, String type, boolean required, boolean expressions); + void onAttribute(String name, String description, String type, boolean required, boolean expressions, boolean runtime); void onOperation(String name, String description, List parameter, ResponseParameter response); void onChild(String name, String description); @@ -38,6 +40,13 @@ public void map(Mapping mapping) { final List properties = description.get("attributes").asPropertyList(); + Collections.sort(properties, new Comparator() { + @Override + public int compare(Property property, Property property1) { + return property.getName().compareTo(property1.getName()); + } + }); + if(!properties.isEmpty()) { @@ -57,7 +66,10 @@ public void map(Mapping mapping) { final boolean expressions = att.getValue().hasDefined("expressions-allowed") ? att.getValue().get("expressions-allowed").asBoolean() : false; - mapping.onAttribute(name, description, type, (!nillable||required), expressions); + final boolean runtime = att.getValue().hasDefined("storage") ? + att.getValue().get("storage").asString().equals("runtime"): false; + + mapping.onAttribute(name, description, type, (!nillable||required), expressions,runtime); } } diff --git a/gui/src/main/java/org/jboss/as/console/public/lab.css b/gui/src/main/java/org/jboss/as/console/public/lab.css index af6c0984be..35e38ae842 100644 --- a/gui/src/main/java/org/jboss/as/console/public/lab.css +++ b/gui/src/main/java/org/jboss/as/console/public/lab.css @@ -134,6 +134,10 @@ a:hover, a:active { outline: none; } margin-right:5px; } +.doc-table tr:hover { + background-color: #e5e5e5; +} + .doc-attribute { font-weight: BOLD; color: #3B4D64; @@ -189,7 +193,7 @@ input[type="checkbox"] { margin-left:5px; margin-right:5px; padding:10px; - line-height: 1.4; + line-height: 1.4!important; } .browser-dump-line:hover {