-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated jump search to entry field with working control input binding
- Loading branch information
1 parent
43f8781
commit d01dcb8
Showing
6 changed files
with
81 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,62 @@ | ||
package org.jabref.gui.edit; | ||
|
||
import java.util.logging.Logger; | ||
import java.util.Collection; | ||
import java.util.Optional; | ||
import java.util.logging.Level; | ||
import java.util.function.Supplier; | ||
|
||
import javafx.scene.control.TextInputDialog; | ||
import org.jabref.gui.DialogService; | ||
import org.jabref.gui.LibraryTab; | ||
import org.jabref.gui.StateManager; | ||
import org.jabref.gui.actions.ActionHelper; | ||
import org.jabref.gui.actions.SimpleCommand; | ||
import org.jabref.gui.entryeditor.EntryEditor; | ||
|
||
import org.jabref.model.entry.BibEntry; | ||
import org.jabref.model.entry.BibEntryType; | ||
//import org.jabref.gui.autocompleter.AutoCompleter; | ||
import org.jabref.model.entry.BibEntryTypesManager; | ||
import org.jabref.gui.preferences.PreferencesService; | ||
|
||
public class JumpSearchAction extends SimpleCommand { | ||
//private final EntryEditor entryEditor; | ||
//private final AutoCompleter<String> autoCompleter; | ||
|
||
private final Supplier<LibraryTab> tabSupplier; | ||
private final DialogService dialogService; | ||
//private final Collection<BibEntryTypesManager> bibentrytype; | ||
|
||
public JumpSearchAction( Supplier<LibraryTab> tabSupplier, StateManager stateManager, DialogService dialogService) { | ||
//this.entryEditor = entryEditor; | ||
//this.autoCompleter = new AutoCompleter<>(entryEditor.getAvailableFieldNames(), preferencesService); | ||
|
||
|
||
public JumpSearchAction(Supplier<LibraryTab> tabSupplier, StateManager stateManager, DialogService dialogService) { | ||
this.tabSupplier = tabSupplier; | ||
this.dialogService = dialogService; | ||
//this.bibentrytype = bibentrytype; | ||
this.executable.bind(ActionHelper.needsDatabase(stateManager)); | ||
} | ||
|
||
private static final Logger logger = Logger.getLogger(JumpSearchAction.class.getName()); | ||
|
||
public static void main(String[] args) { | ||
// Log a simple INFO message | ||
logger.info("Application has started."); | ||
|
||
} | ||
|
||
@Override | ||
public void execute() { | ||
TextInputDialog dialog = new TextInputDialog(); | ||
dialog.setTitle("Jump to Field"); | ||
dialog.setHeaderText("Type a field name:"); | ||
// dialog.initOwner(new Stage()); | ||
|
||
//autoCompleter.bindTo(dialog.getEditor()); | ||
|
||
|
||
Optional<String> result = dialog.showAndWait(); | ||
|
||
// result.ifPresent(fieldName -> { | ||
// if (!entryEditor.focusField(fieldName)) { | ||
// entryEditor.showErrorMessage("Field not found: " + fieldName); | ||
// } | ||
// }); | ||
|
||
dialogService.showCustomDialogAndWait(new JumpSearchView(tabSupplier.get())); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters