Package com.smartgwt.client.rpc
Class Project
java.lang.Object
com.smartgwt.client.core.BaseClass
com.smartgwt.client.rpc.Project
- All Implemented Interfaces:
HasHandlers
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()
.-
Field Summary
Fields inherited from class com.smartgwt.client.core.BaseClass
config, configOnly, factoryCreated, factoryProperties, id, scClassName
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreate()
createScreen
(String screenName) Creates a screen from screen definitions cached in theProject
.createScreen
(String screenName, CreateScreenSettings settings) Creates a screen from screen definitions cached in theProject
.createScreen
(String screenName, String[] globals) Creates screen from first definition cached in the project.createStartScreen
(CreateScreenSettings settings) Creates screen from first definition cached in the project.createStartScreen
(String... settings) Creates screen from first definition cached in the project.void
destroy()
Releases cached screens andDataSources
associated with this project, and unregisters it soget()
no longer can find it by name.static Project
Returns a cached project given its name.getDataSource
(String ID) Returns an instance of the requestedDataSource
by creating it from the project's cache.String[]
Return the names of theDataSources
cached in this project.getJsObj()
static Project
getOrCreateRef
(JavaScriptObject jsObj) String[]
Return the names of the screens cached in this project.boolean
void
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
-
Constructor Details
-
Project
public Project() -
Project
-
-
Method Details
-
getOrCreateRef
-
setJavaScriptObject
- Overrides:
setJavaScriptObject
in classBaseClass
-
create
-
isCreated
public boolean isCreated() -
getJsObj
-
getOrCreateJsObj
- Overrides:
getOrCreateJsObj
in classBaseClass
-
createScreen
Creates a screen from screen definitions cached in theProject
.- Parameters:
screenName
- name of screen to create- Returns:
- last top-level widget in the screen definition
- See Also:
-
createScreen
Creates a screen from screen definitions cached in theProject
.- Parameters:
screenName
- name of screen to createsettings
- widgets to allow to take their global IDs, or a widget remap config- Returns:
- last top-level widget in the screen definition
- See Also:
-
createStartScreen
Creates screen from first definition cached in the project.- Returns:
- last top-level widget in the screen definition
- See Also:
-
createStartScreen
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:
-
createStartScreen
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:
-
destroy
public void destroy()Releases cached screens andDataSources
associated with this project, and unregisters it soget()
no longer can find it by name. After destroying a project, it is an error to call any instance method on it. -
getDataSource
Returns an instance of the requestedDataSource
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. SeeIdentifier
- Returns:
- requested DataSource instance
- See Also:
-
getDataSourceNames
Return the names of theDataSources
cached in this project.- Returns:
- names of cached DataSources
-
getScreenNames
Return the names of the screens cached in this project.- Returns:
- names of cached screens
- See Also:
-
get
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
- Parameters:
screenName
- name of screen to createglobals
- widgets to allow to take their global IDs, or a widget remap config- Returns:
- last top-level widget in the screen definition
-