001: /*
002: * GNetWatch
003: * Copyright 2006, 2007 Alexandre Fenyo
004: * gnetwatch@fenyo.net
005: *
006: * This file is part of GNetWatch.
007: *
008: * GNetWatch is free software; you can redistribute it and/or modify
009: * it under the terms of the GNU General Public License as published by
010: * the Free Software Foundation; either version 2 of the License, or
011: * (at your option) any later version.
012: *
013: * GNetWatch is distributed in the hope that it will be useful,
014: * but WITHOUT ANY WARRANTY; without even the implied warranty of
015: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
016: * GNU General Public License for more details.
017: *
018: * You should have received a copy of the GNU General Public License
019: * along with GNetWatch; if not, write to the Free Software
020: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
021: */
022:
023: package net.fenyo.gnetwatch.data;
024:
025: import net.fenyo.gnetwatch.*;
026: import net.fenyo.gnetwatch.GUI.*;
027: import net.fenyo.gnetwatch.targets.Target;
028:
029: import java.util.*;
030:
031: import org.apache.commons.logging.Log;
032: import org.apache.commons.logging.LogFactory;
033: import org.eclipse.swt.browser.Browser;
034:
035: /**
036: * This view is intended to display general informations.
037: * @author Alexandre Fenyo
038: * @version $Id: GeneralInformationsView.java,v 1.10 2007/03/03 00:38:20 fenyo Exp $
039: */
040:
041: public class GeneralInformationsView extends DataView {
042: private static Log log = LogFactory
043: .getLog(GeneralInformationsView.class);
044:
045: /**
046: * Constructor.
047: * @param gui current GUI instance.
048: * @param target ingress target interface.
049: */
050: // GUI thread
051: public GeneralInformationsView(final GUI gui, final Target target) {
052: // attention : instancier cette classe dans un sync(sync_tree)
053: super (gui, target);
054: }
055:
056: /**
057: * Creates a new display component.
058: * @param none.
059: * @return BasicComponent new display component.
060: */
061: protected BasicComponent createComponent() {
062: return null;
063: }
064:
065: /**
066: * Returns the name of report this view can generate.
067: * @param none.
068: * @return String report name.
069: */
070: protected String browserName() {
071: return getGUI().getConfig().getString("general");
072: }
073:
074: /**
075: * Returns the data unit for values this view can generate.
076: * @param none.
077: * @return String data unit.
078: */
079: protected String browserUnit() {
080: return getGUI().getConfig().getString("byte") + "/s";
081: }
082:
083: /**
084: * Returns the event class this view can manage.
085: * @param none.
086: * @return Class event class.
087: */
088: protected Class browserEventClass() {
089: return null;
090: }
091:
092: /**
093: * Returns a report as an HTML string.
094: * @param none.
095: * @return StringBull HTML report.
096: */
097: protected StringBuffer getBrowserContent() {
098: return super.getBrowserContent();
099: }
100: }
|