Omaha #5206 Remove substitution of commas with ellipses in GFE and limit to WarnGen products in TextWS
Change-Id: Ie110bdb8cf1a51882d4431a727956671910590d9 Former-commit-id: 4eb9482b75a54e11ab86ad0a16cf533fdc332424
This commit is contained in:
parent
6041b694e1
commit
fd19655b86
2 changed files with 40 additions and 36 deletions
|
@ -70,7 +70,7 @@ import com.raytheon.viz.gfe.textformatter.TextFmtParserUtil;
|
|||
|
||||
/**
|
||||
* Composite containing the product editor.
|
||||
*
|
||||
*
|
||||
* <pre>
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
|
@ -91,13 +91,12 @@ import com.raytheon.viz.gfe.textformatter.TextFmtParserUtil;
|
|||
* editing of framing codes.
|
||||
* 07/02/2015 13753 lshi Update times for products in Product Editor
|
||||
* 08/06/2015 13753 lshi use isSystemTextChange instead of isUpdateTime
|
||||
* 11/19/2015 5141 randerso Changed upper() to also replace commas with ellipses
|
||||
*
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* @author lvenable
|
||||
* @version 1.0
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
public class StyledTextComp extends Composite {
|
||||
|
@ -202,7 +201,7 @@ public class StyledTextComp extends Composite {
|
|||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
*
|
||||
* @param parent
|
||||
* Parent composite.
|
||||
* @param wrapMode
|
||||
|
@ -324,7 +323,7 @@ public class StyledTextComp extends Composite {
|
|||
|
||||
/**
|
||||
* Get the StyledText editor.
|
||||
*
|
||||
*
|
||||
* @return The StyledText editor.
|
||||
*/
|
||||
public StyledText getTextEditorST() {
|
||||
|
@ -333,7 +332,7 @@ public class StyledTextComp extends Composite {
|
|||
|
||||
/**
|
||||
* Set the product text.
|
||||
*
|
||||
*
|
||||
* @param text
|
||||
* The product text.
|
||||
*/
|
||||
|
@ -503,7 +502,7 @@ public class StyledTextComp extends Composite {
|
|||
|
||||
/**
|
||||
* Parse the product text string.
|
||||
*
|
||||
*
|
||||
* @param productText
|
||||
* Complete product text.
|
||||
* @throws JepException
|
||||
|
@ -599,7 +598,7 @@ public class StyledTextComp extends Composite {
|
|||
|
||||
/**
|
||||
* Replacement of the text in the given range with new text.
|
||||
*
|
||||
*
|
||||
* @param tip
|
||||
* the range of text to be replaced
|
||||
* @param text
|
||||
|
@ -708,7 +707,7 @@ public class StyledTextComp extends Composite {
|
|||
* A verify event occurs after the user has done something to modify the
|
||||
* text (typically typed a key), but before the text is modified. The doit
|
||||
* field in the verify event indicates whether or not to modify the text.
|
||||
*
|
||||
*
|
||||
* @param event
|
||||
* Verify event that was fired.
|
||||
*/
|
||||
|
@ -798,7 +797,7 @@ public class StyledTextComp extends Composite {
|
|||
/**
|
||||
* Check if there is selected text and if there is locked text in the
|
||||
* selected text.
|
||||
*
|
||||
*
|
||||
* @return True if there is selected text that contains locked text.
|
||||
*/
|
||||
private boolean selectionHasLockedText() {
|
||||
|
@ -812,12 +811,12 @@ public class StyledTextComp extends Composite {
|
|||
|
||||
/**
|
||||
* Check if there is locked text in the specified range of text.
|
||||
*
|
||||
*
|
||||
* @param offset
|
||||
* The starting point of the locked text search.
|
||||
* @param length
|
||||
* The length of the search.
|
||||
*
|
||||
*
|
||||
* @return Whether or not there is text in the range that contains locked
|
||||
* text.
|
||||
*/
|
||||
|
@ -835,7 +834,7 @@ public class StyledTextComp extends Composite {
|
|||
|
||||
/**
|
||||
* Check if the key being pressed is a "non-edit" key.
|
||||
*
|
||||
*
|
||||
* @param event
|
||||
* Verify event.
|
||||
* @return True if the key is an arrow or "non-edit" key.
|
||||
|
@ -869,7 +868,7 @@ public class StyledTextComp extends Composite {
|
|||
|
||||
/**
|
||||
* Handle the mouse down event.
|
||||
*
|
||||
*
|
||||
* @param e
|
||||
* Event fired.
|
||||
*/
|
||||
|
@ -984,7 +983,7 @@ public class StyledTextComp extends Composite {
|
|||
/**
|
||||
* Checks if the system is editing, e.g. updating the issue time every
|
||||
* minute, vs a user typing text in the text area
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private boolean isSystemTextChange() {
|
||||
|
@ -1022,13 +1021,11 @@ public class StyledTextComp extends Composite {
|
|||
|
||||
protected void upper() {
|
||||
String text = textEditorST.getText();
|
||||
if (isUpperCase(text) && !text.contains(",")) {
|
||||
if (isUpperCase(text)) {
|
||||
return;
|
||||
}
|
||||
text = text.toUpperCase();
|
||||
text = text.replaceAll(", {0,1}", "...");
|
||||
int topIdx = textEditorST.getTopIndex();
|
||||
setProductText(text);
|
||||
setProductText(textEditorST.getText().toUpperCase());
|
||||
textEditorST.setTopIndex(topIdx);
|
||||
}
|
||||
|
||||
|
@ -1142,7 +1139,7 @@ public class StyledTextComp extends Composite {
|
|||
|
||||
/**
|
||||
* Getter for the column at which wrap and auto-wrap will wrap the text.
|
||||
*
|
||||
*
|
||||
* @return the column number
|
||||
*/
|
||||
public int getWrapColumn() {
|
||||
|
@ -1151,7 +1148,7 @@ public class StyledTextComp extends Composite {
|
|||
|
||||
/**
|
||||
* Getter for the column at which wrap and auto-wrap will wrap the text.
|
||||
*
|
||||
*
|
||||
* @param wrapColumn
|
||||
* the column number
|
||||
*/
|
||||
|
@ -1190,7 +1187,7 @@ public class StyledTextComp extends Composite {
|
|||
/**
|
||||
* Query the prefs for setting. If it does not exist, use colorDft as its
|
||||
* value. Create an SWT Color for display from the value and return it.
|
||||
*
|
||||
*
|
||||
* @param prefs
|
||||
* A preference store which might have config values.
|
||||
* @param display
|
||||
|
@ -1213,7 +1210,7 @@ public class StyledTextComp extends Composite {
|
|||
|
||||
/**
|
||||
* Send a PROBLEM message if color1 is exactly equal to color2.
|
||||
*
|
||||
*
|
||||
* @param color1
|
||||
* the first color
|
||||
* @param color2
|
||||
|
@ -1240,7 +1237,7 @@ public class StyledTextComp extends Composite {
|
|||
* <p>
|
||||
* The getter name is different to avoid confusion with the getFgColor()
|
||||
* method of Control.
|
||||
*
|
||||
*
|
||||
* @return the foreground Color
|
||||
*/
|
||||
public Color getFgndColor() {
|
||||
|
@ -1251,7 +1248,7 @@ public class StyledTextComp extends Composite {
|
|||
* Get the framed text color of the StyledTextComp. This is the actual
|
||||
* color, not a copy. It will be disposed when the StyledTextComp is, and
|
||||
* should not be disposed before then.
|
||||
*
|
||||
*
|
||||
* @return the frameColor
|
||||
*/
|
||||
public Color getFrameColor() {
|
||||
|
@ -1262,7 +1259,7 @@ public class StyledTextComp extends Composite {
|
|||
* Get the insert color of the StyledTextComp. This is the actual color, not
|
||||
* a copy. It will be disposed when the StyledTextComp is, and should not be
|
||||
* disposed before then.
|
||||
*
|
||||
*
|
||||
* @return the insertColor
|
||||
*/
|
||||
public Color getInsertColor() {
|
||||
|
@ -1273,7 +1270,7 @@ public class StyledTextComp extends Composite {
|
|||
* Get the locked text color of the StyledTextComp. This is the actual
|
||||
* color, not a copy. It will be disposed when the StyledTextComp is, and
|
||||
* should not be disposed before then.
|
||||
*
|
||||
*
|
||||
* @return the lockColor
|
||||
*/
|
||||
public Color getLockColor() {
|
||||
|
@ -1283,7 +1280,7 @@ public class StyledTextComp extends Composite {
|
|||
/**
|
||||
* Word wrap the text in the block around cursorIndex. Adjust the cursor
|
||||
* position to account for inserted or deleted whitespace.
|
||||
*
|
||||
*
|
||||
* @param st
|
||||
* The StyledText in which word wrap is to be performed
|
||||
* @param cursorIndex
|
||||
|
|
|
@ -356,6 +356,7 @@ import com.raytheon.viz.ui.simulatedtime.SimulatedTimeOperations;
|
|||
* 07Oct2015 RM 18132 D. Friedman Exlucde certain phensigs from automatic ETN incrementing.
|
||||
* 19Nov2015 5141 randerso Replace commas with ellipses if product not enabled for
|
||||
* mixed case transmission
|
||||
* 10Dec2015 5206 randerso Replace commas with ellipses only in WarnGen products
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -387,6 +388,10 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
|||
private static List<String> gfePils = Arrays.asList("WSW", "NPW", "HLS",
|
||||
"CFW", "WCN", "FFA", "MWW", "RFW");
|
||||
|
||||
private static final List<String> warngenPils = Arrays.asList("AWW", "EWW",
|
||||
"FFS", "FFW", "FLS", "FLW", "FRW", "MWS", "NOW", "SMW", "SPS",
|
||||
"SVR", "SVS", "TOR");
|
||||
|
||||
/**
|
||||
* Default list of VTEC phenomena significance codes for which the ETN
|
||||
* should not be changed when sending a NEW-action product.
|
||||
|
@ -4235,9 +4240,10 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
|||
// section
|
||||
setCurrentHeaderAndBody();
|
||||
|
||||
// if product is not enabled for mixed case transmission,
|
||||
// replace all commas with ellipses
|
||||
if (!MixedCaseProductSupport.isMixedCase(product.getNnnid())) {
|
||||
// if product a WarnGen product and is not enabled for mixed case
|
||||
// transmission, replace all commas with ellipses
|
||||
if (warngenPils.contains(product.getNnnid())
|
||||
&& !MixedCaseProductSupport.isMixedCase(product.getNnnid())) {
|
||||
textEditor.setText(textEditor.getText()
|
||||
.replaceAll(", {0,1}", "..."));
|
||||
}
|
||||
|
@ -7112,9 +7118,10 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
|||
|
||||
textEditor.append(textProduct);
|
||||
|
||||
// if product is not enabled for mixed case transmission,
|
||||
// replace all commas with ellipses
|
||||
if (!MixedCaseProductSupport.isMixedCase(product.getNnnid())) {
|
||||
// if product a WarnGen product and is not enabled for mixed case
|
||||
// transmission, replace all commas with ellipses
|
||||
if (warngenPils.contains(product.getNnnid())
|
||||
&& !MixedCaseProductSupport.isMixedCase(product.getNnnid())) {
|
||||
textEditor.setText(textEditor.getText()
|
||||
.replaceAll(", {0,1}", "..."));
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue