Source:
public void edit(StorageModel object) { driver.edit(object); final StorageModel storageModel = object; storageModel.getAvailableStorageDomainTypeItems().getSelectedItemChangedEvent().addListener((ev, sender, args) -> { updateStorageTypesByDomainType(storageModel); }); storageModel.getAvailableStorageTypeItems().getSelectedItemChangedEvent().addListener((ev, sender, args) -> { revealStorageView(storageModel); }); storageModel.getDataCenterAlert().getEntityChangedEvent().addListener((ev, sender, args) -> { datacenterAlertIcon.setVisible(storageModel.getDataCenterAlert().getIsAvailable()); datacenterAlertIcon.setTitle(storageModel.getDataCenterAlert().getEntity()); }); warningLowSpaceIndicatorEditor.addKeyUpHandler(event -> { if (!storageModel.isNewStorage()) { storageModel.getWarningLowSpaceSize().setEntity( ConstantsManager.getInstance().getMessages().bracketsWithGB(getWarningLowSpaceSize(storageModel))); } }); criticalSpaceActionBlockerEditor.addKeyUpHandler(event -> { int storageDomainTotalSize = getStorageDomainTotalSize(storageModel); String validationToolTipText = ConstantsManager .getInstance() .getMessages() .criticalSpaceActionBlockerBiggerThanStorageDomain(storageDomainTotalSize); int criticalActionBlockerSpace; if (criticalSpaceActionBlockerEditor.asValueBox().getValue() == null) { criticalSpaceActionBlockerEditor.markAsInvalid(Arrays.asList(validationToolTipText)); } else { criticalActionBlockerSpace = criticalSpaceActionBlockerEditor.asValueBox().getValue(); if (criticalActionBlockerSpace > storageDomainTotalSize) { criticalSpaceActionBlockerEditor.markAsInvalid(Arrays.asList(validationToolTipText)); } else { criticalSpaceActionBlockerEditor.markAsValid(); } } }); }

Target:
public void edit(StorageModel object) { driver.edit(object); final StorageModel storageModel = object; storageModel.getAvailableStorageDomainTypeItems().getSelectedItemChangedEvent().addListener((ev, sender, args) -> { updateStorageTypesByDomainType(storageModel); }); storageModel.getAvailableStorageTypeItems().getSelectedItemChangedEvent().addListener((ev, sender, args) -> { revealStorageView(storageModel); }); storageModel.getDataCenterAlert().getEntityChangedEvent().addListener((ev, sender, args) -> { datacenterAlertIcon.setVisible(storageModel.getDataCenterAlert().getIsAvailable()); datacenterAlertIcon.setTitle(storageModel.getDataCenterAlert().getEntity()); }); warningLowSpaceIndicatorEditor.addKeyUpHandler(event -> { if (!storageModel.isNewStorage()) { storageModel.getWarningLowSpaceSize().setEntity( ConstantsManager.getInstance().getMessages().bracketsWithGB(getWarningLowSpaceSize(storageModel))); } }); criticalSpaceActionBlockerEditor.addKeyUpHandler(event -> { int storageDomainTotalSize = getStorageDomainTotalSize(storageModel); String validationToolTipText = ConstantsManager .getInstance() .getMessages() .criticalSpaceActionBlockerBiggerThanStorageDomain(storageDomainTotalSize); Integer criticalActionBlockerSpace = criticalSpaceActionBlockerEditor.asValueBox().getValue(); if (criticalActionBlockerSpace == null || criticalActionBlockerSpace > storageDomainTotalSize) { criticalSpaceActionBlockerEditor.markAsInvalid(Arrays.asList(validationToolTipText)); } else { criticalSpaceActionBlockerEditor.markAsValid(); } }); }