Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[albireo-dev] AwtEnvironment vs. LookAndFeelHandler

Hi Gordon,

I implemented a TODO from AwtEnvironment (see attached) and added bits of
javadoc here and there.

Regarding the distribution of API, I see that the user needs to customize
  - the look&feel in the LookAndFeelHandler,
  - the font propagation in the AwtEnvironment,
  - the foreground/background color propagation in the SwingControl's subclass.
This seems odd to me, because fonts and colors are conceptually more related
to look&feel than to anything else, for me.

I propose to

  - Move the font propagation methods from AwtEnvironment to LookAndFeelHandler
    (but they will continue to be _invoked_ from AwtEnvironment),

  - Copy the setComponentForeground, setComponentBackground methods from
    SwingControl to LookAndFeelHandler, and change the implementation of
    these methods in SwingControl so that they reference the LookAndFeelHandler.
    This way, the user can customize it either globally (by customizing the
    LookAndFeelHandler) or locally (in the SwingControl subclass).

Does that sound okay?

Bruno



Index: src/org/eclipse/albireo/core/AwtEnvironment.java
===================================================================
RCS file: /cvsroot/technology/org.eclipse.albireo/org.eclipse.albireo.core/src/org/eclipse/albireo/core/AwtEnvironment.java,v
retrieving revision 1.20
diff -c -3 -r1.20 AwtEnvironment.java
*** src/org/eclipse/albireo/core/AwtEnvironment.java	28 Apr 2008 18:40:18 -0000	1.20
--- src/org/eclipse/albireo/core/AwtEnvironment.java	28 Apr 2008 18:43:01 -0000
***************
*** 200,205 ****
--- 200,209 ----
  
      void dispose() {
          dialogListener.dispose();
+         if (popupParent != null) {
+             popupParent.setVisible(false);
+             popupParent.dispose();
+         }
      }
  
      // ======================= Look&Feel initialization =======================
***************
*** 587,592 ****
--- 591,597 ----
  
      // ------------------------ Displaying SWT popups ------------------------
  
+     // Lazily created holder for an SWT popup.
      private Shell popupParent;
  
      /**
***************
*** 601,607 ****
       * @return
       */
      public Shell getSwtPopupParent(SwingControl control) {
-         // TODO: move to AwtEnvironment and dispose properly
          if (Platform.isGtk()) {
              if (true && (popupParent == null)) {
                  // System.err.println("*** Creating separate popup parent shell");
--- 606,611 ----


Back to the top