1 14 package org.jahia.services.htmleditors; 15 16 import java.util.Collection ; 17 import java.util.Set ; 18 import java.util.HashSet ; 19 import java.io.Serializable ; 20 21 29 30 public class HtmlEditorCSS implements Serializable { 31 32 private String id; 33 private String name; 34 private String url; 35 private boolean shared; private Set allowedSites = new HashSet (); 37 38 45 public HtmlEditorCSS(String id, String name, String url, boolean shared){ 46 this.id = id; 47 this.name = name; 48 this.url = url; 49 this.shared = shared; 50 } 51 52 57 public String getId(){ 58 return this.id; 59 } 60 61 66 public String getName(){ 67 return this.name; 68 } 69 70 75 public String getURL(){ 76 return this.url; 77 } 78 79 84 public boolean isShared(){ 85 return this.shared; 86 } 87 88 91 public void addAllowedSite(String siteKey){ 92 if ( siteKey != null ){ 93 this.allowedSites.add(siteKey); 94 } 95 } 96 97 102 public void addAllowedSites(Collection sites){ 103 if ( sites != null ){ 104 this.allowedSites.addAll(sites); 105 } 106 } 107 108 111 public boolean isSiteAllowed(String siteKey){ 112 return ( this.isShared() 113 || ( siteKey != null && this.allowedSites.contains(siteKey) ) ); 114 } 115 } 116 | Popular Tags |