* @param id
* The id of the {@link IWindowTrim} to update
*/
private void updateTrim(String id) {
// Get the trim part from the trim manager
IWindowTrim trim = tbm.getTrim(id);
// If it's not there there's not much we can do
if (trim == null)
return;
// If there are no fast views for the bar then hide it
List fvs = (List) idToFastViewsMap.get(id);
if (fvs != null && fvs.size() == 0
&& !FastViewBar.FASTVIEWBAR_ID.equals(id)) {
if (trim.getControl().getVisible()) {
tbm.setTrimVisible(trim, false);
tbm.forceLayout();
}
return;
}
// Ensure that the trim is displayed
if (!trim.getControl().getVisible()) {
tbm.setTrimVisible(trim, true);
}
if (trim instanceof FastViewBar) {
FastViewBar fvb = (FastViewBar) trim;
fvb.update(true);
} else if (trim instanceof ViewStackTrimToolBar) {
ViewStackTrimToolBar vstb = (ViewStackTrimToolBar) trim;
vstb.update(true);
vstb.getControl().pack();
LayoutUtil.resize(trim.getControl());
}
tbm.forceLayout();
}