How to set ToolbarControl properties


Summary
This topic shows how the various properties of the ToolbarControl can be set by clicking a button using the Java Property Editor and the Properties window in the Eclipse integrated development environment (IDE). The Java Property Editor is one of the easier interfaces that the ArcGIS Engine software development kit (SDK) provides for developers. Use it to set visual properties and add command items to the toolbar. The buddy for the ToolbarControl can be initialized during design time using the Properties window.

Setting ToolbarControl properties

Do the following to set ToolbarControl properties:
  1. Create an ArcGIS Engine project in the Eclipse IDE using the ToolbarControl. For more information, see How to build an application in Eclipse using visual beans. The following screen shot shows an example JFrame in design mode:

  2. Right-click the ESRI ToolbarControl and click Customize Java Bean. The Java Property Editor dialog box appears. The visual properties of the ToolbarControl, such as border style, appearance, and mouse pointer can be set using the Java Property Editor. See the following screen shot:


  3. On the Java Property Editor dialog box, click the General tab. The following table explains the other areas that can be selected under the General tab:
    Labels
    ToolbarControl methods
    Description
    Default value
    Enabled
    Indicates whether the ToolbarControl can respond to user generated events.
    True
    Arrow Key Intercept
    A property that specifies interception of key strokes that are normally handled by the container. When intercepted, the OnKeyDown and OnKeyUp events will be called.
    0
  4. The Java Property Editor dialog box is also used to add command items to the ToolbarControl during design time. Do the following to set the properties on the Java Property Editor dialog box for the ToolbarControl:
    1. Click the Items tab on the Java Property Editor dialog box. See the following screen shot:

    2. Click Add on the preceding Java Property Editor dialog box. The Controls Commands dialog box appears. The Controls Commands dialog box shows a Commands tab, which lists out-of-the-box standard categories and commands. See the following screen shot:

    3. On the preceding Controls Commands dialog box, click the appropriate command or commands, then click Add Command. Click Close after the command items are added. The commands are added to the Java Property Editor dialog box under the Items tab. See the following screen shot:

    4. The Remove All button on the preceding Java Property Editor dialog box removes all added command items together. Other properties of the ToolbarControl, such as item appearance, text alignment, and update interval can be set. Update interval determines the frequency in milliseconds in which the update method is called on the ToolbarControl. The following table explains the other areas that can be selected under the Items tab:
      Label
      ToolbarControl methods
      Description
      Default value
      Large Icon
      Shows large icons for all items on the ToolbarControl.
      False
      Tooltips
      Shows ToolTips.
      True
      MenuTracking
      Enables menu tracking on the ToolbarControl.
      False
  5. Right-click a command item to delete or modify individual commands, such as the following Style and Begin Group:
    • Style—Determines how command items show on the toolbar, such as Text Only (command name), Image Only (command icon), or Image and Text (command icon and name). By default, the Style property is set to Image Only.
    • Begin Group—Determines if a separator shows before the command item. By default, the Begin Group Property is set to false.

      See the following screen shot:

  6. Alternatively, properties, such as the BuddyControl, can also be modified using the Properties window in the Eclipse IDE. Click the BuddyControl property on the Properties window and choose the appropriate buddy from the drop-down list under the Value column. The buddy can be a globe, scene, page layout, or map bean. See the following screen shot:

  7. Similarly, command items of the ToolbarControl can also be added using the Properties window in the Eclipse IDE. Click the ellipses (…) button under the Value column for the ItemsString property to add command items to the toolbar. See the following screen shot:

 
The TOCControl properties can be modified using the Java Property Editor and Properties window in the Eclipse IDE.


See Also:

ToolbarControl class
Toolbar control overview
How to build an application in Eclipse using visual beans




Development licensingDeployment licensing
Engine Developer KitEngine
ArcGIS for Desktop Basic
ArcGIS for Desktop Standard
ArcGIS for Desktop Advanced