Class CmsStyleVariable

java.lang.Object
org.opencms.gwt.client.util.CmsStyleVariable

public class CmsStyleVariable extends Object
This is a helper class for changing GWT UIObjects' styles between a set of given values.

Every time a new value is set, the previous value of the style variable will be removed from all associated UI objects, and the new style name will be added.

Since:
8.0.0
  • Constructor Details

    • CmsStyleVariable

      public CmsStyleVariable(com.google.gwt.user.client.ui.UIObject... uis)
      Creates a new instance.

      Parameters:
      uis - the list of UI objects to associate with this style variable
  • Method Details

    • getValue

      public String getValue()
      Returns the current style value.

      Returns:
      the current style value, or null if non is set
    • setValue

      public void setValue(String newStyle)
      Removes the previous value of the style variable from all associated ui objects and adds the new value as a style name to all of them.

      Parameters:
      newStyle - the new style name