Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
add tooltips for TM copy shortcut keys
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmason committed Jan 31, 2012
1 parent db7678f commit bbdbd61
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Expand Up @@ -45,4 +45,7 @@ public interface UiMessages extends Messages

@DefaultMessage("Glossary")
String glossaryHeader();

@DefaultMessage("Copy \"{0}\" to the editor")
String copyLinkTooltip(String targetMessage);
}
Expand Up @@ -22,7 +22,6 @@
import com.google.gwt.event.dom.client.FocusEvent;
import com.google.gwt.event.dom.client.KeyCodes;
import com.google.gwt.event.dom.client.KeyUpEvent;
import com.google.gwt.i18n.client.LocaleInfo;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
Expand Down Expand Up @@ -81,6 +80,8 @@ interface TransMemoryViewUiBinder extends UiBinder<Widget, TransMemoryView>

private List<TranslationMemoryGlossaryItem> cachedMem = new ArrayList<TranslationMemoryGlossaryItem>();

private UiMessages messages;

@Inject
public TransMemoryView(final UiMessages messages, Resources resources)
{
Expand All @@ -89,6 +90,7 @@ public TransMemoryView(final UiMessages messages, Resources resources)
phraseButton.setText(messages.phraseButtonLabel());
clearButton.setText(messages.clearButtonLabel());
searchButton.setText(messages.searchButtonLabel());
this.messages = messages;
}

@UiHandler("tmTextBox")
Expand Down Expand Up @@ -203,7 +205,12 @@ public void onClick(ClickEvent event)
}
});
resultTable.setWidget(row, ACTION_COL, copyLink);
copyLink.setTitle("Copy \"" + targetMessage + "\" to the editor.");
String shortcutKeys = "";
if (row <= 4)
{
shortcutKeys = " (Ctrl + Shift + " + row + ")";
}
copyLink.setTitle(messages.copyLinkTooltip(targetMessage) + shortcutKeys);
}
resultTable.setCellPadding(CELL_PADDING);
}
Expand Down

0 comments on commit bbdbd61

Please sign in to comment.