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 4.0 Theme Builder, you can now get started by generating a theme while choosing from a huge selection of visual choices. This new functionality can be instigated with only a few starting settings.
Java 7
Sencha Professional Services can also build themes for you. You can inquire about professional services options here.
The themer can be run in several ways. The easiest way to get started is from the command line. You can do this by running one of the pre-built scripts provided in the GXT download script.
The themer.bat
file is meant to work with Windows,
The themer.sh
is written to work on Mac OS X.
Creating a script that works on Linux simply requires downloading the correct version of PhantomJS and specifying the path to the executable file.
The themer can also be run directly from Java as an Ant target or as part of the Maven exec:java goal.
Note: These scripts assume that Java 7 is set up for command line use, and that location of a platform-specific PhantomJS installation has been specified.
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.
-gwtXmlFilename <gwtXmlFilename> Give ability to rename the Theme.gwt.xml file to something else. Must end with .gwt.xml.
-h,--help Print this message.
-i,--imagePath <customImagePath> Optional path to custom images or SVG files for image generation.
-imageFile <path> Captured image used for slicing images.
-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.
-slicedDisabled <slicedDisabled> Whether sliced version of the theme is disabled - flat themes or modern browsers. Default is false.
-sourcesOnly <boolean> Sources only vs compile and jar. Default is false.
-warDir <warDir> Directory to compile the css3-based theme to before images are sliced from it.
As one option, you may use Maven to execute the theme builder. This is best shown through the example archetype project.
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. Once example of a such an organizational method could be myconfig-base.theme
,
myconfig-tools.theme
, myconfig-window.theme
, etc.
This functionality also supports the ability to maintain multiple themes for a single application. Common configuration components can be abstracted out into separate files and re-used between theme generations. This can help minimize maintenance between multiple themes while reducing copy/paste.
All configuration files are processed in the order they appear on the command line.
Typically, the order doesn’t matter so long as there is a clear separation between
configuration options in each file. However, if the same configuration exists in multiple
files, 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 scenarios.
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. These must be corrected before the generator will continue.
Custom icons can be provided through -imagePath <path>
. These icons can be Raster or SVG file types.
The icon naming can be given like icon.svg
, iconOver.svg
, or iconClick.svg
. The default icon displays in all cases,
the over icon is for mouse hovering, and the click icon is for click selection.
When SVG files are used, an icon.css
template file can be given to override styles in the SVG file.
GXT 4.x icon overrides must use the identical given in the theme builder.
The directory layout for overriding icons in 4.x using the -imagePath .jpg
or .png
.
icons
icons/button
icons/button/arrow.cssTemplate
icons/button/arrow.svg
icons/button/arrowBottom.svg
icons/button/split.cssTemplate
icons/button/split.svg
icons/button/splitBottom.cssTemplate
icons/button/splitBottom.svg
icons/button/toolBarArrow.cssTemplate
icons/button/toolBarArrow.svg
icons/button/toolBarArrowBottom.cssTemplate
icons/button/toolBarArrowBottom.svg
icons/button/toolBarButtonSplit.cssTemplate
icons/button/toolBarButtonSplit.svg
icons/button/toolBarButtonSplitBottom.cssTemplate
icons/button/toolBarButtonSplitBottom.svg
icons/container
icons/container/moreIcon.cssTemplate
icons/container/moreIcon.svg
icons/container/moreIconToolBar.cssTemplate
icons/container/moreIconToolBar.svg
icons/field
icons/field/allLeft.svg
icons/field/allRight.svg
icons/field/bold.cssTemplate
icons/field/bold.svg
icons/field/checked.cssTemplate
icons/field/checked.svg
icons/field/clearTrigger.cssTemplate
icons/field/clearTrigger.svg
icons/field/dateTrigger.cssTemplate
icons/field/dateTrigger.svg
icons/field/down.svg
icons/field/exclamation.svg
icons/field/fontDecrease.cssTemplate
icons/field/fontDecrease.svg
icons/field/fontHighlight.cssTemplate
icons/field/fontHighlight.svg
icons/field/fontIncrease.cssTemplate
icons/field/fontIncrease.svg
icons/field/italic.cssTemplate
icons/field/italic.svg
icons/field/justifyCenter.cssTemplate
icons/field/justifyCenter.svg
icons/field/justifyLeft.cssTemplate
icons/field/justifyLeft.svg
icons/field/justifyRight.cssTemplate
icons/field/justifyRight.svg
icons/field/left.svg
icons/field/link.cssTemplate
icons/field/link.svg
icons/field/ol.cssTemplate
icons/field/ol.svg
icons/field/radioSelected.cssTemplate
icons/field/radioSelected.svg
icons/field/radioUnselected.cssTemplate
icons/field/radioUnselected.svg
icons/field/right.svg
icons/field/source.cssTemplate
icons/field/source.svg
icons/field/spinnerDown.cssTemplate
icons/field/spinnerDown.svg
icons/field/spinnerUp.cssTemplate
icons/field/spinnerUp.svg
icons/field/triggerArrow.cssTemplate
icons/field/triggerArrow.svg
icons/field/ul.cssTemplate
icons/field/ul.svg
icons/field/unchecked.cssTemplate
icons/field/unchecked.svg
icons/field/underline.cssTemplate
icons/field/underline.svg
icons/field/up.svg
icons/grid
icons/grid/checked.cssTemplate
icons/grid/checked.svg
icons/grid/collapse.cssTemplate
icons/grid/collapse.svg
icons/grid/columnHeaderBtn.cssTemplate
icons/grid/columnHeaderBtn.svg
icons/grid/columnsIcon.cssTemplate
icons/grid/columnsIcon.svg
icons/grid/expand.cssTemplate
icons/grid/expand.svg
icons/grid/groupBy.cssTemplate
icons/grid/groupBy.svg
icons/grid/sortAscendingIcon.cssTemplate
icons/grid/sortAscendingIcon.svg
icons/grid/sortAscHeaderIcon.cssTemplate
icons/grid/sortAscHeaderIcon.svg
icons/grid/sortDescendingIcon.cssTemplate
icons/grid/sortDescendingIcon.svg
icons/grid/sortDescHeaderIcon.cssTemplate
icons/grid/sortDescHeaderIcon.svg
icons/grid/unchecked.cssTemplate
icons/grid/unchecked.svg
icons/menu
icons/menu/activeMenuParent.cssTemplate
icons/menu/activeMenuParent.svg
icons/menu/checked.cssTemplate
icons/menu/checked.svg
icons/menu/groupChecked.cssTemplate
icons/menu/groupChecked.svg
icons/menu/menuParent.cssTemplate
icons/menu/menuParent.svg
icons/menu/miniBottom.cssTemplate
icons/menu/miniBottom.svg
icons/menu/miniTop.cssTemplate
icons/menu/miniTop.svg
icons/menu/unchecked.cssTemplate
icons/menu/unchecked.svg
icons/statusproxy
icons/statusproxy/dropAllowed.svg
icons/statusproxy/dropNotAllowed.svg
icons/tabs
icons/tabs/activePlainTabClose.cssTemplate
icons/tabs/activePlainTabClose.svg
icons/tabs/activeTabClose.cssTemplate
icons/tabs/activeTabClose.svg
icons/tabs/plainTabClose.cssTemplate
icons/tabs/plainTabClose.svg
icons/tabs/scrollerLeft.svg
icons/tabs/scrollerRight.svg
icons/tabs/tabClose.cssTemplate
icons/tabs/tabClose.svg
icons/tips
icons/tips/anchorBottom.cssTemplate
icons/tips/anchorBottom.svg
icons/tips/anchorLeft.cssTemplate
icons/tips/anchorLeft.svg
icons/tips/anchorRight.cssTemplate
icons/tips/anchorRight.svg
icons/tips/anchorTop.cssTemplate
icons/tips/anchorTop.svg
icons/toolbar
icons/toolbar/first.cssTemplate
icons/toolbar/first.svg
icons/toolbar/last.cssTemplate
icons/toolbar/last.svg
icons/toolbar/next.cssTemplate
icons/toolbar/next.svg
icons/toolbar/prev.cssTemplate
icons/toolbar/prev.svg
icons/toolbar/refresh.cssTemplate
icons/toolbar/refresh.svg
icons/tools
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
icons/tree/arrowDown.cssTemplate
icons/tree/arrowDown.svg
icons/tree/arrowRight.cssTemplate
icons/tree/arrowRight.svg
icons/tree/checked.cssTemplate
icons/tree/checked.svg
icons/tree/folder.cssTemplate
icons/tree/folder.svg
icons/tree/folderOpen.cssTemplate
icons/tree/folderOpen.svg
icons/tree/partial.cssTemplate
icons/tree/partial.svg
icons/tree/unchecked.cssTemplate
icons/tree/unchecked.svg
icons/widget
icons/widget/downIcon.cssTemplate
icons/widget/downIcon.svg
icons/widget/leftButton.cssTemplate
icons/widget/leftButton.svg
icons/widget/miniBottom.svg
icons/widget/miniLeft.svg
icons/widget/miniRight.svg
icons/widget/miniTop.svg
icons/widget/rightButton.cssTemplate
icons/widget/rightButton.svg
On Windows, you can run:
> themebuilder/bin/themer.bat
Here's an 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
Here's an 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" />
You can fork the Neptune theme by customizing the neptune.theme
or triton.theme
configuration files.
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.
Note: Copy the jar to the project library folder, which could be named gxt-project/lib
folder.gxt_project/lib/custom_neptune.jar
and Add to Build Path
<inherits name="tld.domain.theme.custom_neptune.Theme" />
Note: Be sure to disable any other themes in the gxt_project module configuration.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.
Note: Copy the jar to the project library folder, which could be named gxt-project/lib
folder.gxt_project\lib\custom_neptune.jar
and Add to Build Path
<inherits name="tld.domain.theme.custom_neptune.Theme" />
Note: Be sure to disable any other themes in the gxt_project module configuration.There are four examples in the GXT 4.0 download zip found within the themebuilder/examples
directory. Each folder contains its own readme.txt
file.
skeleton-config/
- As the name suggests, this is just bare bones and only contains the
properties that are required for theme building. It presents all of the options and lets you decide what to change when
building a 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/
- This sample has all of the necessary properties pre-filled. Most of these properties 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. You can then dig in further to make more changes and get exactly what your project needs.
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/
- This is a sample Maven project that inherits from the "quick-start" theme.
Running mvn install
reads from the config and builds the entire jar file necessary
for the theme, installing it in your local repository. This is based on the
pom.xml
that is used for generating the "Neptune theme".
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/
- This is a Maven project that lets you generate a set of source
files into your src/
directory where you can then modify them directly. To reset back to the initial settings or
to update with a new version of GXT, simply 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.
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 a theme has been generated, simply 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.
MyGxtProject40/lib
library folder in the root of the project. (The lib name can be changed.)quickstart.jar
to the MyGxtProject40/lib
folder.<inherits name="com.example.Theme" />
to the MyGxtProject40.gwt.xml configuration.Example snippet from the MyGxtProject40.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 MyGxtProject40.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.MyGxtProject40EntryPoint' />
<!-- Specify the paths for translatable code -->
<source path='client' />
<source path='shared' />
<!-- <set-configuration-property name="CssResource.style" value="pretty" /> -->
</module>
New properties have been added to 4.0. The output will list the missing properties when upgrading from an older theme configuration file.
Example of running the theme builder and finding missing properties
$ ./themebuilder/bin/themer.sh ./themebuilder/examples/quick-start/quick-start.theme
Exception in thread "main" com.sencha.gxt.themebuilder.ConfigHandler$ConfigError: Configuration Errors:
Missing property: theme.details.field.radio
Missing property: theme.details.field.radio.boxLabel
Missing property: theme.details.field.radio.boxLabel.size
Missing property: theme.details.field.radio.boxLabel.family
Missing property: theme.details.field.radio.boxLabel.color
...
This error will occur if the application tries to access a theme that has not yet been generated. 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