Skip to content

Commit

Permalink
exclude FX forms from this release
Browse files Browse the repository at this point in the history
  • Loading branch information
heiko-braun committed Aug 7, 2012
1 parent 3f690d8 commit 05f7f0d
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public BrowserView(EventBus eventBus) {
@Override
public void setPresenter(BrowserPresenter presenter) {
this.presenter = presenter;
storageView.setPresenter(presenter);
//TODO storageView.setPresenter(presenter);
}

@Override
Expand Down Expand Up @@ -108,7 +108,7 @@ public void onClick(ClickEvent clickEvent) {

tabLayoutPanel.add(descView.asWidget(), "Description");
tabLayoutPanel.add(rawView.asWidget(), "Model");
tabLayoutPanel.add(storageView.asWidget(), "Templates");
//TODO tabLayoutPanel.add(storageView.asWidget(), "Templates");
tabLayoutPanel.selectTab(0);

tree.addOpenHandler(new OpenHandler<TreeItem>() {
Expand Down Expand Up @@ -318,6 +318,6 @@ class PlaceholderItem extends TreeItem {

@Override
public void setTemplates(Set<FXTemplate> fxTemplates) {
storageView.setTemplates(fxTemplates);
//TODO storageView.setTemplates(fxTemplates);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public void updateDescription(ModelNode address, ModelNode description)
SafeHtmlBuilder childrenBuilder = new SafeHtmlBuilder();

@Override
public void onAttribute(String name, String description, String type, boolean required) {
public void onAttribute(String name, String description, String type, boolean required, boolean expressions) {

attributeBuilder.appendHtmlConstant("<tr valign=top>");
attributeBuilder.appendHtmlConstant("<td class='doc-attribute'>");
Expand All @@ -119,6 +119,8 @@ public void onAttribute(String name, String description, String type, boolean re
attributeBuilder.appendEscaped(type);
String requiredSuffix = required ? " (*)" : "";
attributeBuilder.appendEscaped(requiredSuffix);
String expressionSuffix = expressions? " ($)" : "";
attributeBuilder.appendEscaped(expressionSuffix);
attributeBuilder.appendHtmlConstant("</td>");
attributeBuilder.appendHtmlConstant("</tr>");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ private void buildFromDescription()
mapper.map(new DescriptionMapper.Mapping() {

@Override
public void onAttribute(String name, String description, String type, boolean required) {
public void onAttribute(String name, String description, String type, boolean required, boolean expressions) {

if("STRING".equals(type))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ private void createForm(ModelNode description) {
List<FormItem> items = new LinkedList<FormItem>();

@Override
public void onAttribute(String name, String description, String type, boolean required) {
public void onAttribute(String name, String description, String type, boolean required, boolean expressions) {

// whitelist
if(model.getFieldNames().size()>0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
public void onAttribute(String name, String description, String type, boolean required, boolean expressions) {

if("STRING".equals(type))
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
package org.jboss.as.console.client.tools;

import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.storage.client.Storage;
import com.google.gwt.storage.client.StorageMap;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

/**
Expand All @@ -12,15 +15,21 @@
*/
public class LocalFXStorage implements FXStorage {

private StorageMap delegate;
private Map<String,String> delegate;

public LocalFXStorage() {
Storage storage = Storage.getLocalStorageIfSupported();

if(null==storage)
throw new RuntimeException("Local storage not supported");
{
Log.warn("Local storage not supported");
this.delegate = new HashMap<String,String>();
}
else
{
this.delegate = new StorageMap(storage);
}

this.delegate = new StorageMap(storage);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public DescriptionMapper(ModelNode address, ModelNode description) {
}

public interface Mapping {
void onAttribute(String name, String description, String type, boolean required);
void onAttribute(String name, String description, String type, boolean required, boolean expressions);
void onOperation(String name, String description, List<RequestParameter> parameter, ResponseParameter response);
void onChild(String name, String description);

Expand Down Expand Up @@ -53,7 +53,11 @@ public void map(Mapping mapping) {
final boolean nillable = att.getValue().hasDefined("nillable") ?
att.getValue().get("nillable").asBoolean() : true;

mapping.onAttribute(name, description, type, !nillable||required);

final boolean expressions = att.getValue().hasDefined("expressions-allowed") ?
att.getValue().get("expressions-allowed").asBoolean() : false;

mapping.onAttribute(name, description, type, (!nillable||required), expressions);
}

}
Expand Down

0 comments on commit 05f7f0d

Please sign in to comment.