edu.stanford.smi.protegex.owl.ui.metadatatab.prefixes
Class PrefixesTableModel

java.lang.Object
  extended byjavax.swing.table.AbstractTableModel
      extended byedu.stanford.smi.protegex.owl.ui.metadatatab.prefixes.PrefixesTableModel
All Implemented Interfaces:
edu.stanford.smi.protege.util.Disposable, Serializable, TableModel

public class PrefixesTableModel
extends AbstractTableModel
implements edu.stanford.smi.protege.util.Disposable

A TableModel for editing prefixes in an OWLModel. The resulting table has two columns, one for prefixes and one for the namespace.

Author:
Holger Knublauch
See Also:
Serialized Form

Field Summary
static int COL_COUNT
           
static int COL_NAMESPACE
           
static int COL_PREFIX
           
private  NamespaceManagerListener listener
           
private  OWLOntology ontology
           
private  List prefixes
          A list of prefixes (one String value for each row)
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
PrefixesTableModel(OWLOntology ontology)
           
 
Method Summary
 void dispose()
           
private  void fill()
           
 Class getColumnClass(int columnIndex)
           
 int getColumnCount()
           
 String getColumnName(int column)
           
 String getNamespace(int rowIndex)
           
(package private)  NamespaceManager getNamespaceManager()
           
 String getPrefix(int row)
           
(package private)  int getPrefixRow(String prefix)
           
 int getRowCount()
           
 Object getValueAt(int rowIndex, int columnIndex)
           
 boolean isCellEditable(int rowIndex, int columnIndex)
           
 boolean isNamespaceEditable(String namespace)
           
(package private)  boolean isPrefixEditable(String prefix)
           
private  void setNamespaceOfPrefix(String prefix, String value)
           
private  void setPrefixOfNamespace(String namespace, String value)
           
 void setValueAt(Object aValue, int rowIndex, int columnIndex)
           
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

listener

private NamespaceManagerListener listener

ontology

private OWLOntology ontology

COL_PREFIX

public static final int COL_PREFIX
See Also:
Constant Field Values

COL_NAMESPACE

public static final int COL_NAMESPACE
See Also:
Constant Field Values

COL_COUNT

public static final int COL_COUNT
See Also:
Constant Field Values

prefixes

private List prefixes
A list of prefixes (one String value for each row)

Constructor Detail

PrefixesTableModel

public PrefixesTableModel(OWLOntology ontology)
Method Detail

dispose

public void dispose()
Specified by:
dispose in interface edu.stanford.smi.protege.util.Disposable

fill

private void fill()

getColumnCount

public int getColumnCount()
Specified by:
getColumnCount in interface TableModel

getColumnClass

public Class getColumnClass(int columnIndex)
Specified by:
getColumnClass in interface TableModel

getColumnName

public String getColumnName(int column)
Specified by:
getColumnName in interface TableModel

getNamespace

public String getNamespace(int rowIndex)

getNamespaceManager

NamespaceManager getNamespaceManager()

getPrefix

public String getPrefix(int row)

getPrefixRow

int getPrefixRow(String prefix)

getRowCount

public int getRowCount()
Specified by:
getRowCount in interface TableModel

getValueAt

public Object getValueAt(int rowIndex,
                         int columnIndex)
Specified by:
getValueAt in interface TableModel

isCellEditable

public boolean isCellEditable(int rowIndex,
                              int columnIndex)
Specified by:
isCellEditable in interface TableModel

isNamespaceEditable

public boolean isNamespaceEditable(String namespace)

isPrefixEditable

boolean isPrefixEditable(String prefix)

setValueAt

public void setValueAt(Object aValue,
                       int rowIndex,
                       int columnIndex)
Specified by:
setValueAt in interface TableModel

setNamespaceOfPrefix

private void setNamespaceOfPrefix(String prefix,
                                  String value)

setPrefixOfNamespace

private void setPrefixOfNamespace(String namespace,
                                  String value)