com.cmpware.ide.views
Class EasyTable

java.lang.Object
  extended by org.eclipse.core.commands.common.EventManager
      extended by org.eclipse.ui.part.WorkbenchPart
          extended by org.eclipse.ui.part.ViewPart
              extended by com.cmpware.ide.views.EasyTable
All Implemented Interfaces:
IListener, org.eclipse.core.runtime.IAdaptable, org.eclipse.core.runtime.IExecutableExtension, org.eclipse.ui.IPersistable, org.eclipse.ui.IViewPart, org.eclipse.ui.IWorkbenchPart, org.eclipse.ui.IWorkbenchPart2, org.eclipse.ui.part.IWorkbenchPartOrientation
Direct Known Subclasses:
InstructionMixView, LinkView, PowerMeterView, ProfileView, RegisterView, SpecialRegisterView

public abstract class EasyTable
extends org.eclipse.ui.part.ViewPart
implements IListener

This class provides an easy interface for creating tables.

Copyright (c) 2004 Cmpware, Inc. All Rights Reserved.

Author:
SAG

Nested Class Summary
(package private)  class EasyTable.EasySelectionAdapter
          This selection adapter is used to provide the sorter for the columns.
static class EasyTable.NumericDisplayType
          This class contains definitions for the display types for the numeric values in the EasyTable.
(package private)  class EasyTable.ViewContentProvider
          This class provides the content for the Special Register table view.
(package private)  class EasyTable.ViewLabelProvider
          This class provides the labels for the Special Register table view.
 
Field Summary
static java.lang.String copyright
          Copyright string
protected  int displayType
          A general purpose display type flag
protected  boolean wordSwap
          Are words swapped for 64 bit?
 
Fields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE
 
Constructor Summary
EasyTable()
          The constructor
 
Method Summary
 void addAction(org.eclipse.jface.action.Action a)
          This method adds an action to the table View.
 void addColumn(EasyColumn c)
          This method adds data for a column to the column database.
 java.lang.Number changeableType(long l)
          This method returns an object of type Integer, HexInteger, Long, Float or Double depending on the display type.
 void createPartControl(org.eclipse.swt.widgets.Composite parent)
          Create the view
 int getDisplayType()
          This method returns the general purpose display type field.
abstract  java.lang.Object[][] getTable()
          This method returns a 2D array of Objects used to represent the table.
 void handleEvent(int eventType)
          This method is called upon receipt of an event.
 void setDisplayType(int displayType)
          This method sets the general purpose display type field.
 void setFocus()
          Passing the focus request to the viewer's control.
 void setHexadecimal(boolean b)
          Deprecated. Use setDisplayType().
 void sortOff()
          By default sorting is turned on for the Easy Table.
 void toggleWordSwap()
          This flag determines how 64-bit data are produced from consecutive 32-bit values.
 
Methods inherited from class org.eclipse.ui.part.ViewPart
checkSite, getViewSite, init, init, saveState, setContentDescription, setInitializationData, setPartName
 
Methods inherited from class org.eclipse.ui.part.WorkbenchPart
addPropertyListener, dispose, firePropertyChange, getAdapter, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener, setSite, setTitle, setTitleImage, setTitleToolTip, showBusy
 
Methods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.ui.IWorkbenchPart
addPropertyListener, dispose, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Field Detail

copyright

public static final java.lang.String copyright
Copyright string

See Also:
Constant Field Values

displayType

protected int displayType
A general purpose display type flag


wordSwap

protected boolean wordSwap
Are words swapped for 64 bit?

Constructor Detail

EasyTable

public EasyTable()
The constructor

Method Detail

createPartControl

public void createPartControl(org.eclipse.swt.widgets.Composite parent)
Create the view

Specified by:
createPartControl in interface org.eclipse.ui.IWorkbenchPart
Specified by:
createPartControl in class org.eclipse.ui.part.WorkbenchPart
Parameters:
parent - The parent SWT object

setFocus

public void setFocus()
Passing the focus request to the viewer's control.

Specified by:
setFocus in interface org.eclipse.ui.IWorkbenchPart
Specified by:
setFocus in class org.eclipse.ui.part.WorkbenchPart

handleEvent

public void handleEvent(int eventType)
Description copied from interface: IListener
This method is called upon receipt of an event.

Specified by:
handleEvent in interface IListener
Parameters:
eventType - a code giving the event type.

addColumn

public void addColumn(EasyColumn c)
This method adds data for a column to the column database. All column data must be added before the createPartControl() method is called.

Parameters:
c - The column data.

addAction

public void addAction(org.eclipse.jface.action.Action a)
This method adds an action to the table View. All actions must be added before the createPartControl() method is called.

Parameters:
a - The Action.

sortOff

public void sortOff()
By default sorting is turned on for the Easy Table. The method turns all sorting off.


setHexadecimal

public void setHexadecimal(boolean b)
Deprecated. Use setDisplayType().

This method controls the setting of hexadecimal display of integers for selected fields.

Parameters:
b - If this parameter is true, hexadecimal display is turned on. If this parameter is false, hexadecimal display is turned off.

setDisplayType

public void setDisplayType(int displayType)
This method sets the general purpose display type field.

Parameters:
displayType - the display type flag.

toggleWordSwap

public void toggleWordSwap()
This flag determines how 64-bit data are produced from consecutive 32-bit values. This is only used in LONG and DOUBLE data types.


getDisplayType

public int getDisplayType()
This method returns the general purpose display type field.

Returns:
This method returns the general purpose display type field.

changeableType

public java.lang.Number changeableType(long l)
This method returns an object of type Integer, HexInteger, Long, Float or Double depending on the display type. This is used for fields that change depending on the selected view. Note that many fields keep their type and don't respond to changes in the display type.

Parameters:
l - the value.
Returns:
This method returns an object of type Integer, HexInteger, Long, Float or Double depending on the display type.

getTable

public abstract java.lang.Object[][] getTable()
This method returns a 2D array of Objects used to represent the table. These objects should be Strings. This method should be overloaded by all classes extending the EasyTable.