Slowlyness comes from memory leak.

The other problem remains. If anybody has any idea what I can do,
please tell me!

If it helps, here's the source of the widget which seems to cause
everything:

public class EnhancedSelectBox extends VerticalPanel implements
CloseHandler,
        DoubleClickHandler, HasChangeHandlers {

    private Button windowButton;
    private EnhancedListBox listbox; // only a normal listbox with
additional double click handling
    private HTML header;
    private DialogWindow window; // popup-panel with window
decorations
    private SelectionPanel windowContent; // any panel that has
methods getSelectionList(), clearSelectionList()
    private String window_title;
    private String headerString;

    public EnhancedSelectBox(String heading, String button_label,
String window_title, SelectionPanel windowContent, int width) {

        this.window_title = window_title;
        this.windowContent = windowContent;

        this.windowButton = new Button(button_label, new ClickHandler
() {
            public void onClick(ClickEvent event) {
                showWindow();
            }
        });

        this.headerString = heading;

        header = new HTML(heading);
        header.setStyleName("boldLabel");
        listbox = new EnhancedListBox();
        listbox.addDoubleClickHandler(this);
        listbox.setVisibleItemCount(10);
        listbox.setWidth(width + "px");
        add(this.windowButton);
        add(this.header);
        add(this.listbox);

        this.window = new DialogWindow(this.window_title, false, true,
true, "Auswaehlen und Schliessen");
        if (this.windowContent != null && this.windowContent
instanceof Widget) {
            this.window.setWidget((Widget) this.windowContent);
        }
        this.window.addCloseHandler(this);
    }

    public EnhancedSelectBox(String heading, String button_label,
String window_title, int width) {
        this(heading, button_label, window_title, null, width, false);
    }

    protected void showWindow() {
        this.window.center();
    }

    public ArrayList<String> getSelectedItems() {
        if (this.windowContent != null) {
            ArrayList<String> update =
this.windowContent.getSelectionList();
            return update;
        }
        return new ArrayList<String>();
    }

    public void clearSelectionList() {
        if (this.windowContent != null) {
            this.windowContent.clearSelectionList();
            updateSelectionList();
        }
    }


    public void updateSelectionList() {
        if (this.windowContent != null) {
            ArrayList<String> update =
this.windowContent.getSelectionList();
            this.listbox.clear();
            for (int i = 0; i < update.size(); i++) {
                this.listbox.addItem(update.get(i));
            }
        }
    }

    public void setWindowPanel(SelectionPanel p) {
        this.windowContent = p;
        if (this.window != null) {
            this.window.setWidget((Widget) this.windowContent);
        }
    }

    public SelectionPanel getWindowPanel() {
        return this.windowContent;
    }

    public void setHeader(String header) {
        this.headerString = header;
        this.header.setText(this.headerString);
    }

    public void setWidth(int w) {
        this.listbox.setWidth(w + "px");
    }

    public void onDoubleClick(DoubleClickEvent event) {
        showWindow();
    }

    public HandlerRegistration addPopupCloseHandler(CloseHandler
handler) {
        return this.window.addCloseHandler(handler);
    }

   public HandlerRegistration addChangeHandler(ChangeHandler handler)
{
    return addDomHandler(handler, ChangeEvent.getType());
  }

   public void onClose(CloseEvent event) {
       updateSelectionList();
       ChangeEvent.fireNativeEvent( Document.get().createChangeEvent
(), this);
   }

}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to