01: package test.check.command;
02:
03: import java.awt.Component;
04:
05: import javax.swing.JScrollPane;
06:
07: /**
08: * A configure command that disables the viewport component specified component.
09: *
10: * @author Kirill Grouchnikov
11: */
12: public class DisableViewportCommand implements
13: ConfigurationCommand<Component> {
14: /*
15: * (non-Javadoc)
16: *
17: * @see test.check.ConfigurationCommand#invoke(java.lang.Object)
18: */
19: public void configure(Component ab) {
20: if (ab instanceof JScrollPane) {
21: JScrollPane jsp = (JScrollPane) ab;
22: jsp.getViewport().getView().setEnabled(false);
23: }
24: }
25: }
|