Project

General

Profile

10706-optimize.diff

Vladimir Tsichevski, 01/23/2026 06:59 AM

Download (2.69 KB)

View differences:

new/src/com/goldencode/p2j/ui/client/FillIn.java 2026-01-23 11:54:40 +0000
705 705
   /** Hard format check state flag. */
706 706
   private boolean formatCheck = false;
707 707
   
708
   /** Keep track if the fill-in is date based. */
709
   protected boolean isDateBased = false;
710
   
711 708
   /** The active scroller, used when the fill-in is editable. */
712 709
   protected EditScroller editScroller = null;
713 710
   
......
820 817
      disable();
821 818

  
822 819
      resetEditScroller();
823
      
824
      // check if fill-in is date based
825
      isDateBased = config.dataType.equalsIgnoreCase("date")     ||
826
                    config.dataType.equalsIgnoreCase("datetime") ||
827
                    config.dataType.equalsIgnoreCase("datetime-tz");
828 820
   }
829 821

  
830 822
   /**
......
1519 1511
      final boolean isChui = ThinClient.getInstance().isChui();
1520 1512
      Presentation appDataPres = config.appDataPres;
1521 1513
         
1514
      final boolean isDateBased = isDateBased();
1522 1515
      if (Keyboard.isPrintableKey(ke)) // range for printable characters
1523 1516
      {
1524 1517
         if (config.readOnly)
......
3146 3139
   }
3147 3140

  
3148 3141
   /**
3142
    * Test if this FILL-IN data type is date/datetime/datetime-tz
3143
    * 
3144
    * @return see above
3145
    */
3146
   protected final boolean isDateBased()
3147
   {
3148
      return switch (config.dataType.toLowerCase())
3149
      {
3150
         case "date", "datetime", "datetime-tz" -> true;
3151
         default -> false;
3152
      };
3153
   }
3154

  
3155
   /**
3149 3156
    * Synchronizes the actual size with the default size.
3150 3157
    */
3151 3158
   protected void updateSize()
......
3212 3219

  
3213 3220
      config.dataType = appVar.getTypeName();
3214 3221
      
3215
      // update flag value for date based fill-in
3216
      isDateBased = config.dataType.equalsIgnoreCase("date")     ||
3217
                    config.dataType.equalsIgnoreCase("datetime") ||
3218
                    config.dataType.equalsIgnoreCase("datetime-tz");
3219
      
3220
      if (isDateBased)
3222
      if (isDateBased())
3221 3223
      {
3222 3224
         updateFont();
3223 3225
      }
new/src/com/goldencode/p2j/ui/client/gui/FillInGuiImpl.java 2026-01-23 11:53:12 +0000
1263 1263
         final boolean isBkspOrShiftBksp =   actionCode == Keyboard.KA_BACKSPACE ||
1264 1264
                                             actionCode == Keyboard.KC_SHIFT_BACKSPACE ;
1265 1265

  
1266
         final boolean isDateBased = isDateBased();
1266 1267
         if (isBkspOrShiftBksp && isDateBased)
1267 1268
         {
1268 1269
            // Move cursor at the most left position of the selection