? RenameConversion.diff
? build
? dist
? docs
? src/com/redhat/rhdb/admin/.nbattrs
? src/com/redhat/rhdb/admin/resources/.nbattrs
? src/com/redhat/rhdb/admin/resources/Resources.java
? src/com/redhat/rhdb/admin/resources/Resources_ja_JP.java
? src/com/redhat/rhdb/admin/resources/Resources_ru_RU.java
? src/com/redhat/rhdb/admin/tree/.nbattrs
Index: ChangeLog
===================================================================
RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/ChangeLog,v
retrieving revision 1.2
diff -r1.2 ChangeLog
0a1,14
> 2003-12-23  Benjamin Mar Kuck  <binary_data@hotmail.com>
> 
> 	* src/com/redhat/rhdb/admin/ConversionUpdate.java (renameConversion):
> 	Add new function to rename conversions.
> 	* src/com/redhat/rhdb/admin/RenameDialog.java (doOKAction): Add
> 	handling for renaming conversions.
> 	* src/com/redhat/rhdb/admin/resources/AdminResources.java: Add new
> 	Strings.
> 	* src/com/redhat/rhdb/admin/resources/Resources.java.in: Add new
> 	conversion menu string.
> 	* src/com/redhat/rhdb/admin/tree/ConversionNode.java (doMenuAction):
> 	Add handling for renaming of conversions.
> 	(getNodeMenu): Add new menu option for renaming conversions.
> 
Index: src/com/redhat/rhdb/admin/ConversionUpdate.java
===================================================================
RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/ConversionUpdate.java,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 ConversionUpdate.java
127a128,155
>         
> 	/**
> 	 * Renames a conversion
> 	 *
> 	 * @param client The backend client.
> 	 * @param node the invoking conversion node.
> 	 * @param name the new name of the conversion.
> 	 * @throws ObjectUpdateException if the conversion cannot be renamed.
> 	 */
> 
> 	public static void renameConversion(AdminBackendClient client, ConversionNode node, String name) throws ObjectUpdateException {
> 
> 		String updateString = "ALTER CONVERSION ";
> 		
> 		updateString += AdminMiscFunctions.getDoubleQuotedIdentifier(node.getParentSchemaName()) + ".";
> 		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/RenameDialog.java
===================================================================
RCS file: /cvs/rhdb/src/rhdb/guitools/rhdb-admin/src/com/redhat/rhdb/admin/RenameDialog.java,v
retrieving revision 1.2
diff -r1.2 RenameDialog.java
234a235,236
> 		else if (invocationNode instanceof ConversionNode)
> 			ConversionUpdate.renameConversion(backendClient, (ConversionNode) invocationNode, quotedName);
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.2
diff -r1.2 AdminResources.java
297a298
> 	public static final String MENU_RENAME_CONVERSION			= "menu.rename.conversion";
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.2
diff -r1.2 Resources.java.in
296a297
> 		{ AdminResources.MENU_RENAME_CONVERSION,      "RENAME CONVERSION..." },
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.2
diff -r1.2 ConversionNode.java
90c90,93
< 		if (selectedMenuCaption == AdminResources.getString(AdminResources.MENU_DROP_RESTRICT)) {
---
> 		if (selectedMenuCaption == AdminResources.getString(AdminResources.MENU_RENAME_CONVERSION)) {
> 			RenameDialog rd = new RenameDialog(dockWindow, this, client, this.getNodeType());
> 			rd.show();
>                 } else if (selectedMenuCaption == AdminResources.getString(AdminResources.MENU_DROP_RESTRICT)) {
112a116,134
> 		// Menu items that vary according to backend
> 		
> 		JMenuItem jmiRename = new JMenuItem();
> 		jmiRename.setText(AdminResources.getString(AdminResources.MENU_RENAME_CONVERSION));
> 		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(jmiRename);
