[Jsxe-cvs] SF.net SVN: jsxe: [1017] trunk/jsxe
Status: Inactive
Brought to you by:
ian_lewis
From: <ian...@us...> - 2006-07-12 17:23:47
|
Revision: 1017 Author: ian_lewis Date: 2006-07-12 10:23:27 -0700 (Wed, 12 Jul 2006) ViewCVS: http://svn.sourceforge.net/jsxe/?rev=1017&view=rev Log Message: ----------- Added funcionality to save keyboard shortcuts. Modified Paths: -------------- trunk/jsxe/Changelog trunk/jsxe/src/net/sourceforge/jsxe/gui/TabbedView.java trunk/jsxe/src/net/sourceforge/jsxe/options/ShortcutsOptionPane.java Modified: trunk/jsxe/Changelog =================================================================== --- trunk/jsxe/Changelog 2006-07-12 16:40:31 UTC (rev 1016) +++ trunk/jsxe/Changelog 2006-07-12 17:23:27 UTC (rev 1017) @@ -1,3 +1,10 @@ +07/12/2006 Ian Lewis <Ian...@me...> + + * Added functionality to save keyboard shortcuts. The shortcuts themselves + work but the shortcut labels for menu items are not updated when the + action is updated. This is a bug that is fixed in the beta for Java 6 + but obviously it can't wait that long. + 07/10/2006 Ian Lewis <Ian...@me...> * Added the Shortcuts option pane. However, it currently it doesn't work. Modified: trunk/jsxe/src/net/sourceforge/jsxe/gui/TabbedView.java =================================================================== --- trunk/jsxe/src/net/sourceforge/jsxe/gui/TabbedView.java 2006-07-12 16:40:31 UTC (rev 1016) +++ trunk/jsxe/src/net/sourceforge/jsxe/gui/TabbedView.java 2006-07-12 17:23:27 UTC (rev 1017) @@ -325,7 +325,7 @@ */ protected void processKeyEvent(KeyEvent e) { //TODO: process shortcuts - Log.log(Log.DEBUG, this, e.toString()); + // Log.log(Log.DEBUG, this, e.toString()); ActionManager.handleKey(e); }//}}} Modified: trunk/jsxe/src/net/sourceforge/jsxe/options/ShortcutsOptionPane.java =================================================================== --- trunk/jsxe/src/net/sourceforge/jsxe/options/ShortcutsOptionPane.java 2006-07-12 16:40:31 UTC (rev 1016) +++ trunk/jsxe/src/net/sourceforge/jsxe/options/ShortcutsOptionPane.java 2006-07-12 17:23:27 UTC (rev 1017) @@ -111,7 +111,14 @@ //{{{ _save() protected void _save() { - + if (m_keyTable.getCellEditor() != null) { + m_keyTable.getCellEditor().stopCellEditing(); + } + + Iterator e = m_models.iterator(); + while (e.hasNext()) { + ((ActionSetTableModel)e.next()).save(); + } }//}}} //{{{ toString() @@ -153,7 +160,7 @@ //{{{ getBindingAt() public GrabKeyDialog.KeyBinding getBindingAt(int row) { - return (GrabKeyDialog.KeyBinding)m_set.elementAt(row); + return (GrabKeyDialog.KeyBinding)m_set.elementAt(row); }//}}} //{{{ getColumnCount() @@ -225,6 +232,19 @@ return m_name; }//}}} + //{{{ save() + /** + * Saves the current config to the properties + */ + public void save() { + Iterator e = m_set.iterator(); + while(e.hasNext()) { + GrabKeyDialog.KeyBinding binding = (GrabKeyDialog.KeyBinding)e.next(); + + jsXe.setProperty(binding.name + ".shortcut", binding.shortcut); + } + }//}}} + //{{{ Private members //{{{ KeyCompare class @@ -281,7 +301,6 @@ }//}}} //{{{ initModels() - private void initModels() { m_models = new Vector(); Iterator itr = ActionManager.getActionSets().iterator(); @@ -317,4 +336,4 @@ //}}} -} +} \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |