[IFT] Replace Java File Structure lesson for the general variant
[idea/contrib.git] / ide-features-trainer / res / data / modules / java / Navigation / 02.Declaration.xml
1 <xml type="Scenario" name="Declaration/implementation" id="Navigation.Declaration/Implementation" lang="JAVA">
2         <CopyText><![CDATA[import java.util.LinkedList;
3 import java.util.List;
4
5 class DeclarationDemo {
6
7     void initPigeonPack() {
8         int count = (int) Math.round(Math.abs(Math.random() * 1000));
9         List<Pigeon> pigeonPack = new LinkedList<Pigeon>();
10         for (int i = 0; i < count; i++) {
11             pigeonPack.add(new Pigeon() {
12                 @Override
13                 public void consume(String trashTypeName) {
14                     System.out.println("Pigeon is consuming " + trashTypeName);
15                 }
16             });
17         }
18     }
19
20     class PigeonBoss implements Pigeon {
21
22         public void consume(String trashTypeName) {
23             System.out.println("Pigeon boss consumes only a kebab.");
24         }
25     }
26
27     interface Pigeon {
28         void consume(String foodType);
29     }
30 }]]></CopyText>
31     <MoveCaret position="8:16"/>
32     <Try triggers="GotoDeclaration">Use <action>GotoDeclaration</action> to jump to the declaration of a class or interface.</Try>
33     <MoveCaret position="26:17"/>
34     <Try triggers="GotoImplementation">To see implementations of a class/interface, use <action>GotoImplementation</action>.</Try>
35     <Win/>
36 </xml>