@ -57,6 +57,7 @@ import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Element ;
import com.google.gwt.user.client.Event ;
import com.google.gwt.user.client.EventListener ;
import com.google.gwt.user.client.Random ;
import com.google.gwt.user.client.Window ;
import com.google.gwt.user.client.rpc.AsyncCallback ;
import com.google.gwt.user.client.ui.FlexTable ;
@ -558,6 +559,8 @@ public class LayerManager {
flowPanel . getElement ( ) . getStyle ( ) . setProperty ( "maxHeight" , "600px" ) ;
scrollPanel . add ( flowPanel ) ;
List < Button > listOpenProject = new ArrayList < Button > ( ) ;
final Button expandButton = new Button ( "Expand" ) ;
expandButton . setType ( ButtonType . LINK ) ;
expandButton . setIcon ( IconType . EXPAND ) ;
@ -578,6 +581,10 @@ public class LayerManager {
public void onBrowserEvent ( Event event ) {
if ( Event . ONCLICK = = event . getTypeInt ( ) ) {
expandButton . setVisible ( false ) ;
//hiding the Open Project in expand mode (Modal Window)
for ( Button butt : listOpenProject ) {
butt . setVisible ( false ) ;
}
flowPanel . getElement ( ) . getStyle ( ) . setProperty ( "maxHeight" , "100%" ) ;
int width = Window . getClientWidth ( ) * 75 / 100 ;
int height = Window . getClientHeight ( ) * 70 / 100 ;
@ -624,6 +631,36 @@ public class LayerManager {
heading . setTitle ( nomeConcessione ) ;
heading . getElement ( ) . getStyle ( ) . setMarginBottom ( 10 , Unit . PX ) ;
flowPanel . add ( heading ) ;
Button buttOpenProject = new Button ( "Open Project" ) ;
final String buttId = "open-details-" + Random . nextInt ( ) ;
buttOpenProject . getElement ( ) . setId ( buttId ) ;
buttOpenProject . setType ( ButtonType . LINK ) ;
if ( buttOpenProject ! = null ) {
flowPanel . add ( buttOpenProject ) ;
buttOpenProject . setType ( ButtonType . LINK ) ;
Scheduler . get ( ) . scheduleDeferred ( new ScheduledCommand ( ) {
@Override
public void execute ( ) {
Element buttonElement = DOM . getElementById ( buttId ) ;
Event . sinkEvents ( buttonElement , Event . ONCLICK ) ;
Event . setEventListener ( buttonElement , new EventListener ( ) {
@Override
public void onBrowserEvent ( Event event ) {
if ( Event . ONCLICK = = event . getTypeInt ( ) ) {
applicationBus . fireEvent ( new ShowDetailsEvent ( "concessione" , lo . getSourceConcessione ( ) . getItemId ( ) , nomeConcessione , null ) ) ;
}
}
} ) ;
}
} ) ;
}
listOpenProject . add ( buttOpenProject ) ;
HTML subText = new HTML (
"<p style=\"color:#999; font-size:14px; margin:5px 0 5px 0;\">Layers and Properties</p>" ) ;
flowPanel . add ( subText ) ;
@ -686,6 +723,7 @@ public class LayerManager {
GeoportalDataViewerConstants . printJs ( "Error: " + e . getMessage ( ) ) ;
}
}
olMap . showPopup ( scrollPanel . toString ( ) , queryClick . getCenter ( ) ) ;