|
|
|
|
@ -25,13 +25,9 @@ public class PageNavigation
|
|
|
|
|
private Utilizador userLogged = null;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private PageNavigation( String id )
|
|
|
|
|
private PageNavigation()
|
|
|
|
|
{
|
|
|
|
|
this.containerID = id;
|
|
|
|
|
if ( id == null )
|
|
|
|
|
{
|
|
|
|
|
this.containerID = AppConstants.MAIN_DIV;
|
|
|
|
|
}
|
|
|
|
|
this.containerID = AppConstants.MAIN_DIV;
|
|
|
|
|
|
|
|
|
|
mainPanel = RootPanel.get( this.containerID );
|
|
|
|
|
panelsCache = new HashMap< Integer, Object >();
|
|
|
|
|
@ -39,29 +35,39 @@ public class PageNavigation
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static PageNavigation getProvider()
|
|
|
|
|
{
|
|
|
|
|
return getProvider( null );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static PageNavigation getProvider( String id )
|
|
|
|
|
{
|
|
|
|
|
if ( instance == null )
|
|
|
|
|
{
|
|
|
|
|
instance = new PageNavigation( id );
|
|
|
|
|
instance = new PageNavigation();
|
|
|
|
|
}
|
|
|
|
|
return instance;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void goPage( Composite newWindow )
|
|
|
|
|
public static void goPage( Integer pageID )
|
|
|
|
|
{
|
|
|
|
|
PageNavigation.getProvider().gotoPage( newWindow );
|
|
|
|
|
PageNavigation.getProvider().gotoPage( pageID );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void goPage( Integer pageID )
|
|
|
|
|
/**
|
|
|
|
|
* usado quando se faz logout ...
|
|
|
|
|
* manter login panel e recover se existir ...
|
|
|
|
|
*/
|
|
|
|
|
public void clearCache()
|
|
|
|
|
{
|
|
|
|
|
PageNavigation.getProvider().gotoPage( pageID );
|
|
|
|
|
Map< Integer, Object > newCache = new HashMap< Integer, Object >();
|
|
|
|
|
|
|
|
|
|
if ( panelsCache.containsKey( NavigationConstants.LOGIN_PANEL ) )
|
|
|
|
|
{
|
|
|
|
|
newCache.put( NavigationConstants.LOGIN_PANEL, panelsCache.get( NavigationConstants.LOGIN_PANEL ) );
|
|
|
|
|
}
|
|
|
|
|
if ( panelsCache.containsKey( NavigationConstants.RECOVER_PWD_PANEL ) )
|
|
|
|
|
{
|
|
|
|
|
newCache.put( NavigationConstants.RECOVER_PWD_PANEL, panelsCache.get( NavigationConstants.RECOVER_PWD_PANEL ) );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
panelsCache = newCache;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -139,6 +145,7 @@ public class PageNavigation
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//TODO: find a better place for this stuff ...
|
|
|
|
|
public boolean isLoggedIn()
|
|
|
|
|
{
|
|
|
|
|
return getUserLogged() != null;
|
|
|
|
|
|