Improve CMS UI utilities.
[lgpl/argeo-commons.git] / org.argeo.cms.ui / src / org / argeo / cms / ui / util / CmsStyle.java
index daf78d47787b5e7545d94a0cf823cc939601fc9b..ed2244b8ddce03e283df7b90f4d3a867a0529f54 100644 (file)
@@ -1,15 +1,22 @@
 package org.argeo.cms.ui.util;
 
-/** Can be applied to {@link Enum}s in order to generated (CSS) class names. */
+/** Can be applied to {@link Enum}s in order to generate (CSS) class names. */
 public interface CmsStyle {
        String name();
 
+       /** @deprecated use {@link #style()} instead. */
+       @Deprecated
        default String toStyleClass() {
-               return getClassPrefix() + "-" + name();
+               return style();
+       }
+
+       default String style() {
+               String classPrefix = getClassPrefix();
+               return "".equals(classPrefix) ? name() : classPrefix + "-" + name();
        }
 
        default String getClassPrefix() {
-               return "cms";
+               return "";
        }
 
 }