Open Source & Free  

New Feature: Inspect Component

New Feature: Inspect Component

We’ve added support for "Inspect Component", which is similar to the "Inspect Element" feature available in Chrome.
Inspect Component - Codename One

Continuing in the direction of improving the development experience inside the Codename One simulator, we have made another batch of small improvements this week. Notably, we’ve added support for “Inspect Component”, which is similar to the “Inspect Element” feature available in Chrome. Now, if you right-click on a component in the simulator, it will provide you with a context menu.

Figure 1. The "Inspect Component" option in the context menu.

If you select the “Inspect Component” option in this menu, it will select the selected component in the “Components” panel, and in the “Component details”.

The “Component Inspector” has been available as part of the simulator for a long time, but selecting a particular component used to require you to expand the component tree nodes manually until you found the component you were looking for.

The simulator would help you a little bit by placing a translucent red highlight over the currently selected node’s corresponding component, but it could still be a little bit tedious to have to manually walk through the tree to find the component you wanted.

Figure 2. After choosing "Inspect Component", the "Components" panel auto-expands and selects the corresponding node, and the "Component details" panel is populated with the selected component details.

You’ll notice also, that the “Component Details” will automatically populate with the details of your selected component. Most for the fields in the component details form are read only, but the UIID field can be edited, allowing you to experiment with different styles for your elements directly in the simulator.

Disabling the Context Menu

If your application needs to handle “Right Mouse-click” events, then the context menu may interfere with your app. In such cases you can disable the context menu by toggling the arrow button button found on the toolbar of the Components panel. Once toggled off, the button icon will change to arrow button disabled.
Figure 3. The "Components" panel toolbar, which includes a toggle button to enable/disable the context menu.

4 Comments

Leave a Reply