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

Commit

Permalink
rhbz844820 - fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Huang committed Aug 23, 2012
1 parent f950bbd commit e05158a
Show file tree
Hide file tree
Showing 6 changed files with 176 additions and 111 deletions.
Expand Up @@ -53,7 +53,7 @@ public interface TargetContentsDisplay extends WidgetDisplay, IsWidget, HasTrans

List<String> getCachedTargets();

ArrayList<String> getNewTargets();
List<String> getNewTargets();

boolean isEditing();

Expand Down
Expand Up @@ -543,7 +543,8 @@ public void onFocus(TransUnitId id, int editorIndex)
@Override
public void onCancel()
{
updateTargets(display.getId(), display.getCachedTargets());
display.updateCachedAndInEditorTargets(display.getCachedTargets());
display.setFindMessage(findMessage);
setFocus();
}

Expand All @@ -559,7 +560,7 @@ public void copySource(ToggleEditor editor)
eventBus.fireEvent(new NotificationEvent(Severity.Info, messages.notifyCopied()));
}

public ArrayList<String> getNewTargets()
public List<String> getNewTargets()
{
return display == null ? null : display.getNewTargets();
}
Expand Down
Expand Up @@ -197,7 +197,6 @@ public void onWorkspaceContextUpdated(WorkspaceContextUpdateEvent event)
{
userWorkspaceContext.setProjectActive(event.isProjectActive());
setReadOnly(userWorkspaceContext.hasReadOnlyAccess());
eventBus.fireEvent(UserConfigChangeEvent.EVENT);
}
}));

Expand All @@ -215,6 +214,7 @@ void setReadOnly(boolean readOnly)
{
boolean displayButtons = readOnly ? false : display.getEditorButtonsChk().getValue();
configHolder.setDisplayButtons(displayButtons);
eventBus.fireEvent(UserConfigChangeEvent.EVENT);
display.setEditorOptionsVisible(!readOnly);
display.setValidationOptionsVisible(!readOnly);
}
Expand Down
Expand Up @@ -4,6 +4,7 @@
import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import java.util.Set;

import net.customware.gwt.presenter.client.EventBus;
Expand Down Expand Up @@ -87,7 +88,7 @@ public void onSuccess(GetTranslationHistoryResult result)
{
//add indicator for latest version
latest.setVersionNum(messages.latestVersion(latest.getVersionNum()));
ArrayList<String> newTargets = targetContentsPresenter.getNewTargets();
List<String> newTargets = targetContentsPresenter.getNewTargets();
if (!Objects.equal(latest.getContents(), newTargets))
{
listDataProvider.getList().add(new TransHistoryItem(messages.unsaved(), newTargets, ContentState.New, "", ""));
Expand Down

0 comments on commit e05158a

Please sign in to comment.