use of org.talend.cwm.compare.ui.actions.ReloadDatabaseAction in project tdq-studio-se by Talend.
the class ReloadDatabaseProvider method fillContextMenu.
@Override
public void fillContextMenu(IMenuManager menu) {
// MOD mzhao user readonly role on svn repository mode.
if (!isShowMenu()) {
return;
}
// MOD bug 16532 scorreia 2010-10-19 hide menu when not in TOP standalone
// if (!PluginChecker.isOnlyTopLoaded()) {
// return;
// }
// ~
Object obj = ((TreeSelection) this.getContext().getSelection()).getFirstElement();
if (obj instanceof RepositoryNode) {
RepositoryNode node = (RepositoryNode) obj;
if (shouldShowReloadMenu(node)) {
String menuText = RELOADDATABASE_MENUTEXT;
if (node instanceof DBTableFolderRepNode) {
menuText = RELOADTABLES_MENUTEXT;
} else if (node instanceof DBViewFolderRepNode) {
menuText = RELOADVIEWS_MENUTEXT;
} else if (node instanceof DBColumnFolderRepNode) {
menuText = RELOADCOLUMNS_MENUTEXT;
}
// menu.add(new ReloadDatabaseAction(node.getObject(), menuText));
menu.add(new ReloadDatabaseAction(node, menuText));
}
}
}
use of org.talend.cwm.compare.ui.actions.ReloadDatabaseAction in project tdq-studio-se by Talend.
the class TDQCompareService method reloadDatabase.
/*
* (non-Javadoc)
*
* @see org.talend.core.ITDQCompareService#reloadDatabase(org.talend.core.model.properties.ConnectionItem)
*/
/**
* Comment method "reloadDatabase".
*
* @param connectionItem
*/
public ReturnCode reloadDatabase(ConnectionItem connectionItem) {
ReturnCode retCode = new ReturnCode(Boolean.TRUE);
Connection conn = connectionItem.getConnection();
if (conn instanceof DatabaseConnection) {
// MOD TDQ-7528 20130627 yyin: no need to popup select compare dialog
ReloadDatabaseAction reloadDatabaseAction = new ReloadDatabaseAction(conn, ReloadDatabaseProvider.RELOADDATABASE_MENUTEXT, false);
reloadDatabaseAction.run();
retCode = reloadDatabaseAction.getReturnCode();
}
return retCode;
}
Aggregations