CET Developer Guides

Tutorial: Adopting the new UI style for Extension Libraries

21min
Component Availability
Added
CET 15.0 Major and above


Adoption Strategy and Considerations



Review New UI Adoption Info for recommendations and more details.

New UI Features

The new CET UI has introduced new features and a new look for component tab libraries, helping you to achieve a more consistent look and feel while organizing your content or products in a more logical way. These features can be enabled by setting the facelift parameter to true when creating the Library.

Fika Example

Here's an example of how to migrate an old extension library to the new Facelift style, using the Fika Office extension without utilizing any new images.

For the sake of simplicity, we will not be using any of the new advanced features, and no icons will be updated. To see how to use those new features, refer to Components Area (Toolbox) and Content Layout of a Component Tab.

The original Fika Office extension library
The original Fika Office extension library


Step 1: Enable Facelift mode

Refactor your code to return a classic and facelift library depending if the user has toggled facelift. For extensions using lazy.xml, you can specify separate library functions in lazy.xml. This handles mapping of different function names in Components Tab Configurator.

XML


Alternatively, if you have no other injection point you can swap out libraries in the library function instead.

CM


Now we have classic and facelifted libraries. For the facelift library function, pass facelift=true into the CompanyLibrary constructor.

CM


Setting this flag causes the following to happen:

  1. Left/right margins are set to 16px.
  2. Sections use the new style with inline button support.
  3. Buttons will use a white background with a blue border on hover.
  4. Material limbs use the new facelift style with a brush icon.

After this change, the Fika extension library now looks like this:

Fika Office with just facelift=true
Fika Office with just facelift=true


Step 2: Use the new library header

The old header at the top is quite large, and scrolls along with the rest of the toolbox contents. Let's replace this with the new header introduced in Facelift which will give us a schemes dropdown for free!

CM


Which now gets us the new static library header, with a scheme dropdown on the right:

Fika Office with scheme selector
Fika Office with scheme selector


Step 3: Consolidate separate Global sections

As you can see from the previous image, the global section looks very sparse. We can consolidate the two Global sections across separate toolboxes.

CM


This results in the Global section to look like this:

Document image


For the Picklist, Finish Legend and Elevation tool, we will be refering to Product Button to size the buttons correctly. Check Drawing and Project Information are tools that spawn modal dialogs which will be refering to Tool Button. We can fix the buttons up with the help of facelift hints. A list of facelift hints can be found in cm/core/library/commonHints.cm

CM


This results in the following look for the Global section.

An updated Global section
An updated Global section


If this was a real port of Fika Office to Facelift, we would take this opportunity to refresh the the icons to account for new look and the sizes. I.e. Use 16 x 16 images for the tool buttons.

Step 4: Move Global to an Extension Tab

To further clean things up, we can separate out the Global section to its own tab.

CM


This results in the Fika toolbox split into two tabs.

Products and Global tabs
Products and Global tabs


Step 5: Re-organize Panels section

Let's start by bringing panel symbols and the manager up into product buttons. We will also introduce a new Tile tools sub section.

CM


As we are using the faceliftSubSetAndButtonGroupOrganizer, we can remove labelMinWidth override from our MaterialLimb.

CM


This leads up to a nice look for Panels, and a sub section for material limbs.

Panel section with Tile tools
Panel section with Tile tools


The next step is to work on the panel / tile animations. As the first step, we will be treating them as product buttons.

CM


This would be how existing images for animations map out to product buttons.

Using product buttons for tools
Using product buttons for tools


As these are animation/tools, to match the facelift guidelines they should be Tool Button. To use a tool button, you can use the getToolButtonHint function and pass along a 16 x 16 image. Alternatively, you could forego the image with skipRenderImage=true for SnapperLimb and AnimationLimb.

CM

Panel section facelifted
Panel section facelifted


Step 5: Consolidate Worksurface and Support section

For worksurfaces, we start by defining the relevant product button hint into the parent worksurfaceGroup limb. This hint will apply on all of its children limbs.

CM

Worksufaces with product buttons
Worksufaces with product buttons


The next step would be to consolidate tools for the Worksurface into a sub section.

CM


This gives the Worksurface a new steamlined look.

Worksurfaces with support tools
Worksurfaces with support tools


Step 6: Combine Storage section

We can begin by combining the low and upper storage sections, then apply the relevant product button hint to the parent storageGroup (which will propagate to all the child limbs).

CM

Storage combined
Storage combined


Step 7: Finishing touches

Following the process outlined in the previous step, we make small refineminets to the Table and Chair sections.

CM


Which finally results in this:

Tables and Chairs
Tables and Chairs


To compare the output with "full" facelift that includes new icons, here is a comparison.

Facelift exising image vs full facelift
Facelift exising image vs full facelift