diff options
| author | Benjamin Culkin <scorpress@gmail.com> | 2024-05-20 17:58:16 -0400 |
|---|---|---|
| committer | Benjamin Culkin <scorpress@gmail.com> | 2024-05-20 17:58:16 -0400 |
| commit | 40a9d99496e098562f090fb7ffce9e749011b131 (patch) | |
| tree | 437df24d65470582e943e494a52db8ed65a881ae /projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOFrame.java | |
| parent | ff072dfe782f6f22123cd4ba050828d35c0d0fbd (diff) | |
Formatting pass
Diffstat (limited to 'projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOFrame.java')
| -rw-r--r-- | projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOFrame.java | 99 |
1 files changed, 49 insertions, 50 deletions
diff --git a/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOFrame.java b/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOFrame.java index 30dd4bc..06f4b7f 100644 --- a/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOFrame.java +++ b/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOFrame.java @@ -6,55 +6,54 @@ import net.wotonomy.foundation.NSDictionary; public class WOFrame extends WODynamicElement { - public WOFrame() { - super(); - } - - public WOFrame(String aName, NSDictionary assocs, WOElement template) { - super(aName, assocs, template); - } - - public String frameName(WOContext c) { - String x = (String)valueForProperty("name", c.component()); - if (x != null) - return x; - return c.elementID(); - } - - public String url(WOContext c) { - //Check if the href property is set - String href = stringForProperty("href", c.component()); - if (href != null) - return href; - href = stringForProperty("pageName", c.component()); - if (href != null || associations.objectForKey("action") != null) { //write this component's URL - return c.componentActionURL(); - } - href = stringForProperty("directActionName", c.component()); - if (href != null) { //compose the direct action URL - String fullActionName = stringForProperty("actionClass", c.component()); - if (fullActionName != null) - fullActionName = fullActionName + "/" + href; - else - fullActionName = href; - return c.directActionURLForActionNamed(fullActionName, - urlFields(c.component())); - } - //Coded needed here to support filename/framework and data/mimeType. - return null; - } - - public void appendToResponse(WOResponse r, WOContext c) { - r.appendContentString("<FRAME NAME=\""); - r.appendContentString(frameName(c)); - r.appendContentString("\" SRC=\""); - r.appendContentString(url(c)); - r.appendContentString("\""); - String moreFields = additionalHTMLProperties(c.component(), new NSArray(new Object[]{ - "name", "href", "pageName", "directActionName", "actionClass" })); - if (moreFields != null && moreFields.length() > 0) - r.appendContentString(moreFields); - r.appendContentString(">"); - } + public WOFrame() { + super(); + } + + public WOFrame(String aName, NSDictionary assocs, WOElement template) { + super(aName, assocs, template); + } + + public String frameName(WOContext c) { + String x = (String) valueForProperty("name", c.component()); + if (x != null) + return x; + return c.elementID(); + } + + public String url(WOContext c) { + // Check if the href property is set + String href = stringForProperty("href", c.component()); + if (href != null) + return href; + href = stringForProperty("pageName", c.component()); + if (href != null || associations.objectForKey("action") != null) { // write this component's URL + return c.componentActionURL(); + } + href = stringForProperty("directActionName", c.component()); + if (href != null) { // compose the direct action URL + String fullActionName = stringForProperty("actionClass", c.component()); + if (fullActionName != null) + fullActionName = fullActionName + "/" + href; + else + fullActionName = href; + return c.directActionURLForActionNamed(fullActionName, urlFields(c.component())); + } + // Coded needed here to support filename/framework and data/mimeType. + return null; + } + + public void appendToResponse(WOResponse r, WOContext c) { + r.appendContentString("<FRAME NAME=\""); + r.appendContentString(frameName(c)); + r.appendContentString("\" SRC=\""); + r.appendContentString(url(c)); + r.appendContentString("\""); + String moreFields = additionalHTMLProperties(c.component(), + new NSArray(new Object[] { "name", "href", "pageName", "directActionName", "actionClass" })); + if (moreFields != null && moreFields.length() > 0) + r.appendContentString(moreFields); + r.appendContentString(">"); + } }
\ No newline at end of file |
