Skip to content

Package: DataBindingPhaseListener

DataBindingPhaseListener

nameinstructionbranchcomplexitylinemethod
DataBindingPhaseListener()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
afterPhase(PhaseEvent)
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
beforePhase(PhaseEvent)
M: 8 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
getPhaseId()
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2014 EclipseSource Muenchen GmbH and others.
3: *
4: * All rights reserved. This program and the accompanying materials
5: * are made available under the terms of the Eclipse Public License 2.0
6: * which accompanies this distribution, and is available at
7: * https://www.eclipse.org/legal/epl-2.0/
8: *
9: * SPDX-License-Identifier: EPL-2.0
10: *
11: * Contributors:
12: * EclipseSource Munich - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.makeithappen.application.sample.rap.j2ee;
15:
16: import org.eclipse.core.databinding.observable.Realm;
17: import org.eclipse.rap.rwt.RWT;
18: import org.eclipse.rap.rwt.internal.lifecycle.PhaseEvent;
19: import org.eclipse.rap.rwt.internal.lifecycle.PhaseId;
20: import org.eclipse.rap.rwt.internal.lifecycle.PhaseListener;
21:
22: /**
23: * A {@link PhaseListener} to set the default realm.
24: */
25:
26: @SuppressWarnings({ "deprecation", "serial" })
27: public class DataBindingPhaseListener implements PhaseListener {
28:
29:         @Override
30:         public PhaseId getPhaseId() {
31:                 return PhaseId.PROCESS_ACTION;
32:         }
33:
34:         @Override
35:         public void beforePhase(PhaseEvent event) {
36:                 final Realm realm = (Realm) RWT.getUISession().getAttribute("realm"); //$NON-NLS-1$
37:                 RealmSetter.setRealm(realm);
38:         }
39:
40:         @Override
41:         public void afterPhase(PhaseEvent event) {
42:                 RealmSetter.setRealm(null);
43:         }
44: }