Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: nectar/view/DocumentationView.java


1   /*
2       Copyright (C) 2003  Kai Schutte
3   
4       This program is free software; you can redistribute it and/or modify
5       it under the terms of the GNU General Public License as published by
6       the Free Software Foundation; either version 2 of the License, or
7       (at your option) any later version.
8   
9       This program is distributed in the hope that it will be useful,
10      but WITHOUT ANY WARRANTY; without even the implied warranty of
11      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12      GNU General Public License for more details.
13  
14      You should have received a copy of the GNU General Public License
15      along with this program; if not, write to the Free Software
16      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
17   
18   * DocumentationView.java
19   *
20   * Created on March 28, 2003, 7:04 PM
21   */
22  
23  package nectar.view;
24  import nectar.record.RecordInvalidInputException;
25  import nectar.record.DocumentationRecord;
26  /**
27   *
28   * @author  Kai Schutte skander@skander.com
29   */
30  public class DocumentationView extends RecordView {
31      
32      /** Creates a new instance of DocumentationView */
33      public DocumentationView(DocumentationRecord record) {
34          super(record);
35      }
36      
37      public String getTitle() {
38          String s = ((DocumentationRecord)record).getTitle();
39          if (s == null)
40              return new String();
41          else
42              return s;
43      }
44      
45      public String getContent() {
46          String s = ((DocumentationRecord)record).getContent();
47          if (s == null)
48              return new String();
49          else {
50              return s;
51          }
52      }
53      
54      public String getContentExtract() {
55          try {
56              return nectar.services.StringTools.word_trim(nectar.services.StringTools.strip_tags(getContent(), null), 300);
57          } catch (Exception e) {
58              e.printStackTrace();
59              return "";
60          }
61      }
62  }