use of org.openide.util.RequestProcessor in project netbeans-rcp-lite by outersky.
the class ConfigureToolbarPanel method paint.
@Override
public void paint(java.awt.Graphics g) {
super.paint(g);
if (firstTimeInit) {
// this is not very nice but some Actions insist on being accessed
// from the event queue only so let's wait till the dialog window is
// painted before filtering out Actions without an icon
firstTimeInit = false;
new RequestProcessor("ToolbarPanelConfigWarmUp").post(new // NOI18N
Runnable() {
@Override
public void run() {
// warm up action nodes so that 'expand all' in actions tree is fast
Node[] categories = root.getChildren().getNodes(true);
for (int i = 0; i < categories.length; i++) {
final Node category = categories[i];
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
category.getChildren().getNodes(true);
}
});
}
// replace 'please wait' message with actions tree
SwingUtilities.invokeLater(ConfigureToolbarPanel.this);
}
});
}
}
Aggregations