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

Commit

Permalink
plural support - navigation and shortcut key
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Huang committed Mar 27, 2012
1 parent e2c7ab2 commit 0274041
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
Expand Up @@ -524,13 +524,12 @@ public void onNavTransUnit(NavTransUnitEvent event)
// If goto Next or Prev Fuzzy/New Trans Unit
if (event.getRowType() == NavigationType.PrevEntry)
{
// editor.saveAndMoveRow(NavigationType.PrevEntry);
targetContentsPresenter.saveAsApprovedAndMoveNext();
targetContentsPresenter.saveAsApprovedAndMovePrevious();
}

if (event.getRowType() == NavigationType.NextEntry)
{
targetContentsPresenter.saveAsApprovedAndMovePrevious();
targetContentsPresenter.saveAsApprovedAndMoveNext();
}

if (event.getRowType() == NavigationType.PrevState)
Expand Down
Expand Up @@ -58,16 +58,17 @@
public class TargetContentsPresenter implements TargetContentsDisplay.Listener, UserConfigChangeHandler, UpdateValidationWarningsEventHandler, RequestValidationEventHandler, InsertStringInEditorHandler, CopyDataToEditorHandler
{
private static final int NO_OPEN_EDITOR = -1;
private static final int LAST_INDEX = -2;
private final EventBus eventBus;
private final TableEditorMessages messages;
private final SourceContentsPresenter sourceContentsPresenter;
private final UserConfigHolder configHolder;
private final CheckKey checkKey;

private final CheckKey checkKey;
private NavigationMessages navMessages;
private WorkspaceContext workspaceContext;
private final ValidationMessagePanel validationMessagePanel;

private final ValidationMessagePanel validationMessagePanel;
private TargetContentsDisplay currentDisplay;
private Provider<TargetContentsDisplay> displayProvider;
private ArrayList<TargetContentsDisplay> displayList;
Expand Down Expand Up @@ -129,12 +130,11 @@ public void showEditors(int rowIndex)
previousDisplay.setToView();
}
currentDisplay = displayList.get(rowIndex);
if (previousDisplay != currentDisplay)
currentEditors = currentDisplay.getEditors();
if (currentEditorIndex == LAST_INDEX)
{
// currentEditor = null;
currentEditorIndex = NO_OPEN_EDITOR;
currentEditorIndex = currentEditors.size() - 1;
}
currentEditors = currentDisplay.getEditors();

if (currentEditorIndex != NO_OPEN_EDITOR)
{
Expand Down Expand Up @@ -193,6 +193,7 @@ public void saveAsApprovedAndMoveNext()
}
else
{
currentEditorIndex = 0;
cellEditor.saveAndMoveRow(NavTransUnitEvent.NavigationType.NextEntry);
}
}
Expand All @@ -207,6 +208,7 @@ public void saveAsApprovedAndMovePrevious()
}
else
{
currentEditorIndex = LAST_INDEX;
cellEditor.saveAndMoveRow(NavTransUnitEvent.NavigationType.PrevEntry);
}
}
Expand Down Expand Up @@ -251,7 +253,7 @@ public void copySource(ToggleEditor editor)
public void toggleView(ToggleEditor editor)
{
currentEditorIndex = editor.getIndex();
if (currentEditors.contains(editor))
if (currentEditors != null && currentEditors.contains(editor))
{
// still in the same trans unit. won't trigger transunit selection
// or edit cell event
Expand Down Expand Up @@ -354,11 +356,11 @@ else if (checkKey.isPreviousEntryKey())
}
else if (checkKey.isNextStateEntryKey())
{
// saveAndMoveNextState(NavigationType.NextEntry);
saveAsApprovedAndMoveNext();
}
else if (checkKey.isPreviousStateEntryKey())
{
// saveAndMoveNextState(NavigationType.PrevEntry);
saveAsApprovedAndMovePrevious();
}
else if (checkKey.isSaveAsFuzzyKey())
{
Expand Down

0 comments on commit 0274041

Please sign in to comment.