< prev index next >
src/com/sun/javatest/tool/Desktop.java
Print this page
rev 145 : 7902237: Fixing raw use of parameterized class
Reviewed-by: jjg
*** 165,182 ****
} catch (Exception e) {
}
break;
case CommandContext.METAL_LAF:
try {
! Class nimbusClass = Class.forName("javax.swing.plaf.metal.MetalLookAndFeel");
UIManager.setLookAndFeel((LookAndFeel) nimbusClass.newInstance());
} catch (Throwable e) {
}
break;
case CommandContext.NIMBUS_LAF:
try {
! Class nimbusClass = Class.forName("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
UIManager.setLookAndFeel((LookAndFeel) nimbusClass.newInstance());
} catch (Throwable e) {
}
break;
// no need to process CommandContext.DEFAULT_LAF - it should equal one of the others constatns
--- 165,182 ----
} catch (Exception e) {
}
break;
case CommandContext.METAL_LAF:
try {
! Class<?> nimbusClass = Class.forName("javax.swing.plaf.metal.MetalLookAndFeel");
UIManager.setLookAndFeel((LookAndFeel) nimbusClass.newInstance());
} catch (Throwable e) {
}
break;
case CommandContext.NIMBUS_LAF:
try {
! Class<?> nimbusClass = Class.forName("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
UIManager.setLookAndFeel((LookAndFeel) nimbusClass.newInstance());
} catch (Throwable e) {
}
break;
// no need to process CommandContext.DEFAULT_LAF - it should equal one of the others constatns
*** 397,407 ****
if (mgr.getClass().getName().equals(defaultToolManager)) {
try {
// this is to avoid a class dependency to exec package, which is
// normally not allowed in this package
Method m = mgr.getClass().getMethod("startTool",
! new Class[] { InterviewParameters.class} );
return (Tool) m.invoke(mgr, new Object[] { ip });
}
catch (NoSuchMethodException e) {
// ignore??
--- 397,407 ----
if (mgr.getClass().getName().equals(defaultToolManager)) {
try {
// this is to avoid a class dependency to exec package, which is
// normally not allowed in this package
Method m = mgr.getClass().getMethod("startTool",
! new Class<?>[] { InterviewParameters.class} );
return (Tool) m.invoke(mgr, new Object[] { ip });
}
catch (NoSuchMethodException e) {
// ignore??
*** 447,457 ****
/**
* Get the instance of a tool manager for this desktop of a specific class.
* @param c the class of the desired tool manager.
* @return a tool manager of the desired type, or null if none found
*/
! public ToolManager getToolManager(Class c) {
for (int i = 0; i < toolManagers.length; i++) {
ToolManager m = toolManagers[i];
if (c.isInstance(m))
return m;
}
--- 447,457 ----
/**
* Get the instance of a tool manager for this desktop of a specific class.
* @param c the class of the desired tool manager.
* @return a tool manager of the desired type, or null if none found
*/
! public ToolManager getToolManager(Class<?> c) {
for (int i = 0; i < toolManagers.length; i++) {
ToolManager m = toolManagers[i];
if (c.isInstance(m))
return m;
}
*** 520,530 ****
/**
* Get a list of the current entries on the file history associated with this desktop.
* @return a list of the current entries on the file history associated with this desktop
* @see #addToFileHistory
*/
! List getFileHistory()
{
return fileHistory;
}
/**
--- 520,530 ----
/**
* Get a list of the current entries on the file history associated with this desktop.
* @return a list of the current entries on the file history associated with this desktop
* @see #addToFileHistory
*/
! List<FileHistoryEntry> getFileHistory()
{
return fileHistory;
}
/**
*** 1436,1448 ****
// locate init file and load up the managers
//System.err.println("Desktop.initToolManagers");
try {
ManagerLoader ml = new ManagerLoader(ToolManager.class, System.err);
! ml.setManagerConstructorArgs(new Class[] { Desktop.class }, new Object[] { this });
! Set s = ml.loadManagers(TOOLMGRLIST);
! toolManagers = (ToolManager[]) (s.toArray(new ToolManager[s.size()]));
}
catch (IOException e) {
throw new JavaTestError(uif.getI18NResourceBundle(),
"dt.cantAccessResource", new Object[] { TOOLMGRLIST, e } );
}
--- 1436,1448 ----
// locate init file and load up the managers
//System.err.println("Desktop.initToolManagers");
try {
ManagerLoader ml = new ManagerLoader(ToolManager.class, System.err);
! ml.setManagerConstructorArgs(new Class<?>[] { Desktop.class }, new Object[] { this });
! Set<?> s = ml.loadManagers(TOOLMGRLIST);
! toolManagers = s.toArray(new ToolManager[s.size()]);
}
catch (IOException e) {
throw new JavaTestError(uif.getI18NResourceBundle(),
"dt.cantAccessResource", new Object[] { TOOLMGRLIST, e } );
}
< prev index next >