Source:
public void edit(final boolean isEditWithPMemphasis) { if (getWindow() != null) { return; } VDS host = getSelectedItem(); EditHostModel hostModel = new EditHostModel(); AsyncDataProvider.getInstance().getAllFenceAgentsByHostId(new AsyncQuery<>(retValue -> { ArrayList<FenceAgent> fenceAgents = new ArrayList<>(); for (FenceAgent fenceAgent : retValue) { fenceAgents.add(fenceAgent); } host.setFenceAgents(fenceAgents); hostModel.setSelectedCluster(host); hostModel.getFenceAgentListModel().setItems(hostModel.getFenceAgentModelList(host)); }), getSelectedItem().getId()); AsyncDataProvider.getInstance().getDataCenterList(new AsyncQuery<>(dataCenters -> { hostModel.updateModelFromVds(host, dataCenters, isEditWithPMemphasis); hostModel.onDataInitialized(); hostModel.setTitle(ConstantsManager.getInstance().getConstants().editHostTitle()); hostModel.setHelpTag(HelpTag.edit_host); hostModel.setHashName("edit_host"); hostModel.setIsHeSystem(isHeSystem()); hostModel.setHostsWithHeDeployed(getHostsWithHeDeployed()); hostModel.setHostedEngineHostModel(new HostedEngineHostModel()); setWindow(hostModel); if (host.getFenceProxySources() != null && !host.getFenceProxySources().isEmpty()) { hostModel.setPmProxyPreferences( FenceProxySourceTypeHelper.saveAsString(host.getFenceProxySources())); } else { AsyncDataProvider.getInstance().getDefaultPmProxyPreferences(new AsyncQuery<>(returnValue -> hostModel.setPmProxyPreferences(returnValue))); } UICommand onSaveFalseCommand = UICommand.createDefaultOkUiCommand("OnSaveFalse", HostListModel.this); hostModel.getCommands().add(onSaveFalseCommand); UICommand cancelCommand = UICommand.createCancelUiCommand("Cancel", HostListModel.this); hostModel.getCommands().add(cancelCommand); })); }

Target:
public void edit(final boolean isEditWithPMemphasis) { if (getWindow() != null) { return; } VDS host = getSelectedItem(); EditHostModel hostModel = new EditHostModel(); hostModel.setSelectedCluster(host); AsyncDataProvider.getInstance().getAllFenceAgentsByHostId(new AsyncQuery<>(retValue -> { ArrayList<FenceAgent> fenceAgents = new ArrayList<>(); for (FenceAgent fenceAgent : retValue) { fenceAgents.add(fenceAgent); } host.setFenceAgents(fenceAgents); hostModel.getFenceAgentListModel().setItems(hostModel.getFenceAgentModelList(host)); }), getSelectedItem().getId()); AsyncDataProvider.getInstance().getDataCenterList(new AsyncQuery<>(dataCenters -> { hostModel.updateModelFromVds(host, dataCenters, isEditWithPMemphasis); hostModel.onDataInitialized(); hostModel.setTitle(ConstantsManager.getInstance().getConstants().editHostTitle()); hostModel.setHelpTag(HelpTag.edit_host); hostModel.setHashName("edit_host"); hostModel.setIsHeSystem(isHeSystem()); hostModel.setHostsWithHeDeployed(getHostsWithHeDeployed()); hostModel.setHostedEngineHostModel(new HostedEngineHostModel()); setWindow(hostModel); if (host.getFenceProxySources() != null && !host.getFenceProxySources().isEmpty()) { hostModel.setPmProxyPreferences( FenceProxySourceTypeHelper.saveAsString(host.getFenceProxySources())); } else { AsyncDataProvider.getInstance().getDefaultPmProxyPreferences(new AsyncQuery<>(returnValue -> hostModel.setPmProxyPreferences(returnValue))); } UICommand onSaveFalseCommand = UICommand.createDefaultOkUiCommand("OnSaveFalse", HostListModel.this); hostModel.getCommands().add(onSaveFalseCommand); UICommand cancelCommand = UICommand.createCancelUiCommand("Cancel", HostListModel.this); hostModel.getCommands().add(cancelCommand); })); }