1 package org.andromda.cartridges.jsf.metafacades;
2
3 import java.util.Collection;
4 import org.andromda.metafacades.uml.DependencyFacade;
5 import org.andromda.metafacades.uml.ModelElementFacade;
6 import org.andromda.metafacades.uml.UseCaseFacade;
7
8
9
10
11
12
13 public class JSFPortletPreferencesLogicImpl
14 extends JSFPortletPreferencesLogic
15 {
16 private static final long serialVersionUID = 34L;
17
18
19
20
21 public JSFPortletPreferencesLogicImpl(Object metaObject, String context)
22 {
23 super(metaObject, context);
24 }
25
26
27
28
29 protected Object handleGetUseCase()
30 {
31 UseCaseFacade useCase = null;
32 final Collection<DependencyFacade> dependencies = this.getTargetDependencies();
33 if (dependencies != null && !dependencies.isEmpty())
34 {
35 for (final DependencyFacade dependency : dependencies)
36 {
37 final ModelElementFacade source = dependency.getSourceElement();
38 if (source instanceof UseCaseFacade)
39 {
40 useCase = (UseCaseFacade)source;
41 break;
42 }
43 }
44 }
45 return useCase;
46 }
47 }