All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sourceforge.squirrel_sql.client.gui.desktopcontainer.DesktopStyle Maven / Gradle / Ivy

Go to download

This is the jar that contains the main application classes which are very specific to SQuirreLSQL.

There is a newer version: 3.5.0
Show newest version
package net.sourceforge.squirrel_sql.client.gui.desktopcontainer;

import net.sourceforge.squirrel_sql.client.preferences.SquirrelPreferences;

public class DesktopStyle
{

   private StyleEnum _desktopStyle = null;

   public DesktopStyle(SquirrelPreferences prefs)
   {
      _desktopStyle = StyleEnum.INTERNAL_FRAME_STYLE;
      if(prefs.getTabbedStyle())
      {
         _desktopStyle = StyleEnum.DOCK_TAB_STYLE;
      }
      else if(prefs.getShowTabbedStyleHint())
      {
         TabbedStyleHintController ctrlHint = new TabbedStyleHintController();

         if(ctrlHint.isUseTabbedLayout())
         {
            prefs.setTabbedStyle(true);
            prefs.save();
            _desktopStyle = StyleEnum.DOCK_TAB_STYLE;
         }
         else if(ctrlHint.isDontShowAgain())
         {
            prefs.setShowTabbedStyleHint(false);
            prefs.save();
         }
      }
   }

   public  boolean isDockTabStyle()
   {
      return StyleEnum.DOCK_TAB_STYLE == _desktopStyle;
   }

   public boolean isInternalFrameStyle()
   {
      return StyleEnum.INTERNAL_FRAME_STYLE == _desktopStyle;
   }

   public boolean supportsLayers()
   {
      return _desktopStyle._supportsLayers;
   }

   public static enum StyleEnum
   {
      DOCK_TAB_STYLE(false),
      INTERNAL_FRAME_STYLE(true),;

      private boolean _supportsLayers;

      StyleEnum(boolean supportsLayers)
      {
         _supportsLayers = supportsLayers;
      }
   }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy