001    // This file is part of the Attempto Java Packages.
002    // Copyright 2008-2009, Attempto Group, University of Zurich (see http://attempto.ifi.uzh.ch).
003    //
004    // The Attempto Java Packages is free software: you can redistribute it and/or modify it under the
005    // terms of the GNU Lesser General Public License as published by the Free Software Foundation,
006    // either version 3 of the License, or (at your option) any later version.
007    //
008    // The Attempto Java Packages is distributed in the hope that it will be useful, but WITHOUT ANY
009    // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
010    // PURPOSE. See the GNU Lesser General Public License for more details.
011    //
012    // You should have received a copy of the GNU Lesser General Public License along with the Attempto
013    // Java Packages. If not, see http://www.gnu.org/licenses/.
014    
015    package ch.uzh.ifi.attempto.acewiki.gui.page;
016    
017    import nextapp.echo2.app.event.ActionEvent;
018    import ch.uzh.ifi.attempto.acewiki.Wiki;
019    import ch.uzh.ifi.attempto.acewiki.core.ontology.OntologyElement;
020    import ch.uzh.ifi.attempto.acewiki.core.ontology.Role;
021    
022    /**
023     * This class stands for an article page showing the article of a role. Roles are represented by
024     * verbs, of-constructs, or transitive adjectives.
025     * 
026     * @author Tobias Kuhn
027     */
028    public class RolePage extends ArticlePage {
029            
030            private static final long serialVersionUID = -7034483028750537141L;
031            
032            private Role role;
033            
034            /**
035             * Creates a new article page for a role.
036             * 
037             * @param role The role.
038             * @param wiki The wiki instance.
039             */
040            public RolePage(Role role, Wiki wiki) {
041                    super(wiki, role);
042                    this.role = role;
043            }
044            
045            public OntologyElement getOntologyElement() {
046                    return role;
047            }
048    
049            public void actionPerformed(ActionEvent e) {
050                    super.actionPerformed(e);
051            }
052            
053            protected void doUpdate() {
054                    super.doUpdate();
055                    
056                    getTitle().setText(role.getHeadword());
057            }
058    
059    }