|
23 | 23 | import java.util.List;
|
24 | 24 | import java.util.logging.Level;
|
25 | 25 | import java.util.logging.Logger;
|
| 26 | +import javax.swing.Action; |
26 | 27 | import javax.swing.text.Document;
|
27 | 28 | import javax.swing.text.JTextComponent;
|
| 29 | +import org.openide.windows.IOContainer; |
28 | 30 |
|
29 | 31 | /**
|
30 | 32 | * Provides tmc-spyware access to Output of netbeans and allows us to sniff all
|
@@ -69,6 +71,48 @@ public InputOutput getIO(String string, boolean bln) {
|
69 | 71 | throw new RuntimeException("Failed to get IO. Please contact TestMyCode authors/teacher");
|
70 | 72 | }
|
71 | 73 |
|
| 74 | + @Override |
| 75 | + public InputOutput getIO(String string, Action[] actions) { |
| 76 | + for (IOProvider provider : Lookup.getDefault().lookupAll(IOProvider.class)) { |
| 77 | + if (provider.getName().equals(NAME)) { |
| 78 | + continue; |
| 79 | + } |
| 80 | + |
| 81 | + InputOutput inputOutput = provider.getIO(string, actions); |
| 82 | + return new TmcInputOutputProxy(inputOutput); |
| 83 | + } |
| 84 | + log.log(Level.WARNING, "Failed to get IO. Please contact TestMyCode authors/teacher"); |
| 85 | + throw new RuntimeException("Failed to get IO. Please contact TestMyCode authors/teacher"); |
| 86 | + } |
| 87 | + |
| 88 | + @Override |
| 89 | + public InputOutput getIO(String string, boolean bln, Action[] actions, IOContainer ioc) { |
| 90 | + for (IOProvider provider : Lookup.getDefault().lookupAll(IOProvider.class)) { |
| 91 | + if (provider.getName().equals(NAME)) { |
| 92 | + continue; |
| 93 | + } |
| 94 | + |
| 95 | + InputOutput inputOutput = provider.getIO(string, actions, ioc); |
| 96 | + return new TmcInputOutputProxy(inputOutput); |
| 97 | + } |
| 98 | + log.log(Level.WARNING, "Failed to get IO. Please contact TestMyCode authors/teacher"); |
| 99 | + throw new RuntimeException("Failed to get IO. Please contact TestMyCode authors/teacher"); |
| 100 | + } |
| 101 | + |
| 102 | + @Override |
| 103 | + public InputOutput getIO(String name, Action[] actions, IOContainer ioContainer) { |
| 104 | + for (IOProvider provider : Lookup.getDefault().lookupAll(IOProvider.class)) { |
| 105 | + if (provider.getName().equals(NAME)) { |
| 106 | + continue; |
| 107 | + } |
| 108 | + |
| 109 | + InputOutput inputOutput = provider.getIO(name, actions, ioContainer); |
| 110 | + return new TmcInputOutputProxy(inputOutput); |
| 111 | + } |
| 112 | + log.log(Level.WARNING, "Failed to get IO. Please contact TestMyCode authors/teacher"); |
| 113 | + throw new RuntimeException("Failed to get IO. Please contact TestMyCode authors/teacher"); |
| 114 | + } |
| 115 | + |
72 | 116 | /**
|
73 | 117 | * Proxies access to InputOutput from the default provider. Used as one
|
74 | 118 | * event source for spyware module.
|
|
0 commit comments