Package com.smartgwt.client.rpc

# Class Project

java.lang.Object
com.smartgwt.client.core.BaseClass
com.smartgwt.client.rpc.Project

All Implemented Interfaces:
  `HasHandlers`

public class Project extends BaseClass
Represents a `Reify` project loaded from the server via `RPCManager.loadProject()`. A project contains cached screens and `DataSources` that can be used to create actual screens by calling `createScreen()` or `createStartScreen()`.

See Also:
  - `Reify.loadProject(java.lang.String)`

- ## Field Summary

  ### Fields inherited from class com.smartgwt.client.core.BaseClass

  `config, configOnly, factoryCreated, factoryProperties, id, scClassName`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Project()`
  `Project(JavaScriptObject jsObj)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `JavaScriptObject`
  `create()`
  `Canvas`
  `createScreen(String screenName)`
  Creates a screen from screen definitions cached in the `Project`.
  `Canvas`
  `createScreen(String screenName, CreateScreenSettings settings)`
  Creates a screen from screen definitions cached in the `Project`.
  `Canvas`
  `createScreen(String screenName, String[] globals)`
  See `createScreen(String,com.smartgwt.client.rpc.CreateScreenSettings)`.
  `Canvas`
  `createStartScreen()`
  Creates screen from first definition cached in the project.
  `Canvas`
  `createStartScreen(CreateScreenSettings settings)`
  Creates screen from first definition cached in the project.
  `Canvas`
  `createStartScreen(String settings)`
  Creates screen from first definition cached in the project.
  `Canvas`
  `createStartScreen(String... settings)`
  Creates screen from first definition cached in the project.
  `void`
  `destroy()`
  Releases cached screens and `DataSources` associated with this project, and unregisters it so `get()` no longer can find it by name.
  `static Project`
  `get(String projectName)`
  Returns a cached project given its name.
  `DataSource`
  `getDataSource(String ID)`
  Returns an instance of the requested `DataSource` by creating it from the project's cache.
  `String[]`
  `getDataSourceNames()`
  Return the names of the `DataSources` cached in this project.
  `JavaScriptObject`
  `getJsObj()`
  `JavaScriptObject`
  `getOrCreateJsObj()`
  `static Project`
  `getOrCreateRef(JavaScriptObject jsObj)`
  `String[]`
  `getScreenNames()`
  Return the names of the screens cached in this project.
  `boolean`
  `isCreated()`
  `void`
  `isInReify(Function callback)`
  Check whether this project is stored in Reify's project storage.
  `void`
  `loadInReify(ReifyLoadConfig config, Function callback)`
  Open this project in Reify for editing.
  `void`
  `setJavaScriptObject(JavaScriptObject jsObj)`

  ### Methods inherited from class com.smartgwt.client.core.BaseClass

  `addDynamicProperty, addDynamicProperty, addDynamicProperty, addDynamicProperty, applyFactoryProperties, asSGWTComponent, clearDynamicProperty, createJsObj, doAddHandler, doInit, error, error, errorIfNotCreated, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsElement, getAttributeAsFloat, getAttributeAsInt, getAttributeAsJavaScriptObject, getAttributeAsMap, getAttributeAsString, getAttributeAsStringArray, getClassName, getConfig, getHandlerCount, getID, getRef, getRuleScope, getScClassName, getTestInstance, hasAutoAssignedID, hasDynamicProperty, internalSetID, internalSetID, isConfigOnly, isFactoryCreated, onBind, onInit, registerID, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setConfig, setConfigOnly, setFactoryCreated, setID, setProperty, setProperty, setProperty, setProperty, setRuleScope, setScClassName`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### Project

    public Project()

  - ### Project

    public Project(JavaScriptObject jsObj)

