public inbox for rhdb@sourceware.org
 help / color / mirror / Atom feed
From: "binary code" <binary_data@hotmail.com>
To: rhdb@sources.redhat.com
Subject: Patch for renaming conversions in Java Administrator 2.0
Date: Tue, 23 Dec 2003 19:29:00 -0000	[thread overview]
Message-ID: <BAY8-F575LZepkORXFg000361d9@hotmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 418 bytes --]

This patch adds functionality for renaming conversions in the Java Version 
of Administrator 2.0, when using a 7.4 or higher backend.

Regards,
Benjamin

_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE*  
http://join.msn.com/?page=features/virus&pgmarket=en-ca&RU=http%3a%2f%2fjoin.msn.com%2f%3fpage%3dmisc%2fspecialoffers%26pgmarket%3den-ca

[-- Attachment #2: RenameConversion.diff --]
[-- Type: application/octet-stream, Size: 4957 bytes --]

? 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);

                 reply	other threads:[~2003-12-23 19:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BAY8-F575LZepkORXFg000361d9@hotmail.com \
    --to=binary_data@hotmail.com \
    --cc=rhdb@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).