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:[EMAIL PROTECTED]
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:[EMAIL PROTECTED]
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
[EMAIL PROTECTED] 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]