public class RevisionComparePresenter
extends java.lang.Object
implements java.awt.event.ItemListener, javax.swing.event.ChangeListener, java.awt.event.ActionListener
Modifier and Type | Class and Description |
---|---|
private static class |
RevisionComparePresenter.DefaultFileHandler
does not try to load the file but only return null
|
static interface |
RevisionComparePresenter.FileHandler
This interface is used by the RevisionComparePresenter to handle the file loading.
|
private static class |
RevisionComparePresenter.MockFormula
Mock formula used for functional test.
|
private static class |
RevisionComparePresenter.MockOperator
Mock revision operator for functional test.
|
Modifier and Type | Field and Description |
---|---|
private RevisionComparePresenter.FileHandler |
fileHandler
the default file handler cannot load any files and has to be replaced
|
private RevisionCompareModel |
model
the data model for the revision compare
|
private RevisionCompareView |
view
the view showing the revision compare
|
Constructor and Description |
---|
RevisionComparePresenter(RevisionCompareModel model,
RevisionCompareView view)
Default Ctor: registers the view as listener to the correct model.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent ev) |
void |
itemStateChanged(java.awt.event.ItemEvent ev) |
static void |
main(java.lang.String[] args)
Functional Test method: Only shows the view in a JFrame to test resize behavior.
|
private void |
registerAsViewListener()
Helper method: Registers the presenter as swing listener at the view components.
|
void |
setFileHandler(RevisionComparePresenter.FileHandler handler)
Sets a file handler which is responsible to filter the open file dialog and to load
the selected file.
|
void |
stateChanged(javax.swing.event.ChangeEvent ev) |
private RevisionCompareModel model
private RevisionCompareView view
private RevisionComparePresenter.FileHandler fileHandler
public RevisionComparePresenter(RevisionCompareModel model, RevisionCompareView view)
public void setFileHandler(RevisionComparePresenter.FileHandler handler)
handler
- An implementation of the FileHandler interface or null. If null is given
then the default handler is used which cannot open any files.private void registerAsViewListener()
public void actionPerformed(java.awt.event.ActionEvent ev)
actionPerformed
in interface java.awt.event.ActionListener
public void stateChanged(javax.swing.event.ChangeEvent ev)
stateChanged
in interface javax.swing.event.ChangeListener
public void itemStateChanged(java.awt.event.ItemEvent ev)
itemStateChanged
in interface java.awt.event.ItemListener
public static void main(java.lang.String[] args)