118 lines
3.2 KiB
Java
118 lines
3.2 KiB
Java
/**
|
|
*
|
|
*/
|
|
package org.gcube.portlets.widgets.wsexplorer.client.load;
|
|
|
|
import org.gcube.portlets.widgets.wsexplorer.client.WorkspaceExplorerConstants;
|
|
import org.gcube.portlets.widgets.wsexplorer.client.WorkspaceExplorerController;
|
|
|
|
import com.github.gwtbootstrap.client.ui.Modal;
|
|
import com.github.gwtbootstrap.client.ui.ModalFooter;
|
|
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.HasHorizontalAlignment;
|
|
import com.google.gwt.user.client.ui.HorizontalPanel;
|
|
|
|
|
|
/**
|
|
* The Class WorspaceNavigatorDialog.
|
|
*
|
|
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
|
* Jun 24, 2015
|
|
*/
|
|
public class WorkspaceExplorerLoadDialog extends Modal{
|
|
|
|
private Button cancel;
|
|
private WorkspaceExplorerLoadDialog INSTANCE = this;
|
|
private boolean isValidHide;
|
|
private String captionTxt;
|
|
private ModalFooter footer = new ModalFooter();
|
|
private WorkspaceExplorerController controller = new WorkspaceExplorerController();
|
|
|
|
/**
|
|
* Instantiates a new worspace navigator dialog.
|
|
*
|
|
* @param captionTxt sets the text inside the caption, if null sets "Workspace Explorer"
|
|
*/
|
|
public WorkspaceExplorerLoadDialog(String captionTxt) {
|
|
this.captionTxt = (captionTxt==null || captionTxt.isEmpty())?WorkspaceExplorerConstants.WORKSPACE_EXPLORER_CAPTION:captionTxt;
|
|
// setText(this.captionTxt);
|
|
setAnimation(false);
|
|
setCloseVisible(true);
|
|
setTitle(this.captionTxt);
|
|
isValidHide = false;
|
|
cancel = new Button("Close");
|
|
setWidth(710);
|
|
// setHeight("650px");
|
|
setMaxHeigth("500px");
|
|
// DockPanel dock = new DockPanel();
|
|
// dock.setSpacing(5);
|
|
|
|
// dock.add(okButton, DockPanel.SOUTH);
|
|
// dock.add(cancel, DockPanel.SOUTH);
|
|
|
|
// HorizontalPanel hp = new HorizontalPanel();
|
|
// hp.setStyleName("margin-auto");
|
|
////// hp.add(okButton);
|
|
//// hp.setWidth("50%");
|
|
//// hp.setStyleAttribute("margin", "0 auto");
|
|
// hp.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
|
|
// cancel.getElement().getStyle().setMarginTop(5.0, Unit.PX);
|
|
//// cancel.getElement().getStyle().setMarginBottom(5.0, Unit.PX);
|
|
//// hp.getElement().getStyle().setMarginLeft("0 auto", Unit.PCT);
|
|
// hp.add(cancel);
|
|
// dock.add(hp, DockPanel.SOUTH);
|
|
//
|
|
// dock.add(controller.getWorkspaceExplorerPanel(), DockPanel.CENTER);
|
|
//
|
|
// dock.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
|
|
// dock.setWidth("100%");
|
|
add(controller.getWorkspaceExplorerPanel());
|
|
|
|
// okButton.addClickHandler(new ClickHandler() {
|
|
//
|
|
// @Override
|
|
// public void onClick(ClickEvent event) {
|
|
//
|
|
// }
|
|
// });
|
|
cancel.addClickHandler(new ClickHandler() {
|
|
|
|
@Override
|
|
public void onClick(ClickEvent event) {
|
|
isValidHide = false;
|
|
INSTANCE.hide();
|
|
}
|
|
});
|
|
|
|
footer.add(cancel);
|
|
|
|
add(footer);
|
|
}
|
|
|
|
/**
|
|
* @return the captionTxt
|
|
*/
|
|
public String getCaptionTxt() {
|
|
return captionTxt;
|
|
}
|
|
|
|
/**
|
|
* Checks if is valid hide.
|
|
*
|
|
* @return the isValidHide
|
|
*/
|
|
public boolean isValidHide() {
|
|
return isValidHide;
|
|
}
|
|
|
|
@Override
|
|
public void show() {
|
|
super.show();
|
|
}
|
|
}
|