package com.sun.solarisinstall.panels;

import java.applet.Applet;
import java.awt.*;

public class ReadOnlyTable extends Table {

    public ReadOnlyTable() { 
	super(); 
	setHeaderColors();
	viewportArea().setBackground(Color.lightGray);
	setColumnsResizable(false);
    }


    public ReadOnlyTable(int visibleRows) { 
	super(visibleRows); 
	setHeaderColors();
	viewportArea().setBackground(Color.lightGray);
	setColumnsResizable(false);
    }


    /*
     * Selects the specified row, and sends a selection event.
     */
    public synchronized void select(int index) {
    }


    /*
     * Selects the specified row, and optionally sends a selection event.
     */
    public void select(int index, boolean sendEvent) {
    }


    /*
     * Deselects the specified row.
     */
    public synchronized void deselect(int index) { }


    public synchronized void deselectAll() { }
	

    public synchronized boolean isSelected(int index) {
	return false;
    }


    public boolean allowsMultipleSelections() {
	return false;
    }


    public void setHeaderColors() {
	setHeaderColors (Color.white, Color.blue);
    }


    public void setHeaderColors(Color fg, Color bg) {
	this.headerArea().setForeground (fg);
	this.headerArea().setBackground (bg);
    }

    public void paint(Graphics g) {
      // end the annoying IllegalArgumentExceptions...
      try{
	super.paint(g);
      } catch(IllegalArgumentException e) {}
    }

}


