Esempio n. 1
0
 private static void renderSelectionBackgroundGradient(CTabFolder folder) {
   ICTabFolderAdapter adapter = getCTabFolderAdapter(folder);
   IWidgetGraphicsAdapter gfxAdapter = adapter.getUserSelectionBackgroundGradient();
   Color[] bgGradientColors = gfxAdapter.getBackgroundGradientColors();
   int[] bgGradientPercents = gfxAdapter.getBackgroundGradientPercents();
   Boolean bgGradientVertical = Boolean.valueOf(gfxAdapter.isBackgroundGradientVertical());
   boolean hasChanged =
       WidgetLCAUtil.hasChanged(folder, PROP_SELECTION_BG_GRADIENT_COLORS, bgGradientColors, null)
           || WidgetLCAUtil.hasChanged(
               folder, PROP_SELECTION_BG_GRADIENT_PERCENTS, bgGradientPercents, null)
           || WidgetLCAUtil.hasChanged(
               folder, PROP_SELECTION_BG_GRADIENT_VERTICAL, bgGradientVertical, Boolean.FALSE);
   if (hasChanged) {
     JsonValue gradient = JsonValue.NULL;
     if (bgGradientColors != null) {
       JsonArray colors = new JsonArray();
       for (int i = 0; i < bgGradientColors.length; i++) {
         colors.add(toJson(bgGradientColors[i]));
       }
       JsonValue percents = createJsonArray(bgGradientPercents);
       gradient = new JsonArray().add(colors).add(percents).add(bgGradientVertical.booleanValue());
     }
     getRemoteObject(folder).set(PROP_SELECTION_BG_GRADIENT, gradient);
   }
 }
Esempio n. 2
0
 private static void preserveSelectionBgGradient(CTabFolder folder) {
   ICTabFolderAdapter adapter = getCTabFolderAdapter(folder);
   IWidgetGraphicsAdapter gfxAdapter = adapter.getUserSelectionBackgroundGradient();
   Color[] bgGradientColors = gfxAdapter.getBackgroundGradientColors();
   int[] bgGradientPercents = gfxAdapter.getBackgroundGradientPercents();
   Boolean bgGradientVertical = Boolean.valueOf(gfxAdapter.isBackgroundGradientVertical());
   preserveProperty(folder, PROP_SELECTION_BG_GRADIENT_COLORS, bgGradientColors);
   preserveProperty(folder, PROP_SELECTION_BG_GRADIENT_PERCENTS, bgGradientPercents);
   preserveProperty(folder, PROP_SELECTION_BG_GRADIENT_VERTICAL, bgGradientVertical);
 }