This repository has been archived by the owner on Nov 9, 2017. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
rhbz723084 - can load from bookmark
- Loading branch information
Patrick Huang
committed
Mar 14, 2013
1 parent
97b3e28
commit aba0adf
Showing
11 changed files
with
364 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
zanata-war/src/main/java/org/zanata/webtrans/client/events/InitEditorEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| package org.zanata.webtrans.client.events; | ||
|
|
||
| import com.google.gwt.event.shared.GwtEvent; | ||
|
|
||
| public class InitEditorEvent extends GwtEvent<InitEditorEventHandler> | ||
| { | ||
| public static Type<InitEditorEventHandler> TYPE = new Type<InitEditorEventHandler>(); | ||
|
|
||
| public Type<InitEditorEventHandler> getAssociatedType() | ||
| { | ||
| return TYPE; | ||
| } | ||
|
|
||
| protected void dispatch(InitEditorEventHandler handler) | ||
| { | ||
| handler.onInitEditor(this); | ||
| } | ||
| } |
8 changes: 8 additions & 0 deletions
8
zanata-war/src/main/java/org/zanata/webtrans/client/events/InitEditorEventHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| package org.zanata.webtrans.client.events; | ||
|
|
||
| import com.google.gwt.event.shared.EventHandler; | ||
|
|
||
| public interface InitEditorEventHandler extends EventHandler | ||
| { | ||
| void onInitEditor(InitEditorEvent event); | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
...war/src/main/java/org/zanata/webtrans/client/service/GetTransUnitActionContextHolder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| package org.zanata.webtrans.client.service; | ||
|
|
||
| import org.zanata.webtrans.client.presenter.UserConfigHolder; | ||
| import org.zanata.webtrans.shared.model.DocumentId; | ||
| import org.zanata.webtrans.shared.model.TransUnitId; | ||
| import com.google.inject.Inject; | ||
| import com.google.inject.Singleton; | ||
|
|
||
| /** | ||
| * @author Patrick Huang <a href="mailto:pahuang@redhat.com">pahuang@redhat.com</a> | ||
| */ | ||
| @Singleton | ||
| public class GetTransUnitActionContextHolder | ||
| { | ||
| private GetTransUnitActionContext context; | ||
| private UserConfigHolder configHolder; | ||
|
|
||
| @Inject | ||
| public GetTransUnitActionContextHolder(UserConfigHolder configHolder) | ||
| { | ||
| this.configHolder = configHolder; | ||
| } | ||
|
|
||
| protected boolean isContextInitialized() | ||
| { | ||
| return context != null; | ||
| } | ||
|
|
||
| protected GetTransUnitActionContext initContext(DocumentId documentId, String findMessage, TransUnitId targetTransUnitId) | ||
| { | ||
| // @formatter:off | ||
| context = new GetTransUnitActionContext(documentId) | ||
| .changeCount(configHolder.getState().getEditorPageSize()) | ||
| .changeFindMessage(findMessage) | ||
| .changeFilterNeedReview(configHolder.getState().isFilterByNeedReview()) | ||
| .changeFilterTranslated(configHolder.getState().isFilterByTranslated()) | ||
| .changeFilterUntranslated(configHolder.getState().isFilterByUntranslated()) | ||
| .changeTargetTransUnitId(targetTransUnitId); | ||
| // @formatter:on | ||
|
|
||
| return context; | ||
| } | ||
|
|
||
| public GetTransUnitActionContext getContext() | ||
| { | ||
| return context; | ||
| } | ||
|
|
||
| public GetTransUnitActionContext changeOffset(int targetOffset) | ||
| { | ||
| context = context.changeOffset(targetOffset); | ||
| return context; | ||
| } | ||
|
|
||
| public GetTransUnitActionContext changeTargetTransUnitId(TransUnitId transUnitId) | ||
| { | ||
| context.changeTargetTransUnitId(transUnitId); | ||
| return context; | ||
| } | ||
|
|
||
| public GetTransUnitActionContext updateContext(GetTransUnitActionContext newContext) | ||
| { | ||
| context = newContext; | ||
| return context; | ||
| } | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.