Skip to content

Commit

Permalink
Applying suggestion for change
Browse files Browse the repository at this point in the history
  • Loading branch information
JantBogard committed Nov 25, 2024
1 parent 00e3fa3 commit 825d342
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
4 changes: 2 additions & 2 deletions bundle/language_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ angal.hospital.visitendhour.txt
angal.hospital.visitstarthour.txt = Visit start hour
angal.lab.allnegative.txt = All negative.
angal.invetory.allmedicaladdedsuccessfully.msg = All medicals are added successfully.
angal.inventory.allproduct.radio = All products
angal.inventory.allproduct.btn = All products
angal.inventory.canceled = Canceled
angal.inventory.cancelednoteditable.msg = A canceled inventory can not be modified.
angal.inventory.cannotcreateanotherinventorywithotherinprogressinthisward.msg = Cannot create another inventory with other in progress in this ward.
Expand Down Expand Up @@ -729,7 +729,7 @@ angal.inventory.referenceshow.col
angal.inventory.savesuccess.msg = Inventory saved.
angal.inventory.searchproduct.txt = Search a product
angal.inventory.selectward.label = Select ward
angal.inventory.specificproduct.radio = Specific product
angal.inventory.specificproduct.btn = Specific product
angal.inventory.status.col = Status
angal.inventory.status.label = Status
angal.inventory.status.canceled.txt = Canceled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,12 @@ private JPanel getPanelHeader() {
gbc_jCalendarTo.gridx = 3;
gbc_jCalendarTo.gridy = 0;
panelHeader.add(getJCalendarTo(), gbc_jCalendarTo);
GridBagConstraints gbc_stateLabel = new GridBagConstraints();
gbc_stateLabel.fill = GridBagConstraints.HORIZONTAL;
gbc_stateLabel.insets = new Insets(0, 0, 0, 5);
gbc_stateLabel.gridx = 4;
gbc_stateLabel.gridy = 0;
panelHeader.add(getStatusLabel(), gbc_stateLabel);
GridBagConstraints gbc_statusLabel = new GridBagConstraints();
gbc_statusLabel.fill = GridBagConstraints.HORIZONTAL;
gbc_statusLabel.insets = new Insets(0, 0, 0, 5);
gbc_statusLabel.gridx = 4;
gbc_statusLabel.gridy = 0;
panelHeader.add(getStatusLabel(), gbc_statusLabel);
GridBagConstraints gbc_comboBox = new GridBagConstraints();
gbc_comboBox.fill = GridBagConstraints.HORIZONTAL;
gbc_comboBox.gridx = 5;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1041,7 +1041,7 @@ private boolean existInInventorySearchList(MedicalInventoryRow inventoryRow) {

private JRadioButton getSpecificRadio() {
if (specificRadio == null) {
specificRadio = new JRadioButton(MessageBundle.getMessage("angal.inventory.specificproduct.radio"));
specificRadio = new JRadioButton(MessageBundle.getMessage("angal.inventory.specificproduct.btn"));
specificRadio.addActionListener(actionEvent -> {
if (specificRadio.isSelected()) {
codeTextField.setEnabled(true);
Expand All @@ -1055,7 +1055,7 @@ private JRadioButton getSpecificRadio() {

private JRadioButton getAllRadio() {
if (allRadio == null) {
allRadio = new JRadioButton(MessageBundle.getMessage("angal.inventory.allproduct.radio"));
allRadio = new JRadioButton(MessageBundle.getMessage("angal.inventory.allproduct.btn"));
allRadio.setSelected(inventory != null);
specificRadio.setSelected(inventory == null);
allRadio.addActionListener(actionEvent -> {
Expand Down Expand Up @@ -1198,7 +1198,7 @@ private Medical chooseMedical(String text) throws OHServiceException {
key = med.getCode().toString().toLowerCase();
medicalMap.put(key, med);
}
ArrayList<Medical> medList = new ArrayList<>();
List<Medical> medList = new ArrayList<>();
for (Medical aMed : medicalMap.values()) {
if (NormalizeString.normalizeContains(aMed.getDescription().toLowerCase(), text)) {
medList.add(aMed);
Expand Down Expand Up @@ -1341,7 +1341,7 @@ private JComboBox<Ward> getWardComboBox() {
}

if (medicalWardInventoryDraft.isEmpty() && medicalWardInventoryValidated.isEmpty()) {
activedSomeComponents();
activateSomeComponents();
} else {
MessageDialog.error(this,
"angal.inventory.cannotcreateanotherinventorywithotherinprogressinthisward.msg");
Expand Down Expand Up @@ -1402,7 +1402,7 @@ private void disabledSomeComponents() {
deleteButton.setEnabled(false);
}

private void activedSomeComponents() {
private void activateSomeComponents() {
jCalendarInventory.setEnabled(true);
specificRadio.setEnabled(true);
codeTextField.setEnabled(true);
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/org/isf/medicalinventory/gui/StockMedModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import javax.swing.table.DefaultTableModel;

Expand All @@ -33,10 +34,10 @@
public class StockMedModel extends DefaultTableModel {

private static final long serialVersionUID = 1L;
private ArrayList<Medical> medList;
private ArrayList<Medical> initList = new ArrayList<Medical>();
private List<Medical> medList;
private List<Medical> initList = new ArrayList<>();

public StockMedModel(ArrayList<Medical> meds) {
public StockMedModel(List<Medical> meds) {
medList = meds;
initList.addAll(medList);
}
Expand Down

0 comments on commit 825d342

Please sign in to comment.