org.eclipse.jst.jsf.designtime
Class DesignTimeApplicationManager

java.lang.Object
  extended by org.eclipse.jst.jsf.designtime.DesignTimeApplicationManager

public final class DesignTimeApplicationManager
extends java.lang.Object

Per-web-application manager that manages design time information for a corresponding project. TODO: migrate to managed singleton


Method Summary
 AbstractDTPropertyResolver getDefaultPropertyResolver()
           
 java.lang.String getExternalContextProvider()
           
 DTFacesContext getFacesContext(IFile file)
           
static DesignTimeApplicationManager getInstance(IProject project)
           
 AbstractDTMethodResolver getMethodResolver()
           
 java.lang.String getMethodResolverProvider()
           
 AbstractDTPropertyResolver getPropertyResolver()
           
 java.lang.String getPropertyResolverProvider()
           
 AbstractDTVariableResolver getVariableResolver()
           
 java.lang.String getVariableResolverProvider()
           
 org.eclipse.jst.jsf.designtime.internal.view.IDTViewHandler getViewHandler()
           
 boolean hasDTFacesContext(IFile file)
          Only files for which a runtime request context will be generated have a corresponding design time context.
static boolean hasJSFDesignTime(IProject project)
           The criteria for a project having a JSF design time are: project is non-null.
 void setExternalContextProvider(java.lang.String resolverPluginId)
           
 void setMethodResolverProvider(java.lang.String resolverPluginId)
           
 void setPropertyResolverProvider(java.lang.String resolverPluginId)
           
 void setVariableResolverProvider(java.lang.String resolverPluginId)
          Sets the plugin used to determine the designtime variable resolver.
 void setViewHandlerId(java.lang.String viewHandlerId)
          Sets the persistent id on this project that will be used to load the view handler.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static final DesignTimeApplicationManager getInstance(IProject project)
Parameters:
project -
Returns:
the app manager associated with project

hasJSFDesignTime

public static boolean hasJSFDesignTime(IProject project)

The criteria for a project having a JSF design time are:

Parameters:
project -
Returns:
true if project can have a JSF DesignTimeApplicationManager associated with it. getInstance(project) uses this determine if should construct an instance for a project.

getFacesContext

public DTFacesContext getFacesContext(IFile file)
Parameters:
file - must not be null
Returns:
the faces context for the file or null if not found

hasDTFacesContext

public boolean hasDTFacesContext(IFile file)
Only files for which a runtime request context will be generated have a corresponding design time context. This is generally confined to view definition files such as JSP's. General criteria for a file to have a design time faces context are: - the file is non-null and isAccessible() - the file has designtime view handler (getViewHandler(file) != null) and it supports the content type of file. getFacesContext uses this to decide whether to generate a context for an IFile.

Parameters:
file -
Returns:
true if file has a design time faces context

getViewHandler

public org.eclipse.jst.jsf.designtime.internal.view.IDTViewHandler getViewHandler()
Returns:
the design time view handler for this webap (project).

setViewHandlerId

public void setViewHandlerId(java.lang.String viewHandlerId)
Sets the persistent id on this project that will be used to load the view handler.

Parameters:
viewHandlerId -

setExternalContextProvider

public void setExternalContextProvider(java.lang.String resolverPluginId)
                                throws CoreException
Parameters:
resolverPluginId -
Throws:
CoreException

getExternalContextProvider

public java.lang.String getExternalContextProvider()
Returns:
the id of the active design time external context provider

getVariableResolver

public AbstractDTVariableResolver getVariableResolver()
Returns:
the designtime variable resolver for this application

setVariableResolverProvider

public void setVariableResolverProvider(java.lang.String resolverPluginId)
                                 throws CoreException
Sets the plugin used to determine the designtime variable resolver. To reset to the default, pass null.

Parameters:
resolverPluginId -
Throws:
CoreException - -- if the setting the new value fails

getVariableResolverProvider

public java.lang.String getVariableResolverProvider()
Returns:
the id of the active design time variable resolver

getDefaultPropertyResolver

public AbstractDTPropertyResolver getDefaultPropertyResolver()
Returns:
the default property resolver that will be used if no other is provided. The default property resolver is intended to match the similar resolver used by the runtime.

getPropertyResolver

public AbstractDTPropertyResolver getPropertyResolver()
Returns:
the designtime property resolver for this application

setPropertyResolverProvider

public void setPropertyResolverProvider(java.lang.String resolverPluginId)
                                 throws CoreException
Parameters:
resolverPluginId -
Throws:
CoreException - -- if setting the provider fails

getPropertyResolverProvider

public java.lang.String getPropertyResolverProvider()
Returns:
the id of the active design time variable resolver

getMethodResolver

public AbstractDTMethodResolver getMethodResolver()
Returns:
the designtime method resolver for this application

setMethodResolverProvider

public void setMethodResolverProvider(java.lang.String resolverPluginId)
                               throws CoreException
Parameters:
resolverPluginId -
Throws:
CoreException - -- if setting the plugin fails

getMethodResolverProvider

public java.lang.String getMethodResolverProvider()
Returns:
the id of the active design time variable resolver