com.cmpware.ide.views
Class EasyText

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.EasyText
All Implemented Interfaces:
IListener, java.util.EventListener, org.eclipse.core.runtime.IAdaptable, org.eclipse.core.runtime.IExecutableExtension, org.eclipse.swt.events.ControlListener, org.eclipse.swt.events.SelectionListener, org.eclipse.swt.internal.SWTEventListener, org.eclipse.ui.IPersistable, org.eclipse.ui.IViewPart, org.eclipse.ui.IWorkbenchPart, org.eclipse.ui.IWorkbenchPart2, org.eclipse.ui.part.IWorkbenchPartOrientation
Direct Known Subclasses:
DasmView, HexDumpView

public class EasyText
extends org.eclipse.ui.part.ViewPart
implements IListener, org.eclipse.swt.events.ControlListener, org.eclipse.swt.events.SelectionListener

This describes the Easy Text interface.

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

Author:
SAG

Field Summary
static java.lang.String copyright
          Copyright string
protected  int currentLine
          The current line
protected  org.eclipse.swt.graphics.Font font
          The font
protected  org.eclipse.swt.widgets.Composite parent
          The parent widget
protected  org.eclipse.swt.custom.StyledText text
          The Styled Text Widget
 
Fields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE
 
Constructor Summary
EasyText()
           
 
Method Summary
 void addAction(org.eclipse.jface.action.Action a)
          This method adds an action to the text View.
 void controlMoved(org.eclipse.swt.events.ControlEvent e)
           
 void controlResized(org.eclipse.swt.events.ControlEvent e)
           
 void createPartControl(org.eclipse.swt.widgets.Composite parent)
           
 void dispose()
           
 void handleEvent(int eventType)
          This method is called upon receipt of an event.
 void resize()
          This should be called whenever the size of the window or the content changes.
 void setFocus()
           
 void setFont(java.lang.String name, int points, int type)
          This method sets the font characteristics.
 void setTextColor(org.eclipse.swt.graphics.RGB textRGB)
          This method sets the text color.
 void setTextProvider(ITextProvider textProvider)
          This method sets the Easy Text Model for this class.
 void widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent e)
           
 void widgetSelected(org.eclipse.swt.events.SelectionEvent e)
           
 
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, 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, 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

parent

protected org.eclipse.swt.widgets.Composite parent
The parent widget


text

protected org.eclipse.swt.custom.StyledText text
The Styled Text Widget


currentLine

protected int currentLine
The current line


font

protected org.eclipse.swt.graphics.Font font
The font

Constructor Detail

EasyText

public EasyText()
Method Detail

createPartControl

public void createPartControl(org.eclipse.swt.widgets.Composite parent)
Specified by:
createPartControl in interface org.eclipse.ui.IWorkbenchPart
Specified by:
createPartControl in class org.eclipse.ui.part.WorkbenchPart

dispose

public void dispose()
Specified by:
dispose in interface org.eclipse.ui.IWorkbenchPart
Overrides:
dispose in class org.eclipse.ui.part.WorkbenchPart

setTextProvider

public void setTextProvider(ITextProvider textProvider)
This method sets the Easy Text Model for this class.

Parameters:
textProvider - The Easy Text provider for this class.

addAction

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

Parameters:
a - The Action.

setTextColor

public void setTextColor(org.eclipse.swt.graphics.RGB textRGB)
This method sets the text color. It must be called before createPartControl and is typically done in the constructor of an EasyText subclass.

Parameters:
textRGB - The text color.

setFont

public void setFont(java.lang.String name,
                    int points,
                    int type)
This method sets the font characteristics. It must be called before createPartControl and is typically done in the constructor of an EasyText subclass.

Parameters:
name - The font name (i.e. "Courier")
points - The font size in points.
type - The font type (SWT.NORMAL, SWT.BOLD, SWT.ITALIC)

resize

public void resize()
This should be called whenever the size of the window or the content changes.


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.

setFocus

public void setFocus()
Specified by:
setFocus in interface org.eclipse.ui.IWorkbenchPart
Specified by:
setFocus in class org.eclipse.ui.part.WorkbenchPart

widgetSelected

public void widgetSelected(org.eclipse.swt.events.SelectionEvent e)
Specified by:
widgetSelected in interface org.eclipse.swt.events.SelectionListener

widgetDefaultSelected

public void widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent e)
Specified by:
widgetDefaultSelected in interface org.eclipse.swt.events.SelectionListener

controlMoved

public void controlMoved(org.eclipse.swt.events.ControlEvent e)
Specified by:
controlMoved in interface org.eclipse.swt.events.ControlListener

controlResized

public void controlResized(org.eclipse.swt.events.ControlEvent e)
Specified by:
controlResized in interface org.eclipse.swt.events.ControlListener