Details
-
Sub-task
-
Resolution: Done
-
Major
-
4.0.0.Beta1
-
None
Description
While profiling VPE JUnits it seems that up to 70% of all time of their execution is performed in the method org.jboss.tools.jst.jsp.selection.bar.SelectionBar.setVisible(boolean):
public void setVisible(boolean visible) { if (visible) { splitter.setVisible(realBar, true); splitter.setVisible(emptyBar, false); } else { splitter.setVisible(realBar, false); splitter.setVisible(emptyBar, true); } /* JBIDE-7387: * By default toolbar size is set to fit regular button ToolItems. * But drop-down items are a little bigger and do not * fit in the default-size toolbars (at least under Windows XP). * This temporary ToolItem is needed to set enough size to the toolbar.*/ ToolItem tempItem = new ToolItem(toolbar, SWT.DROP_DOWN); tempItem.setText(" "); //$NON-NLS-1$ tempItem.setEnabled(false); this.getParent().layout(true, true); tempItem.dispose(); }
The call of this.getParent().layout(true, true); is very expensive.
I could suggest two fixes here:
- The panel should know if it is already visible or not. If the same state is requested, the method should do nothing.
- [Optionally!] Calculate the height of the toolbar only once, and then just pass this height to the layout manager.