Revision 43e1b1e0
Added by Andreas Kohlbecker about 6 years ago
src/main/java/eu/etaxonomy/cdm/vaadin/debug/EntityCacheDebugger.java | ||
---|---|---|
31 | 31 |
|
32 | 32 |
import eu.etaxonomy.cdm.vaadin.view.name.CachingPresenter; |
33 | 33 |
import eu.etaxonomy.vaadin.mvp.AbstractCdmPopupEditor; |
34 |
import eu.etaxonomy.vaadin.mvp.AbstractPopupView; |
|
34 | 35 |
import eu.etaxonomy.vaadin.mvp.AbstractPresenter; |
35 | 36 |
import eu.etaxonomy.vaadin.mvp.AbstractView; |
36 | 37 |
import eu.etaxonomy.vaadin.ui.view.PopEditorOpenedEvent; |
... | ... | |
138 | 139 |
@Override |
139 | 140 |
public void onEvent(Event<PopEditorOpenedEvent> event){ |
140 | 141 |
PopupView popupView = event.getPayload().getPopupView(); |
141 |
if(popupView != null && popupView instanceof AbstractCdmPopupEditor){
|
|
142 |
findWindow(((AbstractCdmPopupEditor)popupView)).addShortcutListener(shortcutListener);
|
|
142 |
if(popupView != null && popupView instanceof AbstractPopupView){
|
|
143 |
findWindow((AbstractPopupView)popupView).addShortcutListener(shortcutListener);
|
|
143 | 144 |
} |
144 | 145 |
|
145 | 146 |
} |
146 | 147 |
|
147 |
private Window findWindow(AbstractCdmPopupEditor view){
|
|
148 |
private Window findWindow(AbstractPopupView view){
|
|
148 | 149 |
Optional<Window> popUpWindow = UI.getCurrent().getWindows().stream().filter(w -> w.getContent().equals(view)).findFirst(); |
149 | 150 |
if(popUpWindow.isPresent()){ |
150 | 151 |
return popUpWindow.get(); |
... | ... | |
190 | 191 |
if(sender instanceof AbstractView) { |
191 | 192 |
EntityCacheDebugger.this.openFor((AbstractView)sender); |
192 | 193 |
} |
193 |
if(sender instanceof Window && ((Window)sender).getContent() instanceof AbstractCdmPopupEditor) {
|
|
194 |
EntityCacheDebugger.this.openFor((AbstractCdmPopupEditor)((Window)sender).getContent());
|
|
194 |
if(sender instanceof Window && ((Window)sender).getContent() instanceof AbstractPopupView) {
|
|
195 |
EntityCacheDebugger.this.openFor((AbstractPopupView)((Window)sender).getContent());
|
|
195 | 196 |
} |
196 | 197 |
|
197 | 198 |
} |
Also available in: Unified diff
enabling EntityCacheDebugger for all AbstractPopupViews