changeset 31:fb49a356458a

Control + save button click to save card and stay in edit mode
author Fox
date Wed, 11 May 2022 01:33:40 +0200
parents 91344832aa2a
children 6cbb34600e38
files src/junotu/TabEdit.java
diffstat 1 files changed, 13 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/junotu/TabEdit.java	Fri May 06 17:18:54 2022 +0200
+++ b/src/junotu/TabEdit.java	Wed May 11 01:33:40 2022 +0200
@@ -153,7 +153,8 @@
 				   @Override
 				   public void actionPerformed( ActionEvent e )
 				   {
-					 buttonClickedSave();
+				       boolean noSwitch = (e.getModifiers() & ActionEvent.SHIFT_MASK) != 0;
+				       buttonClickedSave( noSwitch );
 				   }
 			       }
 			       );
@@ -470,7 +471,7 @@
 	
     }
     
-    private void buttonClickedSave()
+    private void buttonClickedSave( boolean noSwitch )
     {
 
 	card.titleSet( title.getText() );
@@ -487,9 +488,16 @@
 	}
 
 	Window window = (Window)this.getTopLevelAncestor();
-        window.tabSearch.search();
-        reset();
-	window.tabSwitch( Tab.SEARCH );
+	window.tabSearch.search();
+	
+	if( noSwitch ) {
+	    if( newCard ) {
+		cardEdit( this.card );
+	    }
+	} else {
+	    reset();
+	    window.tabSwitch( Tab.SEARCH );
+	}
     }
     
 }