class GlossaryDetailsPresenter extends
        WidgetPresenter<GlossaryDetailsDisplay> implements
        GlossaryDetailsDisplay.Listener {

    public void show(final GlossaryResultItem item) {
        // request glossary details from the server
        dispatcher.execute(
                new GetGlossaryDetailsAction(item.getSourceIdList()),
                new AsyncCallback<GetGlossaryDetailsResult>() {
                    @Override
                    public void onFailure(Throwable caught) {
                        Log.error(caught.getMessage(), caught);
                    }

                    @Override
                    public void onSuccess(GetGlossaryDetailsResult result) {
                        glossaryDetails = result;
                        display.setSourceText(item.getSource());
                        display.getTargetText().setText(item.getTarget());
                        display.clearEntries();

                        int i = 1;
                        for (GlossaryDetails detailsItem : result
                                .getGlossaryDetails()) {
                            display.setSourceLabel(
                                            messages.glossarySourceTermLabel(detailsItem
                                                    .getSrcLocale().toString()));
                            display.setTargetLabel(
                                            messages.glossaryTargetTermLabel(detailsItem
                                                    .getTargetLocale()
                                                    .toString()));
                            display.addEntry(messages.entriesLabel(i));
                            i++;
                        }
                        selectEntry(0);
                        display.center();
                    }
                });
    }

    @Inject public  GlossaryDetailsPresenter(final GlossaryDetailsDisplay display,
            final EventBus eventBus, final UiMessages messages,
            final CachingDispatchAsync dispatcher);

}