|
|
@@ -32,6 +32,7 @@ import java.awt.Dimension;
|
|
|
@FieldDefaults(level=AccessLevel.PRIVATE, makeFinal=true)
|
|
|
public class StepPanel extends JPanel implements AutoGrowPanel.DocumentListenable {
|
|
|
ForwardingObservableListener<Step> listener = new ForwardingObservableListener<>();
|
|
|
+ ObservableListener<JTextPane, Step> intructionListener;
|
|
|
ObservableListener<JFormattedTextField, Step> durationListener;
|
|
|
|
|
|
@Getter(AccessLevel.PACKAGE) JLabel lblIndex;
|
|
|
@@ -101,17 +102,19 @@ public class StepPanel extends JPanel implements AutoGrowPanel.DocumentListenabl
|
|
|
|
|
|
txtpnInstructions = new JTextPane();
|
|
|
txtpnInstructions.setPreferredSize(new Dimension(200, 30));
|
|
|
- txtpnInstructions.setText(step.getInstruction());
|
|
|
GridBagConstraints gbc_txtpnInstructions = new GridBagConstraints();
|
|
|
gbc_txtpnInstructions.fill = GridBagConstraints.BOTH;
|
|
|
gbc_txtpnInstructions.gridx = 1;
|
|
|
gbc_txtpnInstructions.gridy = 0;
|
|
|
add(txtpnInstructions, gbc_txtpnInstructions);
|
|
|
|
|
|
+ intructionListener = ObservableController.from(txtpnInstructions,
|
|
|
+ Step::getInstruction, Step::setInstruction);
|
|
|
durationListener = ObservableController.from(panelDuration.txtTime,
|
|
|
Step::getDuration, Step::setDuration);
|
|
|
|
|
|
listener.setObserved(step, ingredients);
|
|
|
+ intructionListener.setObserved(step);
|
|
|
durationListener.setObserved(step);
|
|
|
}
|
|
|
|