com.smartgwt.client.rpc

## Class Project

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

- All Implemented Interfaces:
    com.google.gwt.event.shared.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, com.smartgwt.client.callbacks.LoadProjectCallback, com.smartgwt.client.rpc.LoadProjectSettings)`

- - ### Field Summary

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

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

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Project()`
    `Project(com.google.gwt.core.client.JavaScriptObject jsObj)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `com.google.gwt.core.client.JavaScriptObject` | `create()`
    `Canvas` | `createScreen(java.lang.String screenName)` Creates a screen from screen definitions cached in the `Project`.
    `Canvas` | `createScreen(java.lang.String screenName, CreateScreenSettings settings)` Creates a screen from screen definitions cached in the `Project`.
    `Canvas` | `createScreen(java.lang.String screenName, java.lang.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(java.lang.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(java.lang.String projectName)` Returns a cached project given its name.
    `DataSource` | `getDataSource(java.lang.String ID)` Returns an instance of the requested `DataSource` by creating it from the project's cache.
    `java.lang.String[]` | `getDataSourceNames()` Return the names of the `DataSources` cached in this project.
    `com.google.gwt.core.client.JavaScriptObject` | `getJsObj()`
    `com.google.gwt.core.client.JavaScriptObject` | `getOrCreateJsObj()`
    `static Project` | `getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)`
    `java.lang.String[]` | `getScreenNames()` Return the names of the screens cached in this project.
    `boolean` | `isCreated()`
    `void` | `setJavaScriptObject(com.google.gwt.core.client.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, setAutoID, 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 Detail

    - #### Project

          public Project()

    - #### Project

          public Project(com.google.gwt.core.client.JavaScriptObject jsObj)

  - ### Method Detail

    - #### getOrCreateRef

          public static Project getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)

    - #### setJavaScriptObject

          public void setJavaScriptObject(com.google.gwt.core.client.JavaScriptObject jsObj)

      Overrides:
        `setJavaScriptObject` in class `BaseClass`

    - #### create

          public com.google.gwt.core.client.JavaScriptObject create()

      Specified by:
        `create` in class `BaseClass`

    - #### isCreated

          public boolean isCreated()

      Overrides:
        `isCreated` in class `BaseClass`

    - #### getJsObj

          public com.google.gwt.core.client.JavaScriptObject getJsObj()

      Overrides:
        `getJsObj` in class `BaseClass`

    - #### getOrCreateJsObj

          public com.google.gwt.core.client.JavaScriptObject getOrCreateJsObj()

      Overrides:
        `getOrCreateJsObj` in class `BaseClass`

    - #### createScreen

          public Canvas createScreen(java.lang.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(java.lang.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(java.lang.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(java.lang.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 java.lang.String[] getDataSourceNames()

      Return the names of the `DataSources` cached in this project.
      Returns:
        names of cached DataSources

    - #### getScreenNames

          public java.lang.String[] getScreenNames()

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

    - #### get

          public static Project get(java.lang.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(java.lang.String screenName,
                                     java.lang.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