is there a method to restrict what types of custom components can be dropped into design view?
I was discussing such topic elsewhere:
- say base component is impementation of <ul> (unordered list) based on ComplexPanel widget. It works fine and renders fine in Design view
- say we want to rectrict at design time what can be dropped into that panel and restrict only to <li> (list items) impemented as Widget subclass.
I've tried throwing exception or use of assertion but that only works at runtime compilation. What I was wondering if there is a way to reflect that during authoring time somehow,
- Code: Select all
/*@Override*/
public void add(Widget w) {
add((ListItem) w, getElement());
}
/*@Override*/
public void insert(Widget w, int beforeIndex) {
insert((ListItem) w, getElement(), beforeIndex, true);
}
void add(ListItem item) {
super.add(item, getElement());
}
void insert(ListItem item, int beforeIndex) {
super.insert(item, getElement(), beforeIndex, true);
}
which does not work (however Designer prompts error message box about contacting with support, but design view is refreshed)
some ideas?
thanks,
regards,
Peter