You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by we...@apache.org on 2005/08/17 20:13:09 UTC

svn commit: r233228 - /portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java

Author: weaver
Date: Wed Aug 17 11:13:08 2005
New Revision: 233228

URL: http://svn.apache.org/viewcvs?rev=233228&view=rev
Log:
Column widths have been internalized into the ColumnLayout model object.

Modified:
    portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java

Modified: portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java?rev=233228&r1=233227&r2=233228&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java (original)
+++ portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java Wed Aug 17 11:13:08 2005
@@ -75,6 +75,9 @@
     /** SortedMap of Columns (which are also sorted maps */
     private final SortedMap columns;
     
+    /** Width settings for eacah column */
+    private final String[] columnWidthes;
+    
     /** 
      * The type of layout this is, required for extract row/column properties
      * from a fragment.
@@ -88,7 +91,7 @@
     private final Map coordinates;
     
     /** All of the LayoutEventListeners registered to this layout */
-    private final List eventListeners;
+    private final List eventListeners;    
 
     /**
      * 
@@ -102,10 +105,11 @@
      *            formats without one format effecting the settings of another.
      * @see org.apache.jetspeed.om.page.Fragment#getType()
      */
-    public ColumnLayout(int numberOfColumns, String layoutType)
+    public ColumnLayout(int numberOfColumns, String layoutType, String[] columnWidthes)
     {
         this.numberOfColumns = numberOfColumns;
         this.layoutType = layoutType;
+        this.columnWidthes = columnWidthes;
         eventListeners = new ArrayList();
 
         columns = new TreeMap();
@@ -142,9 +146,9 @@
      * @param fragments Initial set of fragments to add to this layout.
      * @throws LayoutEventException
      */
-    public ColumnLayout(int numberOfColumns, String layoutType, Collection fragments) throws LayoutEventException
+    public ColumnLayout(int numberOfColumns, String layoutType, Collection fragments, String[] columnWidthes) throws LayoutEventException
     {
-        this(numberOfColumns, layoutType);
+        this(numberOfColumns, layoutType, columnWidthes);
         Iterator fragmentsItr = fragments.iterator();
         try
         {
@@ -232,6 +236,61 @@
     {
         return Collections.unmodifiableCollection(getColumnMap(columnNumber).values());
     }
+    
+    /**
+     * returns the width to be used with the specified column.  If
+     * there is no specific column setting sfor the specified column
+     * 0 is returned.
+     * 
+     * @param columnNumber whose width has been requested.
+     * @return the width to be used with the specified column.  Or 0 if no value
+     * has been specified.
+     */
+    public int getColumnWidth(int columnNumber)
+    {
+        if (columnNumber < numberOfColumns)
+        {
+            String stringValue = columnWidthes[columnNumber];
+            if (stringValue.endsWith("%"))
+            {
+                return Integer.parseInt(stringValue.substring(0, (stringValue.length() - 1)));
+            }
+            else
+            {
+                return Integer.parseInt(stringValue);
+            }
+        }
+        else
+        {
+            return 0;
+        }
+    }
+    
+    /**
+     * IE has a non-conformant box modle that takes into account both padding
+     * and margin settings.  You can use this method to return the column width
+     * reduced by the <code>reductionAmount</code> to prevent unwanted 
+     * scrolling/wrapping.
+     *
+     * 
+     * @param columnNumber whose width has been requested.  Will be reduced by
+     * the <code>reductionAmount</code> argument.
+     * @param reductionAmount amount to subtract from the column's width setting
+     * @return column width reduced by the <code>reductionAmount</code>.
+     */
+    public int getSafeColumnWidth(int columnNumber, int reductionAmount)
+    {
+        int columnWidth = getColumnWidth(columnNumber);
+        if(columnWidth > 0)
+        {
+            return (columnWidth - reductionAmount);
+        }
+        else
+        {
+            return 0;
+        }
+    
+    }
 
     /**
      * @return <code>java.util.Collection</code> all of columns (also
@@ -596,7 +655,7 @@
         }
         else
         {
-            throw new FragmentNotInLayoutException((fragment == null)? "null fragment": fragment.getId());
+            throw new FragmentNotInLayoutException(fragment);
         }
     }
 



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


RE: svn commit: r233228 - /portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java

Posted by Scott T Weaver <sc...@binary-designs.net>.
Looks like there was a change to that exception that is refusing to update
into my workspace.  Oh, well more time lost screwing with Subversion :(

-Scott

> -----Original Message-----
> From: Scott T Weaver [mailto:scotts-jetspeed-list@binary-designs.net]
> Sent: Wednesday, August 17, 2005 3:46 PM
> To: 'Jetspeed Developers List'
> Subject: RE: svn commit: r233228 - /portals/jetspeed-2/trunk/layout-
> portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java
> 
> Ate,
> 
> I don't even see that as an option to commit that class as it says there
> are
> no changes in the remote repository.  Please make sure your local repo
> isn't
> corrupted, as this seems to happen a lot.
> 
> -Scott
> 
> > -----Original Message-----
> > From: Ate Douma [mailto:ate@douma.nu]
> > Sent: Wednesday, August 17, 2005 3:41 PM
> > To: Jetspeed Developers List
> > Subject: Re: svn commit: r233228 - /portals/jetspeed-2/trunk/layout-
> > portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java
> >
> > Scott,
> >
> > You need to commit your local update to FragmentNotInLayoutException as
> > trunk currently is broken:
> >
> >      [javac] Compiling 13 source files to D:\workspace\jetspeed-
> 2\layout-
> > portlets\target\classes
> >      [javac] D:\workspace\jetspeed-2\layout-
> >
> portlets\src\java\org\apache\jetspeed\portlets\layout\ColumnLayout.java:65
> > 8:
> > cannot find symbol
> >      [javac] symbol  : constructor
> > FragmentNotInLayoutException(org.apache.jetspeed.om.page.Fragment)
> >      [javac] location: class
> > org.apache.jetspeed.portlets.layout.FragmentNotInLayoutException
> >      [javac]             throw new
> FragmentNotInLayoutException(fragment);
> >      [javac]                   ^
> >      [javac] Note: Some input files use unchecked or unsafe operations.
> >      [javac] Note: Recompile with -Xlint:unchecked for details.
> >      [javac] 1 error
> >
> > weaver@apache.org wrote:
> > > Author: weaver
> > > Date: Wed Aug 17 11:13:08 2005
> > > New Revision: 233228
> > >
> > > URL: http://svn.apache.org/viewcvs?rev=233228&view=rev
> > > Log:
> > > Column widths have been internalized into the ColumnLayout model
> object.
> > >
> > > Modified:
> > >     portals/jetspeed-2/trunk/layout-
> > portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java
> > >
> > > Modified: portals/jetspeed-2/trunk/layout-
> > portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java
> > > URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/layout-
> >
> portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java?re
> > v=233228&r1=233227&r2=233228&view=diff
> > >
> >
> ==========================================================================
> > ====
> > > --- portals/jetspeed-2/trunk/layout-
> > portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java
> > (original)
> > > +++ portals/jetspeed-2/trunk/layout-
> > portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java
> > Wed Aug 17 11:13:08 2005
> > > @@ -75,6 +75,9 @@
> > >      /** SortedMap of Columns (which are also sorted maps */
> > >      private final SortedMap columns;
> > >
> > > +    /** Width settings for eacah column */
> > > +    private final String[] columnWidthes;
> > > +
> > >      /**
> > >       * The type of layout this is, required for extract row/column
> > properties
> > >       * from a fragment.
> > > @@ -88,7 +91,7 @@
> > >      private final Map coordinates;
> > >
> > >      /** All of the LayoutEventListeners registered to this layout */
> > > -    private final List eventListeners;
> > > +    private final List eventListeners;
> > >
> > >      /**
> > >       *
> > > @@ -102,10 +105,11 @@
> > >       *            formats without one format effecting the settings
> of
> > another.
> > >       * @see org.apache.jetspeed.om.page.Fragment#getType()
> > >       */
> > > -    public ColumnLayout(int numberOfColumns, String layoutType)
> > > +    public ColumnLayout(int numberOfColumns, String layoutType,
> > String[] columnWidthes)
> > >      {
> > >          this.numberOfColumns = numberOfColumns;
> > >          this.layoutType = layoutType;
> > > +        this.columnWidthes = columnWidthes;
> > >          eventListeners = new ArrayList();
> > >
> > >          columns = new TreeMap();
> > > @@ -142,9 +146,9 @@
> > >       * @param fragments Initial set of fragments to add to this
> layout.
> > >       * @throws LayoutEventException
> > >       */
> > > -    public ColumnLayout(int numberOfColumns, String layoutType,
> > Collection fragments) throws LayoutEventException
> > > +    public ColumnLayout(int numberOfColumns, String layoutType,
> > Collection fragments, String[] columnWidthes) throws
> LayoutEventException
> > >      {
> > > -        this(numberOfColumns, layoutType);
> > > +        this(numberOfColumns, layoutType, columnWidthes);
> > >          Iterator fragmentsItr = fragments.iterator();
> > >          try
> > >          {
> > > @@ -232,6 +236,61 @@
> > >      {
> > >          return
> > Collections.unmodifiableCollection(getColumnMap(columnNumber).values());
> > >      }
> > > +
> > > +    /**
> > > +     * returns the width to be used with the specified column.  If
> > > +     * there is no specific column setting sfor the specified column
> > > +     * 0 is returned.
> > > +     *
> > > +     * @param columnNumber whose width has been requested.
> > > +     * @return the width to be used with the specified column.  Or 0
> if
> > no value
> > > +     * has been specified.
> > > +     */
> > > +    public int getColumnWidth(int columnNumber)
> > > +    {
> > > +        if (columnNumber < numberOfColumns)
> > > +        {
> > > +            String stringValue = columnWidthes[columnNumber];
> > > +            if (stringValue.endsWith("%"))
> > > +            {
> > > +                return Integer.parseInt(stringValue.substring(0,
> > (stringValue.length() - 1)));
> > > +            }
> > > +            else
> > > +            {
> > > +                return Integer.parseInt(stringValue);
> > > +            }
> > > +        }
> > > +        else
> > > +        {
> > > +            return 0;
> > > +        }
> > > +    }
> > > +
> > > +    /**
> > > +     * IE has a non-conformant box modle that takes into account both
> > padding
> > > +     * and margin settings.  You can use this method to return the
> > column width
> > > +     * reduced by the <code>reductionAmount</code> to prevent
> unwanted
> > > +     * scrolling/wrapping.
> > > +     *
> > > +     *
> > > +     * @param columnNumber whose width has been requested.  Will be
> > reduced by
> > > +     * the <code>reductionAmount</code> argument.
> > > +     * @param reductionAmount amount to subtract from the column's
> > width setting
> > > +     * @return column width reduced by the
> > <code>reductionAmount</code>.
> > > +     */
> > > +    public int getSafeColumnWidth(int columnNumber, int
> > reductionAmount)
> > > +    {
> > > +        int columnWidth = getColumnWidth(columnNumber);
> > > +        if(columnWidth > 0)
> > > +        {
> > > +            return (columnWidth - reductionAmount);
> > > +        }
> > > +        else
> > > +        {
> > > +            return 0;
> > > +        }
> > > +
> > > +    }
> > >
> > >      /**
> > >       * @return <code>java.util.Collection</code> all of columns (also
> > > @@ -596,7 +655,7 @@
> > >          }
> > >          else
> > >          {
> > > -            throw new FragmentNotInLayoutException((fragment ==
> null)?
> > "null fragment": fragment.getId());
> > > +            throw new FragmentNotInLayoutException(fragment);
> > >          }
> > >      }
> > >
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
> > > For additional commands, e-mail: jetspeed-dev-help@portals.apache.org
> > >
> > >
> > >
> > >
> > >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
> > For additional commands, e-mail: jetspeed-dev-help@portals.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-dev-help@portals.apache.org



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


RE: svn commit: r233228 - /portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java

Posted by Scott T Weaver <sc...@binary-designs.net>.
Ate,

I don't even see that as an option to commit that class as it says there are
no changes in the remote repository.  Please make sure your local repo isn't
corrupted, as this seems to happen a lot.

-Scott

> -----Original Message-----
> From: Ate Douma [mailto:ate@douma.nu]
> Sent: Wednesday, August 17, 2005 3:41 PM
> To: Jetspeed Developers List
> Subject: Re: svn commit: r233228 - /portals/jetspeed-2/trunk/layout-
> portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java
> 
> Scott,
> 
> You need to commit your local update to FragmentNotInLayoutException as
> trunk currently is broken:
> 
>      [javac] Compiling 13 source files to D:\workspace\jetspeed-2\layout-
> portlets\target\classes
>      [javac] D:\workspace\jetspeed-2\layout-
> portlets\src\java\org\apache\jetspeed\portlets\layout\ColumnLayout.java:65
> 8:
> cannot find symbol
>      [javac] symbol  : constructor
> FragmentNotInLayoutException(org.apache.jetspeed.om.page.Fragment)
>      [javac] location: class
> org.apache.jetspeed.portlets.layout.FragmentNotInLayoutException
>      [javac]             throw new FragmentNotInLayoutException(fragment);
>      [javac]                   ^
>      [javac] Note: Some input files use unchecked or unsafe operations.
>      [javac] Note: Recompile with -Xlint:unchecked for details.
>      [javac] 1 error
> 
> weaver@apache.org wrote:
> > Author: weaver
> > Date: Wed Aug 17 11:13:08 2005
> > New Revision: 233228
> >
> > URL: http://svn.apache.org/viewcvs?rev=233228&view=rev
> > Log:
> > Column widths have been internalized into the ColumnLayout model object.
> >
> > Modified:
> >     portals/jetspeed-2/trunk/layout-
> portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java
> >
> > Modified: portals/jetspeed-2/trunk/layout-
> portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java
> > URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/layout-
> portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java?re
> v=233228&r1=233227&r2=233228&view=diff
> >
> ==========================================================================
> ====
> > --- portals/jetspeed-2/trunk/layout-
> portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java
> (original)
> > +++ portals/jetspeed-2/trunk/layout-
> portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java
> Wed Aug 17 11:13:08 2005
> > @@ -75,6 +75,9 @@
> >      /** SortedMap of Columns (which are also sorted maps */
> >      private final SortedMap columns;
> >
> > +    /** Width settings for eacah column */
> > +    private final String[] columnWidthes;
> > +
> >      /**
> >       * The type of layout this is, required for extract row/column
> properties
> >       * from a fragment.
> > @@ -88,7 +91,7 @@
> >      private final Map coordinates;
> >
> >      /** All of the LayoutEventListeners registered to this layout */
> > -    private final List eventListeners;
> > +    private final List eventListeners;
> >
> >      /**
> >       *
> > @@ -102,10 +105,11 @@
> >       *            formats without one format effecting the settings of
> another.
> >       * @see org.apache.jetspeed.om.page.Fragment#getType()
> >       */
> > -    public ColumnLayout(int numberOfColumns, String layoutType)
> > +    public ColumnLayout(int numberOfColumns, String layoutType,
> String[] columnWidthes)
> >      {
> >          this.numberOfColumns = numberOfColumns;
> >          this.layoutType = layoutType;
> > +        this.columnWidthes = columnWidthes;
> >          eventListeners = new ArrayList();
> >
> >          columns = new TreeMap();
> > @@ -142,9 +146,9 @@
> >       * @param fragments Initial set of fragments to add to this layout.
> >       * @throws LayoutEventException
> >       */
> > -    public ColumnLayout(int numberOfColumns, String layoutType,
> Collection fragments) throws LayoutEventException
> > +    public ColumnLayout(int numberOfColumns, String layoutType,
> Collection fragments, String[] columnWidthes) throws LayoutEventException
> >      {
> > -        this(numberOfColumns, layoutType);
> > +        this(numberOfColumns, layoutType, columnWidthes);
> >          Iterator fragmentsItr = fragments.iterator();
> >          try
> >          {
> > @@ -232,6 +236,61 @@
> >      {
> >          return
> Collections.unmodifiableCollection(getColumnMap(columnNumber).values());
> >      }
> > +
> > +    /**
> > +     * returns the width to be used with the specified column.  If
> > +     * there is no specific column setting sfor the specified column
> > +     * 0 is returned.
> > +     *
> > +     * @param columnNumber whose width has been requested.
> > +     * @return the width to be used with the specified column.  Or 0 if
> no value
> > +     * has been specified.
> > +     */
> > +    public int getColumnWidth(int columnNumber)
> > +    {
> > +        if (columnNumber < numberOfColumns)
> > +        {
> > +            String stringValue = columnWidthes[columnNumber];
> > +            if (stringValue.endsWith("%"))
> > +            {
> > +                return Integer.parseInt(stringValue.substring(0,
> (stringValue.length() - 1)));
> > +            }
> > +            else
> > +            {
> > +                return Integer.parseInt(stringValue);
> > +            }
> > +        }
> > +        else
> > +        {
> > +            return 0;
> > +        }
> > +    }
> > +
> > +    /**
> > +     * IE has a non-conformant box modle that takes into account both
> padding
> > +     * and margin settings.  You can use this method to return the
> column width
> > +     * reduced by the <code>reductionAmount</code> to prevent unwanted
> > +     * scrolling/wrapping.
> > +     *
> > +     *
> > +     * @param columnNumber whose width has been requested.  Will be
> reduced by
> > +     * the <code>reductionAmount</code> argument.
> > +     * @param reductionAmount amount to subtract from the column's
> width setting
> > +     * @return column width reduced by the
> <code>reductionAmount</code>.
> > +     */
> > +    public int getSafeColumnWidth(int columnNumber, int
> reductionAmount)
> > +    {
> > +        int columnWidth = getColumnWidth(columnNumber);
> > +        if(columnWidth > 0)
> > +        {
> > +            return (columnWidth - reductionAmount);
> > +        }
> > +        else
> > +        {
> > +            return 0;
> > +        }
> > +
> > +    }
> >
> >      /**
> >       * @return <code>java.util.Collection</code> all of columns (also
> > @@ -596,7 +655,7 @@
> >          }
> >          else
> >          {
> > -            throw new FragmentNotInLayoutException((fragment == null)?
> "null fragment": fragment.getId());
> > +            throw new FragmentNotInLayoutException(fragment);
> >          }
> >      }
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
> > For additional commands, e-mail: jetspeed-dev-help@portals.apache.org
> >
> >
> >
> >
> >
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-dev-help@portals.apache.org



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


RE: svn commit: r233228 - /portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java

Posted by Scott T Weaver <sc...@binary-designs.net>.
Ate,

No problem.  I have no idea what's up with SVN.  I even started using
TortoiseSVN exclusively instead of Subclipse and I still have issues from
time to time.  

Regards,
-Scott

> -----Original Message-----
> From: Ate Douma [mailto:ate@douma.nu]
> Sent: Wednesday, August 17, 2005 4:01 PM
> To: Jetspeed Developers List
> Subject: Re: svn commit: r233228 - /portals/jetspeed-2/trunk/layout-
> portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java
> 
> Scott T Weaver wrote:
> > Ate,
> >
> > Update and see if it works now.
> Yes, now it compiles again.
> 
> This certainly is strange.
> Somehow you managed to commit changes to ColumnLayout.java without needing
> to update first to revision 2328720 made by Santiago on Monday.
> I thought Subversion would block such overlapping changes...
> 
> Anyway, thanks for fixing it again.
> 
> Regards,
> Ate
> 
> >
> > Regards,
> > -Scott
> >
> >
> >>-----Original Message-----
> >>From: Ate Douma [mailto:ate@douma.nu]
> >>Sent: Wednesday, August 17, 2005 3:45 PM
> >>To: Jetspeed Developers List
> >>Subject: Re: svn commit: r233228 - /portals/jetspeed-2/trunk/layout-
> >>portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java
> >>
> >>Scott T Weaver wrote:
> >>
> >>>That isn't a new class.  I don't know why it isn't there.  Probably
> >>>Subversion acting up again :(
> >>
> >>I do have FragmentNotInLayoutException, just not the correct
> constructor.
> >>You changed the usage like this:
> >>-            throw new FragmentNotInLayoutException((fragment == null)?
> >>"null fragment": fragment.getId());
> >>+            throw new FragmentNotInLayoutException(fragment);
> >>
> >>
> >>
> >>>-Scott
> >>>
> >>>
> >>>
> >>>>-----Original Message-----
> >>>>From: Ate Douma [mailto:ate@douma.nu]
> >>>>Sent: Wednesday, August 17, 2005 3:41 PM
> >>>>To: Jetspeed Developers List
> >>>>Subject: Re: svn commit: r233228 - /portals/jetspeed-2/trunk/layout-
> >>>>portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.jav
> a
> >>>>
> >>>>Scott,
> >>>>
> >>>>You need to commit your local update to FragmentNotInLayoutException
> as
> >>>>trunk currently is broken:
> >>>>
> >>>>    [javac] Compiling 13 source files to D:\workspace\jetspeed-
> >>
> >>2\layout-
> >>
> >>>>portlets\target\classes
> >>>>    [javac] D:\workspace\jetspeed-2\layout-
> >>>>portlets\src\java\org\apache\jetspeed\portlets\layout\ColumnLayout.jav
> a:
> >>
> >>65
> >>
> >>>>8:
> >>>>cannot find symbol
> >>>>    [javac] symbol  : constructor
> >>>>FragmentNotInLayoutException(org.apache.jetspeed.om.page.Fragment)
> >>>>    [javac] location: class
> >>>>org.apache.jetspeed.portlets.layout.FragmentNotInLayoutException
> >>>>    [javac]             throw new
> >>
> >>FragmentNotInLayoutException(fragment);
> >>
> >>>>    [javac]                   ^
> >>>>    [javac] Note: Some input files use unchecked or unsafe operations.
> >>>>    [javac] Note: Recompile with -Xlint:unchecked for details.
> >>>>    [javac] 1 error
> >>>>
> >>>>weaver@apache.org wrote:
> >>>>
> >>>>
> >>>>>Author: weaver
> >>>>>Date: Wed Aug 17 11:13:08 2005
> >>>>>New Revision: 233228
> >>>>>
> >>>>>URL: http://svn.apache.org/viewcvs?rev=233228&view=rev
> >>>>>Log:
> >>>>>Column widths have been internalized into the ColumnLayout model
> >>
> >>object.
> >>
> >>>>>Modified:
> >>>>>   portals/jetspeed-2/trunk/layout-
> >>>>
> >>>>portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.jav
> a
> >>>>
> >>>>
> >>>>>Modified: portals/jetspeed-2/trunk/layout-
> >>>>
> >>>>portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.jav
> a
> >>>>
> >>>>
> >>>>>URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/layout-
> >>>>
> >>>>portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.jav
> a?
> >>
> >>re
> >>
> >>>>v=233228&r1=233227&r2=233228&view=diff
> >>>>
> >>>>======================================================================
> ==
> >>
> >>==
> >>
> >>>>====
> >>>>
> >>>>
> >>>>>--- portals/jetspeed-2/trunk/layout-
> >>>>
> >>>>portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.jav
> a
> >>>>(original)
> >>>>
> >>>>
> >>>>>+++ portals/jetspeed-2/trunk/layout-
> >>>>
> >>>>portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.jav
> a
> >>>>Wed Aug 17 11:13:08 2005
> >>>>
> >>>>
> >>>>>@@ -75,6 +75,9 @@
> >>>>>    /** SortedMap of Columns (which are also sorted maps */
> >>>>>    private final SortedMap columns;
> >>>>>
> >>>>>+    /** Width settings for eacah column */
> >>>>>+    private final String[] columnWidthes;
> >>>>>+
> >>>>>    /**
> >>>>>     * The type of layout this is, required for extract row/column
> >>>>
> >>>>properties
> >>>>
> >>>>
> >>>>>     * from a fragment.
> >>>>>@@ -88,7 +91,7 @@
> >>>>>    private final Map coordinates;
> >>>>>
> >>>>>    /** All of the LayoutEventListeners registered to this layout */
> >>>>>-    private final List eventListeners;
> >>>>>+    private final List eventListeners;
> >>>>>
> >>>>>    /**
> >>>>>     *
> >>>>>@@ -102,10 +105,11 @@
> >>>>>     *            formats without one format effecting the settings
> of
> >>>>
> >>>>another.
> >>>>
> >>>>
> >>>>>     * @see org.apache.jetspeed.om.page.Fragment#getType()
> >>>>>     */
> >>>>>-    public ColumnLayout(int numberOfColumns, String layoutType)
> >>>>>+    public ColumnLayout(int numberOfColumns, String layoutType,
> >>>>
> >>>>String[] columnWidthes)
> >>>>
> >>>>
> >>>>>    {
> >>>>>        this.numberOfColumns = numberOfColumns;
> >>>>>        this.layoutType = layoutType;
> >>>>>+        this.columnWidthes = columnWidthes;
> >>>>>        eventListeners = new ArrayList();
> >>>>>
> >>>>>        columns = new TreeMap();
> >>>>>@@ -142,9 +146,9 @@
> >>>>>     * @param fragments Initial set of fragments to add to this
> >>
> >>layout.
> >>
> >>>>>     * @throws LayoutEventException
> >>>>>     */
> >>>>>-    public ColumnLayout(int numberOfColumns, String layoutType,
> >>>>
> >>>>Collection fragments) throws LayoutEventException
> >>>>
> >>>>
> >>>>>+    public ColumnLayout(int numberOfColumns, String layoutType,
> >>>>
> >>>>Collection fragments, String[] columnWidthes) throws
> >>
> >>LayoutEventException
> >>
> >>>>>    {
> >>>>>-        this(numberOfColumns, layoutType);
> >>>>>+        this(numberOfColumns, layoutType, columnWidthes);
> >>>>>        Iterator fragmentsItr = fragments.iterator();
> >>>>>        try
> >>>>>        {
> >>>>>@@ -232,6 +236,61 @@
> >>>>>    {
> >>>>>        return
> >>>>
> >>>>Collections.unmodifiableCollection(getColumnMap(columnNumber).values()
> );
> >>>>
> >>>>
> >>>>>    }
> >>>>>+
> >>>>>+    /**
> >>>>>+     * returns the width to be used with the specified column.  If
> >>>>>+     * there is no specific column setting sfor the specified column
> >>>>>+     * 0 is returned.
> >>>>>+     *
> >>>>>+     * @param columnNumber whose width has been requested.
> >>>>>+     * @return the width to be used with the specified column.  Or 0
> >>
> >>if
> >>
> >>>>no value
> >>>>
> >>>>
> >>>>>+     * has been specified.
> >>>>>+     */
> >>>>>+    public int getColumnWidth(int columnNumber)
> >>>>>+    {
> >>>>>+        if (columnNumber < numberOfColumns)
> >>>>>+        {
> >>>>>+            String stringValue = columnWidthes[columnNumber];
> >>>>>+            if (stringValue.endsWith("%"))
> >>>>>+            {
> >>>>>+                return Integer.parseInt(stringValue.substring(0,
> >>>>
> >>>>(stringValue.length() - 1)));
> >>>>
> >>>>
> >>>>>+            }
> >>>>>+            else
> >>>>>+            {
> >>>>>+                return Integer.parseInt(stringValue);
> >>>>>+            }
> >>>>>+        }
> >>>>>+        else
> >>>>>+        {
> >>>>>+            return 0;
> >>>>>+        }
> >>>>>+    }
> >>>>>+
> >>>>>+    /**
> >>>>>+     * IE has a non-conformant box modle that takes into account
> both
> >>>>
> >>>>padding
> >>>>
> >>>>
> >>>>>+     * and margin settings.  You can use this method to return the
> >>>>
> >>>>column width
> >>>>
> >>>>
> >>>>>+     * reduced by the <code>reductionAmount</code> to prevent
> unwanted
> >>>>>+     * scrolling/wrapping.
> >>>>>+     *
> >>>>>+     *
> >>>>>+     * @param columnNumber whose width has been requested.  Will be
> >>>>
> >>>>reduced by
> >>>>
> >>>>
> >>>>>+     * the <code>reductionAmount</code> argument.
> >>>>>+     * @param reductionAmount amount to subtract from the column's
> >>>>
> >>>>width setting
> >>>>
> >>>>
> >>>>>+     * @return column width reduced by the
> >>>>
> >>>><code>reductionAmount</code>.
> >>>>
> >>>>
> >>>>>+     */
> >>>>>+    public int getSafeColumnWidth(int columnNumber, int
> >>>>
> >>>>reductionAmount)
> >>>>
> >>>>
> >>>>>+    {
> >>>>>+        int columnWidth = getColumnWidth(columnNumber);
> >>>>>+        if(columnWidth > 0)
> >>>>>+        {
> >>>>>+            return (columnWidth - reductionAmount);
> >>>>>+        }
> >>>>>+        else
> >>>>>+        {
> >>>>>+            return 0;
> >>>>>+        }
> >>>>>+
> >>>>>+    }
> >>>>>
> >>>>>    /**
> >>>>>     * @return <code>java.util.Collection</code> all of columns (also
> >>>>>@@ -596,7 +655,7 @@
> >>>>>        }
> >>>>>        else
> >>>>>        {
> >>>>>-            throw new FragmentNotInLayoutException((fragment ==
> null)?
> >>>>
> >>>>"null fragment": fragment.getId());
> >>>>
> >>>>
> >>>>>+            throw new FragmentNotInLayoutException(fragment);
> >>>>>        }
> >>>>>    }
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>---------------------------------------------------------------------
> >>>>>To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
> >>>>>For additional commands, e-mail: jetspeed-dev-help@portals.apache.org
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>
> >>>>
> >>>>
> >>>>---------------------------------------------------------------------
> >>>>To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
> >>>>For additional commands, e-mail: jetspeed-dev-help@portals.apache.org
> >>>
> >>>
> >>>
> >>>
> >>>---------------------------------------------------------------------
> >>>To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
> >>>For additional commands, e-mail: jetspeed-dev-help@portals.apache.org
> >>>
> >>>
> >>>
> >>>
> >>>
> >>
> >>
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
> >>For additional commands, e-mail: jetspeed-dev-help@portals.apache.org
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
> > For additional commands, e-mail: jetspeed-dev-help@portals.apache.org
> >
> >
> >
> >
> >
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-dev-help@portals.apache.org



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


Re: svn commit: r233228 - /portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java

Posted by Ate Douma <at...@douma.nu>.
Scott T Weaver wrote:
> Ate,
> 
> Update and see if it works now.
Yes, now it compiles again.

This certainly is strange.
Somehow you managed to commit changes to ColumnLayout.java without needing
to update first to revision 2328720 made by Santiago on Monday.
I thought Subversion would block such overlapping changes...

Anyway, thanks for fixing it again.

Regards,
Ate

> 
> Regards,
> -Scott
> 
> 
>>-----Original Message-----
>>From: Ate Douma [mailto:ate@douma.nu]
>>Sent: Wednesday, August 17, 2005 3:45 PM
>>To: Jetspeed Developers List
>>Subject: Re: svn commit: r233228 - /portals/jetspeed-2/trunk/layout-
>>portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java
>>
>>Scott T Weaver wrote:
>>
>>>That isn't a new class.  I don't know why it isn't there.  Probably
>>>Subversion acting up again :(
>>
>>I do have FragmentNotInLayoutException, just not the correct constructor.
>>You changed the usage like this:
>>-            throw new FragmentNotInLayoutException((fragment == null)?
>>"null fragment": fragment.getId());
>>+            throw new FragmentNotInLayoutException(fragment);
>>
>>
>>
>>>-Scott
>>>
>>>
>>>
>>>>-----Original Message-----
>>>>From: Ate Douma [mailto:ate@douma.nu]
>>>>Sent: Wednesday, August 17, 2005 3:41 PM
>>>>To: Jetspeed Developers List
>>>>Subject: Re: svn commit: r233228 - /portals/jetspeed-2/trunk/layout-
>>>>portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java
>>>>
>>>>Scott,
>>>>
>>>>You need to commit your local update to FragmentNotInLayoutException as
>>>>trunk currently is broken:
>>>>
>>>>    [javac] Compiling 13 source files to D:\workspace\jetspeed-
>>
>>2\layout-
>>
>>>>portlets\target\classes
>>>>    [javac] D:\workspace\jetspeed-2\layout-
>>>>portlets\src\java\org\apache\jetspeed\portlets\layout\ColumnLayout.java:
>>
>>65
>>
>>>>8:
>>>>cannot find symbol
>>>>    [javac] symbol  : constructor
>>>>FragmentNotInLayoutException(org.apache.jetspeed.om.page.Fragment)
>>>>    [javac] location: class
>>>>org.apache.jetspeed.portlets.layout.FragmentNotInLayoutException
>>>>    [javac]             throw new
>>
>>FragmentNotInLayoutException(fragment);
>>
>>>>    [javac]                   ^
>>>>    [javac] Note: Some input files use unchecked or unsafe operations.
>>>>    [javac] Note: Recompile with -Xlint:unchecked for details.
>>>>    [javac] 1 error
>>>>
>>>>weaver@apache.org wrote:
>>>>
>>>>
>>>>>Author: weaver
>>>>>Date: Wed Aug 17 11:13:08 2005
>>>>>New Revision: 233228
>>>>>
>>>>>URL: http://svn.apache.org/viewcvs?rev=233228&view=rev
>>>>>Log:
>>>>>Column widths have been internalized into the ColumnLayout model
>>
>>object.
>>
>>>>>Modified:
>>>>>   portals/jetspeed-2/trunk/layout-
>>>>
>>>>portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java
>>>>
>>>>
>>>>>Modified: portals/jetspeed-2/trunk/layout-
>>>>
>>>>portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java
>>>>
>>>>
>>>>>URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/layout-
>>>>
>>>>portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java?
>>
>>re
>>
>>>>v=233228&r1=233227&r2=233228&view=diff
>>>>
>>>>========================================================================
>>
>>==
>>
>>>>====
>>>>
>>>>
>>>>>--- portals/jetspeed-2/trunk/layout-
>>>>
>>>>portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java
>>>>(original)
>>>>
>>>>
>>>>>+++ portals/jetspeed-2/trunk/layout-
>>>>
>>>>portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java
>>>>Wed Aug 17 11:13:08 2005
>>>>
>>>>
>>>>>@@ -75,6 +75,9 @@
>>>>>    /** SortedMap of Columns (which are also sorted maps */
>>>>>    private final SortedMap columns;
>>>>>
>>>>>+    /** Width settings for eacah column */
>>>>>+    private final String[] columnWidthes;
>>>>>+
>>>>>    /**
>>>>>     * The type of layout this is, required for extract row/column
>>>>
>>>>properties
>>>>
>>>>
>>>>>     * from a fragment.
>>>>>@@ -88,7 +91,7 @@
>>>>>    private final Map coordinates;
>>>>>
>>>>>    /** All of the LayoutEventListeners registered to this layout */
>>>>>-    private final List eventListeners;
>>>>>+    private final List eventListeners;
>>>>>
>>>>>    /**
>>>>>     *
>>>>>@@ -102,10 +105,11 @@
>>>>>     *            formats without one format effecting the settings of
>>>>
>>>>another.
>>>>
>>>>
>>>>>     * @see org.apache.jetspeed.om.page.Fragment#getType()
>>>>>     */
>>>>>-    public ColumnLayout(int numberOfColumns, String layoutType)
>>>>>+    public ColumnLayout(int numberOfColumns, String layoutType,
>>>>
>>>>String[] columnWidthes)
>>>>
>>>>
>>>>>    {
>>>>>        this.numberOfColumns = numberOfColumns;
>>>>>        this.layoutType = layoutType;
>>>>>+        this.columnWidthes = columnWidthes;
>>>>>        eventListeners = new ArrayList();
>>>>>
>>>>>        columns = new TreeMap();
>>>>>@@ -142,9 +146,9 @@
>>>>>     * @param fragments Initial set of fragments to add to this
>>
>>layout.
>>
>>>>>     * @throws LayoutEventException
>>>>>     */
>>>>>-    public ColumnLayout(int numberOfColumns, String layoutType,
>>>>
>>>>Collection fragments) throws LayoutEventException
>>>>
>>>>
>>>>>+    public ColumnLayout(int numberOfColumns, String layoutType,
>>>>
>>>>Collection fragments, String[] columnWidthes) throws
>>
>>LayoutEventException
>>
>>>>>    {
>>>>>-        this(numberOfColumns, layoutType);
>>>>>+        this(numberOfColumns, layoutType, columnWidthes);
>>>>>        Iterator fragmentsItr = fragments.iterator();
>>>>>        try
>>>>>        {
>>>>>@@ -232,6 +236,61 @@
>>>>>    {
>>>>>        return
>>>>
>>>>Collections.unmodifiableCollection(getColumnMap(columnNumber).values());
>>>>
>>>>
>>>>>    }
>>>>>+
>>>>>+    /**
>>>>>+     * returns the width to be used with the specified column.  If
>>>>>+     * there is no specific column setting sfor the specified column
>>>>>+     * 0 is returned.
>>>>>+     *
>>>>>+     * @param columnNumber whose width has been requested.
>>>>>+     * @return the width to be used with the specified column.  Or 0
>>
>>if
>>
>>>>no value
>>>>
>>>>
>>>>>+     * has been specified.
>>>>>+     */
>>>>>+    public int getColumnWidth(int columnNumber)
>>>>>+    {
>>>>>+        if (columnNumber < numberOfColumns)
>>>>>+        {
>>>>>+            String stringValue = columnWidthes[columnNumber];
>>>>>+            if (stringValue.endsWith("%"))
>>>>>+            {
>>>>>+                return Integer.parseInt(stringValue.substring(0,
>>>>
>>>>(stringValue.length() - 1)));
>>>>
>>>>
>>>>>+            }
>>>>>+            else
>>>>>+            {
>>>>>+                return Integer.parseInt(stringValue);
>>>>>+            }
>>>>>+        }
>>>>>+        else
>>>>>+        {
>>>>>+            return 0;
>>>>>+        }
>>>>>+    }
>>>>>+
>>>>>+    /**
>>>>>+     * IE has a non-conformant box modle that takes into account both
>>>>
>>>>padding
>>>>
>>>>
>>>>>+     * and margin settings.  You can use this method to return the
>>>>
>>>>column width
>>>>
>>>>
>>>>>+     * reduced by the <code>reductionAmount</code> to prevent unwanted
>>>>>+     * scrolling/wrapping.
>>>>>+     *
>>>>>+     *
>>>>>+     * @param columnNumber whose width has been requested.  Will be
>>>>
>>>>reduced by
>>>>
>>>>
>>>>>+     * the <code>reductionAmount</code> argument.
>>>>>+     * @param reductionAmount amount to subtract from the column's
>>>>
>>>>width setting
>>>>
>>>>
>>>>>+     * @return column width reduced by the
>>>>
>>>><code>reductionAmount</code>.
>>>>
>>>>
>>>>>+     */
>>>>>+    public int getSafeColumnWidth(int columnNumber, int
>>>>
>>>>reductionAmount)
>>>>
>>>>
>>>>>+    {
>>>>>+        int columnWidth = getColumnWidth(columnNumber);
>>>>>+        if(columnWidth > 0)
>>>>>+        {
>>>>>+            return (columnWidth - reductionAmount);
>>>>>+        }
>>>>>+        else
>>>>>+        {
>>>>>+            return 0;
>>>>>+        }
>>>>>+
>>>>>+    }
>>>>>
>>>>>    /**
>>>>>     * @return <code>java.util.Collection</code> all of columns (also
>>>>>@@ -596,7 +655,7 @@
>>>>>        }
>>>>>        else
>>>>>        {
>>>>>-            throw new FragmentNotInLayoutException((fragment == null)?
>>>>
>>>>"null fragment": fragment.getId());
>>>>
>>>>
>>>>>+            throw new FragmentNotInLayoutException(fragment);
>>>>>        }
>>>>>    }
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>---------------------------------------------------------------------
>>>>>To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
>>>>>For additional commands, e-mail: jetspeed-dev-help@portals.apache.org
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>>---------------------------------------------------------------------
>>>>To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
>>>>For additional commands, e-mail: jetspeed-dev-help@portals.apache.org
>>>
>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
>>>For additional commands, e-mail: jetspeed-dev-help@portals.apache.org
>>>
>>>
>>>
>>>
>>>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
>>For additional commands, e-mail: jetspeed-dev-help@portals.apache.org
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-dev-help@portals.apache.org
> 
> 
> 
> 
> 



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


RE: svn commit: r233228 - /portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java

Posted by Scott T Weaver <sc...@binary-designs.net>.
Ate,

Update and see if it works now.

Regards,
-Scott

> -----Original Message-----
> From: Ate Douma [mailto:ate@douma.nu]
> Sent: Wednesday, August 17, 2005 3:45 PM
> To: Jetspeed Developers List
> Subject: Re: svn commit: r233228 - /portals/jetspeed-2/trunk/layout-
> portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java
> 
> Scott T Weaver wrote:
> > That isn't a new class.  I don't know why it isn't there.  Probably
> > Subversion acting up again :(
> I do have FragmentNotInLayoutException, just not the correct constructor.
> You changed the usage like this:
> -            throw new FragmentNotInLayoutException((fragment == null)?
> "null fragment": fragment.getId());
> +            throw new FragmentNotInLayoutException(fragment);
> 
> 
> >
> > -Scott
> >
> >
> >>-----Original Message-----
> >>From: Ate Douma [mailto:ate@douma.nu]
> >>Sent: Wednesday, August 17, 2005 3:41 PM
> >>To: Jetspeed Developers List
> >>Subject: Re: svn commit: r233228 - /portals/jetspeed-2/trunk/layout-
> >>portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java
> >>
> >>Scott,
> >>
> >>You need to commit your local update to FragmentNotInLayoutException as
> >>trunk currently is broken:
> >>
> >>     [javac] Compiling 13 source files to D:\workspace\jetspeed-
> 2\layout-
> >>portlets\target\classes
> >>     [javac] D:\workspace\jetspeed-2\layout-
> >>portlets\src\java\org\apache\jetspeed\portlets\layout\ColumnLayout.java:
> 65
> >>8:
> >>cannot find symbol
> >>     [javac] symbol  : constructor
> >>FragmentNotInLayoutException(org.apache.jetspeed.om.page.Fragment)
> >>     [javac] location: class
> >>org.apache.jetspeed.portlets.layout.FragmentNotInLayoutException
> >>     [javac]             throw new
> FragmentNotInLayoutException(fragment);
> >>     [javac]                   ^
> >>     [javac] Note: Some input files use unchecked or unsafe operations.
> >>     [javac] Note: Recompile with -Xlint:unchecked for details.
> >>     [javac] 1 error
> >>
> >>weaver@apache.org wrote:
> >>
> >>>Author: weaver
> >>>Date: Wed Aug 17 11:13:08 2005
> >>>New Revision: 233228
> >>>
> >>>URL: http://svn.apache.org/viewcvs?rev=233228&view=rev
> >>>Log:
> >>>Column widths have been internalized into the ColumnLayout model
> object.
> >>>
> >>>Modified:
> >>>    portals/jetspeed-2/trunk/layout-
> >>
> >>portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java
> >>
> >>>Modified: portals/jetspeed-2/trunk/layout-
> >>
> >>portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java
> >>
> >>>URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/layout-
> >>
> >>portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java?
> re
> >>v=233228&r1=233227&r2=233228&view=diff
> >>
> >>========================================================================
> ==
> >>====
> >>
> >>>--- portals/jetspeed-2/trunk/layout-
> >>
> >>portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java
> >>(original)
> >>
> >>>+++ portals/jetspeed-2/trunk/layout-
> >>
> >>portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java
> >>Wed Aug 17 11:13:08 2005
> >>
> >>>@@ -75,6 +75,9 @@
> >>>     /** SortedMap of Columns (which are also sorted maps */
> >>>     private final SortedMap columns;
> >>>
> >>>+    /** Width settings for eacah column */
> >>>+    private final String[] columnWidthes;
> >>>+
> >>>     /**
> >>>      * The type of layout this is, required for extract row/column
> >>
> >>properties
> >>
> >>>      * from a fragment.
> >>>@@ -88,7 +91,7 @@
> >>>     private final Map coordinates;
> >>>
> >>>     /** All of the LayoutEventListeners registered to this layout */
> >>>-    private final List eventListeners;
> >>>+    private final List eventListeners;
> >>>
> >>>     /**
> >>>      *
> >>>@@ -102,10 +105,11 @@
> >>>      *            formats without one format effecting the settings of
> >>
> >>another.
> >>
> >>>      * @see org.apache.jetspeed.om.page.Fragment#getType()
> >>>      */
> >>>-    public ColumnLayout(int numberOfColumns, String layoutType)
> >>>+    public ColumnLayout(int numberOfColumns, String layoutType,
> >>
> >>String[] columnWidthes)
> >>
> >>>     {
> >>>         this.numberOfColumns = numberOfColumns;
> >>>         this.layoutType = layoutType;
> >>>+        this.columnWidthes = columnWidthes;
> >>>         eventListeners = new ArrayList();
> >>>
> >>>         columns = new TreeMap();
> >>>@@ -142,9 +146,9 @@
> >>>      * @param fragments Initial set of fragments to add to this
> layout.
> >>>      * @throws LayoutEventException
> >>>      */
> >>>-    public ColumnLayout(int numberOfColumns, String layoutType,
> >>
> >>Collection fragments) throws LayoutEventException
> >>
> >>>+    public ColumnLayout(int numberOfColumns, String layoutType,
> >>
> >>Collection fragments, String[] columnWidthes) throws
> LayoutEventException
> >>
> >>>     {
> >>>-        this(numberOfColumns, layoutType);
> >>>+        this(numberOfColumns, layoutType, columnWidthes);
> >>>         Iterator fragmentsItr = fragments.iterator();
> >>>         try
> >>>         {
> >>>@@ -232,6 +236,61 @@
> >>>     {
> >>>         return
> >>
> >>Collections.unmodifiableCollection(getColumnMap(columnNumber).values());
> >>
> >>>     }
> >>>+
> >>>+    /**
> >>>+     * returns the width to be used with the specified column.  If
> >>>+     * there is no specific column setting sfor the specified column
> >>>+     * 0 is returned.
> >>>+     *
> >>>+     * @param columnNumber whose width has been requested.
> >>>+     * @return the width to be used with the specified column.  Or 0
> if
> >>
> >>no value
> >>
> >>>+     * has been specified.
> >>>+     */
> >>>+    public int getColumnWidth(int columnNumber)
> >>>+    {
> >>>+        if (columnNumber < numberOfColumns)
> >>>+        {
> >>>+            String stringValue = columnWidthes[columnNumber];
> >>>+            if (stringValue.endsWith("%"))
> >>>+            {
> >>>+                return Integer.parseInt(stringValue.substring(0,
> >>
> >>(stringValue.length() - 1)));
> >>
> >>>+            }
> >>>+            else
> >>>+            {
> >>>+                return Integer.parseInt(stringValue);
> >>>+            }
> >>>+        }
> >>>+        else
> >>>+        {
> >>>+            return 0;
> >>>+        }
> >>>+    }
> >>>+
> >>>+    /**
> >>>+     * IE has a non-conformant box modle that takes into account both
> >>
> >>padding
> >>
> >>>+     * and margin settings.  You can use this method to return the
> >>
> >>column width
> >>
> >>>+     * reduced by the <code>reductionAmount</code> to prevent unwanted
> >>>+     * scrolling/wrapping.
> >>>+     *
> >>>+     *
> >>>+     * @param columnNumber whose width has been requested.  Will be
> >>
> >>reduced by
> >>
> >>>+     * the <code>reductionAmount</code> argument.
> >>>+     * @param reductionAmount amount to subtract from the column's
> >>
> >>width setting
> >>
> >>>+     * @return column width reduced by the
> >>
> >><code>reductionAmount</code>.
> >>
> >>>+     */
> >>>+    public int getSafeColumnWidth(int columnNumber, int
> >>
> >>reductionAmount)
> >>
> >>>+    {
> >>>+        int columnWidth = getColumnWidth(columnNumber);
> >>>+        if(columnWidth > 0)
> >>>+        {
> >>>+            return (columnWidth - reductionAmount);
> >>>+        }
> >>>+        else
> >>>+        {
> >>>+            return 0;
> >>>+        }
> >>>+
> >>>+    }
> >>>
> >>>     /**
> >>>      * @return <code>java.util.Collection</code> all of columns (also
> >>>@@ -596,7 +655,7 @@
> >>>         }
> >>>         else
> >>>         {
> >>>-            throw new FragmentNotInLayoutException((fragment == null)?
> >>
> >>"null fragment": fragment.getId());
> >>
> >>>+            throw new FragmentNotInLayoutException(fragment);
> >>>         }
> >>>     }
> >>>
> >>>
> >>>
> >>>
> >>>---------------------------------------------------------------------
> >>>To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
> >>>For additional commands, e-mail: jetspeed-dev-help@portals.apache.org
> >>>
> >>>
> >>>
> >>>
> >>>
> >>
> >>
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
> >>For additional commands, e-mail: jetspeed-dev-help@portals.apache.org
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
> > For additional commands, e-mail: jetspeed-dev-help@portals.apache.org
> >
> >
> >
> >
> >
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-dev-help@portals.apache.org



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


Re: svn commit: r233228 - /portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java

Posted by Ate Douma <at...@douma.nu>.
Scott T Weaver wrote:
> That isn't a new class.  I don't know why it isn't there.  Probably
> Subversion acting up again :(
I do have FragmentNotInLayoutException, just not the correct constructor.
You changed the usage like this:
-            throw new FragmentNotInLayoutException((fragment == null)? "null fragment": fragment.getId());
+            throw new FragmentNotInLayoutException(fragment);


> 
> -Scott
> 
> 
>>-----Original Message-----
>>From: Ate Douma [mailto:ate@douma.nu]
>>Sent: Wednesday, August 17, 2005 3:41 PM
>>To: Jetspeed Developers List
>>Subject: Re: svn commit: r233228 - /portals/jetspeed-2/trunk/layout-
>>portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java
>>
>>Scott,
>>
>>You need to commit your local update to FragmentNotInLayoutException as
>>trunk currently is broken:
>>
>>     [javac] Compiling 13 source files to D:\workspace\jetspeed-2\layout-
>>portlets\target\classes
>>     [javac] D:\workspace\jetspeed-2\layout-
>>portlets\src\java\org\apache\jetspeed\portlets\layout\ColumnLayout.java:65
>>8:
>>cannot find symbol
>>     [javac] symbol  : constructor
>>FragmentNotInLayoutException(org.apache.jetspeed.om.page.Fragment)
>>     [javac] location: class
>>org.apache.jetspeed.portlets.layout.FragmentNotInLayoutException
>>     [javac]             throw new FragmentNotInLayoutException(fragment);
>>     [javac]                   ^
>>     [javac] Note: Some input files use unchecked or unsafe operations.
>>     [javac] Note: Recompile with -Xlint:unchecked for details.
>>     [javac] 1 error
>>
>>weaver@apache.org wrote:
>>
>>>Author: weaver
>>>Date: Wed Aug 17 11:13:08 2005
>>>New Revision: 233228
>>>
>>>URL: http://svn.apache.org/viewcvs?rev=233228&view=rev
>>>Log:
>>>Column widths have been internalized into the ColumnLayout model object.
>>>
>>>Modified:
>>>    portals/jetspeed-2/trunk/layout-
>>
>>portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java
>>
>>>Modified: portals/jetspeed-2/trunk/layout-
>>
>>portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java
>>
>>>URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/layout-
>>
>>portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java?re
>>v=233228&r1=233227&r2=233228&view=diff
>>
>>==========================================================================
>>====
>>
>>>--- portals/jetspeed-2/trunk/layout-
>>
>>portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java
>>(original)
>>
>>>+++ portals/jetspeed-2/trunk/layout-
>>
>>portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java
>>Wed Aug 17 11:13:08 2005
>>
>>>@@ -75,6 +75,9 @@
>>>     /** SortedMap of Columns (which are also sorted maps */
>>>     private final SortedMap columns;
>>>
>>>+    /** Width settings for eacah column */
>>>+    private final String[] columnWidthes;
>>>+
>>>     /**
>>>      * The type of layout this is, required for extract row/column
>>
>>properties
>>
>>>      * from a fragment.
>>>@@ -88,7 +91,7 @@
>>>     private final Map coordinates;
>>>
>>>     /** All of the LayoutEventListeners registered to this layout */
>>>-    private final List eventListeners;
>>>+    private final List eventListeners;
>>>
>>>     /**
>>>      *
>>>@@ -102,10 +105,11 @@
>>>      *            formats without one format effecting the settings of
>>
>>another.
>>
>>>      * @see org.apache.jetspeed.om.page.Fragment#getType()
>>>      */
>>>-    public ColumnLayout(int numberOfColumns, String layoutType)
>>>+    public ColumnLayout(int numberOfColumns, String layoutType,
>>
>>String[] columnWidthes)
>>
>>>     {
>>>         this.numberOfColumns = numberOfColumns;
>>>         this.layoutType = layoutType;
>>>+        this.columnWidthes = columnWidthes;
>>>         eventListeners = new ArrayList();
>>>
>>>         columns = new TreeMap();
>>>@@ -142,9 +146,9 @@
>>>      * @param fragments Initial set of fragments to add to this layout.
>>>      * @throws LayoutEventException
>>>      */
>>>-    public ColumnLayout(int numberOfColumns, String layoutType,
>>
>>Collection fragments) throws LayoutEventException
>>
>>>+    public ColumnLayout(int numberOfColumns, String layoutType,
>>
>>Collection fragments, String[] columnWidthes) throws LayoutEventException
>>
>>>     {
>>>-        this(numberOfColumns, layoutType);
>>>+        this(numberOfColumns, layoutType, columnWidthes);
>>>         Iterator fragmentsItr = fragments.iterator();
>>>         try
>>>         {
>>>@@ -232,6 +236,61 @@
>>>     {
>>>         return
>>
>>Collections.unmodifiableCollection(getColumnMap(columnNumber).values());
>>
>>>     }
>>>+
>>>+    /**
>>>+     * returns the width to be used with the specified column.  If
>>>+     * there is no specific column setting sfor the specified column
>>>+     * 0 is returned.
>>>+     *
>>>+     * @param columnNumber whose width has been requested.
>>>+     * @return the width to be used with the specified column.  Or 0 if
>>
>>no value
>>
>>>+     * has been specified.
>>>+     */
>>>+    public int getColumnWidth(int columnNumber)
>>>+    {
>>>+        if (columnNumber < numberOfColumns)
>>>+        {
>>>+            String stringValue = columnWidthes[columnNumber];
>>>+            if (stringValue.endsWith("%"))
>>>+            {
>>>+                return Integer.parseInt(stringValue.substring(0,
>>
>>(stringValue.length() - 1)));
>>
>>>+            }
>>>+            else
>>>+            {
>>>+                return Integer.parseInt(stringValue);
>>>+            }
>>>+        }
>>>+        else
>>>+        {
>>>+            return 0;
>>>+        }
>>>+    }
>>>+
>>>+    /**
>>>+     * IE has a non-conformant box modle that takes into account both
>>
>>padding
>>
>>>+     * and margin settings.  You can use this method to return the
>>
>>column width
>>
>>>+     * reduced by the <code>reductionAmount</code> to prevent unwanted
>>>+     * scrolling/wrapping.
>>>+     *
>>>+     *
>>>+     * @param columnNumber whose width has been requested.  Will be
>>
>>reduced by
>>
>>>+     * the <code>reductionAmount</code> argument.
>>>+     * @param reductionAmount amount to subtract from the column's
>>
>>width setting
>>
>>>+     * @return column width reduced by the
>>
>><code>reductionAmount</code>.
>>
>>>+     */
>>>+    public int getSafeColumnWidth(int columnNumber, int
>>
>>reductionAmount)
>>
>>>+    {
>>>+        int columnWidth = getColumnWidth(columnNumber);
>>>+        if(columnWidth > 0)
>>>+        {
>>>+            return (columnWidth - reductionAmount);
>>>+        }
>>>+        else
>>>+        {
>>>+            return 0;
>>>+        }
>>>+
>>>+    }
>>>
>>>     /**
>>>      * @return <code>java.util.Collection</code> all of columns (also
>>>@@ -596,7 +655,7 @@
>>>         }
>>>         else
>>>         {
>>>-            throw new FragmentNotInLayoutException((fragment == null)?
>>
>>"null fragment": fragment.getId());
>>
>>>+            throw new FragmentNotInLayoutException(fragment);
>>>         }
>>>     }
>>>
>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
>>>For additional commands, e-mail: jetspeed-dev-help@portals.apache.org
>>>
>>>
>>>
>>>
>>>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
>>For additional commands, e-mail: jetspeed-dev-help@portals.apache.org
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-dev-help@portals.apache.org
> 
> 
> 
> 
> 



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


RE: svn commit: r233228 - /portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java

Posted by Scott T Weaver <sc...@binary-designs.net>.
That isn't a new class.  I don't know why it isn't there.  Probably
Subversion acting up again :(

-Scott

> -----Original Message-----
> From: Ate Douma [mailto:ate@douma.nu]
> Sent: Wednesday, August 17, 2005 3:41 PM
> To: Jetspeed Developers List
> Subject: Re: svn commit: r233228 - /portals/jetspeed-2/trunk/layout-
> portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java
> 
> Scott,
> 
> You need to commit your local update to FragmentNotInLayoutException as
> trunk currently is broken:
> 
>      [javac] Compiling 13 source files to D:\workspace\jetspeed-2\layout-
> portlets\target\classes
>      [javac] D:\workspace\jetspeed-2\layout-
> portlets\src\java\org\apache\jetspeed\portlets\layout\ColumnLayout.java:65
> 8:
> cannot find symbol
>      [javac] symbol  : constructor
> FragmentNotInLayoutException(org.apache.jetspeed.om.page.Fragment)
>      [javac] location: class
> org.apache.jetspeed.portlets.layout.FragmentNotInLayoutException
>      [javac]             throw new FragmentNotInLayoutException(fragment);
>      [javac]                   ^
>      [javac] Note: Some input files use unchecked or unsafe operations.
>      [javac] Note: Recompile with -Xlint:unchecked for details.
>      [javac] 1 error
> 
> weaver@apache.org wrote:
> > Author: weaver
> > Date: Wed Aug 17 11:13:08 2005
> > New Revision: 233228
> >
> > URL: http://svn.apache.org/viewcvs?rev=233228&view=rev
> > Log:
> > Column widths have been internalized into the ColumnLayout model object.
> >
> > Modified:
> >     portals/jetspeed-2/trunk/layout-
> portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java
> >
> > Modified: portals/jetspeed-2/trunk/layout-
> portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java
> > URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/layout-
> portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java?re
> v=233228&r1=233227&r2=233228&view=diff
> >
> ==========================================================================
> ====
> > --- portals/jetspeed-2/trunk/layout-
> portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java
> (original)
> > +++ portals/jetspeed-2/trunk/layout-
> portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java
> Wed Aug 17 11:13:08 2005
> > @@ -75,6 +75,9 @@
> >      /** SortedMap of Columns (which are also sorted maps */
> >      private final SortedMap columns;
> >
> > +    /** Width settings for eacah column */
> > +    private final String[] columnWidthes;
> > +
> >      /**
> >       * The type of layout this is, required for extract row/column
> properties
> >       * from a fragment.
> > @@ -88,7 +91,7 @@
> >      private final Map coordinates;
> >
> >      /** All of the LayoutEventListeners registered to this layout */
> > -    private final List eventListeners;
> > +    private final List eventListeners;
> >
> >      /**
> >       *
> > @@ -102,10 +105,11 @@
> >       *            formats without one format effecting the settings of
> another.
> >       * @see org.apache.jetspeed.om.page.Fragment#getType()
> >       */
> > -    public ColumnLayout(int numberOfColumns, String layoutType)
> > +    public ColumnLayout(int numberOfColumns, String layoutType,
> String[] columnWidthes)
> >      {
> >          this.numberOfColumns = numberOfColumns;
> >          this.layoutType = layoutType;
> > +        this.columnWidthes = columnWidthes;
> >          eventListeners = new ArrayList();
> >
> >          columns = new TreeMap();
> > @@ -142,9 +146,9 @@
> >       * @param fragments Initial set of fragments to add to this layout.
> >       * @throws LayoutEventException
> >       */
> > -    public ColumnLayout(int numberOfColumns, String layoutType,
> Collection fragments) throws LayoutEventException
> > +    public ColumnLayout(int numberOfColumns, String layoutType,
> Collection fragments, String[] columnWidthes) throws LayoutEventException
> >      {
> > -        this(numberOfColumns, layoutType);
> > +        this(numberOfColumns, layoutType, columnWidthes);
> >          Iterator fragmentsItr = fragments.iterator();
> >          try
> >          {
> > @@ -232,6 +236,61 @@
> >      {
> >          return
> Collections.unmodifiableCollection(getColumnMap(columnNumber).values());
> >      }
> > +
> > +    /**
> > +     * returns the width to be used with the specified column.  If
> > +     * there is no specific column setting sfor the specified column
> > +     * 0 is returned.
> > +     *
> > +     * @param columnNumber whose width has been requested.
> > +     * @return the width to be used with the specified column.  Or 0 if
> no value
> > +     * has been specified.
> > +     */
> > +    public int getColumnWidth(int columnNumber)
> > +    {
> > +        if (columnNumber < numberOfColumns)
> > +        {
> > +            String stringValue = columnWidthes[columnNumber];
> > +            if (stringValue.endsWith("%"))
> > +            {
> > +                return Integer.parseInt(stringValue.substring(0,
> (stringValue.length() - 1)));
> > +            }
> > +            else
> > +            {
> > +                return Integer.parseInt(stringValue);
> > +            }
> > +        }
> > +        else
> > +        {
> > +            return 0;
> > +        }
> > +    }
> > +
> > +    /**
> > +     * IE has a non-conformant box modle that takes into account both
> padding
> > +     * and margin settings.  You can use this method to return the
> column width
> > +     * reduced by the <code>reductionAmount</code> to prevent unwanted
> > +     * scrolling/wrapping.
> > +     *
> > +     *
> > +     * @param columnNumber whose width has been requested.  Will be
> reduced by
> > +     * the <code>reductionAmount</code> argument.
> > +     * @param reductionAmount amount to subtract from the column's
> width setting
> > +     * @return column width reduced by the
> <code>reductionAmount</code>.
> > +     */
> > +    public int getSafeColumnWidth(int columnNumber, int
> reductionAmount)
> > +    {
> > +        int columnWidth = getColumnWidth(columnNumber);
> > +        if(columnWidth > 0)
> > +        {
> > +            return (columnWidth - reductionAmount);
> > +        }
> > +        else
> > +        {
> > +            return 0;
> > +        }
> > +
> > +    }
> >
> >      /**
> >       * @return <code>java.util.Collection</code> all of columns (also
> > @@ -596,7 +655,7 @@
> >          }
> >          else
> >          {
> > -            throw new FragmentNotInLayoutException((fragment == null)?
> "null fragment": fragment.getId());
> > +            throw new FragmentNotInLayoutException(fragment);
> >          }
> >      }
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
> > For additional commands, e-mail: jetspeed-dev-help@portals.apache.org
> >
> >
> >
> >
> >
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-dev-help@portals.apache.org



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


Re: svn commit: r233228 - /portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java

Posted by Ate Douma <at...@douma.nu>.
Scott,

You need to commit your local update to FragmentNotInLayoutException as trunk currently is broken:

     [javac] Compiling 13 source files to D:\workspace\jetspeed-2\layout-portlets\target\classes
     [javac] D:\workspace\jetspeed-2\layout-portlets\src\java\org\apache\jetspeed\portlets\layout\ColumnLayout.java:658:
cannot find symbol
     [javac] symbol  : constructor FragmentNotInLayoutException(org.apache.jetspeed.om.page.Fragment)
     [javac] location: class org.apache.jetspeed.portlets.layout.FragmentNotInLayoutException
     [javac]             throw new FragmentNotInLayoutException(fragment);
     [javac]                   ^
     [javac] Note: Some input files use unchecked or unsafe operations.
     [javac] Note: Recompile with -Xlint:unchecked for details.
     [javac] 1 error

weaver@apache.org wrote:
> Author: weaver
> Date: Wed Aug 17 11:13:08 2005
> New Revision: 233228
> 
> URL: http://svn.apache.org/viewcvs?rev=233228&view=rev
> Log:
> Column widths have been internalized into the ColumnLayout model object.
> 
> Modified:
>     portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java
> 
> Modified: portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java
> URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java?rev=233228&r1=233227&r2=233228&view=diff
> ==============================================================================
> --- portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java (original)
> +++ portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java Wed Aug 17 11:13:08 2005
> @@ -75,6 +75,9 @@
>      /** SortedMap of Columns (which are also sorted maps */
>      private final SortedMap columns;
>      
> +    /** Width settings for eacah column */
> +    private final String[] columnWidthes;
> +    
>      /** 
>       * The type of layout this is, required for extract row/column properties
>       * from a fragment.
> @@ -88,7 +91,7 @@
>      private final Map coordinates;
>      
>      /** All of the LayoutEventListeners registered to this layout */
> -    private final List eventListeners;
> +    private final List eventListeners;    
>  
>      /**
>       * 
> @@ -102,10 +105,11 @@
>       *            formats without one format effecting the settings of another.
>       * @see org.apache.jetspeed.om.page.Fragment#getType()
>       */
> -    public ColumnLayout(int numberOfColumns, String layoutType)
> +    public ColumnLayout(int numberOfColumns, String layoutType, String[] columnWidthes)
>      {
>          this.numberOfColumns = numberOfColumns;
>          this.layoutType = layoutType;
> +        this.columnWidthes = columnWidthes;
>          eventListeners = new ArrayList();
>  
>          columns = new TreeMap();
> @@ -142,9 +146,9 @@
>       * @param fragments Initial set of fragments to add to this layout.
>       * @throws LayoutEventException
>       */
> -    public ColumnLayout(int numberOfColumns, String layoutType, Collection fragments) throws LayoutEventException
> +    public ColumnLayout(int numberOfColumns, String layoutType, Collection fragments, String[] columnWidthes) throws LayoutEventException
>      {
> -        this(numberOfColumns, layoutType);
> +        this(numberOfColumns, layoutType, columnWidthes);
>          Iterator fragmentsItr = fragments.iterator();
>          try
>          {
> @@ -232,6 +236,61 @@
>      {
>          return Collections.unmodifiableCollection(getColumnMap(columnNumber).values());
>      }
> +    
> +    /**
> +     * returns the width to be used with the specified column.  If
> +     * there is no specific column setting sfor the specified column
> +     * 0 is returned.
> +     * 
> +     * @param columnNumber whose width has been requested.
> +     * @return the width to be used with the specified column.  Or 0 if no value
> +     * has been specified.
> +     */
> +    public int getColumnWidth(int columnNumber)
> +    {
> +        if (columnNumber < numberOfColumns)
> +        {
> +            String stringValue = columnWidthes[columnNumber];
> +            if (stringValue.endsWith("%"))
> +            {
> +                return Integer.parseInt(stringValue.substring(0, (stringValue.length() - 1)));
> +            }
> +            else
> +            {
> +                return Integer.parseInt(stringValue);
> +            }
> +        }
> +        else
> +        {
> +            return 0;
> +        }
> +    }
> +    
> +    /**
> +     * IE has a non-conformant box modle that takes into account both padding
> +     * and margin settings.  You can use this method to return the column width
> +     * reduced by the <code>reductionAmount</code> to prevent unwanted 
> +     * scrolling/wrapping.
> +     *
> +     * 
> +     * @param columnNumber whose width has been requested.  Will be reduced by
> +     * the <code>reductionAmount</code> argument.
> +     * @param reductionAmount amount to subtract from the column's width setting
> +     * @return column width reduced by the <code>reductionAmount</code>.
> +     */
> +    public int getSafeColumnWidth(int columnNumber, int reductionAmount)
> +    {
> +        int columnWidth = getColumnWidth(columnNumber);
> +        if(columnWidth > 0)
> +        {
> +            return (columnWidth - reductionAmount);
> +        }
> +        else
> +        {
> +            return 0;
> +        }
> +    
> +    }
>  
>      /**
>       * @return <code>java.util.Collection</code> all of columns (also
> @@ -596,7 +655,7 @@
>          }
>          else
>          {
> -            throw new FragmentNotInLayoutException((fragment == null)? "null fragment": fragment.getId());
> +            throw new FragmentNotInLayoutException(fragment);
>          }
>      }
>  
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-dev-help@portals.apache.org
> 
> 
> 
> 
> 



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