You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by dg...@apache.org on 2003/07/12 02:15:02 UTC

cvs commit: jakarta-struts/src/share/org/apache/struts/tiles/beans SimpleMenuItem.java MenuItem.java

dgraham     2003/07/11 17:15:01

  Modified:    src/share/org/apache/struts/tiles/beans SimpleMenuItem.java
                        MenuItem.java
  Log:
  Formatted code.
  
  Revision  Changes    Path
  1.3       +67 -67    jakarta-struts/src/share/org/apache/struts/tiles/beans/SimpleMenuItem.java
  
  Index: SimpleMenuItem.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/tiles/beans/SimpleMenuItem.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SimpleMenuItem.java	27 Feb 2003 19:20:25 -0000	1.2
  +++ SimpleMenuItem.java	12 Jul 2003 00:15:01 -0000	1.3
  @@ -7,7 +7,7 @@
    *
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 1999-2002 The Apache Software Foundation.  All rights
  + * Copyright (c) 1999-2003 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -59,111 +59,111 @@
    *
    */
   
  -
   package org.apache.struts.tiles.beans;
   
   import java.io.Serializable;
   
  +/**
  + * A MenuItem implementation.
  + * Used to read menu items in definitions.
  + */
  +public class SimpleMenuItem implements MenuItem, Serializable {
  +
  +    private String value = null;
  +
  +    private String link = null;
   
  -  /**
  -   * A MenuItem implementation.
  -   * Used to read menu items in definitions.
  -   */
  -public class SimpleMenuItem implements MenuItem, Serializable
  -{
  -
  -  private String value;
  -  private String link;
  -  private String icon;
  -  private String tooltip;
  +    private String icon = null;
  +
  +    private String tooltip = null;
   
       /**
        * Constructor.
        */
  -  public SimpleMenuItem()
  -  {
  -  }
  +    public SimpleMenuItem() {
  +        super();
  +    }
  +
       /**
        * Set value property.
        */
  -  public void setValue(String value)
  -  {
  -    this.value = value;
  -  }
  +    public void setValue(String value) {
  +        this.value = value;
  +    }
   
       /**
        * Get value property.
        */
  -  public String getValue()
  -  {
  -    return value;
  -  }
  +    public String getValue() {
  +        return value;
  +    }
   
       /**
        * Set link property.
        */
  -  public void setLink(String link)
  -  {
  -    this.link = link;
  -  }
  +    public void setLink(String link) {
  +        this.link = link;
  +    }
   
       /**
        * Get link property.
        */
  -  public String getLink()
  -  {
  -    return link;
  -  }
  +    public String getLink() {
  +        return link;
  +    }
   
       /**
        * Set icon property.
        */
  -  public void setIcon(String icon)
  -  {
  -    this.icon = icon;
  -  }
  +    public void setIcon(String icon) {
  +        this.icon = icon;
  +    }
   
       /**
        * Get icon property.
        */
  -  public String getIcon()
  -  {
  -    return icon;
  -  }
  +    public String getIcon() {
  +        return icon;
  +    }
   
       /**
        * Set tooltip property.
        */
  -  public void setTooltip(String tooltip)
  -  {
  -    this.tooltip = tooltip;
  -  }
  +    public void setTooltip(String tooltip) {
  +        this.tooltip = tooltip;
  +    }
   
       /**
        * Get tooltip property.
        */
  -  public String getTooltip()
  -  {
  -    return tooltip;
  -  }
  +    public String getTooltip() {
  +        return tooltip;
  +    }
   
       /**
        * Return String representation.
        */
  -  public String toString()
  -  {
  -  StringBuffer buff = new StringBuffer();
  -
  -  buff.append( "SimpleMenuItem[");
  -  if( getValue() != null )
  -    buff.append( "value=" ).append(getValue()).append( ", " );
  -  if( getLink() != null )
  -    buff.append( "link=" ).append(getLink()).append( ", " );
  -  if( getTooltip() != null )
  -    buff.append( "tooltip=" ).append(getTooltip()).append( ", " );
  -  if( getIcon() != null )
  -    buff.append( "icon=" ).append(getIcon()).append( ", " );
  -  buff.append( "]");
  -  return buff.toString();
  -  }
  +    public String toString() {
  +        StringBuffer buff = new StringBuffer("SimpleMenuItem[");
  +
  +        if (getValue() != null) {
  +            buff.append("value=").append(getValue()).append(", ");
  +        }
  +
  +        if (getLink() != null) {
  +            buff.append("link=").append(getLink()).append(", ");
  +        }
  +
  +        if (getTooltip() != null) {
  +            buff.append("tooltip=").append(getTooltip()).append(", ");
  +        }
  +
  +        if (getIcon() != null) {
  +            buff.append("icon=").append(getIcon()).append(", ");
  +        }
  +
  +        buff.append("]");
  +        return buff.toString();
  +    }
  +
   }
  
  
  
  1.3       +18 -20    jakarta-struts/src/share/org/apache/struts/tiles/beans/MenuItem.java
  
  Index: MenuItem.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/tiles/beans/MenuItem.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- MenuItem.java	27 Feb 2003 19:20:25 -0000	1.2
  +++ MenuItem.java	12 Jul 2003 00:15:01 -0000	1.3
  @@ -7,7 +7,7 @@
    *
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 1999-2002 The Apache Software Foundation.  All rights
  + * Copyright (c) 1999-2003 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -59,55 +59,53 @@
    *
    */
   
  -
   package org.apache.struts.tiles.beans;
   
   import java.io.Serializable;
   
  -
  -  /**
  -   * Interface for MenuItems.
  -   * @see SimpleMenuItem
  -   */
  -public interface MenuItem extends Serializable
  -{
  +/**
  + * Interface for MenuItems.
  + * @see SimpleMenuItem
  + */
  +public interface MenuItem extends Serializable {
  +    
       /**
        * Set value property.
        */
  -  public void setValue(String value);
  +    public void setValue(String value);
   
       /**
        * Get value property.
        */
  -  public String getValue();
  +    public String getValue();
   
       /**
        * Set link property.
        */
  -  public void setLink(String link);
  +    public void setLink(String link);
   
       /**
        * Get link property.
        */
  -  public String getLink();
  +    public String getLink();
   
       /**
        * Set icon property.
        */
  -  public void setIcon(String link);
  +    public void setIcon(String link);
   
       /**
        * Get icon property.
        */
  -  public String getIcon();
  +    public String getIcon();
   
       /**
        * Set tooltip property.
        */
  -  public void setTooltip(String link);
  +    public void setTooltip(String link);
   
       /**
        * Get tooltip property.
        */
  -  public String getTooltip();
  +    public String getTooltip();
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org