< prev index next >

src/com/sun/javatest/tool/DesktopManager.java

Print this page
rev 145 : 7902237: Fixing raw use of parameterized class
Reviewed-by: jjg


  94         NewDesktopCommand() {
  95             super("newDesktop");
  96         }
  97 
  98         public void run(CommandContext ctx) {
  99         }
 100     }
 101 
 102     private static class ResumeCommand extends Command {
 103 
 104         public ResumeCommand() {
 105             super("resume");
 106         }
 107 
 108         public void run(CommandContext ctx) throws Fault {
 109         }
 110     }
 111 
 112     private static class SetLafCommand extends Command {
 113 
 114         private SetLafCommand(ListIterator argIter, CommandContext ctx) throws Fault {
 115             super("laf");
 116 
 117             if (!argIter.hasNext()) {
 118                 throw new Fault(i18n, "dt.opts.laf.missingArg");
 119             }
 120 
 121             int laf;
 122 
 123             String lafName = (String) argIter.next();
 124             if ("nimbus".equalsIgnoreCase(lafName)) {
 125                 laf = CommandContext.NIMBUS_LAF;
 126             } else if ("metal".equalsIgnoreCase(lafName)) {
 127                 laf = CommandContext.METAL_LAF;
 128             } else if ("system".equalsIgnoreCase(lafName) || "sys".equalsIgnoreCase(lafName)) {
 129                 laf = CommandContext.SYSTEM_LAF;
 130             } else if ("default".equalsIgnoreCase(lafName)) {
 131                 laf = CommandContext.DEFAULT_LAF;
 132             } else {
 133                 throw new Fault(i18n, "dt.opts.laf.badArg", new Object[] {lafName});
 134             }
 135 
 136             addArg(lafName);
 137 
 138             ctx.setPreferredLookAndFeel(laf);
 139         }
 140 
 141         @Override
 142         public void run(CommandContext ctx) throws Fault {
 143         }


  94         NewDesktopCommand() {
  95             super("newDesktop");
  96         }
  97 
  98         public void run(CommandContext ctx) {
  99         }
 100     }
 101 
 102     private static class ResumeCommand extends Command {
 103 
 104         public ResumeCommand() {
 105             super("resume");
 106         }
 107 
 108         public void run(CommandContext ctx) throws Fault {
 109         }
 110     }
 111 
 112     private static class SetLafCommand extends Command {
 113 
 114         private SetLafCommand(ListIterator<String> argIter, CommandContext ctx) throws Fault {
 115             super("laf");
 116 
 117             if (!argIter.hasNext()) {
 118                 throw new Fault(i18n, "dt.opts.laf.missingArg");
 119             }
 120 
 121             int laf;
 122 
 123             String lafName = argIter.next();
 124             if ("nimbus".equalsIgnoreCase(lafName)) {
 125                 laf = CommandContext.NIMBUS_LAF;
 126             } else if ("metal".equalsIgnoreCase(lafName)) {
 127                 laf = CommandContext.METAL_LAF;
 128             } else if ("system".equalsIgnoreCase(lafName) || "sys".equalsIgnoreCase(lafName)) {
 129                 laf = CommandContext.SYSTEM_LAF;
 130             } else if ("default".equalsIgnoreCase(lafName)) {
 131                 laf = CommandContext.DEFAULT_LAF;
 132             } else {
 133                 throw new Fault(i18n, "dt.opts.laf.badArg", new Object[] {lafName});
 134             }
 135 
 136             addArg(lafName);
 137 
 138             ctx.setPreferredLookAndFeel(laf);
 139         }
 140 
 141         @Override
 142         public void run(CommandContext ctx) throws Fault {
 143         }
< prev index next >