256: Workspace Explorer
Task-Url: https://support.d4science.org/issues/256 Added setZIndex to Modal and Modal-Backdrop git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/widgets/workspace-explorer@117664 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
d7befca07a
commit
7258eebebd
|
@ -24,9 +24,11 @@ import com.github.gwtbootstrap.client.ui.event.HideHandler;
|
||||||
import com.github.gwtbootstrap.client.ui.event.ShownEvent;
|
import com.github.gwtbootstrap.client.ui.event.ShownEvent;
|
||||||
import com.github.gwtbootstrap.client.ui.event.ShownHandler;
|
import com.github.gwtbootstrap.client.ui.event.ShownHandler;
|
||||||
import com.google.gwt.core.client.Scheduler;
|
import com.google.gwt.core.client.Scheduler;
|
||||||
|
import com.google.gwt.core.shared.GWT;
|
||||||
import com.google.gwt.dom.client.Element;
|
import com.google.gwt.dom.client.Element;
|
||||||
import com.google.gwt.event.dom.client.ClickEvent;
|
import com.google.gwt.event.dom.client.ClickEvent;
|
||||||
import com.google.gwt.event.dom.client.ClickHandler;
|
import com.google.gwt.event.dom.client.ClickHandler;
|
||||||
|
import com.google.gwt.user.client.Event;
|
||||||
import com.google.gwt.user.client.Window;
|
import com.google.gwt.user.client.Window;
|
||||||
import com.google.gwt.user.client.ui.HTML;
|
import com.google.gwt.user.client.ui.HTML;
|
||||||
import com.google.gwt.user.client.ui.ValueBoxBase.TextAlignment;
|
import com.google.gwt.user.client.ui.ValueBoxBase.TextAlignment;
|
||||||
|
@ -47,6 +49,7 @@ public class WorkspaceExplorerSaveDialog extends Modal implements HasWorskpaceEx
|
||||||
private WorkspaceExplorerController controller;
|
private WorkspaceExplorerController controller;
|
||||||
private List<WorskpaceExplorerSaveNotificationListener> listeners = new ArrayList<WorskpaceExplorerSaveNotificationListener>();
|
private List<WorskpaceExplorerSaveNotificationListener> listeners = new ArrayList<WorskpaceExplorerSaveNotificationListener>();
|
||||||
private TextBox fileNameTextBox = new TextBox();
|
private TextBox fileNameTextBox = new TextBox();
|
||||||
|
private int zIndex = -1;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -424,21 +427,46 @@ public class WorkspaceExplorerSaveDialog extends Modal implements HasWorskpaceEx
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the z index.
|
* Sets the z-index.
|
||||||
*
|
*
|
||||||
* @param zIndex the new z index
|
* @param zIndex the new z index
|
||||||
*/
|
*/
|
||||||
public void setZIndex(int zIndex){
|
public void setZIndex(int zIndex){
|
||||||
Element el = null;
|
this.zIndex = zIndex;
|
||||||
try{
|
configureZindex();
|
||||||
el = getElement();
|
|
||||||
}catch (Exception e) {
|
|
||||||
//silent
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
el.getStyle().setZIndex(zIndex);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configure zindex.
|
||||||
|
*/
|
||||||
|
private void configureZindex() {
|
||||||
|
|
||||||
|
if(zIndex>0){
|
||||||
|
Element el = null;
|
||||||
|
try{
|
||||||
|
el = getElement();
|
||||||
|
}catch (Exception e) {
|
||||||
|
//silent
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
el.getStyle().setZIndex(zIndex+20);
|
||||||
|
|
||||||
|
//IS MODAL-BACKDROP
|
||||||
|
if(el.getNextSiblingElement()!=null)
|
||||||
|
el.getNextSiblingElement().getStyle().setZIndex(zIndex+10);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see com.github.gwtbootstrap.client.ui.Modal#onShown(com.google.gwt.user.client.Event)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void onShown(Event e) {
|
||||||
|
super.onShown(e);
|
||||||
|
GWT.log("Shown fired");
|
||||||
|
configureZindex();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,11 +8,7 @@ import java.util.List;
|
||||||
|
|
||||||
import org.gcube.portlets.widgets.wsexplorer.client.WorkspaceExplorerConstants;
|
import org.gcube.portlets.widgets.wsexplorer.client.WorkspaceExplorerConstants;
|
||||||
import org.gcube.portlets.widgets.wsexplorer.client.WorkspaceExplorerController;
|
import org.gcube.portlets.widgets.wsexplorer.client.WorkspaceExplorerController;
|
||||||
import org.gcube.portlets.widgets.wsexplorer.client.event.BreadcrumbClickEvent;
|
|
||||||
import org.gcube.portlets.widgets.wsexplorer.client.event.BreadcrumbClickEventHandler;
|
|
||||||
import org.gcube.portlets.widgets.wsexplorer.client.event.LoadRootEvent;
|
import org.gcube.portlets.widgets.wsexplorer.client.event.LoadRootEvent;
|
||||||
import org.gcube.portlets.widgets.wsexplorer.client.event.RootLoadedEvent;
|
|
||||||
import org.gcube.portlets.widgets.wsexplorer.client.event.RootLoadedEventHandler;
|
|
||||||
import org.gcube.portlets.widgets.wsexplorer.client.notification.WorkspaceExplorerSelectNotification.HasWorskpaceExplorerSelectNotificationListener;
|
import org.gcube.portlets.widgets.wsexplorer.client.notification.WorkspaceExplorerSelectNotification.HasWorskpaceExplorerSelectNotificationListener;
|
||||||
import org.gcube.portlets.widgets.wsexplorer.client.notification.WorkspaceExplorerSelectNotification.WorskpaceExplorerSelectNotificationListener;
|
import org.gcube.portlets.widgets.wsexplorer.client.notification.WorkspaceExplorerSelectNotification.WorskpaceExplorerSelectNotificationListener;
|
||||||
import org.gcube.portlets.widgets.wsexplorer.shared.FilterCriteria;
|
import org.gcube.portlets.widgets.wsexplorer.shared.FilterCriteria;
|
||||||
|
@ -31,6 +27,7 @@ import com.google.gwt.core.shared.GWT;
|
||||||
import com.google.gwt.dom.client.Element;
|
import com.google.gwt.dom.client.Element;
|
||||||
import com.google.gwt.event.dom.client.ClickEvent;
|
import com.google.gwt.event.dom.client.ClickEvent;
|
||||||
import com.google.gwt.event.dom.client.ClickHandler;
|
import com.google.gwt.event.dom.client.ClickHandler;
|
||||||
|
import com.google.gwt.user.client.Event;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -49,6 +46,7 @@ public class WorkspaceExplorerSelectDialog extends Modal implements HasWorskpace
|
||||||
private Alert alertConfirm;
|
private Alert alertConfirm;
|
||||||
private WorkspaceExplorerController controller;
|
private WorkspaceExplorerController controller;
|
||||||
private List<WorskpaceExplorerSelectNotificationListener> listeners = new ArrayList<WorskpaceExplorerSelectNotificationListener>();
|
private List<WorskpaceExplorerSelectNotificationListener> listeners = new ArrayList<WorskpaceExplorerSelectNotificationListener>();
|
||||||
|
private int zIndex = -1;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -76,8 +74,10 @@ public class WorkspaceExplorerSelectDialog extends Modal implements HasWorskpace
|
||||||
/**
|
/**
|
||||||
* Instantiates a new workspace explorer select dialog.
|
* Instantiates a new workspace explorer select dialog.
|
||||||
* You can implement {@link WorskpaceExplorerSelectNotificationListener} to receive events
|
* You can implement {@link WorskpaceExplorerSelectNotificationListener} to receive events
|
||||||
|
*
|
||||||
* @param captionTxt the caption txt
|
* @param captionTxt the caption txt
|
||||||
* @param filterCriteria the filter criteria
|
* @param filterCriteria the filter criteria
|
||||||
|
* @param selectableTypes the selectable types
|
||||||
*/
|
*/
|
||||||
public WorkspaceExplorerSelectDialog(String captionTxt, FilterCriteria filterCriteria, List<ItemType> selectableTypes) {
|
public WorkspaceExplorerSelectDialog(String captionTxt, FilterCriteria filterCriteria, List<ItemType> selectableTypes) {
|
||||||
controller = new WorkspaceExplorerController(filterCriteria, WorkspaceExplorerConstants.HEIGHT_EXPLORER_PANEL);
|
controller = new WorkspaceExplorerController(filterCriteria, WorkspaceExplorerConstants.HEIGHT_EXPLORER_PANEL);
|
||||||
|
@ -373,18 +373,45 @@ public class WorkspaceExplorerSelectDialog extends Modal implements HasWorskpace
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the z index.
|
* Sets the z-index.
|
||||||
*
|
*
|
||||||
* @param zIndex the new z index
|
* @param zIndex the new z index
|
||||||
*/
|
*/
|
||||||
public void setZIndex(int zIndex){
|
public void setZIndex(int zIndex){
|
||||||
Element el = null;
|
this.zIndex = zIndex;
|
||||||
try{
|
configureZindex();
|
||||||
el = getElement();
|
}
|
||||||
}catch (Exception e) {
|
|
||||||
//silent
|
|
||||||
return;
|
/**
|
||||||
|
* Configure zindex.
|
||||||
|
*/
|
||||||
|
private void configureZindex() {
|
||||||
|
|
||||||
|
if(zIndex>0){
|
||||||
|
Element el = null;
|
||||||
|
try{
|
||||||
|
el = getElement();
|
||||||
|
}catch (Exception e) {
|
||||||
|
//silent
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
el.getStyle().setZIndex(zIndex+20);
|
||||||
|
|
||||||
|
//IS MODAL-BACKDROP
|
||||||
|
if(el.getNextSiblingElement()!=null)
|
||||||
|
el.getNextSiblingElement().getStyle().setZIndex(zIndex+10);
|
||||||
}
|
}
|
||||||
el.getStyle().setZIndex(zIndex);
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see com.github.gwtbootstrap.client.ui.Modal#onShown(com.google.gwt.user.client.Event)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void onShown(Event e) {
|
||||||
|
super.onShown(e);
|
||||||
|
GWT.log("Shown fired");
|
||||||
|
configureZindex();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue