<html>
<head>
<style>
P
{
margin:0px;
padding:0px
}
body
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body><FONT face=Helv size=2>
<FONT face="Courier New, Courier, Monospace">It seems "Rule" class doesn't store its parent "Package" information and Rule.<FONT face="">getPackage</FONT>() always returns null.</FONT><BR>
<FONT face="Courier New, Courier, Monospace">I would like to create an <FONT face="">AgendaFilter</FONT> based on package name but there is no way to get the parent package of each rule.</FONT><BR>
<FONT face="Courier New"></FONT> <BR>
<FONT face="Courier New">Thanks,</FONT><BR>
<FONT face="Courier New">Hooman</FONT><BR>
<BR>
<FONT face="Courier New, Courier, Monospace"></FONT> <BR>
<FONT face="Courier New, Courier, Monospace">public class <FONT face="">PackageNameAgendaFilter</FONT> implements AgendaFilter {</FONT><BR>
<FONT face="Courier New, Courier, Monospace"> private final String <FONT face="">packageSuffix</FONT>;</FONT><BR>
<FONT face="Courier New, Courier, Monospace"> private final boolean accept;</FONT><BR>
<FONT face="Courier New, Courier, Monospace"> </FONT><BR>
<FONT face="Courier New, Courier, Monospace"> public <FONT face="">PackageNameAgendaFilter</FONT>(String <FONT face="">packageSuffix</FONT>){</FONT><BR>
<FONT face="Courier New, Courier, Monospace"> this(<FONT face="">packageSuffix</FONT>, true);</FONT><BR>
<FONT face="Courier New, Courier, Monospace"> }</FONT><BR>
<FONT face="Courier New, Courier, Monospace"> </FONT><BR>
<FONT face="Courier New, Courier, Monospace"> public <FONT face="">PackageNameAgendaFilter</FONT>(String <FONT face="">packageSuffix</FONT>, boolean accept){</FONT><BR>
<FONT face="Courier New, Courier, Monospace"><FONT face=""> this.<FONT face="">packageSuffix</FONT></FONT> = <FONT face="">packageSuffix</FONT>;</FONT><BR>
<FONT face="Courier New, Courier, Monospace"><FONT face=""> this.accept</FONT> = accept;</FONT><BR>
<FONT face="Courier New, Courier, Monospace"> }</FONT><BR>
<FONT face="Courier New, Courier, Monospace"> </FONT><BR>
<FONT face="Courier New, Courier, Monospace"> public boolean accept(Activation activation) {</FONT><BR>
<FONT face="Courier New, Courier, Monospace"> if(<FONT face="">activation.getRule</FONT>().<FONT face="">getPackage</FONT>().<FONT face="">startsWith</FONT>(<FONT face="">packageSuffix</FONT>))</FONT><BR>
<FONT face="Courier New, Courier, Monospace"> return accept;</FONT><BR>
<FONT face="Courier New, Courier, Monospace"> else</FONT><BR>
<FONT face="Courier New, Courier, Monospace"> return false;</FONT><BR>
<FONT face="Courier New, Courier, Monospace"> }</FONT><BR>
<FONT face="Courier New, Courier, Monospace">}</FONT><BR></FONT><br /><hr />Discover the new Windows Vista <a href='http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE' target='_new'>Learn more!</a></body>
</html>