@Override
 public void notifyChanged(Notification notification) {
   assert getHost() != null;
   if (notification.getEventType() != Notification.SET) return;
   boolean hasChanged = false;
   switch (notification.getFeatureID(GridLayoutRule.class)) {
     case SWTStylesPackage.GRID_LAYOUT_RULE__MAKE_COLUMNS_EQUAL_WIDTH:
       hasChanged =
           !CompareUtils.areEquals(
               notification.getOldBooleanValue(), notification.getNewBooleanValue());
       break;
     case SWTStylesPackage.GRID_LAYOUT_RULE__HORIZONTAL_SPACING:
     case SWTStylesPackage.GRID_LAYOUT_RULE__MARGIN_BOTTOM:
     case SWTStylesPackage.GRID_LAYOUT_RULE__MARGIN_HEIGHT:
     case SWTStylesPackage.GRID_LAYOUT_RULE__MARGIN_LEFT:
     case SWTStylesPackage.GRID_LAYOUT_RULE__MARGIN_RIGHT:
     case SWTStylesPackage.GRID_LAYOUT_RULE__MARGIN_TOP:
     case SWTStylesPackage.GRID_LAYOUT_RULE__MARGIN_WIDTH:
     case SWTStylesPackage.GRID_LAYOUT_RULE__NUM_COLUMNS:
     case SWTStylesPackage.GRID_LAYOUT_RULE__VERTICAL_SPACING:
       hasChanged =
           !CompareUtils.areEquals(notification.getOldIntValue(), notification.getNewIntValue());
       break;
     default:
       super.notifyChanged(notification);
   }
   if (hasChanged && getHost().styleRuleUpdated((StyleRule) notification.getNotifier()))
     reCreateWidgetView();
 }
示例#2
0
 @Override
 public void notifyChanged(Notification notification) {
   assert getHost() != null;
   if (notification.getEventType() != Notification.SET) return;
   boolean hasChanged = false;
   switch (notification.getFeatureID(IntRule.class)) {
     case CoreStylesPackage.INT_RULE__VALUE:
       hasChanged =
           !CompareUtils.areEquals(notification.getOldIntValue(), notification.getNewIntValue());
       break;
     case CoreStylesPackage.INT_RULE__PROPERTY_NAME:
       reCreateWidgetView();
       return;
     default:
       super.notifyChanged(notification);
   }
   if (hasChanged && getHost().styleRuleUpdated((StyleRule) notification.getNotifier()))
     reCreateWidgetView();
 }