01: /*
02: * MakeLowerCaseAction.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.actions;
13:
14: import java.awt.event.ActionEvent;
15: import java.awt.event.KeyEvent;
16:
17: import javax.swing.KeyStroke;
18:
19: import workbench.gui.sql.EditorPanel;
20: import workbench.interfaces.TextSelectionListener;
21: import workbench.resource.ResourceMgr;
22:
23: /**
24: * Make text lower case
25: * @see workbench.gui.sql.EditorPanel#toLowerCase()
26: * @author support@sql-workbench.net
27: */
28: public class MakeLowerCaseAction extends WbAction implements
29: TextSelectionListener {
30: private EditorPanel client;
31:
32: public MakeLowerCaseAction(EditorPanel aClient) {
33: super ();
34: this .client = aClient;
35: this .client.addSelectionListener(this );
36: this .initMenuDefinition("MnuTxtMakeLowerCase", KeyStroke
37: .getKeyStroke(KeyEvent.VK_L, KeyEvent.CTRL_MASK));
38: this .setMenuItemName(ResourceMgr.MNU_TXT_EDIT);
39: this .setEnabled(false);
40: }
41:
42: public void executeAction(ActionEvent e) {
43: this .client.toLowerCase();
44: }
45:
46: public void selectionChanged(int newStart, int newEnd) {
47: this.setEnabled(newEnd > newStart);
48: }
49:
50: }
|