[Schmitzm-commits] r2210 - in trunk/schmitzm-core/src/main/java/de/schmitzm/swing: . menu
scm-commit at wald.intevation.org
scm-commit at wald.intevation.org
Thu Jan 31 14:29:55 CET 2013
Author: mojays
Date: 2013-01-31 14:29:55 +0100 (Thu, 31 Jan 2013)
New Revision: 2210
Modified:
trunk/schmitzm-core/src/main/java/de/schmitzm/swing/ListMaintainancePanel.java
trunk/schmitzm-core/src/main/java/de/schmitzm/swing/menu/FavoritesMenu.java
Log:
FavoritesMenu: Bugfix in constructor
ListMaintainancePanel: Bugfix in enabling actions on initialization
Modified: trunk/schmitzm-core/src/main/java/de/schmitzm/swing/ListMaintainancePanel.java
===================================================================
--- trunk/schmitzm-core/src/main/java/de/schmitzm/swing/ListMaintainancePanel.java 2013-01-31 13:18:49 UTC (rev 2209)
+++ trunk/schmitzm-core/src/main/java/de/schmitzm/swing/ListMaintainancePanel.java 2013-01-31 13:29:55 UTC (rev 2210)
@@ -73,6 +73,7 @@
// list = new JList<T>( new ListModel<T>() ); // TODO: Java 1.7
list = new JList( new ListModel<T>() );
list.addListSelectionListener(this);
+ // add MouseListener to edit list item on double click
list.addMouseListener( new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
@@ -147,6 +148,7 @@
*/
public void setData(List<T> data) {
((ListModel<T>)list.getModel()).setDataSource(data);
+ updateActions();
}
Modified: trunk/schmitzm-core/src/main/java/de/schmitzm/swing/menu/FavoritesMenu.java
===================================================================
--- trunk/schmitzm-core/src/main/java/de/schmitzm/swing/menu/FavoritesMenu.java 2013-01-31 13:18:49 UTC (rev 2209)
+++ trunk/schmitzm-core/src/main/java/de/schmitzm/swing/menu/FavoritesMenu.java 2013-01-31 13:29:55 UTC (rev 2210)
@@ -91,7 +91,7 @@
* {@link #initMenu(Map)} should be called to update the menu structure!)
* @param actionListener listener which is called for menu actions
*/
- public FavoritesMenu(String name, Map<Object,F> favorites, ActionListener actionListener) {
+ public FavoritesMenu(String name, Map<?,F> favorites, ActionListener actionListener) {
this(name,favorites,actionListener,null,null);
}
@@ -112,7 +112,7 @@
if ( addFavoriteAction == null )
addFavoriteAction = SwingUtil.createAction(SwingUtil.R("FavoritesMenu.add"), actionListener, ACTION_CMD_ADD, SwingUtil.R("FavoritesMenu.add.desc"), null);
if ( maintainFavoritesAction == null )
- addFavoriteAction = SwingUtil.createAction(SwingUtil.R("FavoritesMenu.maintain"), actionListener, ACTION_CMD_MAINTAIN, SwingUtil.R("FavoritesMenu.maintain.desc"), null);
+ maintainFavoritesAction = SwingUtil.createAction(SwingUtil.R("FavoritesMenu.maintain"), actionListener, ACTION_CMD_MAINTAIN, SwingUtil.R("FavoritesMenu.maintain.desc"), null);
this.actionListener = actionListener;
this.addFavoriteAction = addFavoriteAction;
More information about the Schmitzm-commits
mailing list