task_21363 #1
|
@ -29,14 +29,14 @@ import com.google.gwt.user.client.ui.NamedFrame;
|
||||||
*/
|
*/
|
||||||
public class CkanInternalFramePanel extends FlowPanel {
|
public class CkanInternalFramePanel extends FlowPanel {
|
||||||
|
|
||||||
private NamedFrame frame;
|
private NamedFrame namedFrame;
|
||||||
private HandlerManager eventBus;
|
private HandlerManager eventBus;
|
||||||
private Image loading = new Image(ContentModeratorWidgetResources.ICONS.loading());
|
private Image loading = new Image(ContentModeratorWidgetResources.ICONS.loading());
|
||||||
private String messageToSend;
|
private String messageToSend;
|
||||||
private String iFrameRandomName;
|
private String iFrameRandomName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiates a new ckan frame panel.
|
* Instantiates a new ckan namedFrame panel.
|
||||||
*
|
*
|
||||||
* @param eventBus the event bus
|
* @param eventBus the event bus
|
||||||
*/
|
*/
|
||||||
|
@ -55,46 +55,46 @@ public class CkanInternalFramePanel extends FlowPanel {
|
||||||
}-*/;
|
}-*/;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instance frame.
|
* Instance namedFrame.
|
||||||
*
|
*
|
||||||
* @param datasetURL the dataset URL
|
* @param datasetURL the dataset URL
|
||||||
* @return the frame
|
* @return the namedFrame
|
||||||
*/
|
*/
|
||||||
public Frame instanceFrame(String datasetURL) {
|
public Frame instanceFrame(String datasetURL) {
|
||||||
GWT.log("Instancing new IFRAME with uri: " + datasetURL);
|
GWT.log("Instancing new IFRAME with uri: " + datasetURL);
|
||||||
addLoading();
|
addLoading();
|
||||||
String urlEncoded = URL.encode(datasetURL);
|
String urlEncoded = URL.encode(datasetURL);
|
||||||
GWT.log("Encoded url for instanciating frame is " + urlEncoded);
|
GWT.log("Encoded url for instanciating namedFrame is " + urlEncoded);
|
||||||
iFrameRandomName = Random.nextInt() + "dataset-iframe" + Random.nextInt();
|
iFrameRandomName = Random.nextInt() + "dataset-internal-iframe" + Random.nextInt();
|
||||||
frame = new NamedFrame(iFrameRandomName);
|
namedFrame = new NamedFrame(iFrameRandomName);
|
||||||
frame.setUrl(urlEncoded);
|
namedFrame.setUrl(urlEncoded);
|
||||||
|
|
||||||
frame.getElement().setId(iFrameRandomName);
|
namedFrame.getElement().setId(iFrameRandomName);
|
||||||
frame.setWidth("100%");
|
namedFrame.setWidth("100%");
|
||||||
frame.setHeight("580px");
|
namedFrame.setHeight("580px");
|
||||||
frame.getElement().getStyle().setBorderWidth(0, Unit.PX);
|
namedFrame.getElement().getStyle().setBorderWidth(0, Unit.PX);
|
||||||
frame.addLoadHandler(new LoadHandler() {
|
namedFrame.addLoadHandler(new LoadHandler() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLoad(LoadEvent arg0) {
|
public void onLoad(LoadEvent arg0) {
|
||||||
|
|
||||||
CkanInternalFramePanel.this.remove(loading);
|
CkanInternalFramePanel.this.remove(loading);
|
||||||
eventBus.fireEvent(new IFrameInstanciedEvent(frame, OPERATION.ONLOAD));
|
eventBus.fireEvent(new IFrameInstanciedEvent(namedFrame, OPERATION.ONLOAD));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
add(frame);
|
add(namedFrame);
|
||||||
frame.setVisible(true);
|
namedFrame.setVisible(true);
|
||||||
eventBus.fireEvent(new IFrameInstanciedEvent(frame, OPERATION.INIT));
|
eventBus.fireEvent(new IFrameInstanciedEvent(namedFrame, OPERATION.INIT));
|
||||||
return frame;
|
return namedFrame;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the frame.
|
* Gets the namedFrame.
|
||||||
*
|
*
|
||||||
* @return the frame
|
* @return the namedFrame
|
||||||
*/
|
*/
|
||||||
public Frame getFrame() {
|
public Frame getFrame() {
|
||||||
return frame;
|
return namedFrame;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue