just updated Java doc

This commit is contained in:
Francesco Mangiacrapa 2022-02-25 10:14:08 +01:00
parent b2f9c350c9
commit 7795335590
1 changed files with 29 additions and 29 deletions

View File

@ -19,17 +19,17 @@ import com.google.gwt.user.client.ui.Frame;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.NamedFrame;
/**
* The Class CkanInternalFramePanel.
* The Class CkanFramePanel.
*
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
* Jun 9, 2016
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* Feb 25, 2022
*/
public class CkanFramePanel extends FlowPanel{
public class CkanFramePanel extends FlowPanel {
private NamedFrame frame;
//private static final String FRAME_NAME = "ckan-content-frame";
// private static final String FRAME_NAME = "ckan-content-frame";
private HandlerManager eventBus;
private Image loading = new Image(CkanPortletResources.ICONS.loading());
private String messageToSend;
@ -47,19 +47,17 @@ public class CkanFramePanel extends FlowPanel{
/**
* Post message.
*
* @param msg the msg (as json)
* @param javaScriptObject
* @param
* @param
* @param msg the msg (as json)
* @param frameName the frame name
*/
protected native void sendMessage(String msg, String frameName) /*-{
console.log("Sending message " + msg);
// $wnd.parent.postMessage(msg,'*');
//var f = $wnd.frames[frameName];
//console.log(f);
//f.contentWindow.postMessage(msg, "*");
$wnd.frames[frameName].postMessage(msg,"*")
console.log("Message sent");
console.log("Sending message " + msg);
// $wnd.parent.postMessage(msg,'*');
//var f = $wnd.frames[frameName];
//console.log(f);
//f.contentWindow.postMessage(msg, "*");
$wnd.frames[frameName].postMessage(msg, "*")
console.log("Message sent");
}-*/;
/**
@ -68,36 +66,38 @@ public class CkanFramePanel extends FlowPanel{
* @param msg the msg
*/
private static native void print(String msg)/*-{
console.log(msg);
console.log(msg);
}-*/;
/**
* Instance frame.
*
* @param ckanUrlConnector the ckan url connector
* @param messageToSend the message to send
* @param ckanUrl the ckan url
* @return the frame
*/
public Frame instanceFrame(String ckanUrlConnector, final String messageToSend,final String ckanUrl) {
GWT.log("Instancing new IFRAME with uri: "+ckanUrlConnector);
try{
if(frame != null)
public Frame instanceFrame(String ckanUrlConnector, final String messageToSend, final String ckanUrl) {
GWT.log("Instancing new IFRAME with uri: " + ckanUrlConnector);
try {
if (frame != null)
remove(frame);
}catch(Exception e){
} catch (Exception e) {
print("Error " + e);
}
addLoading();
String urlEncoded = URL.encode(ckanUrlConnector);
GWT.log("Encoded url for instanciating frame is " + urlEncoded);
frame = new NamedFrame(GCubeCkanDataCatalog.GCUBE_CKAN_IFRAME);
frame.setUrl(urlEncoded);
frame.getElement().setId(GCubeCkanDataCatalog.GCUBE_CKAN_IFRAME);
frame.setWidth("100%");
// frame.setHeight("100%");
// frame.getElement().getStyle().setOverflow(Overflow.HIDDEN);
// frame.getElement().setAttribute("scrolling", "no");
// frame.setHeight("100%");
// frame.getElement().getStyle().setOverflow(Overflow.HIDDEN);
// frame.getElement().setAttribute("scrolling", "no");
frame.getElement().getStyle().setBorderWidth(0, Unit.PX);
frame.addLoadHandler(new LoadHandler() {
@ -125,9 +125,9 @@ public class CkanFramePanel extends FlowPanel{
}
/**
* add loading image
* add loading image.
*/
private void addLoading(){
private void addLoading() {
this.add(loading);
loading.getElement().getStyle().setProperty("margin", "auto");
loading.getElement().getStyle().setDisplay(Display.BLOCK);