layout.setStyleName("bpm-window-layout");
layout.setPadding(5);
// info
HeaderLabel header = new HeaderLabel(title, true);
layout.add(header, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
windowPanel.addWindowCloseListener(new WindowCloseListener() {
public void onWindowClosed() {
if(getCallback()!=null)
getCallback().onWindowClosed();
windowPanel = null;
frame = null;
}
public String onWindowClosing() {
return null;
}
});
// iframe
frame = new Frame()
{
/*public void onBrowserEvent(com.google.gwt.user.client.Event event)
{
ConsoleLog.debug("Browser Event: "+ DOM.eventGetTypeString(event));
final Element iframe = getFrame().getElement();
String size = getContents(IFrameElement.as(iframe));
if(size!=null && size.indexOf(",")!=-1)
{
ConsoleLog.debug("Frame content size: "+ size);
String[] wh = size.split(",");
getWindowPanel().setContentSize(
new Dimension(
Integer.valueOf(wh[0]),
Integer.valueOf(wh[1])+100
)
);
}
else
{
ConsoleLog.debug("Unable to retrieve frame content size: "+size);
final int width = Window.getClientWidth()-200;
final int height = Window.getClientHeight()-100;
getWindowPanel().setContentSize(
new Dimension(width,height)
);
}
windowPanel.layout();
windowPanel.center();
windowPanel.setVisible(true);
} */
};
//frame.sinkEvents(com.google.gwt.user.client.Event.ONLOAD);
DOM.setStyleAttribute(frame.getElement(), "border", "none");
// https://jira.jboss.org/jira/browse/JBPM-2244
frame.getElement().setId(
String.valueOf( new Date().getTime())
);
frame.setUrl(this.url);
layout.add(frame, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
windowPanel.setWidget(layout);
WindowUtil.addMaximizeButton(windowPanel, Caption.CaptionRegion.RIGHT);
WindowUtil.addMinimizeButton(windowPanel, Caption.CaptionRegion.RIGHT);