myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bom...@apache.org
Subject svn commit: r697182 - in /myfaces/tobago/branches/tobago-1.0.x/theme: scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/stand...
Date Fri, 19 Sep 2008 18:51:08 GMT
Author: bommel
Date: Fri Sep 19 11:51:08 2008
New Revision: 697182

URL: http://svn.apache.org/viewvc?rev=697182&view=rev
Log:
(TOBAGO-176) Starting with a tabNavigationBar

Modified:
    myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabGroupRenderer.java
    myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago-theme-config.properties
    myfaces/tobago/branches/tobago-1.0.x/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/property/tobago-theme-config.properties

Modified: myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabGroupRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabGroupRenderer.java?rev=697182&r1=697181&r2=697182&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabGroupRenderer.java
(original)
+++ myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabGroupRenderer.java
Fri Sep 19 11:51:08 2008
@@ -78,7 +78,6 @@
   private static final Log LOG = LogFactory.getLog(TabGroupRenderer.class);
 
   public static final String ACTIVE_INDEX_POSTFIX = "__activeIndex";
-  private static final int TOOLBAR_WIDTH = 60;
 
   public void decode(FacesContext facesContext, UIComponent component) {
     if (ComponentUtil.isOutputOnly(component)) {
@@ -142,6 +141,7 @@
     // selected with stylesheet.
     int virtualTab = 0;
     int currentWidth = 0;
+    int navigationBarWidth = getConfiguredValue(facesContext, component, "navigationBarWidth");
     for (UIComponent tab : (List<UIComponent>) component.getChildren()) {
       if (tab instanceof UIPanelBase) {
         if (tab.isRendered()) {
@@ -164,7 +164,7 @@
             writer.writeClassAttribute(classes);
             renderTabGroupView(facesContext, writer, component, virtualTab,
                 (HtmlStyleMap) component.getAttributes().get(ATTR_STYLE),
-                switchType, image1x1, TOOLBAR_WIDTH, currentWidth, tabList);
+                switchType, image1x1, navigationBarWidth, currentWidth, tabList);
             writer.endElement(HtmlConstants.DIV);
 
             if (TobagoConfig.getInstance(facesContext).isAjaxEnabled()
@@ -196,7 +196,8 @@
   private TabList getTabList(FacesContext facesContext, UITabGroup component) {
     TabList tabs = new TabList();
     int index = 0;
-    int tabLabelExtraWidth = 15;
+    int tabLabelExtraWidth = getConfiguredValue(facesContext, component, "tabLabelExtraWidth");
+
     boolean first = true;
     for (UIComponent child : (List<UIComponent>) component.getChildren()) {
       if (child instanceof UITab) {
@@ -488,7 +489,7 @@
     writer.endElement(HtmlConstants.TABLE);
     writer.endElement(HtmlConstants.DIV);
     if (toolBar != null) { // todo: configurable later
-      renderToolbar(facesContext, writer, toolBar, width - toolbarWidth);
+      renderToolbar(facesContext, writer, toolBar, width - toolbarWidth, toolbarWidth);
     }
     writer.endElement(HtmlConstants.DIV);
     writer.endElement(HtmlConstants.TD);
@@ -499,11 +500,11 @@
     writer.endElement(HtmlConstants.TABLE);
   }
 
-  private void renderToolbar(FacesContext facesContext, TobagoResponseWriter writer, UIPanel
toolbar, int width)
-      throws IOException {
+  private void renderToolbar(FacesContext facesContext, TobagoResponseWriter writer, UIPanel
toolbar, int width,
+      int navigationBarWidth) throws IOException {
     writer.startElement(HtmlConstants.DIV, null);
     HtmlStyleMap map = new HtmlStyleMap();
-    map.put("width", TOOLBAR_WIDTH);
+    map.put("width", navigationBarWidth);
     map.put("left", width);
     writer.writeStyleAttribute(map);
     writer.writeClassAttribute("tobago-tabnavigationbar");
@@ -540,7 +541,8 @@
     renderTabGroupView(context, HtmlRendererUtil.getTobagoResponseWriter(context),
         (UITabGroup) component, index,
         (HtmlStyleMap) component.getAttributes().get(ATTR_STYLE), SWITCH_TYPE_RELOAD_TAB,
-        ResourceManagerUtil.getImageWithPath(context, "image/1x1.gif"), TOOLBAR_WIDTH, currentWidth,
tabList);
+        ResourceManagerUtil.getImageWithPath(context, "image/1x1.gif"),
+        getConfiguredValue(context, component, "navigationBarWidth"), currentWidth, tabList);
   }
 
 

Modified: myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago-theme-config.properties
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago-theme-config.properties?rev=697182&r1=697181&r2=697182&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago-theme-config.properties
(original)
+++ myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago-theme-config.properties
Fri Sep 19 11:51:08 2008
@@ -91,6 +91,8 @@
 TabGroup.paddingWidth=24
 TabGroup.paddingHeight=25
 TabGroup.headerHeight=24
+TabGroup.tabLabelExtraWidth=30
+TabGroup.navigationBarWidth=60
 
 Tab.paddingWidth=0
 Tab.paddingHeight=0

Modified: myfaces/tobago/branches/tobago-1.0.x/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/property/tobago-theme-config.properties
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/property/tobago-theme-config.properties?rev=697182&r1=697181&r2=697182&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/property/tobago-theme-config.properties
(original)
+++ myfaces/tobago/branches/tobago-1.0.x/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/property/tobago-theme-config.properties
Fri Sep 19 11:51:08 2008
@@ -39,6 +39,8 @@
 TabGroup.paddingHeight=22
 TabGroup.paddingWidth=23
 TabGroup.headerHeight=19
+TabGroup.tabLabelExtraWidth=20
+TabGroup.navigationBarWidth=60
 
 Tab.paddingWidth=0
 Tab.paddingHeight=0



Mime
View raw message