refs:3772: SAI - Create a github project importer
https://support.d4science.org/issues/3772 Fixed directory explorer git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/widgets/github-connector@129135 82a268e6-3cf1-43bd-a215-b396298e98cfmaster
parent
d0918a9f60
commit
a5cd17254d
@ -0,0 +1,65 @@
|
||||
package org.gcube.portlets.widgets.githubconnector.client.util;
|
||||
|
||||
import com.google.gwt.core.client.Callback;
|
||||
import com.google.gwt.dom.client.Style.Unit;
|
||||
import com.google.gwt.event.dom.client.ClickEvent;
|
||||
import com.google.gwt.event.dom.client.ClickHandler;
|
||||
import com.google.gwt.user.client.ui.Button;
|
||||
import com.google.gwt.user.client.ui.DialogBox;
|
||||
import com.google.gwt.user.client.ui.DockPanel;
|
||||
import com.google.gwt.user.client.ui.HTML;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class ProgressDialog extends DialogBox implements ClickHandler {
|
||||
private Callback<Void, Void> callback;
|
||||
protected HTML msg;
|
||||
protected double msgMinWidth=200;
|
||||
protected double msgMinHeight=30;
|
||||
|
||||
|
||||
public ProgressDialog(String title, String text) {
|
||||
init(title, text);
|
||||
}
|
||||
|
||||
public ProgressDialog(String title, String text, Callback<Void, Void> callback) {
|
||||
init(title, text);
|
||||
}
|
||||
|
||||
private void init(String title, String text) {
|
||||
setText(title);
|
||||
|
||||
|
||||
|
||||
Button closeButton = new Button("Close", this);
|
||||
msg = new HTML(text, true);
|
||||
msg.getElement().getStyle().setProperty("minWidth", msgMinWidth, Unit.PX);
|
||||
msg.getElement().getStyle().setProperty("minHeight",msgMinHeight, Unit.PX);
|
||||
|
||||
DockPanel dock = new DockPanel();
|
||||
dock.setSpacing(4);
|
||||
|
||||
|
||||
dock.add(closeButton, DockPanel.SOUTH);
|
||||
dock.add(msg, DockPanel.CENTER);
|
||||
|
||||
dock.setCellHorizontalAlignment(closeButton, DockPanel.ALIGN_CENTER);
|
||||
dock.setWidth("100%");
|
||||
setWidget(dock);
|
||||
center();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
if(callback!=null){
|
||||
callback.onSuccess(null);
|
||||
}
|
||||
hide();
|
||||
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue