Design view "drop" area reflects custom restrictio

GWT Designer allows you to quickly create the modules, composites, panels, remote services and other elements that comprise Google Web Tookit applications.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

Design view "drop" area reflects custom restrictio

Postby peterblazejewicz » Mon Oct 01, 2007 3:22 pm

Hi all & team,

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
Peter Blazejewicz
GWT groups profile
peterblazejewicz
 
Posts: 153
Joined: Fri Jul 27, 2007 7:09 pm
Location: Europe/Poland/Warsaw

Re: Design view "drop" area reflects custom restri

Postby Eric Clayberg » Wed Oct 03, 2007 7:39 pm

peterblazejewicz wrote:is there a method to restrict what types of custom components can be dropped into design view?

There is no public way to do this. Even Sun's Java Bean spec does not specify a way to do this.

Special components that require unique design-time behavior require special support within the editor.

We have special design-time support classes for all of the built-in GWT panel types.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Postby peterblazejewicz » Thu Oct 04, 2007 3:01 pm

hi Eric,
thaks for information,
i'll stay with maybe runtime exceptions or assertions if that will be required then,

regards,
Peter
Peter Blazejewicz
GWT groups profile
peterblazejewicz
 
Posts: 153
Joined: Fri Jul 27, 2007 7:09 pm
Location: Europe/Poland/Warsaw

Postby Eric Clayberg » Fri Oct 05, 2007 7:57 am

peterblazejewicz wrote:i'll stay with maybe runtime exceptions or assertions if that will be required then

For now, that will need to do. We have some thoughts on putting together a developer api for adding custom widgets, but that will take some time.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA


Return to GWT Designer

Who is online

Users browsing this forum: No registered users and 3 guests