Index: ChangeLog =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/ChangeLog,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 ChangeLog *** ChangeLog 21 Nov 2003 18:30:19 -0000 1.1.1.1 --- ChangeLog 22 Dec 2003 19:31:03 -0000 *************** *** 1,3 **** --- 1,163 ---- + 2003-12-19 Deepak Bhole + + * src/com/redhat/rhdb/admin/AdminBackendClient.java + (getBackendVersion): Fix improper comparisions in function that caused + it to return incorrect version in some cases. + * src/com/redhat/rhdb/admin/DatabaseUpdate.java (renameDatabase): Add + new function to rename a database. + * src/com/redhat/rhdb/admin/GroupUpdate.java (renameGroup): Add + new function to rename a group. + * src/com/redhat/rhdb/admin/OperatorClassUpdate.java (renameOpClass): + Add new function to rename an operator class. + * src/com/redhat/rhdb/admin/RenameDialog.java (constructor): Change + function to set title correctly when renaming elements that have a + custom signature. Also, change function to put the current name in + quotes if Auto-Quote Identifiers is off. + (doOKAction): Add handling for renaming of databases, groups, operator + classes, schemas and users. Also, fix code for repositioning selector + back to newly named item (old one didn't handle certain conditions + well). + * src/com/redhat/rhdb/admin/SchemaUpdate.java (renameGroup): Add + new function to rename a schema. + * src/com/redhat/rhdb/admin/UserUpdate.java (userGroup): Add + new function to rename a user. + * src/com/redhat/rhdb/admin/resources/AdminResources.java: Added some + new strings in English. + * src/com/redhat/rhdb/admin/tree/AbstractCustomSignatureFactory.java + (getOpClassDataTypesFromSignature): New function. Returns the + datatypes of an operator class given a signature. + (getOpClassSignature): new function. Returns an op class signature + given name, am and data types. + * src/com/redhat/rhdb/admin/tree/AdminGenericTreeNode.java + (getPopupMenu): Change function to take a client as an argument, and + also pass it to getNodeMenu(). + * src/com/redhat/rhdb/admin/tree/AdminTree.java (processPopupEvent): + Pass the client to getPopupmenu(). + * src/com/redhat/rhdb/admin/tree/AdminTreeNode.java (getPopupMenu): + Change fucntion to take an AdminBackendClient as an argument. + (getNodeMenu): Ditto. + * src/com/redhat/rhdb/admin/tree/AggregateNode.java (getNodeMenu): + Ditto. + * src/com/redhat/rhdb/admin/tree/AggregatesHeaderNode.java + (getNodeMenu): Ditto. + * src/com/redhat/rhdb/admin/tree/CastNode.java (getNodeMenu): Ditto. + * src/com/redhat/rhdb/admin/tree/CastsHeaderNode.java (getNodeMenu): + Ditto. + * src/com/redhat/rhdb/admin/tree/CheckConstraintNode.java + (getNodeMenu): Ditto. + * src/com/redhat/rhdb/admin/tree/ClusterNode.java (getNodeMenu): + Ditto. + * src/com/redhat/rhdb/admin/tree/ColumnGenericNode.java (getNodeMenu): + Ditto. + * src/com/redhat/rhdb/admin/tree/ColumnsGenericHeaderNode.java + (getNodeMenu): Ditto. + * src/com/redhat/rhdb/admin/tree/ColumnsUnderTableHeaderNode.java + (getNodeMenu): Ditto. + * src/com/redhat/rhdb/admin/tree/ColumnsUnderViewHeaderNode.java + (getNodeMenu): Ditto. + * src/com/redhat/rhdb/admin/tree/ColumnUnderTableNode.java + (getNodeMenu): Ditto. + * src/com/redhat/rhdb/admin/tree/ColumnUnderViewNode.java + (getNodeMenu): Ditto. + * src/com/redhat/rhdb/admin/tree/ConstraintsHeaderNode.java + (getNodeMenu): Ditto. + * src/com/redhat/rhdb/admin/tree/ConversionNode.java (getNodeMenu): + Ditto. + * src/com/redhat/rhdb/admin/tree/ConversionsHeaderNode.java + (getNodeMenu): Ditto. + * src/com/redhat/rhdb/admin/tree/DatabaseNode.java (doMenuAction): Add + handling for RENAME DATABASE. + (getNodeMenu): Change fucntion to take an AdminBackendClient as an + argument. Also, add menu option for RENAME DATABASE when backend + is > 7.3 + * src/com/redhat/rhdb/admin/tree/DatabasesHeaderNode.java + (getNodeMenu): Change fucntion to take an AdminBackendClient as an + argument. + * src/com/redhat/rhdb/admin/tree/DataTypeNode.java (getNodeMenu): + Ditto. + * src/com/redhat/rhdb/admin/tree/DataTypesHeaderNode.java + (getNodeMenu): Ditto. + * src/com/redhat/rhdb/admin/tree/DomainNode.java (getNodeMenu): Ditto. + * src/com/redhat/rhdb/admin/tree/DomainsHeaderNode.java (getNodeMenu): + Ditto. + * src/com/redhat/rhdb/admin/tree/DummyNode.java (getNodeMenu): Ditto. + * src/com/redhat/rhdb/admin/tree/FKConstraintNode.java (getNodeMenu): + Ditto. + * src/com/redhat/rhdb/admin/tree/FunctionNode.java (getNodeMenu): + Ditto. + * src/com/redhat/rhdb/admin/tree/FunctionsHeaderNode.java + (getNodeMenu): Ditto. + * src/com/redhat/rhdb/admin/tree/GroupNode.java (doMenuAction): Add + handling for RENAME GROUP. + (getNodeMenu): Change fucntion to take an AdminBackendClient as an + argument. Also, add menu option for RENAME GROUP when backend + is > 7.3. + * src/com/redhat/rhdb/admin/tree/GroupsHeaderNode.java (getNodeMenu): + Change fucntion to take an AdminBackendClient as an argument. + * src/com/redhat/rhdb/admin/tree/IndexesHeaderNode.java (getNodeMenu): + Ditto. + * src/com/redhat/rhdb/admin/tree/IndexNode.java (getNodeMenu): Ditto. + * src/com/redhat/rhdb/admin/tree/LanguageNode.java (getNodeMenu): + Ditto. + * src/com/redhat/rhdb/admin/tree/LanguagesHeaderNode.java + (getNodeMenu): Ditto. + * src/com/redhat/rhdb/admin/tree/OperatorClassesHeaderNode.java + (getNodeMenu): Ditto. + * src/com/redhat/rhdb/admin/tree/OperatorClassNode.java + (doMenuAction): Add handling for RENAME OPERATOR CLASS. + (getNodeMenu): Change fucntion to take an AdminBackendClient as an + argument. Also, add menu option for RENAME OPERATOR CLASS when backend + is > 7.3. + * src/com/redhat/rhdb/admin/tree/OperatorNode.java (getNodeMenu): + Change fucntion to take an AdminBackendClient as an argument. + * src/com/redhat/rhdb/admin/tree/OperatorsHeaderNode.java + (getNodeMenu): Ditto. + * src/com/redhat/rhdb/admin/tree/PKConstraintNode.java (getNodeMenu): + Ditto. + * src/com/redhat/rhdb/admin/tree/RootNode.java (getNodeMenu): Ditto. + * src/com/redhat/rhdb/admin/tree/RuleGenericNode.java (getNodeMenu): + Ditto. + * src/com/redhat/rhdb/admin/tree/RulesGenericHeaderNode.java + (getNodeMenu): Ditto. + * src/com/redhat/rhdb/admin/tree/RulesUnderTableHeaderNode.java + (getNodeMenu): Ditto. + * src/com/redhat/rhdb/admin/tree/RulesUnderViewHeaderNode.java + (getNodeMenu): Ditto. + * src/com/redhat/rhdb/admin/tree/RuleUnderTableNode.java + (getNodeMenu): Ditto. + * src/com/redhat/rhdb/admin/tree/RuleUnderViewNode.java (getNodeMenu): + Ditto. + * src/com/redhat/rhdb/admin/tree/SchemaNode.java (doMenuAction): Add + handling for RENAME SCHEMA. + (getNodeMenu): Change fucntion to take an AdminBackendClient as an + argument. Also, add menu option for RENAME SCHEMA when backend + is > 7.3. + * src/com/redhat/rhdb/admin/tree/SchemasHeaderNode.java (getNodeMenu): + Change fucntion to take an AdminBackendClient as an argument. + * src/com/redhat/rhdb/admin/tree/SequenceNode.java (getNodeMenu): + Ditto. + * src/com/redhat/rhdb/admin/tree/SequencesHeaderNode.java + (getNodeMenu): Ditto. + * src/com/redhat/rhdb/admin/tree/TableNode.java (getNodeMenu): Ditto. + * src/com/redhat/rhdb/admin/tree/TablesHeaderNode.java (getNodeMenu): + Ditto. + * src/com/redhat/rhdb/admin/tree/TriggerNode.java (getNodeMenu): + Ditto. + * src/com/redhat/rhdb/admin/tree/TriggersHeaderNode.java + (getNodeMenu): Ditto. + * src/com/redhat/rhdb/admin/tree/UniqueConstraintNode.java + (getNodeMenu): Ditto. + * src/com/redhat/rhdb/admin/tree/UserNode.java (doMenuAction): Add + handling for RENAME USER. + (getNodeMenu): Change fucntion to take an AdminBackendClient as an + argument. Also, add menu option for RENAME USER when backend + is > 7.3. + * src/com/redhat/rhdb/admin/tree/UsersHeaderNode.java (getNodeMenu): + Change fucntion to take an AdminBackendClient as an argument. + * src/com/redhat/rhdb/admin/tree/ViewNode.java (getNodeMenu): Ditto. + * src/com/redhat/rhdb/admin/tree/ViewsHeaderNode.java (getNodeMenu): + Ditto. + 2003-11-21 Fernando Nasser * Initial public revision. Index: src/com/redhat/rhdb/admin/AdminBackendClient.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/AdminBackendClient.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 AdminBackendClient.java *** src/com/redhat/rhdb/admin/AdminBackendClient.java 21 Nov 2003 18:30:19 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/AdminBackendClient.java 22 Dec 2003 19:31:03 -0000 *************** public class AdminBackendClient { *** 106,117 **** public double getBackendVersion(String clusterName) throws ClassNotFoundException, IOException, SQLException { Connection conn = connPool.getConnection(clusterName); ! if (((Jdbc3Connection) conn).getDBVersionNumber().compareTo("7.2") >= 0 ! && ((Jdbc3Connection) conn).getDBVersionNumber().compareTo("7.4") <= 0) return 7.3; ! if (((Jdbc3Connection) conn).getDBVersionNumber().compareTo("7.3") >= 0 ! && ((Jdbc3Connection) conn).getDBVersionNumber().compareTo("7.5") <= 0) return 7.4; // FIXME: What should the "default" be? --- 106,117 ---- public double getBackendVersion(String clusterName) throws ClassNotFoundException, IOException, SQLException { Connection conn = connPool.getConnection(clusterName); ! if (((Jdbc3Connection) conn).getDBVersionNumber().compareTo("7.2") > 0 ! && ((Jdbc3Connection) conn).getDBVersionNumber().compareTo("7.4") < 0) return 7.3; ! if (((Jdbc3Connection) conn).getDBVersionNumber().compareTo("7.3") > 0 ! && ((Jdbc3Connection) conn).getDBVersionNumber().compareTo("7.5") < 0) return 7.4; // FIXME: What should the "default" be? Index: src/com/redhat/rhdb/admin/DatabaseUpdate.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/DatabaseUpdate.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 DatabaseUpdate.java *** src/com/redhat/rhdb/admin/DatabaseUpdate.java 21 Nov 2003 18:30:22 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/DatabaseUpdate.java 22 Dec 2003 19:31:03 -0000 *************** public class DatabaseUpdate extends Obje *** 215,219 **** --- 215,250 ---- } } + + /** + * Renames a database + * + * @param client The backend client. + * @param node the invoking database node. + * @param name the new name of the database. + * @throws ObjectUpdateException if the database cannot be renamed. + */ + + public static void renameDatabase(AdminBackendClient client, DatabaseNode node, String name) throws ObjectUpdateException { + + String updateString = "ALTER DATABASE "; + + updateString += AdminMiscFunctions.getDoubleQuotedIdentifier(node.toString()); + + updateString += " RENAME TO " + name; + + // perform the update. Any errors are passed to the parent + + // Need to drop connection to current database first.. + + client.dropConnection(node.getParentClusterName(), node.toString()); + + try { + client.performUpdate(node.getParentClusterName(), "template1", updateString); + } catch (Exception e) { + throw new ObjectUpdateException(e.getMessage()); + } + + } } Index: src/com/redhat/rhdb/admin/GroupUpdate.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/GroupUpdate.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 GroupUpdate.java *** src/com/redhat/rhdb/admin/GroupUpdate.java 21 Nov 2003 18:30:23 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/GroupUpdate.java 22 Dec 2003 19:31:03 -0000 *************** package com.redhat.rhdb.admin; *** 16,21 **** --- 16,22 ---- import java.util.*; import com.redhat.rhdb.admin.resources.*; + import com.redhat.rhdb.admin.tree.*; import com.redhat.rhdb.admin.utils.*; /** *************** public class GroupUpdate extends ObjectU *** 184,188 **** --- 185,216 ---- } catch (Exception e) { throw new ObjectUpdateException(e.getMessage()); } + } + + /** + * Renames a group + * + * @param client The backend client. + * @param node the invoking group node. + * @param name the new name of the group. + * @throws ObjectUpdateException if the group cannot be renamed. + */ + + public static void renameGroup(AdminBackendClient client, GroupNode node, String name) throws ObjectUpdateException { + + String updateString = "ALTER GROUP "; + + updateString += AdminMiscFunctions.getDoubleQuotedIdentifier(node.toString()); + + updateString += " RENAME TO " + name; + + // perform the update. Any errors are passed to the parent + + try { + client.performUpdate(node.getParentClusterName(), "template1", updateString); + } catch (Exception e) { + throw new ObjectUpdateException(e.getMessage()); + } + } } Index: src/com/redhat/rhdb/admin/OperatorClassUpdate.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/OperatorClassUpdate.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 OperatorClassUpdate.java *** src/com/redhat/rhdb/admin/OperatorClassUpdate.java 21 Nov 2003 18:30:23 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/OperatorClassUpdate.java 22 Dec 2003 19:31:03 -0000 *************** public abstract class OperatorClassUpdat *** 151,155 **** --- 151,188 ---- } } + + + /** + * Renames an operator class + * + * @param client The backend client. + * @param node the invoking table node. + * @param name the new name of the op class. + * @throws ObjectUpdateException if the table cannot be renamed. + */ + + public static void renameOpClass(AdminBackendClient client, OperatorClassNode node, String name) throws ObjectUpdateException { + + // Index method.. + + String im = node.getAccessMethod(); + + String updateString = "ALTER OPERATOR CLASS "; + + updateString += AdminMiscFunctions.getDoubleQuotedIdentifier(node.getParentSchemaName()) + "."; + updateString += AdminMiscFunctions.getDoubleQuotedIdentifier(node.getName()); + updateString += " USING " + im; + updateString += " RENAME TO " + name; + + // perform the update. Any errors are passed to the parent + + try { + client.performUpdate(node.getParentClusterName(), node.getParentDatabaseName(), updateString); + } catch (Exception e) { + throw new ObjectUpdateException(e.getMessage()); + } + + } } Index: src/com/redhat/rhdb/admin/RenameDialog.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/RenameDialog.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 RenameDialog.java *** src/com/redhat/rhdb/admin/RenameDialog.java 21 Nov 2003 18:30:24 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/RenameDialog.java 22 Dec 2003 19:31:04 -0000 *************** public class RenameDialog extends AlterC *** 45,52 **** this.invocationNode = node; // update title and name box ! setTitle(AdminResources.getString(AdminResources.DLG_RENAME_TITLE, objectType.toUpperCase(), invocationNode.toString())); ! jtfName.setText(invocationNode.toString()); jlbName.setText(AdminResources.getString(AdminResources.DLG_RENAME_LABEL, objectType)); centerDialog(); --- 45,69 ---- this.invocationNode = node; // update title and name box ! ! // Some nodes such as Operator Classes have names embedded inside the ! // signature. We need to put it in the rename dialog appropriately. ! ! String name = invocationNode.toString(); ! ! if (invocationNode instanceof OperatorClassNode) { ! name = ((OperatorClassNode) invocationNode).getName(); ! } ! ! setTitle(AdminResources.getString(AdminResources.DLG_RENAME_TITLE, objectType.toUpperCase(), name)); ! ! // Put the name in quotes for the user if auto quoting is off ! ! if (!AdminConfig.autoQuoteIdentifiers()) { ! name = AdminMiscFunctions.getDoubleQuotedIdentifier(name); ! } ! ! jtfName.setText(name); jlbName.setText(AdminResources.getString(AdminResources.DLG_RENAME_LABEL, objectType)); centerDialog(); *************** public class RenameDialog extends AlterC *** 205,211 **** ViewUpdate.renameView(backendClient, (ViewNode) invocationNode, quotedName); else if (invocationNode instanceof IndexNode) IndexUpdate.alterIndex(backendClient, (IndexNode) invocationNode, ObjectUpdate.ALTER_INDEX_ACTION_RENAME, quotedName); ! // Reached here => all went well // will need this to compute the new path and go to it if this is the selected node.. --- 222,238 ---- ViewUpdate.renameView(backendClient, (ViewNode) invocationNode, quotedName); else if (invocationNode instanceof IndexNode) IndexUpdate.alterIndex(backendClient, (IndexNode) invocationNode, ObjectUpdate.ALTER_INDEX_ACTION_RENAME, quotedName); ! else if (invocationNode instanceof OperatorClassNode) ! OperatorClassUpdate.renameOpClass(backendClient, (OperatorClassNode) invocationNode, quotedName); ! else if (invocationNode instanceof SchemaNode) ! SchemaUpdate.renameSchema(backendClient, (SchemaNode) invocationNode, quotedName); ! else if (invocationNode instanceof DatabaseNode) ! DatabaseUpdate.renameDatabase(backendClient, (DatabaseNode) invocationNode, quotedName); ! else if (invocationNode instanceof GroupNode) ! GroupUpdate.renameGroup(backendClient, (GroupNode) invocationNode, quotedName); ! else if (invocationNode instanceof UserNode) ! UserUpdate.renameUser(backendClient, (UserNode) invocationNode, quotedName); ! // Reached here => all went well // will need this to compute the new path and go to it if this is the selected node.. *************** public class RenameDialog extends AlterC *** 216,227 **** // the new name of the node that was just renamed. Note that // if the Auto-Quote option wasn't used, the new node name will be // all in lower case, due to PostgreSQL's case collapsing property. String newNodeName; if (AdminConfig.autoQuoteIdentifiers()) { newNodeName = jtfName.getText(); } else { ! newNodeName = jtfName.getText().toLowerCase(); } // There are two special cases here: --- 243,278 ---- // the new name of the node that was just renamed. Note that // if the Auto-Quote option wasn't used, the new node name will be // all in lower case, due to PostgreSQL's case collapsing property. + // There is an exception in this case. If NOT autoquoting AND new name + // is in quotes, we need to extract the name. String newNodeName; if (AdminConfig.autoQuoteIdentifiers()) { newNodeName = jtfName.getText(); } else { ! ! // If in quotes, we need to extract what is inside. No need to turn ! // it to lowercase then. ! ! newNodeName = jtfName.getText(); ! ! // Starts with \" => Ends with \" else backend will give ! // parse error.. ! ! if (newNodeName.startsWith("\"")) { ! newNodeName = newNodeName.substring(1, (newNodeName.length() - 1)); ! } else { ! newNodeName = newNodeName.toLowerCase(); ! } ! } ! ! // If we are dealing with something like an "operator" class, a new ! // node name is a bit more complicated ! ! if (invocationNode instanceof OperatorClassNode) { ! String am = ((OperatorClassNode) invocationNode).getAccessMethod(); ! String types = AbstractCustomSignatureFactory.getOpClassDataTypesFromSignature(invocationNode.toString()); ! newNodeName = AbstractCustomSignatureFactory.getOpClassSignature(newNodeName, am, types); } // There are two special cases here: Index: src/com/redhat/rhdb/admin/SchemaUpdate.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/SchemaUpdate.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 SchemaUpdate.java *** src/com/redhat/rhdb/admin/SchemaUpdate.java 21 Nov 2003 18:30:24 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/SchemaUpdate.java 22 Dec 2003 19:31:04 -0000 *************** public class SchemaUpdate extends Object *** 116,120 **** --- 116,145 ---- } } + /** + * Renames a schema + * + * @param client The backend client. + * @param node the invoking schema node. + * @param name the new name of the schema. + * @throws ObjectUpdateException if the schema cannot be renamed. + */ + public static void renameSchema(AdminBackendClient client, SchemaNode node, String name) throws ObjectUpdateException { + + String updateString = "ALTER SCHEMA "; + + updateString += AdminMiscFunctions.getDoubleQuotedIdentifier(node.toString()); + + updateString += " RENAME TO " + name; + + // perform the update. Any errors are passed to the parent + + try { + client.performUpdate(node.getParentClusterName(), node.getParentDatabaseName(), updateString); + } catch (Exception e) { + throw new ObjectUpdateException(e.getMessage()); + } + + } } Index: src/com/redhat/rhdb/admin/UserUpdate.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/UserUpdate.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 UserUpdate.java *** src/com/redhat/rhdb/admin/UserUpdate.java 21 Nov 2003 18:30:24 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/UserUpdate.java 22 Dec 2003 19:31:04 -0000 *************** package com.redhat.rhdb.admin; *** 15,20 **** --- 15,21 ---- import java.util.*; import com.redhat.rhdb.admin.resources.*; + import com.redhat.rhdb.admin.tree.*; import com.redhat.rhdb.admin.utils.*; /** *************** public class UserUpdate extends ObjectUp *** 269,273 **** --- 270,301 ---- } catch (Exception e) { throw new ObjectUpdateException(e.getMessage()); } + } + + /** + * Renames a user + * + * @param client The backend client. + * @param node the invoking user node. + * @param name the new name of the user. + * @throws ObjectUpdateException if the user cannot be renamed. + */ + + public static void renameUser(AdminBackendClient client, UserNode node, String name) throws ObjectUpdateException { + + String updateString = "ALTER USER "; + + updateString += AdminMiscFunctions.getDoubleQuotedIdentifier(node.toString()); + + updateString += " RENAME TO " + name; + + // perform the update. Any errors are passed to the parent + + try { + client.performUpdate(node.getParentClusterName(), "template1", updateString); + } catch (Exception e) { + throw new ObjectUpdateException(e.getMessage()); + } + } } Index: src/com/redhat/rhdb/admin/resources/AdminResources.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/resources/AdminResources.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 AdminResources.java *** src/com/redhat/rhdb/admin/resources/AdminResources.java 21 Nov 2003 18:30:29 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/resources/AdminResources.java 22 Dec 2003 19:31:04 -0000 *************** public abstract class AdminResources *** 284,295 **** --- 284,300 ---- public static final String MENU_REMOVE_CLUSTER = "remove.cluster"; public static final String MENU_REINDEX_INDEX = "menu.reindex.index"; public static final String MENU_REINDEX_TABLE = "menu.reindex.table"; + public static final String MENU_RENAME_DATABASE = "menu.rename.database"; public static final String MENU_RENAME_COLUMN = "menu.rename.column"; + public static final String MENU_RENAME_GROUP = "menu.rename.group"; public static final String MENU_RENAME_INDEX = "menu.rename.index"; + public static final String MENU_RENAME_OP_CLASS = "menu.rename.op.class"; + public static final String MENU_RENAME_SCHEMA = "menu.rename.schema"; public static final String MENU_RENAME_SEQUENCE = "menu.rename.sequence"; public static final String MENU_RENAME_TABLE = "menu.rename.table"; public static final String MENU_RENAME_VIEW = "rename.view"; public static final String MENU_RENAME_TRIGGER = "rename.trigger"; + public static final String MENU_RENAME_USER = "menu.rename.user"; public static final String MENU_REPLACE_FUNCTION = "replace.function"; public static final String MENU_REPLACE_RULE = "replace.rule"; public static final String MENU_REPLACE_VIEW = "replace.view"; Index: src/com/redhat/rhdb/admin/resources/Resources.java.in =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/resources/Resources.java.in,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 Resources.java.in *** src/com/redhat/rhdb/admin/resources/Resources.java.in 21 Nov 2003 18:30:30 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/resources/Resources.java.in 22 Dec 2003 19:31:05 -0000 *************** public class Resources extends ListResou *** 284,293 **** --- 284,298 ---- { AdminResources.MENU_REINDEX_INDEX, "REINDEX INDEX" }, { AdminResources.MENU_REINDEX_TABLE, "REINDEX TABLE..."}, { AdminResources.MENU_REMOVE_CLUSTER, "REMOVE CLUSTER" }, + { AdminResources.MENU_RENAME_DATABASE, "RENAME DATABASE..." }, + { AdminResources.MENU_RENAME_GROUP, "RENAME GROUP..." }, { AdminResources.MENU_RENAME_INDEX, "RENAME INDEX" }, + { AdminResources.MENU_RENAME_OP_CLASS, "RENAME OPERATOR CLASS" }, + { AdminResources.MENU_RENAME_SCHEMA, "RENAME SCHEMA..." }, { AdminResources.MENU_RENAME_SEQUENCE, "RENAME SEQUENCE..." }, { AdminResources.MENU_RENAME_TRIGGER, "RENAME TRIGGER..." }, { AdminResources.MENU_RENAME_TABLE, "RENAME TABLE..."}, + { AdminResources.MENU_RENAME_USER, "RENAME USER..." }, { AdminResources.MENU_RENAME_VIEW, "RENAME VIEW..." }, { AdminResources.MENU_REPLACE_FUNCTION, "REPLACE FUNCTION..." }, { AdminResources.MENU_REPLACE_RULE, "REPLACE RULE..." }, Index: src/com/redhat/rhdb/admin/tree/AbstractCustomSignatureFactory.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/AbstractCustomSignatureFactory.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 AbstractCustomSignatureFactory.java *** src/com/redhat/rhdb/admin/tree/AbstractCustomSignatureFactory.java 21 Nov 2003 18:30:27 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/AbstractCustomSignatureFactory.java 22 Dec 2003 19:31:05 -0000 *************** public abstract class AbstractCustomSign *** 410,415 **** --- 410,440 ---- } /** + * Returns the op class data types (comma separated) + * + * @param opClassSig The operator class signature + * @return String containing the op class data types (comma separated) + */ + + public static String getOpClassDataTypesFromSignature (String opClassSig) { + return opClassSig.substring(opClassSig.indexOf(',') + 1); + } + + /** + * Returns op class signatures given name, access method, and comma + * separated data types (as returned by getOpClassDataTypesFromSignature()) + * + * @param name op class name + * @param am op class access method + * @param types comma separated op class data types, as returned by + * getOpClassDataTypesFromSignature() + */ + + public static String getOpClassSignature (String name, String am, String types) { + return name + "->" + am + "," + types; + } + + /** * Returns the operator class node signatures based on the given result set. * * @param resultSet the String array that contains the information about the opClass Index: src/com/redhat/rhdb/admin/tree/AdminGenericTreeNode.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/AdminGenericTreeNode.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 AdminGenericTreeNode.java *** src/com/redhat/rhdb/admin/tree/AdminGenericTreeNode.java 21 Nov 2003 18:30:27 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/AdminGenericTreeNode.java 22 Dec 2003 19:31:05 -0000 *************** public class AdminGenericTreeNode implem *** 436,447 **** /** * Creates a popup menu for this node. * */ ! public JPopupMenu getPopupMenu() { JMenuItem menuItem; ! JPopupMenu nodeMenu = ((AdminTreeNode) this).getNodeMenu(); // Create a new menu iff its needed --- 436,448 ---- /** * Creates a popup menu for this node. * + * @param client A client to the backend */ ! public JPopupMenu getPopupMenu(AdminBackendClient client) { JMenuItem menuItem; ! JPopupMenu nodeMenu = ((AdminTreeNode) this).getNodeMenu(client); // Create a new menu iff its needed Index: src/com/redhat/rhdb/admin/tree/AdminTree.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/AdminTree.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 AdminTree.java *** src/com/redhat/rhdb/admin/tree/AdminTree.java 21 Nov 2003 18:30:27 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/AdminTree.java 22 Dec 2003 19:31:06 -0000 *************** public class AdminTree extends JTree imp *** 249,255 **** AdminTreeNode node = (AdminTreeNode) nodePath.getPathComponent(nodePath.getPathCount() - 1); try { ! menu = node.getPopupMenu(); if (menu == null) { return; --- 249,255 ---- AdminTreeNode node = (AdminTreeNode) nodePath.getPathComponent(nodePath.getPathCount() - 1); try { ! menu = node.getPopupMenu(backendClient); if (menu == null) { return; Index: src/com/redhat/rhdb/admin/tree/AdminTreeNode.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/AdminTreeNode.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 AdminTreeNode.java *** src/com/redhat/rhdb/admin/tree/AdminTreeNode.java 21 Nov 2003 18:30:27 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/AdminTreeNode.java 22 Dec 2003 19:31:06 -0000 *************** public interface AdminTreeNode extends T *** 105,115 **** ImageIcon getImage(String file); /** - * * Creates a popup menu for this node. */ ! JPopupMenu getNodeMenu(); /** --- 105,116 ---- ImageIcon getImage(String file); /** * Creates a popup menu for this node. + * + * @param client Client to the backend */ ! JPopupMenu getNodeMenu(AdminBackendClient client); /** *************** public interface AdminTreeNode extends T *** 135,145 **** TreePath getPath(); /** - * * Creates a popup menu for this node (implemented in AdminGenericTreeNode). */ ! JPopupMenu getPopupMenu(); /** * Gets whether this node is expanded or not. --- 136,147 ---- TreePath getPath(); /** * Creates a popup menu for this node (implemented in AdminGenericTreeNode). + * + * @param client Client to the backend */ ! JPopupMenu getPopupMenu(AdminBackendClient client); /** * Gets whether this node is expanded or not. Index: src/com/redhat/rhdb/admin/tree/AggregateNode.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/AggregateNode.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 AggregateNode.java *** src/com/redhat/rhdb/admin/tree/AggregateNode.java 21 Nov 2003 18:30:27 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/AggregateNode.java 22 Dec 2003 19:31:06 -0000 *************** public class AggregateNode extends Admin *** 156,165 **** /** * Returns the popup-menu for this node * * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu() { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_DROP_RESTRICT))); --- 156,166 ---- /** * Returns the popup-menu for this node * + * @param client Client to the backend * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu(AdminBackendClient client) { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_DROP_RESTRICT))); Index: src/com/redhat/rhdb/admin/tree/AggregatesHeaderNode.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/AggregatesHeaderNode.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 AggregatesHeaderNode.java *** src/com/redhat/rhdb/admin/tree/AggregatesHeaderNode.java 21 Nov 2003 18:30:27 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/AggregatesHeaderNode.java 22 Dec 2003 19:31:06 -0000 *************** public class AggregatesHeaderNode extend *** 138,147 **** /** * Returns the popup-menu for this node * * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu() { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_CREATE_AGGREGATE))); --- 138,148 ---- /** * Returns the popup-menu for this node * + * @param client Client to the backend * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu(AdminBackendClient client) { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_CREATE_AGGREGATE))); Index: src/com/redhat/rhdb/admin/tree/CastNode.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/CastNode.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 CastNode.java *** src/com/redhat/rhdb/admin/tree/CastNode.java 21 Nov 2003 18:30:27 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/CastNode.java 22 Dec 2003 19:31:06 -0000 *************** public class CastNode extends AdminGener *** 136,145 **** /** * Returns the popup-menu for this node * * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu() { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_DROP_RESTRICT))); --- 136,146 ---- /** * Returns the popup-menu for this node * + * @param client Client to the backend * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu(AdminBackendClient client) { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_DROP_RESTRICT))); Index: src/com/redhat/rhdb/admin/tree/CastsHeaderNode.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/CastsHeaderNode.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 CastsHeaderNode.java *** src/com/redhat/rhdb/admin/tree/CastsHeaderNode.java 21 Nov 2003 18:30:27 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/CastsHeaderNode.java 22 Dec 2003 19:31:06 -0000 *************** public class CastsHeaderNode extends Adm *** 100,109 **** /** * Returns the popup-menu for this node * * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu() { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_CREATE_CAST))); --- 100,110 ---- /** * Returns the popup-menu for this node * + * @param client Client to the backend * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu(AdminBackendClient client) { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_CREATE_CAST))); Index: src/com/redhat/rhdb/admin/tree/CheckConstraintNode.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/CheckConstraintNode.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 CheckConstraintNode.java *** src/com/redhat/rhdb/admin/tree/CheckConstraintNode.java 21 Nov 2003 18:30:27 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/CheckConstraintNode.java 22 Dec 2003 19:31:06 -0000 *************** public class CheckConstraintNode extends *** 135,144 **** /** * Returns the popup-menu for this node * * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu() { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_DROP_RESTRICT))); --- 135,145 ---- /** * Returns the popup-menu for this node * + * @param client Client to the backend * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu(AdminBackendClient client) { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_DROP_RESTRICT))); Index: src/com/redhat/rhdb/admin/tree/ClusterNode.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/ClusterNode.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 ClusterNode.java *** src/com/redhat/rhdb/admin/tree/ClusterNode.java 21 Nov 2003 18:30:27 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/ClusterNode.java 22 Dec 2003 19:31:06 -0000 *************** public class ClusterNode extends AdminGe *** 166,175 **** /** * Returns the popup-menu for this node * * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu() { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_EDIT_CLUSTER))); --- 166,176 ---- /** * Returns the popup-menu for this node * + * @param client Client to the backend * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu(AdminBackendClient client) { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_EDIT_CLUSTER))); Index: src/com/redhat/rhdb/admin/tree/ColumnUnderTableNode.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/ColumnUnderTableNode.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 ColumnUnderTableNode.java *** src/com/redhat/rhdb/admin/tree/ColumnUnderTableNode.java 21 Nov 2003 18:30:27 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/ColumnUnderTableNode.java 22 Dec 2003 19:31:06 -0000 *************** public class ColumnUnderTableNode extend *** 115,124 **** /** * Returns the popup-menu for this node * * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu() { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_DROP_RESTRICT))); --- 115,125 ---- /** * Returns the popup-menu for this node * + * @param client Client to the backend * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu(AdminBackendClient client) { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_DROP_RESTRICT))); Index: src/com/redhat/rhdb/admin/tree/ColumnUnderViewNode.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/ColumnUnderViewNode.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 ColumnUnderViewNode.java *** src/com/redhat/rhdb/admin/tree/ColumnUnderViewNode.java 21 Nov 2003 18:30:27 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/ColumnUnderViewNode.java 22 Dec 2003 19:31:06 -0000 *************** public class ColumnUnderViewNode extends *** 99,108 **** /** * Returns the popup-menu for this node * * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu() { JPopupMenu menu = new JPopupMenu(); --- 99,109 ---- /** * Returns the popup-menu for this node * + * @param client Client to the backend * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu(AdminBackendClient client) { JPopupMenu menu = new JPopupMenu(); Index: src/com/redhat/rhdb/admin/tree/ColumnsGenericHeaderNode.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/ColumnsGenericHeaderNode.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 ColumnsGenericHeaderNode.java *** src/com/redhat/rhdb/admin/tree/ColumnsGenericHeaderNode.java 21 Nov 2003 18:30:27 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/ColumnsGenericHeaderNode.java 22 Dec 2003 19:31:06 -0000 *************** public abstract class ColumnsGenericHead *** 97,106 **** /** * Returns the popup-menu for this node * * @return the popup menu for this node */ ! public abstract JPopupMenu getNodeMenu(); /** --- 97,107 ---- /** * Returns the popup-menu for this node * + * @param client Client to the backend * @return the popup menu for this node */ ! public abstract JPopupMenu getNodeMenu(AdminBackendClient client); /** Index: src/com/redhat/rhdb/admin/tree/ColumnsUnderTableHeaderNode.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/ColumnsUnderTableHeaderNode.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 ColumnsUnderTableHeaderNode.java *** src/com/redhat/rhdb/admin/tree/ColumnsUnderTableHeaderNode.java 21 Nov 2003 18:30:27 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/ColumnsUnderTableHeaderNode.java 22 Dec 2003 19:31:06 -0000 *************** public class ColumnsUnderTableHeaderNode *** 91,100 **** /** * Returns the popup-menu for this node * * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu() { JPopupMenu menu = new JPopupMenu(); --- 91,101 ---- /** * Returns the popup-menu for this node * + * @param client Client to the backend * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu(AdminBackendClient client) { JPopupMenu menu = new JPopupMenu(); Index: src/com/redhat/rhdb/admin/tree/ColumnsUnderViewHeaderNode.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/ColumnsUnderViewHeaderNode.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 ColumnsUnderViewHeaderNode.java *** src/com/redhat/rhdb/admin/tree/ColumnsUnderViewHeaderNode.java 21 Nov 2003 18:30:27 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/ColumnsUnderViewHeaderNode.java 22 Dec 2003 19:31:06 -0000 *************** public class ColumnsUnderViewHeaderNode *** 87,96 **** /** * Returns the popup-menu for this node * * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu() { JPopupMenu menu = new JPopupMenu(); return menu; --- 87,97 ---- /** * Returns the popup-menu for this node * + * @param client Client to the backend * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu(AdminBackendClient client) { JPopupMenu menu = new JPopupMenu(); return menu; Index: src/com/redhat/rhdb/admin/tree/ConstraintsHeaderNode.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/ConstraintsHeaderNode.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 ConstraintsHeaderNode.java *** src/com/redhat/rhdb/admin/tree/ConstraintsHeaderNode.java 21 Nov 2003 18:30:27 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/ConstraintsHeaderNode.java 22 Dec 2003 19:31:06 -0000 *************** public class ConstraintsHeaderNode exten *** 110,119 **** /** * Returns the popup-menu for this node * * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu() { JPopupMenu menu = new JPopupMenu(); JMenu subMenu = new JMenu(AdminResources.getString(AdminResources.MENU_ADD_TABLE_CONSTRAINT)); --- 110,120 ---- /** * Returns the popup-menu for this node * + * @param client Client to the backend * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu(AdminBackendClient client) { JPopupMenu menu = new JPopupMenu(); JMenu subMenu = new JMenu(AdminResources.getString(AdminResources.MENU_ADD_TABLE_CONSTRAINT)); Index: src/com/redhat/rhdb/admin/tree/ConversionNode.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/ConversionNode.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 ConversionNode.java *** src/com/redhat/rhdb/admin/tree/ConversionNode.java 21 Nov 2003 18:30:27 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/ConversionNode.java 22 Dec 2003 19:31:06 -0000 *************** public class ConversionNode extends Admi *** 103,112 **** /** * Returns the popup-menu for this node * * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu() { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_DROP_RESTRICT))); --- 103,113 ---- /** * Returns the popup-menu for this node * + * @param client Client to the backend * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu(AdminBackendClient client) { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_DROP_RESTRICT))); Index: src/com/redhat/rhdb/admin/tree/ConversionsHeaderNode.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/ConversionsHeaderNode.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 ConversionsHeaderNode.java *** src/com/redhat/rhdb/admin/tree/ConversionsHeaderNode.java 21 Nov 2003 18:30:27 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/ConversionsHeaderNode.java 22 Dec 2003 19:31:07 -0000 *************** public class ConversionsHeaderNode exten *** 100,109 **** /** * Returns the popup-menu for this node * * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu() { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_CREATE_CONVERSION))); --- 100,110 ---- /** * Returns the popup-menu for this node * + * @param client Client to the backend * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu(AdminBackendClient client) { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_CREATE_CONVERSION))); Index: src/com/redhat/rhdb/admin/tree/DataTypeNode.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/DataTypeNode.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 DataTypeNode.java *** src/com/redhat/rhdb/admin/tree/DataTypeNode.java 21 Nov 2003 18:30:27 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/DataTypeNode.java 22 Dec 2003 19:31:07 -0000 *************** public class DataTypeNode extends AdminG *** 105,114 **** /** * Returns the popup-menu for this node * * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu() { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_DROP_RESTRICT))); --- 105,115 ---- /** * Returns the popup-menu for this node * + * @param client Client to the backend * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu(AdminBackendClient client) { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_DROP_RESTRICT))); Index: src/com/redhat/rhdb/admin/tree/DataTypesHeaderNode.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/DataTypesHeaderNode.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 DataTypesHeaderNode.java *** src/com/redhat/rhdb/admin/tree/DataTypesHeaderNode.java 21 Nov 2003 18:30:27 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/DataTypesHeaderNode.java 22 Dec 2003 19:31:07 -0000 *************** public class DataTypesHeaderNode extends *** 141,150 **** /** * Returns the popup-menu for this node * * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu() { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_CREATE_DATATYPE))); --- 141,151 ---- /** * Returns the popup-menu for this node * + * @param client Client to the backend * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu(AdminBackendClient client) { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_CREATE_DATATYPE))); Index: src/com/redhat/rhdb/admin/tree/DatabaseNode.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/DatabaseNode.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 DatabaseNode.java *** src/com/redhat/rhdb/admin/tree/DatabaseNode.java 21 Nov 2003 18:30:28 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/DatabaseNode.java 22 Dec 2003 19:31:07 -0000 *************** public class DatabaseNode extends AdminG *** 137,156 **** launchShell(dockWindow); } else if (selectedMenuCaption == AdminResources.getString(AdminResources.REFRESH_THIS_LEVEL)) { refreshSelf(client); } } /** * Returns the popup-menu for this node * * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu() { JPopupMenu menu = new JPopupMenu(); ! menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_DROP_DATABASE))); JMenu subMenu = new JMenu(AdminResources.getString(AdminResources.MENU_ALTER_DATABASE)); subMenu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_ALTER_DATABASE_SET_VAR))); menu.add(subMenu); --- 137,179 ---- launchShell(dockWindow); } else if (selectedMenuCaption == AdminResources.getString(AdminResources.REFRESH_THIS_LEVEL)) { refreshSelf(client); + } else if (selectedMenuCaption == AdminResources.getString(AdminResources.MENU_RENAME_DATABASE)) { + RenameDialog rd = new RenameDialog(dockWindow, this, client, this.getNodeType()); + rd.show(); } } /** * Returns the popup-menu for this node * + * @param client Client to the backend * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu(AdminBackendClient client) { JPopupMenu menu = new JPopupMenu(); ! // Menu items that vary according to backend ! ! JMenuItem jmiRename = new JMenuItem(); ! jmiRename.setText(AdminResources.getString(AdminResources.MENU_RENAME_DATABASE)); ! jmiRename.setEnabled(false); + try { + + // For a consistent look, if item is not available on this version, + // we will disable it, but still show it + + if (client.getBackendVersion(this.getParentClusterName()) > 7.3) { + jmiRename.setEnabled(true); + } + + } catch (Exception e) { + // Nothing.. element will remain disabled + } + + menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_DROP_DATABASE))); + menu.add(jmiRename); JMenu subMenu = new JMenu(AdminResources.getString(AdminResources.MENU_ALTER_DATABASE)); subMenu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_ALTER_DATABASE_SET_VAR))); menu.add(subMenu); Index: src/com/redhat/rhdb/admin/tree/DatabasesHeaderNode.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/DatabasesHeaderNode.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 DatabasesHeaderNode.java *** src/com/redhat/rhdb/admin/tree/DatabasesHeaderNode.java 21 Nov 2003 18:30:28 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/DatabasesHeaderNode.java 22 Dec 2003 19:31:07 -0000 *************** public class DatabasesHeaderNode extends *** 190,199 **** /** * Returns the popup-menu for this node * * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu() { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_CREATE_DATABASE))); --- 190,200 ---- /** * Returns the popup-menu for this node * + * @param client Client to the backend * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu(AdminBackendClient client) { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_CREATE_DATABASE))); Index: src/com/redhat/rhdb/admin/tree/DomainNode.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/DomainNode.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 DomainNode.java *** src/com/redhat/rhdb/admin/tree/DomainNode.java 21 Nov 2003 18:30:28 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/DomainNode.java 22 Dec 2003 19:31:07 -0000 *************** public class DomainNode extends AdminGen *** 142,151 **** /** * Returns the popup-menu for this node * * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu() { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_DROP_RESTRICT))); --- 142,152 ---- /** * Returns the popup-menu for this node * + * @param client Client to the backend * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu(AdminBackendClient client) { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_DROP_RESTRICT))); Index: src/com/redhat/rhdb/admin/tree/DomainsHeaderNode.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/DomainsHeaderNode.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 DomainsHeaderNode.java *** src/com/redhat/rhdb/admin/tree/DomainsHeaderNode.java 21 Nov 2003 18:30:28 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/DomainsHeaderNode.java 22 Dec 2003 19:31:07 -0000 *************** public class DomainsHeaderNode extends A *** 100,109 **** /** * Returns the popup-menu for this node * * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu() { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_CREATE_DOMAIN))); --- 100,110 ---- /** * Returns the popup-menu for this node * + * @param client Client to the backend * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu(AdminBackendClient client) { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_CREATE_DOMAIN))); Index: src/com/redhat/rhdb/admin/tree/DummyNode.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/DummyNode.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 DummyNode.java *** src/com/redhat/rhdb/admin/tree/DummyNode.java 21 Nov 2003 18:30:28 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/DummyNode.java 22 Dec 2003 19:31:07 -0000 *************** public class DummyNode extends AdminGene *** 51,57 **** return nodeIcon; } ! public javax.swing.JPopupMenu getNodeMenu() { return null; } --- 51,57 ---- return nodeIcon; } ! public javax.swing.JPopupMenu getNodeMenu(AdminBackendClient client) { return null; } Index: src/com/redhat/rhdb/admin/tree/FKConstraintNode.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/FKConstraintNode.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 FKConstraintNode.java *** src/com/redhat/rhdb/admin/tree/FKConstraintNode.java 21 Nov 2003 18:30:28 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/FKConstraintNode.java 22 Dec 2003 19:31:07 -0000 *************** public class FKConstraintNode extends Ad *** 198,207 **** /** * Returns the popup-menu for this node * * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu() { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_DROP_RESTRICT))); --- 198,208 ---- /** * Returns the popup-menu for this node * + * @param client Client to the backend * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu(AdminBackendClient client) { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_DROP_RESTRICT))); Index: src/com/redhat/rhdb/admin/tree/FunctionNode.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/FunctionNode.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 FunctionNode.java *** src/com/redhat/rhdb/admin/tree/FunctionNode.java 21 Nov 2003 18:30:28 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/FunctionNode.java 22 Dec 2003 19:31:07 -0000 *************** public class FunctionNode extends AdminG *** 140,149 **** /** * Returns the popup-menu for this node * * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu() { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_DROP_RESTRICT))); --- 140,150 ---- /** * Returns the popup-menu for this node * + * @param client Client to the backend * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu(AdminBackendClient client) { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_DROP_RESTRICT))); Index: src/com/redhat/rhdb/admin/tree/FunctionsHeaderNode.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/FunctionsHeaderNode.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 FunctionsHeaderNode.java *** src/com/redhat/rhdb/admin/tree/FunctionsHeaderNode.java 21 Nov 2003 18:30:28 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/FunctionsHeaderNode.java 22 Dec 2003 19:31:07 -0000 *************** public class FunctionsHeaderNode extends *** 151,160 **** /** * Returns the popup-menu for this node * * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu() { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_CREATE_FUNCTION))); --- 151,161 ---- /** * Returns the popup-menu for this node * + * @param client Client to the backend * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu(AdminBackendClient client) { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_CREATE_FUNCTION))); Index: src/com/redhat/rhdb/admin/tree/GroupNode.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/GroupNode.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 GroupNode.java *** src/com/redhat/rhdb/admin/tree/GroupNode.java 21 Nov 2003 18:30:28 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/GroupNode.java 22 Dec 2003 19:31:07 -0000 *************** public class GroupNode extends AdminGene *** 93,111 **** mpd.show(); } else if (selectedMenuCaption == AdminResources.getString(AdminResources.REFRESH_THIS_LEVEL)) { refreshSelf(client); } } /** * Returns the popup-menu for this node * * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu() { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_DROP_GROUP))); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_ALTER_GROUP))); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_MANAGE_PRIVILEGES))); --- 93,135 ---- mpd.show(); } else if (selectedMenuCaption == AdminResources.getString(AdminResources.REFRESH_THIS_LEVEL)) { refreshSelf(client); + } else if (selectedMenuCaption == AdminResources.getString(AdminResources.MENU_RENAME_GROUP)) { + RenameDialog rd = new RenameDialog(dockWindow, this, client, this.getNodeType()); + rd.show(); } } /** * Returns the popup-menu for this node * + * @param client Client to the backend * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu(AdminBackendClient client) { JPopupMenu menu = new JPopupMenu(); + // Menu items that vary according to backend + + JMenuItem jmiRename = new JMenuItem(); + jmiRename.setText(AdminResources.getString(AdminResources.MENU_RENAME_GROUP)); + jmiRename.setEnabled(false); + + try { + + // For a consistent look, if item is not available on this version, + // we will disable it, but still show it + + if (client.getBackendVersion(this.getParentClusterName()) > 7.3) { + jmiRename.setEnabled(true); + } + + } catch (Exception e) { + // Nothing.. element will remain disabled + } + menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_DROP_GROUP))); + menu.add(jmiRename); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_ALTER_GROUP))); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_MANAGE_PRIVILEGES))); Index: src/com/redhat/rhdb/admin/tree/GroupsHeaderNode.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/GroupsHeaderNode.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 GroupsHeaderNode.java *** src/com/redhat/rhdb/admin/tree/GroupsHeaderNode.java 21 Nov 2003 18:30:28 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/GroupsHeaderNode.java 22 Dec 2003 19:31:07 -0000 *************** public class GroupsHeaderNode extends Ad *** 174,183 **** /** * Returns the popup-menu for this node * * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu() { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_CREATE_GROUP))); --- 174,184 ---- /** * Returns the popup-menu for this node * + * @param client Client to the backend * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu(AdminBackendClient client) { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_CREATE_GROUP))); Index: src/com/redhat/rhdb/admin/tree/IndexNode.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/IndexNode.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 IndexNode.java *** src/com/redhat/rhdb/admin/tree/IndexNode.java 21 Nov 2003 18:30:28 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/IndexNode.java 22 Dec 2003 19:31:08 -0000 *************** public class IndexNode extends AdminGene *** 132,141 **** /** * Returns the popup-menu for this node * * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu() { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_DROP_RESTRICT))); --- 132,142 ---- /** * Returns the popup-menu for this node * + * @param client Client to the backend * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu(AdminBackendClient client) { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_DROP_RESTRICT))); Index: src/com/redhat/rhdb/admin/tree/IndexesHeaderNode.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/IndexesHeaderNode.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 IndexesHeaderNode.java *** src/com/redhat/rhdb/admin/tree/IndexesHeaderNode.java 21 Nov 2003 18:30:28 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/IndexesHeaderNode.java 22 Dec 2003 19:31:08 -0000 *************** public class IndexesHeaderNode extends A *** 158,167 **** /** * Returns the popup-menu for this node * * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu() { JPopupMenu menu = new JPopupMenu(); menu.add(AdminResources.getString(AdminResources.MENU_CREATE_INDEX)); --- 158,168 ---- /** * Returns the popup-menu for this node * + * @param client Client to the backend * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu(AdminBackendClient client) { JPopupMenu menu = new JPopupMenu(); menu.add(AdminResources.getString(AdminResources.MENU_CREATE_INDEX)); Index: src/com/redhat/rhdb/admin/tree/LanguageNode.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/LanguageNode.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 LanguageNode.java *** src/com/redhat/rhdb/admin/tree/LanguageNode.java 21 Nov 2003 18:30:28 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/LanguageNode.java 22 Dec 2003 19:31:08 -0000 *************** public class LanguageNode extends AdminG *** 146,155 **** /** * Returns the popup-menu for this node * * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu() { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_DROP_RESTRICT))); --- 146,156 ---- /** * Returns the popup-menu for this node * + * @param client Client to the backend * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu(AdminBackendClient client) { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_DROP_RESTRICT))); Index: src/com/redhat/rhdb/admin/tree/LanguagesHeaderNode.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/LanguagesHeaderNode.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 LanguagesHeaderNode.java *** src/com/redhat/rhdb/admin/tree/LanguagesHeaderNode.java 21 Nov 2003 18:30:28 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/LanguagesHeaderNode.java 22 Dec 2003 19:31:08 -0000 *************** public class LanguagesHeaderNode extends *** 117,126 **** /** * Returns the popup-menu for this node * * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu() { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_CREATE_LANGUAGE))); --- 117,127 ---- /** * Returns the popup-menu for this node * + * @param client Client to the backend * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu(AdminBackendClient client) { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_CREATE_LANGUAGE))); Index: src/com/redhat/rhdb/admin/tree/OperatorClassNode.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/OperatorClassNode.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 OperatorClassNode.java *** src/com/redhat/rhdb/admin/tree/OperatorClassNode.java 21 Nov 2003 18:30:28 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/OperatorClassNode.java 22 Dec 2003 19:31:08 -0000 *************** public class OperatorClassNode extends A *** 109,115 **** */ public void doMenuAction(String selectedMenuCaption, AdminBackendClient client, JFrame dockWindow) throws ObjectDropException, TreeNodePopulationException, DialogRaiseException { ! if (selectedMenuCaption == AdminResources.getString(AdminResources.MENU_DROP_RESTRICT)) { if (getDropResponse(dockWindow, DROP_TYPE_RESTRICT)) { OperatorClassUpdate.dropOperatorClass(client, this, ObjectUpdate.DROP_TYPE_RESTRICT); refreshParent(client); --- 109,118 ---- */ public void doMenuAction(String selectedMenuCaption, AdminBackendClient client, JFrame dockWindow) throws ObjectDropException, TreeNodePopulationException, DialogRaiseException { ! if (selectedMenuCaption == AdminResources.getString(AdminResources.MENU_RENAME_OP_CLASS)) { ! RenameDialog rd = new RenameDialog(dockWindow, this, client, this.getNodeType()); ! rd.show(); ! } else if (selectedMenuCaption == AdminResources.getString(AdminResources.MENU_DROP_RESTRICT)) { if (getDropResponse(dockWindow, DROP_TYPE_RESTRICT)) { OperatorClassUpdate.dropOperatorClass(client, this, ObjectUpdate.DROP_TYPE_RESTRICT); refreshParent(client); *************** public class OperatorClassNode extends A *** 125,138 **** /** * Returns the popup-menu for this node * * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu() { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_DROP_RESTRICT))); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_DROP_CASCADE))); return menu; } --- 128,162 ---- /** * Returns the popup-menu for this node * + * @param client Client to the backend * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu(AdminBackendClient client) { JPopupMenu menu = new JPopupMenu(); + // Menu items that vary according to backend + + JMenuItem jmiRename = new JMenuItem(); + jmiRename.setText(AdminResources.getString(AdminResources.MENU_RENAME_OP_CLASS)); + jmiRename.setEnabled(false); + + try { + + // For a consistent look, if item is not available on this version, + // we will disable it, but still show it + + if (client.getBackendVersion(this.getParentClusterName()) > 7.3) { + jmiRename.setEnabled(true); + } + + } catch (Exception e) { + // Nothing.. element will remain disabled + } + menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_DROP_RESTRICT))); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_DROP_CASCADE))); + menu.add(jmiRename); return menu; } Index: src/com/redhat/rhdb/admin/tree/OperatorClassesHeaderNode.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/OperatorClassesHeaderNode.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 OperatorClassesHeaderNode.java *** src/com/redhat/rhdb/admin/tree/OperatorClassesHeaderNode.java 21 Nov 2003 18:30:28 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/OperatorClassesHeaderNode.java 22 Dec 2003 19:31:08 -0000 *************** public class OperatorClassesHeaderNode e *** 100,109 **** /** * Returns the popup-menu for this node * * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu() { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_CREATE_OPERATOR_CLASS))); --- 100,110 ---- /** * Returns the popup-menu for this node * + * @param client Client to the backend * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu(AdminBackendClient client) { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_CREATE_OPERATOR_CLASS))); Index: src/com/redhat/rhdb/admin/tree/OperatorNode.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/OperatorNode.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 OperatorNode.java *** src/com/redhat/rhdb/admin/tree/OperatorNode.java 21 Nov 2003 18:30:28 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/OperatorNode.java 22 Dec 2003 19:31:08 -0000 *************** public class OperatorNode extends AdminG *** 166,175 **** /** * Returns the popup-menu for this node * * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu() { JPopupMenu menu = new JPopupMenu(); --- 166,176 ---- /** * Returns the popup-menu for this node * + * @param client Client to the backend * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu(AdminBackendClient client) { JPopupMenu menu = new JPopupMenu(); Index: src/com/redhat/rhdb/admin/tree/OperatorsHeaderNode.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/OperatorsHeaderNode.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 OperatorsHeaderNode.java *** src/com/redhat/rhdb/admin/tree/OperatorsHeaderNode.java 21 Nov 2003 18:30:28 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/OperatorsHeaderNode.java 22 Dec 2003 19:31:08 -0000 *************** public class OperatorsHeaderNode extends *** 103,112 **** /** * Returns the popup-menu for this node * * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu() { JPopupMenu menu = new JPopupMenu(); --- 103,113 ---- /** * Returns the popup-menu for this node * + * @param client Client to the backend * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu(AdminBackendClient client) { JPopupMenu menu = new JPopupMenu(); Index: src/com/redhat/rhdb/admin/tree/PKConstraintNode.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/PKConstraintNode.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 PKConstraintNode.java *** src/com/redhat/rhdb/admin/tree/PKConstraintNode.java 21 Nov 2003 18:30:28 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/PKConstraintNode.java 22 Dec 2003 19:31:08 -0000 *************** public class PKConstraintNode extends Ad *** 150,159 **** /** * Returns the popup-menu for this node * * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu() { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_DROP_RESTRICT))); --- 150,160 ---- /** * Returns the popup-menu for this node * + * @param client Client to the backend * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu(AdminBackendClient client) { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_DROP_RESTRICT))); Index: src/com/redhat/rhdb/admin/tree/RootNode.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/RootNode.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 RootNode.java *** src/com/redhat/rhdb/admin/tree/RootNode.java 21 Nov 2003 18:30:28 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/RootNode.java 22 Dec 2003 19:31:08 -0000 *************** public class RootNode extends AdminGener *** 91,100 **** /** * Returns the popup-menu for this node * * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu() { return null; } --- 91,101 ---- /** * Returns the popup-menu for this node * + * @param client Client to the backend * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu(AdminBackendClient client) { return null; } Index: src/com/redhat/rhdb/admin/tree/RuleGenericNode.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/RuleGenericNode.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 RuleGenericNode.java *** src/com/redhat/rhdb/admin/tree/RuleGenericNode.java 21 Nov 2003 18:30:28 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/RuleGenericNode.java 22 Dec 2003 19:31:08 -0000 *************** public abstract class RuleGenericNode ex *** 112,121 **** /** * Returns the popup-menu for this node * * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu() { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_DROP_RESTRICT))); --- 112,122 ---- /** * Returns the popup-menu for this node * + * @param client Client to the backend * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu(AdminBackendClient client) { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_DROP_RESTRICT))); Index: src/com/redhat/rhdb/admin/tree/RulesGenericHeaderNode.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/RulesGenericHeaderNode.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 RulesGenericHeaderNode.java *** src/com/redhat/rhdb/admin/tree/RulesGenericHeaderNode.java 21 Nov 2003 18:30:28 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/RulesGenericHeaderNode.java 22 Dec 2003 19:31:08 -0000 *************** public abstract class RulesGenericHeader *** 85,94 **** /** * Returns the popup-menu for this node * * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu() { JPopupMenu menu = new JPopupMenu(); --- 85,95 ---- /** * Returns the popup-menu for this node * + * @param client Client to the backend * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu(AdminBackendClient client) { JPopupMenu menu = new JPopupMenu(); Index: src/com/redhat/rhdb/admin/tree/SchemaNode.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/SchemaNode.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 SchemaNode.java *** src/com/redhat/rhdb/admin/tree/SchemaNode.java 21 Nov 2003 18:30:28 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/SchemaNode.java 22 Dec 2003 19:31:08 -0000 *************** public class SchemaNode extends AdminGen *** 112,131 **** SchemaUpdate.dropSchema(client, this, ObjectUpdate.DROP_TYPE_CASCADE); refreshParent(client); } } } /** * Returns the popup-menu for this node * * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu() { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_DROP_RESTRICT))); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_DROP_CASCADE))); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_EDIT_PRIVILEGES))); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_COMMENT))); --- 112,155 ---- SchemaUpdate.dropSchema(client, this, ObjectUpdate.DROP_TYPE_CASCADE); refreshParent(client); } + } else if (selectedMenuCaption == AdminResources.getString(AdminResources.MENU_RENAME_SCHEMA)) { + RenameDialog rd = new RenameDialog(dockWindow, this, client, this.getNodeType()); + rd.show(); } } /** * Returns the popup-menu for this node * + * @param client Client to the backend * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu(AdminBackendClient client) { JPopupMenu menu = new JPopupMenu(); + // Menu items that vary according to backend + + JMenuItem jmiRename = new JMenuItem(); + jmiRename.setText(AdminResources.getString(AdminResources.MENU_RENAME_SCHEMA)); + jmiRename.setEnabled(false); + + try { + + // For a consistent look, if item is not available on this version, + // we will disable it, but still show it + + if (client.getBackendVersion(this.getParentClusterName()) > 7.3) { + jmiRename.setEnabled(true); + } + + } catch (Exception e) { + // Nothing.. element will remain disabled + } + menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_DROP_RESTRICT))); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_DROP_CASCADE))); + menu.add(jmiRename); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_EDIT_PRIVILEGES))); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_COMMENT))); Index: src/com/redhat/rhdb/admin/tree/SchemasHeaderNode.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/SchemasHeaderNode.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 SchemasHeaderNode.java *** src/com/redhat/rhdb/admin/tree/SchemasHeaderNode.java 21 Nov 2003 18:30:28 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/SchemasHeaderNode.java 22 Dec 2003 19:31:08 -0000 *************** public class SchemasHeaderNode extends A *** 163,172 **** /** * Returns the popup-menu for this node * * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu() { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_CREATE_SCHEMA))); --- 163,173 ---- /** * Returns the popup-menu for this node * + * @param client Client to the backend * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu(AdminBackendClient client) { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_CREATE_SCHEMA))); Index: src/com/redhat/rhdb/admin/tree/SequenceNode.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/SequenceNode.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 SequenceNode.java *** src/com/redhat/rhdb/admin/tree/SequenceNode.java 21 Nov 2003 18:30:28 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/SequenceNode.java 22 Dec 2003 19:31:09 -0000 *************** public class SequenceNode extends AdminG *** 123,132 **** /** * Returns the popup-menu for this node * * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu() { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_DROP_RESTRICT))); --- 123,133 ---- /** * Returns the popup-menu for this node * + * @param client Client to the backend * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu(AdminBackendClient client) { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_DROP_RESTRICT))); Index: src/com/redhat/rhdb/admin/tree/SequencesHeaderNode.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/SequencesHeaderNode.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 SequencesHeaderNode.java *** src/com/redhat/rhdb/admin/tree/SequencesHeaderNode.java 21 Nov 2003 18:30:28 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/SequencesHeaderNode.java 22 Dec 2003 19:31:09 -0000 *************** public class SequencesHeaderNode extends *** 100,109 **** /** * Returns the popup-menu for this node * * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu() { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_CREATE_SEQUENCE))); --- 100,110 ---- /** * Returns the popup-menu for this node * + * @param client Client to the backend * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu(AdminBackendClient client) { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_CREATE_SEQUENCE))); Index: src/com/redhat/rhdb/admin/tree/TableNode.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/TableNode.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 TableNode.java *** src/com/redhat/rhdb/admin/tree/TableNode.java 21 Nov 2003 18:30:28 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/TableNode.java 22 Dec 2003 19:31:09 -0000 *************** public class TableNode extends AdminGene *** 152,161 **** /** * Returns the popup-menu for this node * * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu() { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_DROP_RESTRICT))); --- 152,162 ---- /** * Returns the popup-menu for this node * + * @param client Client to the backend * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu(AdminBackendClient client) { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_DROP_RESTRICT))); Index: src/com/redhat/rhdb/admin/tree/TablesHeaderNode.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/TablesHeaderNode.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 TablesHeaderNode.java *** src/com/redhat/rhdb/admin/tree/TablesHeaderNode.java 21 Nov 2003 18:30:28 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/TablesHeaderNode.java 22 Dec 2003 19:31:09 -0000 *************** public class TablesHeaderNode extends Ad *** 191,200 **** /** * Returns the popup-menu for this node * * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu() { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_CREATE_TABLE))); --- 191,201 ---- /** * Returns the popup-menu for this node * + * @param client Client to the backend * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu(AdminBackendClient client) { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_CREATE_TABLE))); Index: src/com/redhat/rhdb/admin/tree/TriggerNode.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/TriggerNode.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 TriggerNode.java *** src/com/redhat/rhdb/admin/tree/TriggerNode.java 21 Nov 2003 18:30:28 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/TriggerNode.java 22 Dec 2003 19:31:09 -0000 *************** public class TriggerNode extends AdminGe *** 143,152 **** /** * Returns the popup-menu for this node * * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu() { JPopupMenu menu = new JPopupMenu(); --- 143,153 ---- /** * Returns the popup-menu for this node * + * @param client Client to the backend * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu(AdminBackendClient client) { JPopupMenu menu = new JPopupMenu(); Index: src/com/redhat/rhdb/admin/tree/TriggersHeaderNode.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/TriggersHeaderNode.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 TriggersHeaderNode.java *** src/com/redhat/rhdb/admin/tree/TriggersHeaderNode.java 21 Nov 2003 18:30:28 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/TriggersHeaderNode.java 22 Dec 2003 19:31:09 -0000 *************** public class TriggersHeaderNode extends *** 158,167 **** /** * Returns the popup-menu for this node * * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu() { JPopupMenu menu = new JPopupMenu(); --- 158,168 ---- /** * Returns the popup-menu for this node * + * @param client Client to the backend * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu(AdminBackendClient client) { JPopupMenu menu = new JPopupMenu(); Index: src/com/redhat/rhdb/admin/tree/UniqueConstraintNode.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/UniqueConstraintNode.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 UniqueConstraintNode.java *** src/com/redhat/rhdb/admin/tree/UniqueConstraintNode.java 21 Nov 2003 18:30:28 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/UniqueConstraintNode.java 22 Dec 2003 19:31:09 -0000 *************** public class UniqueConstraintNode extend *** 161,170 **** /** * Returns the popup-menu for this node * * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu() { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_DROP_RESTRICT))); --- 161,171 ---- /** * Returns the popup-menu for this node * + * @param client Client to the backend * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu(AdminBackendClient client) { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_DROP_RESTRICT))); Index: src/com/redhat/rhdb/admin/tree/UserNode.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/UserNode.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 UserNode.java *** src/com/redhat/rhdb/admin/tree/UserNode.java 21 Nov 2003 18:30:28 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/UserNode.java 22 Dec 2003 19:31:09 -0000 *************** public class UserNode extends AdminGener *** 99,117 **** SetVariableDialog svd = new SetVariableDialog(dockWindow, this, client); svd.show(); } } /** * Returns the popup-menu for this node * * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu() { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_DROP_USER))); JMenu alterSubMenu = new JMenu(AdminResources.getString(AdminResources.MENU_ALTER_USER)); alterSubMenu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_ALTER_USER_ATTRIBUTES))); --- 99,141 ---- SetVariableDialog svd = new SetVariableDialog(dockWindow, this, client); svd.show(); + } else if (selectedMenuCaption == AdminResources.getString(AdminResources.MENU_RENAME_USER)) { + RenameDialog rd = new RenameDialog(dockWindow, this, client, this.getNodeType()); + rd.show(); } } /** * Returns the popup-menu for this node * + * @param client Client to the backend * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu(AdminBackendClient client) { JPopupMenu menu = new JPopupMenu(); + // Menu items that vary according to backend + + JMenuItem jmiRename = new JMenuItem(); + jmiRename.setText(AdminResources.getString(AdminResources.MENU_RENAME_USER)); + jmiRename.setEnabled(false); + + try { + + // For a consistent look, if item is not available on this version, + // we will disable it, but still show it + + if (client.getBackendVersion(this.getParentClusterName()) > 7.3) { + jmiRename.setEnabled(true); + } + + } catch (Exception e) { + // Nothing.. element will remain disabled + } + menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_DROP_USER))); + menu.add(jmiRename); JMenu alterSubMenu = new JMenu(AdminResources.getString(AdminResources.MENU_ALTER_USER)); alterSubMenu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_ALTER_USER_ATTRIBUTES))); Index: src/com/redhat/rhdb/admin/tree/UsersHeaderNode.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/UsersHeaderNode.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 UsersHeaderNode.java *** src/com/redhat/rhdb/admin/tree/UsersHeaderNode.java 21 Nov 2003 18:30:28 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/UsersHeaderNode.java 22 Dec 2003 19:31:09 -0000 *************** public class UsersHeaderNode extends Adm *** 100,109 **** /** * Returns the popup-menu for this node * * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu() { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_CREATE_USER))); --- 100,110 ---- /** * Returns the popup-menu for this node * + * @param client Client to the backend * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu(AdminBackendClient client) { JPopupMenu menu = new JPopupMenu(); menu.add(new JMenuItem(AdminResources.getString(AdminResources.MENU_CREATE_USER))); Index: src/com/redhat/rhdb/admin/tree/ViewNode.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/ViewNode.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 ViewNode.java *** src/com/redhat/rhdb/admin/tree/ViewNode.java 21 Nov 2003 18:30:28 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/ViewNode.java 22 Dec 2003 19:31:09 -0000 *************** public class ViewNode extends AdminGener *** 193,202 **** /** * Returns the popup-menu for this node * * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu() { JPopupMenu menu = new JPopupMenu(); --- 193,203 ---- /** * Returns the popup-menu for this node * + * @param client Client to the backend * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu(AdminBackendClient client) { JPopupMenu menu = new JPopupMenu(); Index: src/com/redhat/rhdb/admin/tree/ViewsHeaderNode.java =================================================================== RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/tree/ViewsHeaderNode.java,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 ViewsHeaderNode.java *** src/com/redhat/rhdb/admin/tree/ViewsHeaderNode.java 21 Nov 2003 18:30:28 -0000 1.1.1.1 --- src/com/redhat/rhdb/admin/tree/ViewsHeaderNode.java 22 Dec 2003 19:31:09 -0000 *************** public class ViewsHeaderNode extends Adm *** 101,110 **** /** * Returns the popup-menu for this node * * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu() { JPopupMenu menu = new JPopupMenu(); --- 101,111 ---- /** * Returns the popup-menu for this node * + * @param client Client to the backend * @return the popup menu for this node */ ! public JPopupMenu getNodeMenu(AdminBackendClient client) { JPopupMenu menu = new JPopupMenu();