DisplayPaperComments.java

Go to the documentation of this file.
00001 package cedar.hepdata.webapp.components;
00002 
00003 import org.apache.tapestry.MarkupWriter;
00004 import org.apache.tapestry.annotations.*;
00005 import cedar.hepdata.model.*;
00006 
00007 public class DisplayPaperComments {
00008 
00009     @BeginRender
00010     void renderMessage(MarkupWriter writer) {
00011 
00012         if(_dataset != null){
00013           _paper = _dataset.getPaper();
00014         }
00015 
00016         if(_yaxis != null){
00017           _dataset = _yaxis.getDataset();
00018           _paper = _dataset.getPaper();
00019         }
00020 
00021         if(_reaction != null){
00022           _yaxis = _reaction.getYAxis();
00023           _dataset = _yaxis.getDataset();
00024           _paper = _dataset.getPaper();
00025         }
00026 
00027         if ( _paper != null) {
00028             for (String comment : _paper.getComments()) {
00029                 writer.element("p");
00030                 writer.write(comment);
00031                 writer.end();
00032             }
00033         }
00034     }
00035 
00036     @Parameter(name="p")
00037     private Paper _paper;
00038 
00039     @Parameter(name="ds")
00040     private Dataset _dataset;
00041 
00042     @Parameter(name="yax")
00043     private YAxis _yaxis;
00044 
00045     @Parameter(name="re")
00046     private AxisReaction _reaction;
00047 
00048 }

Generated on Tue Apr 21 15:55:00 2009 for HepData Web servlets by  doxygen 1.5.5