Cosmetics  JBuilder OpenTool


Cosmetics  is an OpenTool add-on for the JBuilder IDE. It provides a number of options for making cosmetic alterations to the JBuilder user interface. These options do not significantly change the behavior of JBuilder, but they do make it easier to use.

These options are:


The Properties Page

Most of the alterations are controlled using the Cosmetics  property page, which can be found in the IDE Options dialog box. The property page is shown in the following image. For help on any of the options in the dialog, click on the option in the image.

Figure 1. Properties Page
Align tabs Fixed height tabs Rotate tab runs Highlight selected tab Tab width limit Splitter appearance


Aligning the Content Pane Tabs

JBuilder uses a Swing JTabbedPane for its content pane tabs, and Swing always displays tab labels centered within the tab. This is fine in many cases, but when the content pane tabs are arranged vertically, it is not ideal. Scanning down a list of centered labels for a given file name is not very easy.

Cosmetics provides an option to align the tabs in a vertical tab run to the left rather than centered. This option is enabled by checking the Align Tabs checkbox in the Cosmetics properties page.

Figure 2. Tab alignment
Default
Aligned


Limiting the Width of Content Pane Tabs

JBuilder has options for controlling what appears in the content pane tabs. But no matter which option is selected, if just one of the open files has a rather long name, all tabs will be wide enough to accomodate it. This takes away from the space used for the content pane.

Cosmetics provides an option for limiting the width of the content pane tabs. This option is enabled by entering a width value (in pixels) into the Tab Width Limit field in the properties page. If this field is left blank, there will be no limit, and tabs will be as wide as needed to display the longest file name.

Immediately below the Tab Width Limit field, Cosmetics  shows the Maximum Tab Width. This is the maximum "normal" width (in pixels) of all the tabs currently displayed in the content pane. This indicates how wide the tabs would be if there were no limit imposed.

Figure 3. Tab width limits
Not limited
Limited


Hiding the Content Pane Tabs

Cosmetics allows you to hide the content pane tabs altogether, providing more space for the content window itself. This feature is not controlled through the property page like other options. Instead, it can be controlled using a bound keystroke, a toolbar button (shown at the right), or from the View menu Content tabs menu entry.

The default keystroke to toggle the content pane tabs is Ctrl+Alt+T, but it can be changed using the JBuilder Keymapping editor. This is accessed from the IDE Options dialog, Browser tab by pressing the Customize... button. The action is named toggle-content-tabs and can be found under the Browser category.

Figure 4. Hiding content tabs
Showing
Hidden


Highlighting the Selected Tab

When using the Metal or CDE/Motif look-and-feel, JTabbedPane will always highlight the selected tab; with the Windows look-and-feel it does not. Instead, the selected tab is drawn slightly offset from the rest of the tabs, making the tab appear to be pushed outward. This effect is fine, but it does not stand out very well amongst a large number of tabs arranged in multiple runs.

Cosmetics provides the Highlight Selected Tab option, which will cause the JTabbedPane to highlight the selected tab when the Windows look-and-feel is used. This option has no effect when the Metal or CDE/Motif look-and-feel are in use, since they always highlight the selected tab.

Figure 7. Highlighting the Selected Tab
Not Highlighted
Highlighted


Fixed Height Tabs

When there are too many tabs to fit along the edge of the Swing JTabbedPane's content area, the JTabbedPane breaks the tabs into multiple rows when tabs are arranged vertically, or columns when tabs are arranged horizontally. Each grouping of tabs is referred to as a tab run.

Normally, when JTabbedPane needs more than one tab run, it "normalizes" the tab runs, distributing the tabs amongst the different runs. Then it fills each tab run by expanding the tabs to occupy the entire space allocated to the tab run. This looks fine with horizontal tab runs, but not with vertical tab runs.

Cosmetics provides the Fixed height tabs option to eliminate the normalization of tab runs when the tabs are arranged vertically. When this option is selected and tabs are arranged vertically, all of the tabs will be of the same height, and each tab run will be filled to capacity before a tab is placed into the next tab run.

When this option is selected, I recommend that you turn off the Rotate Tab Runs option. The effect is not esthetically pleasing when both options are selected.

Figure 5. Fixed height tabs
Varying height
Fixed height


Rotating Tab Runs

When using the Windows or the CDE/Motif look-and-feel and multiple tab runs are required, JTabbedPane will "rotate" the tab runs so the selected tab is always in the tab run closest to the content of the JTabbedPane. In other words, if two tab runs are required and the selected tab is in the second tab run, the entire second tab run will move into the "normal" position of the first tab run.

Some like this effect. It is not a problem with a small number of tabs, but when you have a large number of open files in JBuilder the effect is disturbing, since the position of the individual tabs keeps changing. This rotation can make it difficult to keep track of where the tab for a particular file is.

Cosmetics provides the Rotate Tab Runs option, which can be turned off to eliminate this effect. Note that the Metal look-and-feel does not rotate tab runs, so this option has no effect when the Metal look-and-feel is selected.

Figure 6. Rotate Tab runs
Rotated
Not rotated


Changing the appearance of splitter bars

JBuilder uses splitters to separate the different panes in the JBuilder browser window: "Project", "Structure", "Content", and "Message". A splitter is a container that holds two components with a splitter bar between the two components. The splitter allows you to use the mouse to "grab" the splitter bar and drag it to a new position, resizing the two components that it separates.

JBuilder's splitter bar is painted the same as the plain background of the browser. This makes it hard to find the splitter bar with the mouse to adjust the splitter when the components do not both have borders.

This is shown in Figure 8 below. Image (8a) shows the mouse positioned on what appears to be the border between JBuilder's content pane and message pane. Image (8b) shows the mouse positioned on the actual splitter bar, a little bit above the apparent position.

Cosmetics provides an option to change the appearance of splitter bars, as shown in image (8c), which makes it easier to "find" the splitter bar. This option can be selected for just the splitter bar between the message and content panes, or for all other splitter bars in the browser. These options are provided because the message pane splitter is the only one that is really difficult to locate.

Figure 8. Splitter bars
(a) Below splitter
(b) On splitter
(c) Splitter showing


Copyright © 2000, John P. McGrath