Ok its late and im tired. in the example setWidth(String width) and
setHeight(String width) should be as follow.
setWidth(String width) {
addAttribute("width",width);
}
setHeight(String height) {
addAttribute("height",height);
}
-stephan
[EMAIL PROTECTED]
om To: "ECS" <[EMAIL PROTECTED]>
Sent by: cc:
<[EMAIL PROTECTED] Subject: Re: No future?
-dogs.com>
12/05/2000 11:17
PM
Please respond to
"ECS"
Hi Simon,
Not at all, The more eyes that look at the code the better it will become.
If you check ecs2 out of cvs look in the org.apache.ecs.html directory i've
implemented a few of the html elements from the w3c 4.0 spec. Basically
what needs to be done is to go through the spec and implement the remaining
elements. It's not hard just tedious.
For example lets implement some of the html td element.
public class TD extends HtmlElement impelements Printable
{
public pElement element = new pElement(); // we use an innerclass to
support method chaining.
public TD() {}
public void setWidth(String width) {
setWidth("width",width);
}
public void setWidth(int width) {
setWidth(Integer.toString(width));
}
public String getWidth() {
return getAttribute("width");
}
public void setHeight(String height) {
setHeight("height",height);
}
public void setHeight(int height) {
setHeight(Integer.toString(height));
}
public String getHeight() {
return getAttribute("height");
}
private TD getInstance()
{
return this;
}
// inner class to support method chaining and allow for object
extensability.
public class pElement {
public TD add(Element element)
{
addElement(element);
return getInstance();
}
public TD add(String element)
{
addElement(element);
return getInstance();
}
public TD setHeight(String height)
{
getInstance().setHeight(height);
return getInstance();
}
public TD setHeight(int height)
{
getInstance().setHeight(height);
return getInstance();
}
public TD setWidth(String width)
{
getInstance().setWidth(width);
return getInstance();
}
public TD setWidth(int width)
{
getInstance().setWidth(width);
return getInstance();
}
}
}
Most of the work takes place inside the base class. We use an innerclass
so that the object can be extended and reused. As you can see there isn't
much to implementing an element aside from alot of typing. Hope this
helps.
Feel free to ask questions.
-stephan
Simon Allaway
<simona@uchicago. To: ECS
<[EMAIL PROTECTED]>
edu> cc:
Sent by: Subject: Re: No future?
<[EMAIL PROTECTED]
-dogs.com>
12/05/2000 10:51
PM
Please respond to
"ECS"
Stephan Nagy wrote:
>
> As of yet I haven't receive any offers to my plea for help. My time is
> really limited at the moment ( more so then normal ), so any/all help is
> really appreciated. If I am ever in the city of any contributors beer
> is on me.
Stephan,
I'd love to contribute, but I'm hesitant to wade in as your nicely
detailed request went mostly over my head. On the other hand I know I'd
increase my java skills by doing it. Would I be wasting your time by
asking for an example of what you need doing? Or does asking that tell
you everything about my abilities?
Simon
--
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Archives and Other: <http://java.apache.org/main/mail.html>
Problems?: [EMAIL PROTECTED]
--
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Archives and Other: <http://java.apache.org/main/mail.html>
Problems?: [EMAIL PROTECTED]
--
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Archives and Other: <http://java.apache.org/main/mail.html>
Problems?: [EMAIL PROTECTED]