| [aspectj-users] AJDT 1.3 Issue already or is just me |
/*
* Created on Sep 7, 2005
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Generation - Code and Comments
*/
package com.tascon.tim.sofia.aop;
import java.io.IOException;
import com.salmonllc.jsp.JspTableCell;
import com.salmonllc.jsp.JspTableRow;
import com.salmonllc.sql.DataStoreBuffer;
import com.salmonllc.sql.DataStoreEvaluator;
import com.salmonllc.sql.DataStoreExpression
;
import com.tascon.tim.sofia.util.SofiaUtil;
public aspect SofiaJspTableRow {
public DataStoreEvaluator JspTableRow._dsEval = null;
public JspTableRow JspTableRow._otherRow = null;
public boolean JspTableRow.flipLogic = false;
/**
* Use this method to bind this component to an _expression_ in a DataStore
* @param ds The DataStore to bind to.
* @param _expression_ The _expression_ to bind to.
* @see DataStoreEvaluator
*/
public void JspTableRow.setExpression(DataStoreBuffer ds, DataStoreExpression _expression_) throws Exception {
this._dsEval = new DataStoreEvaluator(ds, _expression_);
}
/**
* Use this method to bind this component to an _expression_ in a DataStore
* @param ds The DataStore to bind to.
* @param _expression_ The _expression_ to bind to.
* @param
* @see DataStoreEvaluator
*/
public void JspTableRow.setExpression(DataStoreBuffer ds, DataStoreExpression _expression_, JspTableRow row) throws Exception {
this._dsEval = new DataStoreEvaluator(ds, _expression_);
this._otherRow = row;
}
/**
* Use this method to bind this component to an _expression_ in a DataStore
* @param ds The DataStore to bind to.
* @param _expression_ The _expression_ to bind to.
* @param
* @param
* @see DataStoreEvaluator
*/
public void JspTableRow.setExpression(DataStoreBuffer ds, DataStoreExpression _expression_, JspTableRow row, boolean flip) throws Exception {
this._dsEval = new DataStoreEvaluator(ds, _expression_);
this._otherRow = row;
this.flipLogic = flip;
}
pointcut generateHtml(JspTableRow row) :
execution(public void JspTableRow.generateHTML(..))
&& target(row);
void around(JspTableRow row) throws IOException : generateHtml(row)
{
// no sense processing if the row is not visible
if (row._dsEval != null && row.getVisible())
{
try
{
if (row._otherRow != null && row.flipLogic)
{
// Check the other to see if this should be enabled.
Boolean visibile = (Boolean)row._otherRow._dsEval.evaluateRow();
System.out.println("visibile: " + visibile);
SofiaUtil.enableOrDisableMe(row, !visibile.booleanValue());
}
else
{
Boolean visibile = (Boolean)row._dsEval.evaluateRow();
System.out.println("visibile: " + visibile);
// Enable or disable this appropriately
SofiaUtil.enableOrDisableMe(row,
visibile.booleanValue());
// Re-enable the other row is this one is to be visible.
if (row._otherRow != null && visibile.booleanValue())
{
SofiaUtil.enableOrDisableMe(row._otherRow,
visibile.booleanValue());
}
}
}
catch(Exception e)
{
}
}
// Now generate the HTML is appropriate
if (row.getVisible())
{
proceed(row);
}
}
}
Now I am weaving this into an external JAR file then dropping it into the classes folder of my web app.
Thanks and I hope it just me!
Ron