-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/finished/iia 1365 implement data refresh on submit for compon…
…ent and component set (#248) * Update version to start feature: IIA-1367-New-Implement-Capability-to-Submit-Data-in-database-for-Component-sets * Update version to finish feature: IIA-1367-New-Implement-Capability-to-Submit-Data-in-database-for-Component-sets * Fixed code broken by the git process. * Some more fixes
- Loading branch information
1 parent
e18bf66
commit 37535e9
Showing
14 changed files
with
241 additions
and
112 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
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
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
44 changes: 44 additions & 0 deletions
44
...src/main/java/dev/ikm/komet/kview/klfields/componentfield/DefaultKlComponentSetField.java
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package dev.ikm.komet.kview.klfields.componentfield; | ||
|
||
import dev.ikm.komet.framework.Identicon; | ||
import dev.ikm.komet.framework.observable.ObservableField; | ||
import dev.ikm.komet.framework.view.ObservableView; | ||
import dev.ikm.komet.kview.controls.KLComponentSetControl; | ||
import dev.ikm.komet.kview.controls.KLReadOnlyComponentControl; | ||
import dev.ikm.komet.kview.klfields.BaseDefaultKlField; | ||
import dev.ikm.komet.layout.component.version.field.KlComponentSetField; | ||
import dev.ikm.tinkar.common.id.IntIdSet; | ||
import dev.ikm.tinkar.terms.EntityProxy; | ||
import javafx.scene.Node; | ||
import javafx.scene.control.Label; | ||
import javafx.scene.layout.VBox; | ||
|
||
public class DefaultKlComponentSetField extends BaseDefaultKlField<IntIdSet> implements KlComponentSetField { | ||
|
||
public DefaultKlComponentSetField(ObservableField<IntIdSet> observableComponentSetField, ObservableView observableView, boolean isEditable) { | ||
super(observableComponentSetField, observableView, isEditable); | ||
Node node; | ||
if (isEditable) { | ||
KLComponentSetControl klComponentSetControl = new KLComponentSetControl(); | ||
klComponentSetControl.setTitle(getTitle()); | ||
klComponentSetControl.valueProperty().bindBidirectional(observableComponentSetField.valueProperty()); | ||
node = klComponentSetControl; | ||
} else { | ||
VBox vBox = new VBox(); | ||
observableComponentSetField.valueProperty().subscribe(intIdSet -> { | ||
vBox.getChildren().clear(); | ||
vBox.getChildren().add(new Label(getTitle())); | ||
intIdSet.forEach(nid -> { | ||
KLReadOnlyComponentControl readOnlyComponentControl = new KLReadOnlyComponentControl(); | ||
EntityProxy entityProxy = EntityProxy.make(nid); | ||
readOnlyComponentControl.setText(entityProxy.description()); | ||
readOnlyComponentControl.setIcon(Identicon.generateIdenticonImage(entityProxy.publicId())); | ||
vBox.getChildren().add(readOnlyComponentControl); | ||
}); | ||
}); | ||
node = vBox; | ||
|
||
} | ||
setKlWidget(node); | ||
} | ||
} |
Oops, something went wrong.