- ## Method Details

  - ### getOrCreateRef

    public static Project getOrCreateRef(JavaScriptObject jsObj)

  - ### setJavaScriptObject

    public void setJavaScriptObject(JavaScriptObject jsObj)
    Overrides:
      `setJavaScriptObject` in class `BaseClass`

  - ### create

    public JavaScriptObject create()
    Specified by:
      `create` in class `BaseClass`

  - ### isCreated

    public boolean isCreated()
    Overrides:
      `isCreated` in class `BaseClass`

  - ### getJsObj

    public JavaScriptObject getJsObj()
    Overrides:
      `getJsObj` in class `BaseClass`

  - ### getOrCreateJsObj

    public JavaScriptObject getOrCreateJsObj()
    Overrides:
      `getOrCreateJsObj` in class `BaseClass`

  - ### createScreen

    public Canvas createScreen(String screenName)
    Creates a screen from screen definitions cached in the `Project`.
    Parameters:
      `screenName` - name of screen to create
    Returns:
      last top-level widget in the screen definition
    See Also:
      - `RPCManager.createScreen(java.lang.String)`

  - ### createScreen

    public Canvas createScreen(String screenName, CreateScreenSettings settings)
    Creates a screen from screen definitions cached in the `Project`.
    Parameters:
      `screenName` - name of screen to create
      `settings` - widgets to allow to take their global IDs, or a widget remap config
    Returns:
      last top-level widget in the screen definition
    See Also:
      - `RPCManager.createScreen(java.lang.String)`

  - ### createStartScreen

    public Canvas createStartScreen()
    Creates screen from first definition cached in the project.
    Returns:
      last top-level widget in the screen definition
    See Also:
      - `createScreen(java.lang.String)`
      - `RPCManager.createScreen(java.lang.String)`

  - ### createStartScreen

    public Canvas createStartScreen(CreateScreenSettings settings)
    Creates screen from first definition cached in the project.
    Parameters:
      `settings` - widgets to allow to take their global IDs, or a widget remap config
    Returns:
      last top-level widget in the screen definition
    See Also:
      - `createScreen(java.lang.String)`
      - `RPCManager.createScreen(java.lang.String)`

  - ### createStartScreen

    public Canvas createStartScreen(String settings)
    Creates screen from first definition cached in the project.
    Parameters:
      `settings` - widgets to allow to take their global IDs, or a widget remap config
    Returns:
      last top-level widget in the screen definition
    See Also:
      - `createScreen(java.lang.String)`
      - `RPCManager.createScreen(java.lang.String)`

  - ### createStartScreen

    public Canvas createStartScreen(String... settings)
    Creates screen from first definition cached in the project.
    Parameters:
      `settings` - widgets to allow to take their global IDs, or a widget remap config
    Returns:
      last top-level widget in the screen definition
    See Also:
      - `createScreen(java.lang.String)`
      - `RPCManager.createScreen(java.lang.String)`

  - ### destroy

    public void destroy()
    Releases cached screens and `DataSources` associated with this project, and unregisters it so `get()` no longer can find it by name. After destroying a project, it is an error to call any instance method on it.
    Overrides:
      `destroy` in class `BaseClass`

  - ### getDataSource

    public DataSource getDataSource(String ID)
    Returns an instance of the requested `DataSource` by creating it from the project's cache. If the ID is not globally bound, the framework will globally bind the instance before returning it.

    Note that when a screen cached in the project is created, all project DataSources in the screen will be automatically instantiated from the project cache, so this method need not be called before creating a screen just to ensure its DataSources are available.

    Parameters:
      `ID` - ID of the DataSource to create. See `Identifier`
    Returns:
      requested DataSource instance
    See Also:
      - `Identifier`

  - ### getDataSourceNames

    public String[] getDataSourceNames()
    Return the names of the `DataSources` cached in this project.
    Returns:
      names of cached DataSources

  - ### getScreenNames

    public String[] getScreenNames()
    Return the names of the screens cached in this project.
    Returns:
      names of cached screens
    See Also:
      - `createScreen(java.lang.String)`

  - ### isInReify

    public void isInReify(Function callback)
    Check whether this project is stored in Reify's project storage.
    Parameters:
      `callback` - called with (Boolean isStored)

  - ### loadInReify

    public void loadInReify(ReifyLoadConfig config, Function callback)
    Open this project in Reify for editing. The project must be stored in Reify's project storage; if not, a warning is logged and the call fails.
    Parameters:
      `config` - optional config for `Reify.loadReify()`
      `callback` - called with ReifyRemote

  - ### get

    public static Project get(String projectName)
    Returns a cached project given its name.
    Parameters:
      `projectName` - name of project to retrieve
    Returns:
      cached project, or null if it's not cached

  - ### createScreen

    public Canvas createScreen(String screenName, String[] globals)
    See `createScreen(String,com.smartgwt.client.rpc.CreateScreenSettings)`.
    Parameters:
      `screenName` - name of screen to create
      `globals` - widgets to allow to take their global IDs, or a widget remap config
    Returns:
      last top-level widget in the screen definition