public void actionPerformed(ActionEvent evt) { if (_session != null) { IPlugin plugin = _session.getApplication().getDummyAppPlugin(); IObjectTreeAPI treeAPI = _session.getSessionInternalFrame().getObjectTreeAPI(); IDatabaseObjectInfo[] dbs = treeAPI.getSelectedDatabaseObjects(); ObjectTreeNode[] nodes = treeAPI.getSelectedNodes(); if (dbs.length > 0) new ShrinkDatabaseCommand(_session, _plugin, dbs).execute(); } }
public void actionPerformed(ActionEvent evt) { if (_session != null) { IPlugin plugin = _session.getApplication().getDummyAppPlugin(); IObjectTreeAPI treeAPI = _session.getSessionInternalFrame().getObjectTreeAPI(); IDatabaseObjectInfo[] dbs = treeAPI.getSelectedDatabaseObjects(); ObjectTreeNode[] nodes = treeAPI.getSelectedNodes(); if (dbs.length > 0) new TruncateLogCommand(_session, _plugin, dbs).execute(); } }
/** * Since the catalog has changed, it is necessary to reload the schema info and expand the tables node * in the tree. Saves the user a few clicks. * * @param session * the session whose ObjectTreePanel should be updated * @param selectedCatalog * the catalog that was selected. */ private void expandTablesForCatalog(ISession session, String selectedCatalog) { IObjectTreeAPI api = session.getObjectTreeAPIOfActiveSessionWindow(); api.refreshTree(true); if (api.selectInObjectTree(selectedCatalog, null, new FilterMatcher("TABLE", null))) { ObjectTreeNode[] nodes = api.getSelectedNodes(); if (nodes.length > 0) { ObjectTreeNode tableNode = nodes[0]; // send a tree expansion event to the object tree api.expandNode(tableNode); } } } }
/** * Since the catalog has changed, it is necessary to reload the schema info and expand the tables node * in the tree. Saves the user a few clicks. * * @param session * the session whose ObjectTreePanel should be updated * @param selectedCatalog * the catalog that was selected. */ private void expandTablesForCatalog(ISession session, String selectedCatalog) { IObjectTreeAPI api = session.getObjectTreeAPIOfActiveSessionWindow(); api.refreshTree(true); if (api.selectInObjectTree(selectedCatalog, null, new FilterMatcher("TABLE", null))) { ObjectTreeNode[] nodes = api.getSelectedNodes(); if (nodes.length > 0) { ObjectTreeNode tableNode = nodes[0]; // send a tree expansion event to the object tree api.expandNode(tableNode); } } } }
public void actionPerformed(ActionEvent evt) { if (_session != null) { IPlugin plugin = _session.getApplication().getDummyAppPlugin(); IObjectTreeAPI treeAPI = _session.getSessionInternalFrame().getObjectTreeAPI(); IDatabaseObjectInfo[] dbs = treeAPI.getSelectedDatabaseObjects(); ObjectTreeNode[] nodes = treeAPI.getSelectedNodes(); if (dbs.length > 0) { if (Dialogs.showYesNo(_session.getSessionSheet(), MSG, TITLE)) { try { new DropDatabaseCommand(_session, _plugin, dbs).execute(); treeAPI.removeNodes(nodes); } catch (Throwable th) { _session.showErrorMessage(th); } } } } }
removeActionsOfType(coll,ShrinkDatabaseFileAction.class); final ObjectTreeNode[] nodes = _treeAPI.getSelectedNodes(); if (nodes.length != 1) return;