src/share/classes/sun/awt/AWTAccessor.java

Print this page




 462          */
 463         void setFiles(FileDialog fileDialog, File files[]);
 464 
 465         /*
 466          * Sets the file the user selects
 467          */
 468         void setFile(FileDialog fileDialog, String file);
 469 
 470         /*
 471          * Sets the directory the user selects
 472          */
 473         void setDirectory(FileDialog fileDialog, String directory);
 474 
 475         /*
 476          * Returns whether the file dialog allows the multiple file selection.
 477          */
 478         boolean isMultipleMode(FileDialog fileDialog);
 479     }
 480 
 481     /*















 482      * Accessor instances are initialized in the static initializers of
 483      * corresponding AWT classes by using setters defined below.
 484      */
 485     private static ComponentAccessor componentAccessor;
 486     private static ContainerAccessor containerAccessor;
 487     private static WindowAccessor windowAccessor;
 488     private static AWTEventAccessor awtEventAccessor;
 489     private static InputEventAccessor inputEventAccessor;
 490     private static FrameAccessor frameAccessor;
 491     private static KeyboardFocusManagerAccessor kfmAccessor;
 492     private static MenuComponentAccessor menuComponentAccessor;
 493     private static EventQueueAccessor eventQueueAccessor;
 494     private static PopupMenuAccessor popupMenuAccessor;
 495     private static FileDialogAccessor fileDialogAccessor;

 496 
 497     /*
 498      * Set an accessor object for the java.awt.Component class.
 499      */
 500     public static void setComponentAccessor(ComponentAccessor ca) {
 501         componentAccessor = ca;
 502     }
 503 
 504     /*
 505      * Retrieve the accessor object for the java.awt.Component class.
 506      */
 507     public static ComponentAccessor getComponentAccessor() {
 508         if (componentAccessor == null) {
 509             unsafe.ensureClassInitialized(Component.class);
 510         }
 511 
 512         return componentAccessor;
 513     }
 514 
 515     /*


 666         return popupMenuAccessor;
 667     }
 668 
 669     /*
 670      * Set an accessor object for the java.awt.FileDialog class.
 671      */
 672     public static void setFileDialogAccessor(FileDialogAccessor fda) {
 673         fileDialogAccessor = fda;
 674     }
 675 
 676     /*
 677      * Retrieve the accessor object for the java.awt.FileDialog class.
 678      */
 679     public static FileDialogAccessor getFileDialogAccessor() {
 680         if (fileDialogAccessor == null) {
 681             unsafe.ensureClassInitialized(FileDialog.class);
 682         }
 683         return fileDialogAccessor;
 684     }
 685 
















 686 }


 462          */
 463         void setFiles(FileDialog fileDialog, File files[]);
 464 
 465         /*
 466          * Sets the file the user selects
 467          */
 468         void setFile(FileDialog fileDialog, String file);
 469 
 470         /*
 471          * Sets the directory the user selects
 472          */
 473         void setDirectory(FileDialog fileDialog, String directory);
 474 
 475         /*
 476          * Returns whether the file dialog allows the multiple file selection.
 477          */
 478         boolean isMultipleMode(FileDialog fileDialog);
 479     }
 480 
 481     /*
 482      * An accessor for the SequencedEventAccessor class
 483      */
 484     public interface SequencedEventAccessor {
 485         /*
 486          * Returns the nested event.
 487          */
 488         AWTEvent getNested(AWTEvent sequencedEvent);
 489 
 490         /*
 491          * Returns true if the event is an instances of SequencedEvent.
 492          */
 493         boolean isSequencedEvent(AWTEvent event);
 494     }
 495 
 496     /*
 497      * Accessor instances are initialized in the static initializers of
 498      * corresponding AWT classes by using setters defined below.
 499      */
 500     private static ComponentAccessor componentAccessor;
 501     private static ContainerAccessor containerAccessor;
 502     private static WindowAccessor windowAccessor;
 503     private static AWTEventAccessor awtEventAccessor;
 504     private static InputEventAccessor inputEventAccessor;
 505     private static FrameAccessor frameAccessor;
 506     private static KeyboardFocusManagerAccessor kfmAccessor;
 507     private static MenuComponentAccessor menuComponentAccessor;
 508     private static EventQueueAccessor eventQueueAccessor;
 509     private static PopupMenuAccessor popupMenuAccessor;
 510     private static FileDialogAccessor fileDialogAccessor;
 511     private static SequencedEventAccessor sequencedEventAccessor;
 512 
 513     /*
 514      * Set an accessor object for the java.awt.Component class.
 515      */
 516     public static void setComponentAccessor(ComponentAccessor ca) {
 517         componentAccessor = ca;
 518     }
 519 
 520     /*
 521      * Retrieve the accessor object for the java.awt.Component class.
 522      */
 523     public static ComponentAccessor getComponentAccessor() {
 524         if (componentAccessor == null) {
 525             unsafe.ensureClassInitialized(Component.class);
 526         }
 527 
 528         return componentAccessor;
 529     }
 530 
 531     /*


 682         return popupMenuAccessor;
 683     }
 684 
 685     /*
 686      * Set an accessor object for the java.awt.FileDialog class.
 687      */
 688     public static void setFileDialogAccessor(FileDialogAccessor fda) {
 689         fileDialogAccessor = fda;
 690     }
 691 
 692     /*
 693      * Retrieve the accessor object for the java.awt.FileDialog class.
 694      */
 695     public static FileDialogAccessor getFileDialogAccessor() {
 696         if (fileDialogAccessor == null) {
 697             unsafe.ensureClassInitialized(FileDialog.class);
 698         }
 699         return fileDialogAccessor;
 700     }
 701 
 702     /*
 703      * Set an accessor object for the java.awt.SequencedEvent class.
 704      */
 705     public static void setSequencedEventAccessor(SequencedEventAccessor sea) {
 706         sequencedEventAccessor = sea;
 707     }
 708 
 709     /*
 710      * Get the accessor object for the java.awt.SequencedEvent class.
 711      */
 712     public static SequencedEventAccessor getSequencedEventAccessor() {
 713         // The class is not public. So we can't ensure it's initialized.
 714         // Null returned value means it's not initialized
 715         // (so not a single instance of the event has been created).
 716         return sequencedEventAccessor;
 717     }
 718 }