minor bug fix cleanup to give the SIG menu links the same style as other

left menu links
This commit is contained in:
Eric J. Bowersox 2001-11-01 22:30:09 +00:00
parent 7bc0584cfd
commit bf040973ba

View File

@ -25,12 +25,22 @@ import com.silverwrist.venice.core.*;
public class MenuSIG implements ComponentRender, ColorSelectors
{
private String image_url;
private boolean image_url_needs_fixup = false;
private String title;
private List items_list;
private int sigid;
private boolean show_unjoin;
/*--------------------------------------------------------------------------------
* Attributes
*--------------------------------------------------------------------------------
*/
private String image_url; // path to actual image
private boolean image_url_needs_fixup = false; // do we need to fix image path up?
private String title; // title for menu
private List items_list; // list of menu items
private int sigid; // SIG ID
private boolean show_unjoin; // show the "Unjoin" menu choice?
/*--------------------------------------------------------------------------------
* Constructor
*--------------------------------------------------------------------------------
*/
public MenuSIG(SIGContext ctxt)
{
@ -59,15 +69,14 @@ public class MenuSIG implements ComponentRender, ColorSelectors
} // end constructor
public int getID()
{
return sigid;
} // end getID
/*--------------------------------------------------------------------------------
* Implementations from interface ComponentRender
*--------------------------------------------------------------------------------
*/
public void renderHere(Writer out, RenderData rdat) throws IOException
{
String hilite = "<FONT COLOR=\"" + rdat.getStdColor(LEFT_LINK) + "\">";
String hilite = rdat.getStdFontTag(LEFT_LINK,2);
if (image_url!=null)
{ // display the image by URL
if (image_url_needs_fixup)
@ -86,21 +95,34 @@ public class MenuSIG implements ComponentRender, ColorSelectors
// display the menu items
Iterator it = items_list.iterator();
String sigparm = "sig=" + sigid;
while (it.hasNext())
{ // display each menu item in turn
SIGFeature ftr = (SIGFeature)(it.next());
out.write("<BR>\n<A HREF=\"" + rdat.getEncodedServletPath(ftr.getApplet() + "?sig="
+ String.valueOf(sigid)));
out.write("\">" + hilite + StringUtil.encodeHTML(ftr.getName()) + "</FONT></A>\n");
out.write("<BR>\n<A CLASS=\"lbar\" HREF=\""
+ rdat.getEncodedServletPath(ftr.getApplet() + "?" + sigparm) + "\">" + hilite
+ StringUtil.encodeHTML(ftr.getName()) + "</FONT></A>\n");
} // end while
if (show_unjoin)
out.write("<P>\n<A HREF=\"" + rdat.getEncodedServletPath("sigops?cmd=U&sig=" + String.valueOf(sigid))
+ "\">" + hilite + "Unjoin</FONT></A>\n");
out.write("<P>\n<A CLASS=\"lbar\" HREF=\""
+ rdat.getEncodedServletPath("sigops?cmd=U&" + sigparm) + "\">"
+ hilite + "Unjoin</FONT></A>\n");
out.write("\n"); // all done...
} // end renderHere
/*--------------------------------------------------------------------------------
* External operations
*--------------------------------------------------------------------------------
*/
public int getID()
{
return sigid;
} // end getID
} // end class MenuTop