<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>&nbsp;<BR>
<FONT face="Courier New">Thanks,</FONT><BR>
<FONT face="Courier New">Hooman</FONT><BR>
&nbsp;<BR>
<FONT face="Courier New, Courier, Monospace"></FONT>&nbsp;<BR>
<FONT face="Courier New, Courier, Monospace">public class <FONT face="">PackageNameAgendaFilter</FONT> implements AgendaFilter {</FONT><BR>
<FONT face="Courier New, Courier, Monospace">&nbsp;&nbsp; private final String <FONT face="">packageSuffix</FONT>;</FONT><BR>
<FONT face="Courier New, Courier, Monospace">&nbsp;&nbsp; private final boolean accept;</FONT><BR>
<FONT face="Courier New, Courier, Monospace">&nbsp;&nbsp; </FONT><BR>
<FONT face="Courier New, Courier, Monospace">&nbsp;&nbsp; public <FONT face="">PackageNameAgendaFilter</FONT>(String <FONT face="">packageSuffix</FONT>){</FONT><BR>
<FONT face="Courier New, Courier, Monospace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this(<FONT face="">packageSuffix</FONT>, true);</FONT><BR>
<FONT face="Courier New, Courier, Monospace">&nbsp;&nbsp; }</FONT><BR>
<FONT face="Courier New, Courier, Monospace">&nbsp;&nbsp; </FONT><BR>
<FONT face="Courier New, Courier, Monospace">&nbsp;&nbsp; public <FONT face="">PackageNameAgendaFilter</FONT>(String <FONT face="">packageSuffix</FONT>, boolean accept){</FONT><BR>
<FONT face="Courier New, Courier, Monospace"><FONT face="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.<FONT face="">packageSuffix</FONT></FONT> = <FONT face="">packageSuffix</FONT>;</FONT><BR>
<FONT face="Courier New, Courier, Monospace"><FONT face="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.accept</FONT> = accept;</FONT><BR>
<FONT face="Courier New, Courier, Monospace">&nbsp;&nbsp; }</FONT><BR>
<FONT face="Courier New, Courier, Monospace">&nbsp;&nbsp;&nbsp;</FONT><BR>
<FONT face="Courier New, Courier, Monospace">&nbsp;&nbsp; public boolean accept(Activation activation) {</FONT><BR>
<FONT face="Courier New, Courier, Monospace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return accept;</FONT><BR>
<FONT face="Courier New, Courier, Monospace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else</FONT><BR>
<FONT face="Courier New, Courier, Monospace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return false;</FONT><BR>
<FONT face="Courier New, Courier, Monospace">&nbsp;&nbsp;&nbsp;}</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>