1 package org.jahia.services.htmlparser; 2 3 import org.jahia.registries.ServicesRegistry; 4 5 14 public class ToRemoveMarkupSetting extends MarkupSetting { 15 16 public static final String SETTING_TYPE = "TO_REMOVE_MARKUP_SETTING"; 17 18 private MarkupDefinition markupDefinition = null; 19 20 public ToRemoveMarkupSetting(int markupDefId){ 21 super(SETTING_TYPE,markupDefId); 22 } 23 24 public ToRemoveMarkupSetting(MarkupSetting setting){ 25 super(SETTING_TYPE,setting.getMarkupDefId()); 26 this.setSettingId(setting.getSettingId()); 27 this.setApplyToAllSite(setting.applyToAllSite()); 28 this.setProperties(setting.getProperties()); 29 this.getSites().addAll(setting.getSites()); 30 this.markupDefinition = ServicesRegistry.getInstance().getHtmlParserService() 31 .getMarkupDefinition(this.getMarkupDefId()); 32 } 33 34 public MarkupDefinition getMarkupDefinition(){ 35 return this.markupDefinition; 36 } 37 38 public int compare(Object obj1, Object obj2){ 39 ToRemoveMarkupSetting item1 = (ToRemoveMarkupSetting)obj1; 40 ToRemoveMarkupSetting item2 = (ToRemoveMarkupSetting)obj2; 41 if ( item1.getMarkupDefinition() != null 42 && item2.getMarkupDefinition() != null ){ 43 return item1.getMarkupDefinition().getName() 44 .compareTo(item2.getMarkupDefinition().getName()); 45 } 46 47 Integer val1 = new Integer (item1.getSettingId()); 48 Integer val2 = new Integer (item2.getSettingId()); 49 return ( val1.compareTo(val2) ); 50 } 51 52 } 53 54 | Popular Tags |