iter.remove();
}
}
private JMenu addToMssqlTableMenu(JMenu menu) {
final IApplication app = getApplication();
final ActionCollection coll = app.getActionCollection();
final MssqlPlugin plugin = this;
final JMenu mssqlMenu;
if (menu == null)
mssqlMenu = _resources.createMenu(MssqlResources.IMenuResourceKeys.MSSQL);
else
mssqlMenu = menu;
_resources.addToMenu(coll.get(UpdateStatisticsAction.class), mssqlMenu);
final JMenu showStatisticsMenu = _resources.createMenu(MssqlResources.IMenuResourceKeys.SHOW_STATISTICS);
showStatisticsMenu.addMenuListener(new MenuListener() {
public void menuSelected(MenuEvent e) {
final JMenu menu = (JMenu) e.getSource();
menu.removeAll();
removeActionsOfType(coll,ShowStatisticsAction.class);
iterateIndexes(new IndexIterationListener() {
public void indexSpotted(final ITableInfo tableInfo, final String indexName) {
final ShowStatisticsAction showStatisticsAction = new ShowStatisticsAction(app,_resources,plugin,tableInfo,indexName);
showStatisticsAction.setSession(_session);
coll.add(showStatisticsAction);
_resources.addToMenu(showStatisticsAction,menu);
}
});
}
public void menuDeselected(MenuEvent e) { }
public void menuCanceled(MenuEvent e) { }
}
);
final JMenu indexDefragMenu = _resources.createMenu(MssqlResources.IMenuResourceKeys.INDEXDEFRAG);
indexDefragMenu.addMenuListener(new MenuListener() {
public void menuSelected(MenuEvent e) {
final JMenu menu = (JMenu) e.getSource();
menu.removeAll();
removeActionsOfType(coll,IndexDefragAction.class);
app.getThreadPool().addTask(new IteratorIndexesTask(menu));
}
public void menuDeselected(MenuEvent e) { }
public void menuCanceled(MenuEvent e) { }
}
);