01: /*
02: * RenameGroupAction.java
03: *
04: * This file is part of SQL Workbench/J, http://www.sql-workbench.net
05: *
06: * Copyright 2002-2008, Thomas Kellerer
07: * No part of this code maybe reused without the permission of the author
08: *
09: * To contact the author please send an email to: support@sql-workbench.net
10: *
11: */
12: package workbench.gui.profiles;
13:
14: import java.awt.event.ActionEvent;
15: import javax.swing.event.TreeSelectionEvent;
16: import javax.swing.event.TreeSelectionListener;
17: import workbench.gui.actions.WbAction;
18: import workbench.log.LogMgr;
19:
20: /**
21: * @author support@sql-workbench.net
22: */
23: public class RenameGroupAction extends WbAction implements
24: TreeSelectionListener {
25: private ProfileTree client;
26:
27: public RenameGroupAction(ProfileTree panel) {
28: this .client = panel;
29: this .client.addTreeSelectionListener(this );
30: this .initMenuDefinition("LblRenameProfileGroup");
31: }
32:
33: public void executeAction(ActionEvent e) {
34: client.renameGroup();
35: }
36:
37: public void valueChanged(TreeSelectionEvent e) {
38: this.setEnabled(client.onlyGroupSelected());
39: }
40:
41: }
|