1 package org.apache.turbine.modules.layouts; 2 3 18 19 import org.apache.ecs.ConcreteElement; 20 import org.apache.ecs.HtmlColor; 21 22 import org.apache.ecs.html.Font; 23 import org.apache.ecs.html.P; 24 25 import org.apache.turbine.modules.Layout; 26 import org.apache.turbine.modules.NavigationLoader; 27 import org.apache.turbine.modules.ScreenLoader; 28 29 import org.apache.turbine.util.RunData; 30 31 39 public class DefaultLayout extends Layout 40 { 41 50 public void doBuild(RunData data) throws Exception 51 { 52 ConcreteElement topNav = NavigationLoader.getInstance() 54 .eval(data, "DefaultTopNavigation"); 55 56 if (topNav != null) 57 { 58 data.getPage().getBody().addElement(topNav); 59 } 60 61 if (data.getMessage() != null) 63 { 64 data.getPage().getBody().addElement(new P()) 65 .addElement(new Font().setColor(HtmlColor.red) 66 .addElement(data.getMessageAsHTML())); 67 } 68 69 ConcreteElement screen = ScreenLoader.getInstance() 71 .eval(data, data.getScreen()); 72 73 if (screen != null) 74 { 75 data.getPage().getBody().addElement(screen); 76 } 77 78 data.getPage().getTitle().addElement(data.getTitle()); 81 82 data.getPage().getBody().setBgColor(HtmlColor.white); 85 86 ConcreteElement bottomNav = NavigationLoader.getInstance().eval(data, 88 "DefaultBottomNavigation"); 89 90 if (bottomNav != null) 91 { 92 data.getPage().getBody().addElement(bottomNav); 93 } 94 } 95 } 96 | Popular Tags |