/[classpath]/classpath/java/awt/KeyboardFocusManager.java
ViewVC logotype

Diff of /classpath/java/awt/KeyboardFocusManager.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.14 by trebligd, Wed Jul 6 08:15:17 2005 UTC revision 1.15 by rabbit78, Thu Jul 7 12:37:04 2005 UTC
# Line 287  public abstract class KeyboardFocusManag Line 287  public abstract class KeyboardFocusManag
287      KeyboardFocusManager manager;      KeyboardFocusManager manager;
288    
289      if (m == null)      if (m == null)
290        manager = new DefaultKeyboardFocusManager ();        manager = createFocusManager();
291      else      else
292        manager = m;        manager = m;
293    
# Line 295  public abstract class KeyboardFocusManag Line 295  public abstract class KeyboardFocusManag
295    }    }
296    
297    /**    /**
298       * Creates a KeyboardFocusManager. The exact class is determined by the
299       * system property 'gnu.java.awt.FocusManager'. If this is not set,
300       * we default to DefaultKeyboardFocusManager.
301       */
302      private static KeyboardFocusManager createFocusManager()
303      {
304        String fmClassName = System.getProperty("gnu.java.awt.FocusManager",
305                                           "java.awt.DefaultKeyboardFocusManager");
306        try
307          {
308            Class fmClass = Class.forName(fmClassName);
309            KeyboardFocusManager fm = (KeyboardFocusManager) fmClass.newInstance();
310            return fm;
311          }
312        catch (ClassNotFoundException ex)
313          {
314            System.err.println("The class " + fmClassName + " cannot be found.");
315            System.err.println("Check the setting of the system property");
316            System.err.println("gnu.java.awt.FocusManager");
317            return null;
318          }
319        catch (InstantiationException ex)
320          {
321            System.err.println("The class " + fmClassName + " cannot be");
322            System.err.println("instantiated.");
323            System.err.println("Check the setting of the system property");
324            System.err.println("gnu.java.awt.FocusManager");
325            return null;
326          }
327        catch (IllegalAccessException ex)
328          {
329            System.err.println("The class " + fmClassName + " cannot be");
330            System.err.println("accessed.");
331            System.err.println("Check the setting of the system property");
332            System.err.println("gnu.java.awt.FocusManager");
333            return null;
334          }
335      }
336    
337      /**
338     * Retrieve the {@link Component} that has the keyboard focus, or     * Retrieve the {@link Component} that has the keyboard focus, or
339     * null if the focus owner was not set by a thread in the current     * null if the focus owner was not set by a thread in the current
340     * {@link java.lang.ThreadGroup}.     * {@link java.lang.ThreadGroup}.

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26