-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Replaces the standard ComboBox with a SearchableComboBox and a free text field in custom Entry Types #14189
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
Replaces the standard ComboBox with a SearchableComboBox and a free text field in custom Entry Types #14189
Changes from 7 commits
7031c45
f4c97d1
0537d80
9cab4c1
f3f36c4
d2352e7
14d3bf4
ec9af70
24d5d8b
bc2d00e
cb86426
e41aa63
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,7 +6,6 @@ | |
| import javafx.fxml.FXML; | ||
| import javafx.scene.Group; | ||
| import javafx.scene.control.Button; | ||
| import javafx.scene.control.ComboBox; | ||
| import javafx.scene.control.Label; | ||
| import javafx.scene.control.TableColumn; | ||
| import javafx.scene.control.TableRow; | ||
|
|
@@ -40,21 +39,24 @@ | |
| import com.tobiasdiez.easybind.EasyBind; | ||
| import de.saxsys.mvvmfx.utils.validation.visualization.ControlsFxVisualizer; | ||
| import jakarta.inject.Inject; | ||
| import org.controlsfx.control.SearchableComboBox; | ||
|
|
||
| public class CustomEntryTypesTab extends AbstractPreferenceTabView<CustomEntryTypesTabViewModel> implements PreferencesTab { | ||
|
|
||
| @FXML private TableView<EntryTypeViewModel> entryTypesTable; | ||
| @FXML private TableColumn<EntryTypeViewModel, String> entryTypColumn; | ||
| @FXML private TableColumn<EntryTypeViewModel, String> entryTypeActionsColumn; | ||
| @FXML private TextField addNewEntryType; | ||
| @FXML private TextField addNewCustomFieldText; | ||
| @FXML private TableView<FieldViewModel> fields; | ||
| @FXML private TableColumn<FieldViewModel, String> fieldNameColumn; | ||
| @FXML private TableColumn<FieldViewModel, Boolean> fieldTypeColumn; | ||
| @FXML private TableColumn<FieldViewModel, String> fieldTypeActionColumn; | ||
| @FXML private TableColumn<FieldViewModel, Boolean> fieldTypeMultilineColumn; | ||
| @FXML private ComboBox<Field> addNewField; | ||
| @FXML private SearchableComboBox<Field> addNewField; | ||
| @FXML private Button addNewEntryTypeButton; | ||
| @FXML private Button addNewFieldButton; | ||
| @FXML private Button addNewCustomFieldButton; | ||
|
|
||
| @Inject private StateManager stateManager; | ||
|
|
||
|
|
@@ -89,9 +91,13 @@ public void initialize() { | |
| addNewEntryTypeButton.disableProperty().bind(viewModel.entryTypeValidationStatus().validProperty().not()); | ||
| addNewFieldButton.disableProperty().bind(viewModel.fieldValidationStatus().validProperty().not().or(viewModel.selectedEntryTypeProperty().isNull())); | ||
|
|
||
| viewModel.newCustomFieldToAddProperty().bindBidirectional(addNewCustomFieldText.textProperty()); | ||
| addNewCustomFieldButton.disableProperty().bind(viewModel.customFieldValidationStatus().validProperty().not().or(viewModel.selectedEntryTypeProperty().isNull())); | ||
|
|
||
| Platform.runLater(() -> { | ||
| visualizer.initVisualization(viewModel.entryTypeValidationStatus(), addNewEntryType, true); | ||
| visualizer.initVisualization(viewModel.fieldValidationStatus(), addNewField, true); | ||
| visualizer.initVisualization(viewModel.customFieldValidationStatus(), addNewCustomFieldText, true); | ||
| }); | ||
| } | ||
|
|
||
|
|
@@ -203,7 +209,7 @@ private void setupFieldsTable() { | |
| viewModel.newFieldToAddProperty().bindBidirectional(addNewField.valueProperty()); | ||
| // The valueProperty() of addNewField ComboBox needs to be updated by typing text in the ComboBox textfield, | ||
| // since the enabled/disabled state of addNewFieldButton won't update otherwise | ||
| EasyBind.subscribe(addNewField.getEditor().textProperty(), text -> addNewField.setValue(FieldsUtil.FIELD_STRING_CONVERTER.fromString(text))); | ||
| // EasyBind.subscribe(addNewField.getEditor().textProperty(), text -> addNewField.setValue(FieldsUtil.FIELD_STRING_CONVERTER.fromString(text))); | ||
|
||
| } | ||
|
|
||
| private void makeRotatedColumnHeader(TableColumn<?, ?> column, String text) { | ||
|
|
@@ -269,6 +275,11 @@ void addNewField() { | |
| viewModel.addNewField(); | ||
| } | ||
|
|
||
| @FXML | ||
| void addNewCustomField() { | ||
| viewModel.addNewCustomField(); | ||
| } | ||
|
|
||
| @FXML | ||
| void resetEntryTypes() { | ||
| boolean reset = dialogService.showConfirmationDialogAndWait( | ||
|
|
||
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.
No changes to project files
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.
You're right. Sorry, I accidentally removed a line in a previous commit, and the latest one reintroduces it
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.
Please fix. Take this as learning for git.
I see two options:
git checkout main -- .idea/codeStyles/Project.xmlThere 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.
Fixed, thanks!