de.cau.cs.kieler.krep.evalbench.ui.editors
Class AssemblerEditor

java.lang.Object
  extended by org.eclipse.core.commands.common.EventManager
      extended by org.eclipse.ui.part.WorkbenchPart
          extended by org.eclipse.ui.part.EditorPart
              extended by de.cau.cs.kieler.krep.evalbench.ui.editors.AssemblerEditor
All Implemented Interfaces:
IAdaptable, IExecutableExtension, IEditorPart, ISaveablePart, IWorkbenchPart, IWorkbenchPart2, IWorkbenchPart3, IWorkbenchPartOrientation
Direct Known Subclasses:
KasmEditor, KitEditor

public abstract class AssemblerEditor
extends EditorPart

The basic editor for displaying assembler instructions in the evaluation bench. Subclasses of this abstract class must create a suitable implementation of the IAssembler

Rating yellow
(2010-03-09) review by msp, soh

Field Summary
 
Fields inherited from interface org.eclipse.ui.IEditorPart
PROP_DIRTY, PROP_INPUT
 
Fields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE
 
Constructor Summary
protected AssemblerEditor(IAssembler asm)
          Generate new editor which displays the given assembler.
 
Method Summary
 boolean canExecute(IConfig krp)
          Check whether the current program can be executed on this the given configuration.
 void createPartControl(Composite parent)
           
 void doSave(IProgressMonitor monitor)
           
 void doSaveAs()
           
 IAssembler getAssembler()
          Gets the program binary.
 LinkedList<Signal> getInputs()
          Gets the input signals.
 LinkedList<Signal> getOutputs()
          Gets the output signals.
abstract  String getProtocolType()
          Gets the protocol type suited for the current editor implementation.
 void init(IEditorSite site, IEditorInput input)
           
 boolean isDirty()
           
 boolean isSaveAsAllowed()
           
 void setFocus()
           
 void setSelectedRows(int[] adrs)
          Selects the rows with the given numbers in the embedded table.
 
Methods inherited from class org.eclipse.ui.part.EditorPart
checkSite, getEditorInput, getEditorSite, getTitleToolTip, isSaveOnCloseNeeded, setContentDescription, setInitializationData, setInput, setInputWithNotify, setPartName
 
Methods inherited from class org.eclipse.ui.part.WorkbenchPart
addPartPropertyListener, addPropertyListener, dispose, firePartPropertyChanged, firePropertyChange, getAdapter, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getPartProperties, getPartProperty, getSite, getTitle, getTitleImage, removePartPropertyListener, removePropertyListener, setPartProperty, 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, removePropertyListener
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Constructor Detail

AssemblerEditor

protected AssemblerEditor(IAssembler asm)
Generate new editor which displays the given assembler.

Parameters:
asm - the assembler used by this editor
Method Detail

getProtocolType

public abstract String getProtocolType()
Gets the protocol type suited for the current editor implementation. Subclasses must extend this and return one of the constants defined in ICommunicationProtocol.

Returns:
communication protocol identifier

init

public void init(IEditorSite site,
                 IEditorInput input)
          throws PartInitException
Specified by:
init in interface IEditorPart
Specified by:
init in class EditorPart
Throws:
PartInitException

createPartControl

public void createPartControl(Composite parent)
Specified by:
createPartControl in interface IWorkbenchPart
Specified by:
createPartControl in class WorkbenchPart

setSelectedRows

public final void setSelectedRows(int[] adrs)
Selects the rows with the given numbers in the embedded table.

Parameters:
adrs - instruction addresses to select

doSave

public void doSave(IProgressMonitor monitor)
Specified by:
doSave in interface ISaveablePart
Specified by:
doSave in class EditorPart

doSaveAs

public void doSaveAs()
Specified by:
doSaveAs in interface ISaveablePart
Specified by:
doSaveAs in class EditorPart

isDirty

public boolean isDirty()
Specified by:
isDirty in interface ISaveablePart
Specified by:
isDirty in class EditorPart

isSaveAsAllowed

public boolean isSaveAsAllowed()
Specified by:
isSaveAsAllowed in interface ISaveablePart
Specified by:
isSaveAsAllowed in class EditorPart

setFocus

public void setFocus()
Specified by:
setFocus in interface IWorkbenchPart
Specified by:
setFocus in class WorkbenchPart

getAssembler

public IAssembler getAssembler()
Gets the program binary.

Returns:
the program

getInputs

public LinkedList<Signal> getInputs()
Gets the input signals.

Returns:
the inputs

getOutputs

public LinkedList<Signal> getOutputs()
Gets the output signals.

Returns:
the outputs

canExecute

public boolean canExecute(IConfig krp)
Check whether the current program can be executed on this the given configuration. Should be accessed from the currently connected target.

Parameters:
krp - configuration of the current processor
Returns:
true if all constraints (e.g., number of signals) are fulfilled