Source:
public MainModelProvider<GlusterVolumeEntity, VolumeListModel> getVolumeListProvider(EventBus eventBus, Provider<DefaultConfirmationPopupPresenterWidget> defaultConfirmPopupProvider, final Provider<VolumePopupPresenterWidget> popupProvider, final Provider<RemoveConfirmationPopupPresenterWidget> removeConfirmPopupProvider, final Provider<VolumeRebalanceStatusPopupPresenterWidget> rebalanceStatusPopupProvider, final Provider<VolumeProfileStatisticsPopupPresenterWidget> volumeProfileStatsPopupProvider) { return new MainTabModelProvider<GlusterVolumeEntity, VolumeListModel>(eventBus, defaultConfirmPopupProvider, VolumeListModel.class) { @Override public AbstractModelBoundPopupPresenterWidget<? extends Model, ?> getModelPopup(VolumeListModel source, UICommand lastExecutedCommand, Model windowModel) { if (lastExecutedCommand == getModel().getNewVolumeCommand()) { return popupProvider.get(); } else if (lastExecutedCommand == getModel().getStatusRebalanceCommand() || lastExecutedCommand.getName().equals("onStopRebalance")) { return rebalanceStatusPopupProvider.get(); } else if(lastExecutedCommand == getModel().getShowVolumeProfileDetailsCommand() || lastExecutedCommand.getName().equals("Show Profile Details")) { return volumeProfileStatsPopupProvider.get(); } else { return super.getModelPopup(source, lastExecutedCommand, windowModel); } } @Override public AbstractModelBoundPopupPresenterWidget<? extends ConfirmationModel, ?> getConfirmModelPopup(VolumeListModel source, UICommand lastExecutedCommand) { if (lastExecutedCommand == getModel().getStopCommand() || lastExecutedCommand == getModel().getRemoveVolumeCommand()) { return removeConfirmPopupProvider.get(); } else { return super.getConfirmModelPopup(source, lastExecutedCommand); } } }; }

Target:
public MainModelProvider<GlusterVolumeEntity, VolumeListModel> getVolumeListProvider(EventBus eventBus, Provider<DefaultConfirmationPopupPresenterWidget> defaultConfirmPopupProvider, final Provider<VolumePopupPresenterWidget> popupProvider, final Provider<RemoveConfirmationPopupPresenterWidget> removeConfirmPopupProvider, final Provider<VolumeRebalanceStatusPopupPresenterWidget> rebalanceStatusPopupProvider, final Provider<VolumeProfileStatisticsPopupPresenterWidget> volumeProfileStatsPopupProvider) { return new MainTabModelProvider<GlusterVolumeEntity, VolumeListModel>(eventBus, defaultConfirmPopupProvider, VolumeListModel.class) { @Override public AbstractModelBoundPopupPresenterWidget<? extends Model, ?> getModelPopup(VolumeListModel source, UICommand lastExecutedCommand, Model windowModel) { if (lastExecutedCommand == getModel().getNewVolumeCommand()) { return popupProvider.get(); } else if (lastExecutedCommand == getModel().getStatusRebalanceCommand() || lastExecutedCommand.getName().equals("onStopRebalance")) { return rebalanceStatusPopupProvider.get(); } else if(lastExecutedCommand == getModel().getShowVolumeProfileDetailsCommand() || lastExecutedCommand.getName().equals("showProfileDetails")) { return volumeProfileStatsPopupProvider.get(); } else { return super.getModelPopup(source, lastExecutedCommand, windowModel); } } @Override public AbstractModelBoundPopupPresenterWidget<? extends ConfirmationModel, ?> getConfirmModelPopup(VolumeListModel source, UICommand lastExecutedCommand) { if (lastExecutedCommand == getModel().getStopCommand() || lastExecutedCommand == getModel().getRemoveVolumeCommand()) { return removeConfirmPopupProvider.get(); } else { return super.getConfirmModelPopup(source, lastExecutedCommand); } } }; }