Re: svn commit: r608445 - in /ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget: html/HtmlMenuRenderer.java menu/ModelMenu.java menu/ModelMenuItem.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r608445 - in /ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget: html/HtmlMenuRenderer.java menu/ModelMenu.java menu/ModelMenuItem.java

Scott Gray
Hello again Jacques :-)

I would leave the changes to ModelMenu.java but revert the other two, they
weren't bug fixes but small improvements that included deprecating a method
which I don't think we want to do in 4.0

Regards
Scott

On 03/01/2008, [hidden email] <[hidden email]> wrote:

>
> Author: jleroux
> Date: Thu Jan  3 02:55:51 2008
> New Revision: 608445
>
> URL: http://svn.apache.org/viewvc?rev=608445&view=rev
> Log:
> Merged by hand from 607999
>
> Modified:
>
>     ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget/html/HtmlMenuRenderer.java
>
>     ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget/menu/ModelMenu.java
>
>     ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget/menu/ModelMenuItem.java
>
> Modified:
> ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget/html/HtmlMenuRenderer.java
> URL:
> http://svn.apache.org/viewvc/ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget/html/HtmlMenuRenderer.java?rev=608445&r1=608444&r2=608445&view=diff
>
> ==============================================================================
> ---
> ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget/html/HtmlMenuRenderer.java
> (original)
> +++
> ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget/html/HtmlMenuRenderer.java
> Thu Jan  3 02:55:51 2008
> @@ -156,7 +156,7 @@
>
>          String style = null;
>
> -        if (menuItem.isSelected(context)) {
> +        if (menuItem.isSelected()) {
>              style = menuItem.getSelectedStyle();
>              if (UtilValidate.isEmpty(style)) {
>                  style = "selected";
>
> Modified:
> ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget/menu/ModelMenu.java
> URL:
> http://svn.apache.org/viewvc/ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget/menu/ModelMenu.java?rev=608445&r1=608444&r2=608445&view=diff
>
> ==============================================================================
> ---
> ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget/menu/ModelMenu.java
> (original)
> +++
> ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget/menu/ModelMenu.java
> Thu Jan  3 02:55:51 2008
> @@ -326,6 +326,9 @@
>          // render formatting wrapper open
>          menuStringRenderer.renderFormatSimpleWrapperOpen(buffer, context,
> this);
>
> +        // Set the selected menu item from the context
> +        this.setCurrentMenuItemName(context);
> +
>              //Debug.logInfo("in ModelMenu, menuItemList:" + menuItemList,
> module);
>          // render each menuItem row, except hidden & ignored rows
>          //menuStringRenderer.renderFormatSimpleWrapperRows(buffer,
> context, this);
> @@ -538,6 +541,12 @@
>          this.currentMenuItemName = string;
>      }
>
> +    /**
> +     * @param context Map containing the menu context
> +     */
> +    public void setCurrentMenuItemName(Map context) {
> +        this.currentMenuItemName =
> this.getSelectedMenuItemContextFieldName(context);
> +    }
>
>      /**
>       * @param string
>
> Modified:
> ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget/menu/ModelMenuItem.java
> URL:
> http://svn.apache.org/viewvc/ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget/menu/ModelMenuItem.java?rev=608445&r1=608444&r2=608445&view=diff
>
> ==============================================================================
> ---
> ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget/menu/ModelMenuItem.java
> (original)
> +++
> ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget/menu/ModelMenuItem.java
> Thu Jan  3 02:55:51 2008
> @@ -569,9 +569,14 @@
>         return this.link;
>      }
>
> +    /** @deprecated use isSelected() */
>      public boolean isSelected(Map context) {
>          String currentMenuItemName =
> modelMenu.getSelectedMenuItemContextFieldName(context);
>          return currentMenuItemName != null && currentMenuItemName.equals(
> this.name);
> +    }
> +
> +    public boolean isSelected() {
> +        return modelMenu.getCurrentMenuItemName() != null &&
> modelMenu.getCurrentMenuItemName().equals(this.name);
>      }
>
>      public static class Link {
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r608445 - in /ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget: html/HtmlMenuRenderer.java menu/ModelMenu.java menu/ModelMenuItem.java

Jacques Le Roux
Administrator
> Hello again Jacques :-)
>
> I would leave the changes to ModelMenu.java but revert the other two, they
> weren't bug fixes but small improvements that included deprecating a method
> which I don't think we want to do in 4.0

