001    /*
002      Copyright (C) 2002-2003 Renaud Pawlak <renaud@aopsys.com>
003      
004      This program is free software; you can redistribute it and/or modify
005      it under the terms of the GNU Lesser General Public License as
006      published by the Free Software Foundation; either version 2 of the
007      License, or (at your option) any later version.
008    
009      This program is distributed in the hope that it will be useful,
010      but WITHOUT ANY WARRANTY; without even the implied warranty of
011      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
012      GNU Lesser General Public License for more details.
013    
014      You should have received a copy of the GNU Lesser General Public License
015      along with this program; if not, write to the Free Software
016      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
017    
018    package org.objectweb.jac.aspects.gui.web;
019    
020    import java.io.PrintWriter;
021    import org.objectweb.jac.aspects.gui.*;
022    import org.objectweb.jac.core.rtti.MethodItem;
023    import org.objectweb.jac.util.ExtArrays;
024    
025    public class StatusBar extends AbstractView implements StatusView, HTMLViewer {
026    
027        MethodItem method = null;
028    
029        public StatusBar(ViewFactory factory, DisplayContext context,MethodItem method) {
030            super(factory,context);
031            this.method = method;
032        }
033    
034        // StatusView interface
035    
036        String position;
037       
038        /**
039         * Get the value of position.
040         * @return value of position.
041         */
042        public String getPosition() {
043            return position;
044        }
045       
046        /**
047         * Set the value of position.
048         * @param v  Value to assign to position.
049         */
050        public void setPosition(String  v) {
051            this.position = v;
052        }
053    
054        public void showMessage(String message) {
055        }
056    
057        // HTMLViewer interface
058    
059        public void genHTML(PrintWriter out) {
060            if (method!=null) {
061                out.println("<div class=\"statusBar\">");
062                out.println(method.invoke(null,ExtArrays.emptyObjectArray));
063                out.println("</div>");
064            }
065        }
066    
067    }