org.fopps.ui.log
Class LogListModel

java.lang.Object
  |
  +--javax.swing.AbstractListModel
        |
        +--javax.swing.DefaultListModel
              |
              +--org.fopps.ui.log.LogListModel
All Implemented Interfaces:
javax.swing.ListModel, java.io.Serializable
Direct Known Subclasses:
CompileLogModel

public class LogListModel
extends javax.swing.DefaultListModel

LogListModel is a specialized model for the log dialog. It provides methods to add different kinds of messages (info, warning, error).

Author:
Oliver Wieland
See Also:
LogDialog, Serialized Form

Nested Class Summary
 class LogListModel.MessageEntry
          Wrapper class for message entries
 
Field Summary
static int ERROR
          Value for error messages
static int INFORMATION
          Value for information messages
static int WARNING
          Value for warning messages
 
Fields inherited from class javax.swing.AbstractListModel
listenerList
 
Constructor Summary
LogListModel()
          Creates an empty log list model
 
Method Summary
 void addErrorMessage(java.lang.String pMessage)
          Adds an error message to the list
 void addInfoMessage(java.lang.String pMessage)
          Adds an information message to the list
 void addWarningMessage(java.lang.String pMessage)
          Adds a warning message to the list
 void clearMessages()
          Removes all messages from the list
 java.lang.Object getElementAt(int index)
          Returns the value at the specified index.
 int getErrors()
          Returns the number of error in the list
 int getSize()
          Returns the length of the list.
 int getWarnings()
          Returns the number of warnings in the list
 
Methods inherited from class javax.swing.DefaultListModel
add, addElement, capacity, clear, contains, copyInto, elementAt, elements, ensureCapacity, firstElement, get, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, removeAllElements, removeElement, removeElementAt, removeRange, set, setElementAt, setSize, size, toArray, toString, trimToSize
 
Methods inherited from class javax.swing.AbstractListModel
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

INFORMATION

public static final int INFORMATION
Value for information messages

See Also:
Constant Field Values

WARNING

public static final int WARNING
Value for warning messages

See Also:
Constant Field Values

ERROR

public static final int ERROR
Value for error messages

See Also:
Constant Field Values
Constructor Detail

LogListModel

public LogListModel()
Creates an empty log list model

Method Detail

addInfoMessage

public void addInfoMessage(java.lang.String pMessage)
Adds an information message to the list

Parameters:
pMessage - Message to insert

addWarningMessage

public void addWarningMessage(java.lang.String pMessage)
Adds a warning message to the list

Parameters:
pMessage - Message to insert

addErrorMessage

public void addErrorMessage(java.lang.String pMessage)
Adds an error message to the list

Parameters:
pMessage - Message to insert

getWarnings

public int getWarnings()
Returns the number of warnings in the list


getErrors

public int getErrors()
Returns the number of error in the list


clearMessages

public void clearMessages()
Removes all messages from the list


getSize

public int getSize()
Returns the length of the list.

Specified by:
getSize in interface javax.swing.ListModel
Overrides:
getSize in class javax.swing.DefaultListModel
Returns:
the length of the list

getElementAt

public java.lang.Object getElementAt(int index)
Returns the value at the specified index.

Specified by:
getElementAt in interface javax.swing.ListModel
Overrides:
getElementAt in class javax.swing.DefaultListModel
Parameters:
index - the requested index
Returns:
the value at index


Fopps 0.19 - Copyright © 2002 Oliver Wieland. All Rights Reserved.