Sean1
(Sean Owen)
February 10, 2012, 7:05am
1
I’ve created widget which inherit from VTextField. Everything works ok, but I don’t know how to inherit CSS style from VTextField.
public class VTimeField extends VTextField implements Paintable {
public static final String CLASSNAME = "v-timefield";
....some code ommited....
public VTimeField() {
setStyleName(CLASSNAME);
/** maybe addStyleName("v-textfield"); **/
}
....some code ommited....
}
regards Sean
Marc17
(Marc Bosserhoff)
February 10, 2012, 11:16am
2
Hello,
rewrite the constructor like this:
public VTimeField() {
addStyleName(CLASSNAME);
}
As VTextfield sets its own css class with “setStyleName” you overwrite these settings again and loose the style information from the original text field.
Just a note: As VTextfield already implements Paintable i think you don’t have to implement it again.
Hope that helps,
Marc
Sean1
(Sean Owen)
February 13, 2012, 7:49am
3
Thank you for your reply. Now everything works just like it should.
You have right that I unnecessarily implement interface which was implemented in superclass.
regards Sean