Friday, December 12, 2014

Re: PopupImpl class in GWT 2.7.0



On Thursday, December 11, 2014 1:00:27 PM UTC+1, KARAN DANI wrote:
my application  must needs this methods

No.
You have needs, but they're definitely not "these methods".
I suspect that your needs are more about knowing when a popup panel (or dialog box, or menu), and any such popup panel, is shown/hidden.
Let's face the truth: hacking into PopupImpl wasn't a good idea; internals can change, and in this case they did.
What you need is to make sure that you attach an AttachHandler and maybe a CloseHandler to each popup that you need to "monitor" that way; or maybe make sure every popup panel uses your own subclass that overrides the show() and hide() methods.

Put differently: GWT does not support "aspect oriented programming" of any form; things have to be explicit, and abstraction layers built upon it if you want to hide them from your code.
It has worked for you hacking into the popup panel internals; but "Impl" classes (and "impl" packages) are implementation details where things exist for a purpose (which is not that you use them as hooks to plug your own logic), and can change at any time without notice; and it happened in 2.7.
 

On Wednesday, December 10, 2014 4:47:39 PM UTC+5:30, KARAN DANI wrote:
i use PopupImpl  class in GWT 2.6.1 now i moved on gwt 2.7.0..
so its give me an error in onHide,onShow and setVisible methods.. this method is not available in PopupImpl class... 
so i create CustomPopupPanel.java as below
package com.shipco.phoenix.client.common.widgets;

import com.google.gwt.dom.client.Document;
import com.google.gwt.dom.client.Element;

public class CustomPopupPanel {

public Element createElement() {
return Document.get().createDivElement();
}

public Element getContainerElement(Element popup) {
return popup;
}

public Element getStyleElement(Element popup) {
return popup.getParentElement();
}

/**
* @param popup
*            the popup
*/
public void onHide(Element popup) {
}

/**
* @param popup
*            the popup
*/
public void onShow(Element popup) {
}

/**
* @param popup
*            the popup
* @param rect
*            the clip rect
*/
public void setClip(Element popup, String rect) {
popup.getStyle().setProperty("clip", rect);
}

/**
* @param popup
*            the popup
* @param visible
*            true if visible
*/
public void setVisible(Element popup, boolean visible) {
}
}


still i am not getting the output.. how can i use onShow,onHide and setVisible method in GWT 2.7.0
Please help asap

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment