Neil,

I am working on a little component that has formatting that is
complicated and not user friendly. What I am trying to do is allow the
end user to be able to use CSS (which we are all very familiar with) and
then on the inside of the black box, convert that CSS to the formatting
used by the component. 

It just seems like the right way to go, but I am a bit lost on how to
parse the CSS. I turned to Swing to see if they had something to handle
it for me and they do.... But it is very incomplete (the documentation
says this as well).  


......................
Ben Nadel
Certified Advanced ColdFusion MX7 Developer
www.bennadel.com
 
Need ColdFusion Help?
www.bennadel.com/ask-ben/

-----Original Message-----
From: Robertson-Ravo, Neil (RX)
[mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 18, 2007 9:19 AM
To: CF-Talk
Subject: RE: Parse CSS using Java/ColdFusion?

Can I just ask, why are you are adding rules like this?!




-----Original Message-----
From: Ben Nadel [mailto:[EMAIL PROTECTED]
Sent: 18 January 2007 14:18
To: CF-Talk
Subject: Parse CSS using Java/ColdFusion?

Hey all, 
 
I have been playing about with the javax.swing.text.html.StyleSheet in
an attempt to keep track of CSS rules:
 
<cfset objStyleSheet = CreateObject( "java",
"javax.swing.text.html.StyleSheet" ).Init() />
 
<cfset objStyleSheet.AddRule(
JavaCast( "string", "td.header { border-top: 0px solid black ; }" ) )/>
  
<cfset objStyleSheet.AddRule(
JavaCast( "string", "td.header { border-top-width: 3px ; }" ) )/>
 
<cfset objRule = objStyleSheet.GetStyle( JavaCast( "string", "td.header"
) ) />

#objRule.ToString()#

 
What I want this to do is know that the second border width overrides
the first one. Apparently the CSS implementation in Swing is rather
limited and the above is not working. It is storing the two different
definitions as two different styles..... I think this Swing approach is
waaaaay off. 
 
Does anyone know if there is a way in Java to be able to pass in various
CSS definitions and then at the end query attributes and get actual
cascading styles?
 

........................
Ben Nadel
Certified Advanced ColdFusion MX7 Developer www.bennadel.com
<http://www.bennadel.com/> 
 
Need ColdFusion Help?
www.bennadel.com/ask-ben/






~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7 
Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs 
http:http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:266872
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to