public BootSequence getSequence() { StringBuilder str = new StringBuilder(); for (EntityModel a : getItems()) { if (a.getIsChangable()) { BootSequence bs = (BootSequence) a.getEntity(); str.append(bs.toString()); } } return !str.toString().equals("") ? BootSequence.valueOf(str.toString()) : null; //$NON-NLS-1$ }
public BootSequence getBootSequence() { EntityModel<BootSequence> firstSelectedItem = getFirstBootDevice().getSelectedItem(); EntityModel<BootSequence> secondSelectedItem = getSecondBootDevice().getSelectedItem(); String firstSelectedString = firstSelectedItem.getEntity() == null ? "" : firstSelectedItem.getEntity().toString(); //$NON-NLS-1$ String secondSelectedString = secondSelectedItem.getEntity() == null ? "" : secondSelectedItem.getEntity().toString(); //$NON-NLS-1$ return BootSequence.valueOf(firstSelectedString + secondSelectedString); }
public void setBootSequence(BootSequence value) { ArrayList<BootSequence> items = new ArrayList<>(); for (char a : value.toString().toCharArray()) { items.add(BootSequence.valueOf(String.valueOf(a))); } EntityModel<BootSequence> firstBootDevice = null; for (EntityModel<BootSequence> item : getFirstBootDevice().getItems()) { if (item.getEntity() == Linq.firstOrNull(items)) { firstBootDevice = item; } } getFirstBootDevice().setSelectedItem(firstBootDevice); Iterable<EntityModel<BootSequence>> secondDeviceOptions = getSecondBootDevice().getItems(); if (items.size() > 1) { BootSequence last = items.get(items.size() - 1); for (EntityModel<BootSequence> a : secondDeviceOptions) { if (a.getEntity() != null && a.getEntity() == last) { getSecondBootDevice().setSelectedItem(a); break; } } } else { for (EntityModel<BootSequence> a : secondDeviceOptions) { if (a.getEntity() == null) { getSecondBootDevice().setSelectedItem(a); break; } } } }