11 |
public class PrefixOrOther implements Function { |
public class PrefixOrOther implements Function { |
12 |
|
|
13 |
protected Cell getCell(Map context) { |
protected Cell getCell(Map context) { |
|
System.out.println("PrefixOrOther.getCell"); |
|
14 |
Fallback.Win win = (Fallback.Win)context.get(ViewContext.class); |
Fallback.Win win = (Fallback.Win)context.get(ViewContext.class); |
15 |
return win.getOther().cursor; |
return win.getOther().cursor; |
16 |
} |
} |
17 |
|
|
18 |
public List evaluate(List[] params, Map context) { |
protected List getCells(Map context) { |
19 |
|
System.out.println("PrefixOrOther.getCell"); |
20 |
|
|
21 |
|
PotionFallbackBinder binder = |
22 |
|
(PotionFallbackBinder)context.get(PotionFallbackBinder.class); |
23 |
|
|
24 |
|
if(!binder.markedCells.isEmpty()) |
25 |
|
return new ArrayList(binder.markedCells); |
26 |
|
|
27 |
return Collections.nCopies(1, getCell(context)); |
return Collections.nCopies(1, getCell(context)); |
28 |
} |
} |
29 |
|
|
30 |
|
public List evaluate(List[] params, Map context) { |
31 |
|
return getCells(context); |
32 |
|
} |
33 |
|
|
34 |
public String getString(Expression[] params, Map context) { |
public String getString(Expression[] params, Map context) { |
35 |
return "the cell in the other window"; |
return "the cell in the other window"; |
36 |
} |
} |
37 |
|
|
38 |
public void render(Expression[] params,Map context, HChain into) { |
public void render(Expression[] params,Map context, HChain into) { |
39 |
} |
} |
40 |
|
|
41 |
public Type[] getParams() { |
public Type[] getParams() { |
42 |
return new Type[0]; |
return new Type[0]; |
43 |
} |
} |