001: /*
002: * Copyright (C) 2005 - 2008 JasperSoft Corporation. All rights reserved.
003: * http://www.jaspersoft.com.
004: *
005: * Unless you have purchased a commercial license agreement from JasperSoft,
006: * the following license terms apply:
007: *
008: * This program is free software; you can redistribute it and/or modify
009: * it under the terms of the GNU General Public License version 2 as published by
010: * the Free Software Foundation.
011: *
012: * This program is distributed WITHOUT ANY WARRANTY; and without the
013: * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
014: * See the GNU General Public License for more details.
015: *
016: * You should have received a copy of the GNU General Public License
017: * along with this program; if not, see http://www.gnu.org/licenses/gpl.txt
018: * or write to:
019: *
020: * Free Software Foundation, Inc.,
021: * 59 Temple Place - Suite 330,
022: * Boston, MA USA 02111-1307
023: *
024: *
025: *
026: *
027: * DocumentTreeEntry.java
028: *
029: * Created on 1 giugno 2003, 0.43
030: *
031: */
032:
033: package it.businesslogic.ireport;
034:
035: import it.businesslogic.ireport.gui.*;
036:
037: /**
038: *
039: * @author Administrator
040: */
041: public class DocumentTreeEntry {
042:
043: private JReportFrame jrf;
044: private String filename; // used only if the report is closed (jrf == null)
045:
046: /** Creates a new instance of DocumentTreeEntry */
047: public DocumentTreeEntry(JReportFrame jrf, String filename) {
048: this .jrf = jrf;
049: this .filename = filename;
050: }
051:
052: public String toString() {
053: if (filename == null && jrf == null)
054: return "Unknow doc";
055:
056: if (jrf == null) {
057: java.io.File file = new java.io.File(filename);
058: return file.getName();
059: }
060:
061: if (jrf.getReport().getFilename() == null
062: || jrf.getReport().getFilename().equals(""))
063: return "[" + jrf.getReport().getName() + "]";
064: else {
065: java.io.File file = new java.io.File(jrf.getReport()
066: .getFilename());
067: return file.getName();
068: }
069: }
070:
071: /** Getter for property filename.
072: * @return Value of property filename.
073: *
074: */
075: public java.lang.String getFilename() {
076: return filename;
077: }
078:
079: /** Setter for property filename.
080: * @param filename New value of property filename.
081: *
082: */
083: public void setFilename(java.lang.String filename) {
084: this .filename = filename;
085: }
086:
087: /** Getter for property jrf.
088: * @return Value of property jrf.
089: *
090: */
091: public it.businesslogic.ireport.gui.JReportFrame getJrf() {
092: return jrf;
093: }
094:
095: /** Setter for property jrf.
096: * @param jrf New value of property jrf.
097: *
098: */
099: public void setJrf(it.businesslogic.ireport.gui.JReportFrame jrf) {
100: this.jrf = jrf;
101: }
102:
103: }
|