Docs Help

Terms, Icons, and Labels

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.

Access Levels

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.

Member Types

Member Syntax

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).

lookupComponent ( item ) : Ext.Component
protected

Called when a raw config object is added to this container either during initialization of the items config, or when new items are added), or {@link #insert inserted.

This method converts the passed object into an instanced child component.

This may be overridden in subclasses when special processing needs to be applied to child creation.

Parameters

item :  Object

The config object being added.

Returns
Ext.Component

The component to be added.

Let's look at each part of the member row:

Member Flags

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.

Class Icons

- 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

Member Icons

- 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

Class Member Quick-Nav Menu

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.

Getter and Setter Methods

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.

History Bar

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.

Search and Filters

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.

API Doc Class Metadata

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:

Expanding and Collapsing Examples and Class Members

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.

Desktop -vs- Mobile View

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:

Viewing the Class Source

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.

GXT 3.x


top

Generating Themes

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.

Reference

Project Templates

Get started quickly with a demo project.

Requirements

  • Java 7

Running the Themer

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.

Java launcher options

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 launcher options

Maven can be used to execute the theme builder. This is best shown through the example archetype project creation.

Multiple configuration file support

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

Custom icons can be provided through -imagePath <path>. They can be Raster or SVG file types.

  • The icon naming can be given like icon.svg, iconOver.svg or iconClick.svg. The default icon is for everything. The over icon is for mouse hovering. The click icon is for selection.
  • When SVG files are used, a icon.cssTemplate file can be given to override styles in the SVG file.
  • 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
    

Windows runner

  • 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
    

Mac runner

  • 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
    

Console output

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" />
    

Quick start examples

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.

Generating the skeleton-config theme

  1. Open and add all the values to the properties in the skeleton-config.theme file.
    • Windows: .\themebuilder\examples\skeleton-config\skeleton-config.theme
    • Mac: ./themebuilder/examples/skeleton-config/skeleton-config.theme
  2. Generate the theme.
    • Windows: .\themebuilder\bin\themer.bat .\themebuilder\examples\skeleton-config\skeleton-config.theme
    • Mac: ./themebuilder/bin/themer.sh ./themebuilder/examples/skeleton-config/skeleton-config.theme
  3. Find the generated theme jar in the same directory the themer command was run.

Generating the quickstart-config theme

  1. Optional modify the quick-start.theme values.
    • Windows: .\themebuilder\examples\quick-start\quick-start.theme
    • Mac: ./themebuilder/examples/quick-start/quick-start.theme
  2. Generate the theme.
    • Windows: .\themebuilder\bin\themer.bat .\themebuilder\examples\quick-start\quick-start.theme
    • Mac: ./themebuilder/bin/themer.sh ./themebuilder/examples/quick-start/quick-start.theme
  3. Find the generated theme quickstart.jar in the same directory the themer command was run.

Generating the maven-jar theme

  1. Optional: modify the theme in the directory maven-jar named themeDetails.theme.
  2. Change to the maven-jar directory.
    • Windows: cd .\themebuilder\examples\maven-jar
    • Mac: cd ./themebuilder/examples/maven-jar
  3. Generate the theme by running mvn install.
  4. Find the generated theme in the target directory named sample-theme-1.0.0-SNAPSHOT.jar.

Generating the maven-source theme

  1. Optional: modify the theme in the directory maven-source named themeDetails.theme.
  2. Change to the maven-source.
    • Windows: cd .\themebuilder\examples\maven-source
    • Mac: cd ./themebuilder/examples/maven-source
  3. Generate the theme sources by running mvn install -Pgenerate.
  4. Modify any source in src/main/java to fit your specific needs
  5. Generate the theme jar by running mvn install.
  6. Find the generated theme in the target directory named sample-theme-1.0.0-SNAPSHOT.jar.
  7. If mvn install -Pgenerate is later run, it will restore the source to its original state.

Using the theme

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.

  • Create a MyGxtProject31/lib library folder in the root of the project. (The lib name can be changed.)
  • Copy the generated theme 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>
    

Customizing Neptune

Forking the neptune theme can be done by taking Neptune theme configuration file and customizing it.

Mac

  1. Download GXT 3.1 zip file.
  2. Extract GXT 3.1 zip file.
  3. Rename gxt-theme-neptune.jar to gxt-theme.neptune.zip.
  4. Extract the gxt-theme-neptune.zip contents.
  5. Open and modify the ./gxt-theme-neptune/neptune.theme with a text editor.
    • Change the name property to something like name = "custom_neptune".
    • Change the basePackage to something like tld.domain.theme.custom_neptune.
    • Modify properties in the theme to produce the desired theming.
  6. Generate the theme with ../themebuilder/bin/themer.sh ./neptune.theme
  7. A jar named custom_neptune.jar is generated.
    • Copy the jar to the project library folder, which could be named gxt-project/lib folder.
  8. Right click on gxt_project/lib/custom_neptune.jar and Add to Build Path
  9. Then add the theme to the gxt_project module <inherits name="tld.domain.theme.custom_neptune.Theme" />
    • Be sure to disable any other themes in the gxt_project module configuration.
  10. Run the application and verify theme was loaded.
  11. Return to Step 5 for more theme modifications.

Windows

  1. Download GXT 3.1 zip file.
  2. Extract GXT 3.1 zip file.
  3. Rename gxt-theme-neptune.jar to gxt-theme.neptune.zip.
  4. Extract the gxt-theme-neptune.zip contents.
  5. Open and modify the .\gxt-theme-neptune\neptune.theme with a text editor.
    • Change the name property to something like name = "custom_neptune".
    • Change the basePackage to something like tld.domain.theme.custom_neptune.
    • Modify properties in the theme to produce the desired theming.
  6. Generate the theme with ..\themebuilder\bin\themer.bat .\neptune.theme
  7. A jar named custom_neptune.jar is generated.
    • Copy the jar to the project library folder, which could be named gxt-project/lib folder.
  8. Right click on gxt_project\lib\custom_neptune.jar and Add to Build Path
  9. Then add the theme to the gxt_project module <inherits name="tld.domain.theme.custom_neptune.Theme" />
    • Be sure to disable any other themes in the gxt_project module configuration.
  10. Run the application and verify theme was loaded.
  11. Return to Step 5 for more theme modifications.

Customizing Triton

Customize the Triton theme named Tritium in the template project here.

Errors

Missing Theme.gwt.xml

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

GXT 3.x