Many classes have shortcut names used when creating (instantiating) a class with a
configuration object. The shortcut name is referred to as an alias
(or xtype
if the
class extends Ext.Component). The alias/xtype is listed next to the class name of
applicable classes for quick reference.
Framework classes or their members may be specified as private
or protected
. Else,
the class / member is public
. Public
, protected
, and private
are access
descriptors used to convey how and when the class or class member should be used.
Public classes and class members are available for use by any other class or application code and may be relied upon as a stable and persistent within major product versions. Public classes and members may safely be extended via a subclass.
Protected class members are stable public
members intended to be used by the
owning class or its subclasses. Protected members may safely be extended via a subclass.
Private classes and class members are used internally by the framework and are not intended to be used by application developers. Private classes and members may change or be omitted from the framework at any time without notice and should not be relied upon in application logic.
static
label next to the
method name. *See Static below.Below is an example class member that we can disect to show the syntax of a class member (the lookupComponent method as viewed from the Ext.button.Button class in this case).
Let's look at each part of the member row:
lookupComponent
in this example)( item )
in this example)Ext.Component
in this case). This may be omitted for methods that do not
return anything other than undefined
or may display as multiple possible values
separated by a forward slash /
signifying that what is returned may depend on the
results of the method call (i.e. a method may return a Component if a get method calls is
successful or false
if unsuccessful which would be displayed as
Ext.Component/Boolean
).PROTECTED
in
this example - see the Flags section below)Ext.container.Container
in this example). The source
class will be displayed as a blue link if the member originates from the current class
and gray if it is inherited from an ancestor or mixed-in class.view source
in the example)item : Object
in the example).undefined
a "Returns" section
will note the type of class or object returned and a description (Ext.Component
in the
example)Available since 3.4.0
- not pictured in
the example) just after the member descriptionDefaults to: false
)The API documentation uses a number of flags to further commnicate the class member's function and intent. The label may be represented by a text label, an abbreviation, or an icon.
classInstance.method1().method2().etc();
false
is returned from
an event handler- Indicates a framework class
- A singleton framework class. *See the singleton flag for more information
- A component-type framework class (any class within the Ext JS framework that extends Ext.Component)
- Indicates that the class, member, or guide is new in the currently viewed version
- Indicates a class member of type config
- Indicates a class member of type property
- Indicates a class member of type
method
- Indicates a class member of type event
- Indicates a class member of type
theme variable
- Indicates a class member of type
theme mixin
- Indicates that the class, member, or guide is new in the currently viewed version
Just below the class name on an API doc page is a row of buttons corresponding to the types of members owned by the current class. Each button shows a count of members by type (this count is updated as filters are applied). Clicking the button will navigate you to that member section. Hovering over the member-type button will reveal a popup menu of all members of that type for quick navigation.
Getting and setter methods that correlate to a class config option will show up in the methods section as well as in the configs section of both the API doc and the member-type menus just beneath the config they work with. The getter and setter method documentation will be found in the config row for easy reference.
Your page history is kept in localstorage and displayed (using the available real estate) just below the top title bar. By default, the only search results shown are the pages matching the product / version you're currently viewing. You can expand what is displayed by clicking on the button on the right-hand side of the history bar and choosing the "All" radio option. This will show all recent pages in the history bar for all products / versions.
Within the history config menu you will also see a listing of your recent page visits. The results are filtered by the "Current Product / Version" and "All" radio options. Clicking on the button will clear the history bar as well as the history kept in local storage.
If "All" is selected in the history config menu the checkbox option for "Show product details in the history bar" will be enabled. When checked, the product/version for each historic page will show alongside the page name in the history bar. Hovering the cursor over the page names in the history bar will also show the product/version as a tooltip.
Both API docs and guides can be searched for using the search field at the top of the page.
On API doc pages there is also a filter input field that filters the member rows using the filter string. In addition to filtering by string you can filter the class members by access level, inheritance, and read only. This is done using the checkboxes at the top of the page.
The checkbox at the bottom of the API class navigation tree filters the class list to include or exclude private classes.
Clicking on an empty search field will show your last 10 searches for quick navigation.
Each API doc page (with the exception of Javascript primitives pages) has a menu view of metadata relating to that class. This metadata view will have one or more of the following:
Ext.button.Button
class has an alternate class name of Ext.Button
). Alternate class
names are commonly maintained for backward compatibility.Runnable examples (Fiddles) are expanded on a page by default. You can collapse and expand example code blocks individually using the arrow on the top-left of the code block. You can also toggle the collapse state of all examples using the toggle button on the top-right of the page. The toggle-all state will be remembered between page loads.
Class members are collapsed on a page by default. You can expand and collapse members using the arrow icon on the left of the member row or globally using the expand / collapse all toggle button top-right.
Viewing the docs on narrower screens or browsers will result in a view optimized for a smaller form factor. The primary differences between the desktop and "mobile" view are:
The class source can be viewed by clicking on the class name at the top of an API doc page. The source for class members can be viewed by clicking on the "view source" link on the right-hand side of the member row.
With the introduction of GXT 3.1's Theme Builder, you can now get started on generating a theme as a huge set of appearances, with only a few starting settings.
Get started quickly with a demo project.
The themer can be run in several ways. The easiest way to get started with it from the command line is to run one of
the pre-built scripts provided in the GXT download script. The themer.bat
file is written for running on Windows,
while the themer.sh
is written to work on Mac OS X. These scripts assume that Java 7 is set up correctly for use on
the command line, and specify the location of a platform-specific PhantomJS installation.
Creating a script that works on Linux simply requires downloading the correct version of
PhantomJS and specifying the path to the executable.
The themer can also be run directly from Java, perhaps as an Ant target or as part of the Maven exec:java goal.
These options are available on both Windows and Mac.
usage: ThemeBuilder [options] [config ...]
-gen <path> directory to generate code to
-generateConfig <outputFile> Generate sample configuration
-h,--help print this message
-imageFile <path> captured image used for slicing images
-imagePath <path> provides the directory where custom icons can be provided
-manifestFile <manifestFile> json manifest file of the captured image
-out <jar> path to jar file to generate. Default is
a jar named <theme.name>.jar in the
current directory
-warDir <warDir> directory to compile the css3-based theme
to before images are sliced from it
Maven can be used to execute the theme builder. This is best shown through the example archetype project creation.
The Theme Builder supports passing multiple configuration files. All configuration details can exist in a single file, but in some cases it may be convenient to separate these configurations into multiple files. This can help break up a large file into different "detail" groups; such as myconfig-base.theme, myconfig-tools.theme, myconfig-window.theme, etc.
Another benefit to this functionality is if an application needs to be able to support multiple themes. Common configuration components can be pulled out into a separate file and re-used between theme generations. This can help reduce copy and paste as well as maintenance between these multiple themes.
All configuration files are processed in order they appear on the command-line. Order would typically not matter if there is a clear separation of configuration options in each file, but if the same configuration exists in multiple files, then the last one wins. There is no indication in the command output that multiple configurations exist, so it is up to the developer to identify these.
As with a single configuration file option, a full configuration must be available when running the theme generator. If any parts are missing, an error will be displayed indicating which paths are missing and must be corrected before the generator will continue.
Custom icons can be provided through -imagePath <path>
. They can be Raster or SVG file types.
GXT 3.1 icon overrides must clobber the path they are given in the theme builder.
Directory layout for overriding icons in 3.1 using the -imagePath <path>.
Remember they can be images using .jpg or .png.
./checkmark.svg
./dropdown.svg
./icons/button/arrow.svg
./icons/button/arrowBottom.svg
./icons/button/split.svg
./icons/button/splitBottom.svg
./icons/button/toolBarArrow.svg
./icons/button/toolBarArrowBottom.svg
./icons/button/toolBarButtonSplit.svg
./icons/button/toolBarButtonSplitBottom.svg
./icons/container/moreIcon.svg
./icons/container/moreIconToolBar.svg
./icons/field/allLeft.svg
./icons/field/allRight.svg
./icons/field/clearTrigger.svg
./icons/field/dateTrigger.svg
./icons/field/down.svg
./icons/field/exclamation.svg
./icons/field/left.svg
./icons/field/right.svg
./icons/field/spinnerDown.svg
./icons/field/spinnerUp.svg
./icons/field/triggerArrow.svg
./icons/field/up.svg
./icons/grid/checked.svg
./icons/grid/collapse.svg
./icons/grid/columnHeaderBtn.svg
./icons/grid/columnsIcon.svg
./icons/grid/expand.svg
./icons/grid/groupBy.svg
./icons/grid/sortAscendingIcon.svg
./icons/grid/sortAscHeaderIcon.svg
./icons/grid/sortDescendingIcon.svg
./icons/grid/sortDescHeaderIcon.svg
./icons/grid/unchecked.svg
./icons/menu/checked.svg
./icons/menu/groupChecked.svg
./icons/menu/menuParent.svg
./icons/menu/miniBottom.svg
./icons/menu/miniTop.svg
./icons/menu/unchecked.svg
./icons/statusproxy/dropAllowed.svg
./icons/statusproxy/dropNotAllowed.svg
./icons/tabs/scrollerLeft.svg
./icons/tabs/scrollerRight.svg
./icons/tabs/tabClose.svg
./icons/tips/anchorBottom.svg
./icons/tips/anchorLeft.svg
./icons/tips/anchorRight.svg
./icons/tips/anchorTop.svg
./icons/toolbar/first.svg
./icons/toolbar/last.svg
./icons/toolbar/next.svg
./icons/toolbar/prev.svg
./icons/toolbar/refresh.svg
./icons/tools/close.svg
./icons/tools/collapse.svg
./icons/tools/doubleDown.svg
./icons/tools/doubleLeft.svg
./icons/tools/doubleRight.svg
./icons/tools/doubleUp.svg
./icons/tools/down.svg
./icons/tools/expand.svg
./icons/tools/gear.svg
./icons/tools/left.svg
./icons/tools/maximize.svg
./icons/tools/minimize.svg
./icons/tools/minus.svg
./icons/tools/pin.svg
./icons/tools/plus.svg
./icons/tools/print.svg
./icons/tools/question.svg
./icons/tools/refresh.svg
./icons/tools/restore.svg
./icons/tools/right.svg
./icons/tools/save.svg
./icons/tools/search.svg
./icons/tools/unpin.svg
./icons/tools/up.svg
./icons/tree/arrowDown.svg
./icons/tree/arrowRight.svg
./icons/tree/checked.svg
./icons/tree/folder.svg
./icons/tree/folderOpen.svg
./icons/tree/partial.svg
./icons/tree/unchecked.svg
./icons/widget/downIcon.svg
./icons/widget/leftButton.svg
./icons/widget/miniBottom.svg
./icons/widget/miniLeft.svg
./icons/widget/miniRight.svg
./icons/widget/miniTop.svg
./icons/widget/rightButton.svg
./setting.svg
./toggle.svg
./tree_collapse.svg
./tree_expand.svg
On Windows, you can run:
> themebuilder/bin/themer.bat
Example using the quick-start theme configuration.
$ .\themebuilder\bin\themer.bat .\themebuilder\examples\quick-start\quick-start.theme
On OS X, you can run:
$ ./themebuilder/bin/themer.sh
Example using the quick-start theme configuration.
$ ./themebuilder/bin/themer.sh ./themebuilder/examples/quick-start/quick-start.theme
The Themer runner console output will look something like this.
Example output.
template generation started
template generation complete
image generation started
generating tool icons
Saving sliced image to /private/var/folders/x8/9wz7qtw96t7grkdyjw1l61p40000gn/T/temp7830532799076699840.1/com/example/client/sliced/window/window-r.png
Slicing complete - generated 225 images
slice complete
packaging started
packaging complete
The quickstart theme has finished generating.
Copy the jar (/Path/To/Jar/quickstart.jar) into your project and copy the following line into your gwt.xml file:
<inherits name="com.example.Theme" />
There are four examples in the GXT 3.1 download zip, besides the neptune.theme
file that describes the new Neptune
theme. These can be found in the themebuilder/examples
directory, and each have their own readme.txt file.
skeleton-config/
- As the name suggests, this includes just the bare bones. Only the properties that are required
are included, in such a way as to let you see all the options and decide for yourself what to change to build a
theme.quick-start/
- This sample has all of the necessary properties already filled out, most of which are built to key
off of values defined at the top of the file. This allows you to make very few changes to get a rough start of your
ideal theme very quickly. Then you can dig in further and make more changes to get exactly what your project needs.maven-jar/
- This is a sample Maven project that starts from the quick-start theme.
When mvn install
is run on it, it reads from the config, and builds the entire jar file necessary for the theme,
and installs it in your local repository. This is based on the pom.xml
that is used for generating the Neptune
theme.maven-source/
- Also a Maven project, this instead let you generate a set of source files into your src/
directory where you can modify them directly to make whatever changes you'd like. To reset back to the initial
settings or to update with a new version of GXT you can re-run the mvn install -Pgenerate
command to update the
sources, and re-apply changes you need. This lets you version control your own changes, on top of the generated
theme.skeleton-config.theme
file..\themebuilder\examples\skeleton-config\skeleton-config.theme
./themebuilder/examples/skeleton-config/skeleton-config.theme
.\themebuilder\bin\themer.bat .\themebuilder\examples\skeleton-config\skeleton-config.theme
./themebuilder/bin/themer.sh ./themebuilder/examples/skeleton-config/skeleton-config.theme
quick-start.theme
values..\themebuilder\examples\quick-start\quick-start.theme
./themebuilder/examples/quick-start/quick-start.theme
.\themebuilder\bin\themer.bat .\themebuilder\examples\quick-start\quick-start.theme
./themebuilder/bin/themer.sh ./themebuilder/examples/quick-start/quick-start.theme
quickstart.jar
in the same directory the themer command was run.maven-jar
named themeDetails.theme
.maven-jar
directory.cd .\themebuilder\examples\maven-jar
cd ./themebuilder/examples/maven-jar
mvn install
.sample-theme-1.0.0-SNAPSHOT.jar
.maven-source
named themeDetails.theme
.maven-source
.cd .\themebuilder\examples\maven-source
cd ./themebuilder/examples/maven-source
mvn install -Pgenerate
.src/main/java
to fit your specific needsmvn install
.sample-theme-1.0.0-SNAPSHOT.jar
.mvn install -Pgenerate
is later run, it will restore the source to its original state.After the theme has been generated, copy the jar and add it to the classpath of the library, then add it to the GWT module.
The theme package naming used in the inherits is derived from the basePackage
property in the theme configuration.
Generate the theme.
MyGxtProject31/lib
library folder in the root of the project. (The lib name can be changed.)quickstart.jar
to the MyGxtProject31/lib
folder.Add the theme by adding <inherits name="com.example.Theme" />
to the MyGxtProject31.gwt.xml configuration.
Example snippet from the MyGxtProject31.gwt.xml.
<!-- <inherits name='com.sencha.gxt.theme.blue.Blue'/> -->
<!-- <inherits name='com.sencha.gxt.theme.gray.Gray' /> -->
<!-- <inherits name="com.sencha.gxt.theme.neptune.Theme" /> -->
<inherits name="com.example.Theme" />
Example MyGxtProject31.gwt.xml configuration using the generated theme.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD GWT 2.7.0//EN"
"http://gwtproject.org/doctype/2.7.0/gwt-module.dtd">
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User' />
<!-- Other module inherits -->
<inherits name='com.sencha.gxt.ui.GXT' />
<inherits name='com.sencha.gxt.chart.Chart' />
<!-- GXT Stylesheet -->
<stylesheet src="reset.css" />
<!-- <inherits name='com.sencha.gxt.theme.blue.Blue'/> -->
<!-- <inherits name='com.sencha.gxt.theme.gray.Gray' /> -->
<!-- <inherits name="com.sencha.gxt.theme.neptune.Theme" /> -->
<inherits name="com.example.Theme" />
<!-- Specify the app entry point class. -->
<entry-point class='com.sencha.gxt.test.client.MyGxtProject31EntryPoint' />
<!-- Specify the paths for translatable code -->
<source path='client' />
<source path='shared' />
<!-- <set-configuration-property name="CssResource.style" value="pretty" /> -->
</module>
Forking the neptune theme can be done by taking Neptune
theme configuration file and customizing it.
gxt-theme-neptune.jar
to gxt-theme.neptune.zip
.gxt-theme-neptune.zip
contents../gxt-theme-neptune/neptune.theme
with a text editor.name
property to something like name = "custom_neptune"
.basePackage
to something like tld.domain.theme.custom_neptune
.../themebuilder/bin/themer.sh ./neptune.theme
custom_neptune.jar
is generated.Add to Build Path
<inherits name="tld.domain.theme.custom_neptune.Theme" />
gxt-theme-neptune.jar
to gxt-theme.neptune.zip
.gxt-theme-neptune.zip
contents..\gxt-theme-neptune\neptune.theme
with a text editor.name
property to something like name = "custom_neptune"
.basePackage
to something like tld.domain.theme.custom_neptune
...\themebuilder\bin\themer.bat .\neptune.theme
custom_neptune.jar
is generated.Add to Build Path
<inherits name="tld.domain.theme.custom_neptune.Theme" />
Customize the Triton theme named Tritium in the template project here.
This error will occur if the application tries to access a theme that has not been generated yet. Run the theme builder to generate the missing theme and be sure the theme jar is available on the classpath.
Super Dev Mode starting up
workDir: /var/folders/x8/9wz7qtw96t7grkdyjw1l61p40000gn/T/gwt-codeserver-1988045627584289815.tmp
Loading modules
com.example.project.MyThemeSandbox
Loading inherited module 'com.example.project.MyThemeSandbox'
Loading inherited module 'com.example.project.MyThemeSandbox'
Loading inherited module 'com.example.project.Theme'
Loading inherited module 'com.example.project.Theme'
[ERROR] Unable to find 'com/example/project/Theme.gwt.xml' on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source?
[ERROR] Unable to find 'com/example/project/Theme.gwt.xml' on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source?
[ERROR] shell failed in doStartup method