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

Commit

Permalink
Browse files Browse the repository at this point in the history
rhbz873509 - Selected message in editor should scroll fully into view
  • Loading branch information
Patrick Huang committed Nov 9, 2012
1 parent 9c96e58 commit 08e094a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 0 deletions.
Expand Up @@ -581,6 +581,11 @@ else if (!Objects.equal(contentsDisplay.getCachedTargets(), contentsDisplay.getN
}
}

public TargetContentsDisplay getCurrentDisplay()
{
return display;
}

/**
* For testing only
* @param currentTransUnitId current trans unit id
Expand Down
Expand Up @@ -152,6 +152,7 @@ public void onTransUnitSelected(TransUnitSelectionEvent event)
Log.debug("selected id: " + selectedId);
sourceContentsPresenter.setSelectedSource(selectedId);
targetContentsPresenter.setSelected(selectedId);
display.ensureVisible(targetContentsPresenter.getCurrentDisplay());
translatorService.transUnitSelected(selection);
}

Expand Down
Expand Up @@ -49,6 +49,8 @@ public interface TransUnitsTableDisplay extends WidgetDisplay

void delayRefresh();

void ensureVisible(TargetContentsDisplay currentDisplay);

interface Listener
{
void onRowSelected(int rowIndex);
Expand Down
Expand Up @@ -178,6 +178,12 @@ public void delayRefresh()
timer.schedule(100);
}

@Override
public void ensureVisible(TargetContentsDisplay currentDisplay)
{
root.ensureVisible(currentDisplay.asWidget());
}

@Override
public void setRowSelectionListener(Listener listener)
{
Expand Down
Expand Up @@ -112,6 +112,7 @@ public void onTransUnitSelected()
verify(sourceContentsPresenter).setSelectedSource(selection.getId());
verify(targetContentsPresenter).setSelected(selection.getId());
verify(translatorService).transUnitSelected(selection);
verify(display).ensureVisible(targetContentsPresenter.getCurrentDisplay());
}

@Test
Expand Down

0 comments on commit 08e094a

Please sign in to comment.