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.
Implement append glossary text into editor in cursor position
- Loading branch information
1 parent
7d587e7
commit 8d754b2
Showing
7 changed files
with
117 additions
and
4 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
56 changes: 56 additions & 0 deletions
56
...zanata-war/src/main/java/org/zanata/webtrans/client/events/InsertStringInEditorEvent.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,56 @@ | ||
package org.zanata.webtrans.client.events; | ||
|
||
import com.google.gwt.event.shared.GwtEvent; | ||
|
||
public class InsertStringInEditorEvent extends GwtEvent<InsertStringInEditorHandler> | ||
{ | ||
|
||
/** | ||
* Handler type. | ||
*/ | ||
private static Type<InsertStringInEditorHandler> TYPE; | ||
|
||
/** | ||
* Gets the type associated with this event. | ||
* | ||
* @return returns the handler type | ||
*/ | ||
public static Type<InsertStringInEditorHandler> getType() | ||
{ | ||
return TYPE != null ? TYPE : (TYPE = new Type<InsertStringInEditorHandler>()); | ||
} | ||
|
||
private String valueToReplace, suggestion; | ||
|
||
/** | ||
* @param sourceResult | ||
* @param targetResult | ||
*/ | ||
public InsertStringInEditorEvent(String valueToReplace, String suggestion) | ||
{ | ||
this.valueToReplace = valueToReplace; | ||
this.suggestion = suggestion; | ||
} | ||
|
||
@Override | ||
protected void dispatch(InsertStringInEditorHandler handler) | ||
{ | ||
handler.onInsertString(this); | ||
} | ||
|
||
@Override | ||
public GwtEvent.Type<InsertStringInEditorHandler> getAssociatedType() | ||
{ | ||
return getType(); | ||
} | ||
|
||
public String getValueToReplace() | ||
{ | ||
return valueToReplace; | ||
} | ||
|
||
public String getSuggestion() | ||
{ | ||
return suggestion; | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
...nata-war/src/main/java/org/zanata/webtrans/client/events/InsertStringInEditorHandler.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 InsertStringInEditorHandler extends EventHandler | ||
{ | ||
void onInsertString(InsertStringInEditorEvent 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
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