Package org.exoplatform.services.web.css.model

Examples of org.exoplatform.services.web.css.model.StringLexicalUnitObject


               else if ("float".equals(previousName) && previousValue.getLexicalUnitType() == LexicalUnit.SAC_IDENT)
               {
                  String s = previousValue.getStringValue();
                  if ("left".equals(s))
                  {
                     previousValue = new StringLexicalUnitObject(LexicalUnit.SAC_IDENT, "right");
                  }
                  else if ("right".equals(s))
                  {
                     previousValue = new StringLexicalUnitObject(LexicalUnit.SAC_IDENT, "left");
                  }
               }
               else if ("padding".equals(previousName))
               {
                  int count = 0;
                  for (LexicalUnit current = previousValue; current != null; current = current.getNextLexicalUnit())
                  {
                     count++;
                  }
                  if (count == 4)
                  {
                     LexicalUnitObject top = LexicalUnitObject.create(previousValue);
                     LexicalUnitObject right = top.getNext();
                     LexicalUnitObject bottom = right.getNext();
                     LexicalUnitObject left = bottom.getNext();

                     //
                     right.detach();
                     left.detach();
                     top.attachNext(left);
                     bottom.attachPrevious(left);
                     bottom.attachNext(right);

                     //
                     previousValue = top;
                  }
               }
               else if ("background".equals(previousName))
               {
                  LexicalUnitObject lu = LexicalUnitObject.create(previousValue);
                  StringLexicalUnitObject lor = null;
                  StringLexicalUnitObject url = null;
                  for (LexicalUnitObject current : lu.next(true))
                  {
                     if (current.getLexicalUnitType() == LexicalUnit.SAC_URI)
                     {
                        url = (StringLexicalUnitObject)current;
                     }
                     else if (current.getLexicalUnitType() == LexicalUnit.SAC_IDENT)
                     {
                        String s = current.getStringValue();
                        if ("left".equals(s) || "right".equals(s))
                        {
                           lor = (StringLexicalUnitObject)current;
                        }
                     }
                  }
                  if (lor != null && url != null)
                  {
                     Matcher matcher = URL_PARSER.matcher(url.getStringValue());
                     if (matcher.find())
                     {
                        lor.setStringValue("left".equals(lor.getStringValue()) ? "right" : "left");
                        url.setStringValue(matcher.group(1) + "-rt." + matcher.group(2));
                        previousValue = lu;
                     }
                  }
               }
            }
View Full Code Here

TOP

Related Classes of org.exoplatform.services.web.css.model.StringLexicalUnitObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.