OK Scott, done in rev. 608461

Thanks for the pointer.

Jacques

> Regards
> Scott
>
> On 03/01/2008, [hidden email] <[hidden email]> wrote:
>>
>> Author: jleroux
>> Date: Thu Jan  3 02:55:51 2008
>> New Revision: 608445
>>
>> URL: http://svn.apache.org/viewvc?rev=608445&view=rev
>> Log:
>> Merged by hand from 607999
>>
>> Modified:
>>
>>     ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget/html/HtmlMenuRenderer.java
>>
>>     ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget/menu/ModelMenu.java
>>
>>     ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget/menu/ModelMenuItem.java
>>
>> Modified:
>> ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget/html/HtmlMenuRenderer.java
>> URL:
>> http://svn.apache.org/viewvc/ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget/html/HtmlMenuRenderer.java?rev=608445&r1=608444&r2=608445&view=diff
>>
>> ==============================================================================
>> ---
>> ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget/html/HtmlMenuRenderer.java
>> (original)
>> +++
>> ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget/html/HtmlMenuRenderer.java
>> Thu Jan  3 02:55:51 2008
>> @@ -156,7 +156,7 @@
>>
>>          String style = null;
>>
>> -        if (menuItem.isSelected(context)) {
>> +        if (menuItem.isSelected()) {
>>              style = menuItem.getSelectedStyle();
>>              if (UtilValidate.isEmpty(style)) {
>>                  style = "selected";
>>
>> Modified:
>> ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget/menu/ModelMenu.java
>> URL:
>> http://svn.apache.org/viewvc/ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget/menu/ModelMenu.java?rev=608445&r1=608444&r2=608445&view=diff
>>
>> ==============================================================================
>> ---
>> ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget/menu/ModelMenu.java
>> (original)
>> +++
>> ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget/menu/ModelMenu.java
>> Thu Jan  3 02:55:51 2008
>> @@ -326,6 +326,9 @@
>>          // render formatting wrapper open
>>          menuStringRenderer.renderFormatSimpleWrapperOpen(buffer, context,
>> this);
>>
>> +        // Set the selected menu item from the context
>> +        this.setCurrentMenuItemName(context);
>> +
>>              //Debug.logInfo("in ModelMenu, menuItemList:" + menuItemList,
>> module);
>>          // render each menuItem row, except hidden & ignored rows
>>          //menuStringRenderer.renderFormatSimpleWrapperRows(buffer,
>> context, this);
>> @@ -538,6 +541,12 @@
>>          this.currentMenuItemName = string;
>>      }
>>
>> +    /**
>> +     * @param context Map containing the menu context
>> +     */
>> +    public void setCurrentMenuItemName(Map context) {
>> +        this.currentMenuItemName =
>> this.getSelectedMenuItemContextFieldName(context);
>> +    }
>>
>>      /**
>>       * @param string
>>
>> Modified:
>> ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget/menu/ModelMenuItem.java
>> URL:
>> http://svn.apache.org/viewvc/ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget/menu/ModelMenuItem.java?rev=608445&r1=608444&r2=608445&view=diff
>>
>> ==============================================================================
>> ---
>> ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget/menu/ModelMenuItem.java
>> (original)
>> +++
>> ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget/menu/ModelMenuItem.java
>> Thu Jan  3 02:55:51 2008
>> @@ -569,9 +569,14 @@
>>         return this.link;
>>      }
>>
>> +    /** @deprecated use isSelected() */
>>      public boolean isSelected(Map context) {
>>          String currentMenuItemName =
>> modelMenu.getSelectedMenuItemContextFieldName(context);
>>          return currentMenuItemName != null && currentMenuItemName.equals(
>> this.name);
>> +    }
>> +
>> +    public boolean isSelected() {
>> +        return modelMenu.getCurrentMenuItemName() != null &&
>> modelMenu.getCurrentMenuItemName().equals(this.name);
>>      }
>>
>>      public static class Link {
>>
>>
>>
>