-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switching entry tabs using tab #7
base: main
Are you sure you want to change the base?
Conversation
…ed fields" because the "CitationKey" isnt created in SimpleEditor.java and therefore hasn't had its textfield id updated.
…ed fields" because the "CitationKey" isnt created in SimpleEditor.java and therefore hasn't had its textfield id updated.
import org.jabref.gui.fieldeditors.contextmenu.EditorContextAction; | ||
import org.jabref.gui.keyboard.KeyBindingRepository; | ||
|
||
public class EditorTextField extends TextField implements Initializable, ContextMenuAddable { | ||
|
||
private final ContextMenu contextMenu = new ContextMenu(); | ||
public static TabPane tabs; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.DeclarationOrderCheck> reported by reviewdog 🐶
Static variable definition in wrong order.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Plz check the styling
@@ -38,6 +48,10 @@ public EditorTextField(final String text) { | |||
ClipBoardManager.addX11Support(this); | |||
} | |||
|
|||
public static void entryContext(TabPane tab){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAroundCheck> reported by reviewdog 🐶
'{' is not preceded with whitespace.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this also plz check the style
@FXML | ||
private TabPane tabbed; | ||
|
||
@FXML | ||
private Button typeChangeButton; | ||
@FXML | ||
private Button fetcherButton; | ||
@FXML | ||
private Label typeLabel; | ||
|
||
@Inject | ||
private BuildInfo buildInfo; | ||
@Inject | ||
private DialogService dialogService; | ||
@Inject | ||
private TaskExecutor taskExecutor; | ||
@Inject | ||
private GuiPreferences preferences; | ||
@Inject | ||
private StateManager stateManager; | ||
@Inject | ||
private ThemeManager themeManager; | ||
@Inject | ||
private FileUpdateMonitor fileMonitor; | ||
@Inject | ||
private CountingUndoManager undoManager; | ||
@Inject | ||
private BibEntryTypesManager bibEntryTypesManager; | ||
@Inject | ||
private KeyBindingRepository keyBindingRepository; | ||
@Inject | ||
private JournalAbbreviationRepository journalAbbreviationRepository; | ||
@Inject | ||
private AiService aiService; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Styling should be improved - I think this won't pass the styling check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the previous one - it's all in one line
.root(this) | ||
.load(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the space removed?
if (textField != null && lastField != null) { | ||
if (textField.getId() == null) { | ||
return false; | ||
} | ||
return lastField.getDisplayName().equalsIgnoreCase(textField.getId()); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is it indented one space deeper
import org.jabref.gui.fieldeditors.contextmenu.EditorContextAction; | ||
import org.jabref.gui.keyboard.KeyBindingRepository; | ||
|
||
public class EditorTextField extends TextField implements Initializable, ContextMenuAddable { | ||
|
||
private final ContextMenu contextMenu = new ContextMenu(); | ||
public static TabPane tabs; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Plz check the styling
@@ -38,6 +48,10 @@ public EditorTextField(final String text) { | |||
ClipBoardManager.addX11Support(this); | |||
} | |||
|
|||
public static void entryContext(TabPane tab){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this also plz check the style
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove space pls
if (isMultiLine) { | ||
EditorTextArea textArea = new EditorTextArea(); | ||
textArea.setId(field.getName()); | ||
textInput = textArea; | ||
} else { | ||
EditorTextField textField = new EditorTextField(); | ||
textField.setId(field.getName()); | ||
textInput = textField; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be simplified with
textInput = isMultiLine
? new EditorTextArea()
: new EditorTextField();
textInput.setId(field.getName());
protected TextInputControl createTextInputControl(Field field) { | ||
if (isMultiLine) { | ||
EditorTextArea textArea = new EditorTextArea(); | ||
textArea.setId(field.getName()); | ||
return textArea; | ||
} else { | ||
EditorTextField textField = new EditorTextField(); | ||
textField.setId(field.getName()); | ||
return textField; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again, you can see the simplified version above
Hey Everyone,
This PR has been created because I believe I have completed this issue: #11937.
To solve this, I used a similar approach as @yeonissa in the
EditorTextField
class. Using the entry tabs provided byEntryEditor
, the method,EditorTextField
is able to find the current tab, locate its last field, and compare the currentTextField
in focus to that field. To make this comparison possible, I set eachTextField
's ID to match the corresponding field's name.I believe I have tested this well, but I’d appreciate any suggestions from you all before I submit a PR to the main repo.
Thankyou
CHANGELOG.md
described in a way that is understandable for the average user (if applicable)