{
public void handleEvent(Event evt)
{
Element currTarget = (Element)evt.getCurrentTarget(); // Link
ElementCSSInlineStyle styleElem = (ElementCSSInlineStyle)currTarget;
CSSStyleDeclaration cssDec = styleElem.getStyle();
CSSValueList border = (CSSValueList)cssDec.getPropertyCSSValue("border");
int len = border.getLength();
String cssText = "";
for(int i = 0; i < len; i++)
{
CSSValue value = border.item(i);
if (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE)
{
CSSPrimitiveValue primValue = (CSSPrimitiveValue)value;
if (primValue.getPrimitiveType() == CSSPrimitiveValue.CSS_RGBCOLOR)
{
RGBColor rgb = primValue.getRGBColorValue();
System.out.println("Current border color: rgb(" + rgb.getRed().getCssText() + "," + rgb.getGreen().getCssText() + "," + rgb.getBlue().getCssText() + ")");
}
else cssText += primValue.getCssText() + " ";
}
else cssText += value.getCssText() + " ";
}
cssDec.setProperty("border",cssText,null); // Removed border color
CSS2Properties cssDec2 = (CSS2Properties)styleElem.getStyle();
String newColor = "rgb(255,100,150)";
cssDec2.setBorderColor(newColor); // border-color property
System.out.println("New border color: " + cssDec2.getBorderColor());
}