Revision 5ba148ae
Added by Andreas Kohlbecker almost 7 years ago
src/main/java/eu/etaxonomy/vaadin/mvp/AbstractPresenter.java | ||
---|---|---|
5 | 5 |
import org.apache.log4j.Logger; |
6 | 6 |
import org.springframework.beans.factory.annotation.Autowired; |
7 | 7 |
import org.springframework.beans.factory.annotation.Qualifier; |
8 |
import org.springframework.transaction.TransactionStatus; |
|
8 | 9 |
|
9 | 10 |
import com.vaadin.spring.annotation.SpringComponent; |
10 | 11 |
import com.vaadin.spring.annotation.ViewScope; |
... | ... | |
75 | 76 |
logger.trace("Presenter ready"); |
76 | 77 |
} |
77 | 78 |
|
79 |
public final void onViewEnter() { |
|
80 |
logger.trace("View entered"); |
|
81 |
TransactionStatus tx = getRepo().startTransaction(); |
|
82 |
handleViewEntered(); |
|
83 |
getRepo().commitTransaction(tx); |
|
84 |
} |
|
85 |
|
|
86 |
public final void onViewExit() { |
|
87 |
handleViewExit(); |
|
88 |
} |
|
89 |
|
|
78 | 90 |
/** |
79 | 91 |
* Extending classes should overwrite this method to react to the event when |
80 | 92 |
* user has navigated into the view that this presenter governs. |
81 | 93 |
*/ |
82 |
public void onViewEnter() { |
|
83 |
logger.trace("View entered"); |
|
94 |
public void handleViewEntered() { |
|
84 | 95 |
} |
85 | 96 |
|
86 |
public void onViewExit() { |
|
87 |
|
|
88 |
} |
|
97 |
/** |
|
98 |
* Extending classes may overwrite this method to react to |
|
99 |
* the event when user leaves the view that this presenter |
|
100 |
* governs. |
|
101 |
*/ |
|
102 |
public void handleViewExit() { |
|
103 |
} |
|
89 | 104 |
|
90 | 105 |
/** |
91 | 106 |
* @return the navigationManager |
Also available in: Unified diff
ref #6169 generic AbstractCdmEditorPresenter wihout LazyInitializationExeption problems