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:
Ron Anderson 2015-12-10 11:16:43 -06:00
parent 6041b694e1
commit fd19655b86
2 changed files with 40 additions and 36 deletions

View file

@ -70,7 +70,7 @@ import com.raytheon.viz.gfe.textformatter.TextFmtParserUtil;
/** /**
* Composite containing the product editor. * Composite containing the product editor.
* *
* <pre> * <pre>
* SOFTWARE HISTORY * SOFTWARE HISTORY
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
@ -91,13 +91,12 @@ import com.raytheon.viz.gfe.textformatter.TextFmtParserUtil;
* editing of framing codes. * editing of framing codes.
* 07/02/2015 13753 lshi Update times for products in Product Editor * 07/02/2015 13753 lshi Update times for products in Product Editor
* 08/06/2015 13753 lshi use isSystemTextChange instead of isUpdateTime * 08/06/2015 13753 lshi use isSystemTextChange instead of isUpdateTime
* 11/19/2015 5141 randerso Changed upper() to also replace commas with ellipses *
*
* </pre> * </pre>
* *
* @author lvenable * @author lvenable
* @version 1.0 * @version 1.0
* *
*/ */
public class StyledTextComp extends Composite { public class StyledTextComp extends Composite {
@ -202,7 +201,7 @@ public class StyledTextComp extends Composite {
/** /**
* Constructor. * Constructor.
* *
* @param parent * @param parent
* Parent composite. * Parent composite.
* @param wrapMode * @param wrapMode
@ -324,7 +323,7 @@ public class StyledTextComp extends Composite {
/** /**
* Get the StyledText editor. * Get the StyledText editor.
* *
* @return The StyledText editor. * @return The StyledText editor.
*/ */
public StyledText getTextEditorST() { public StyledText getTextEditorST() {
@ -333,7 +332,7 @@ public class StyledTextComp extends Composite {
/** /**
* Set the product text. * Set the product text.
* *
* @param text * @param text
* The product text. * The product text.
*/ */
@ -503,7 +502,7 @@ public class StyledTextComp extends Composite {
/** /**
* Parse the product text string. * Parse the product text string.
* *
* @param productText * @param productText
* Complete product text. * Complete product text.
* @throws JepException * @throws JepException
@ -599,7 +598,7 @@ public class StyledTextComp extends Composite {
/** /**
* Replacement of the text in the given range with new text. * Replacement of the text in the given range with new text.
* *
* @param tip * @param tip
* the range of text to be replaced * the range of text to be replaced
* @param text * @param text
@ -708,7 +707,7 @@ public class StyledTextComp extends Composite {
* A verify event occurs after the user has done something to modify the * 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 * 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. * field in the verify event indicates whether or not to modify the text.
* *
* @param event * @param event
* Verify event that was fired. * 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 * Check if there is selected text and if there is locked text in the
* selected text. * selected text.
* *
* @return True if there is selected text that contains locked text. * @return True if there is selected text that contains locked text.
*/ */
private boolean selectionHasLockedText() { private boolean selectionHasLockedText() {
@ -812,12 +811,12 @@ public class StyledTextComp extends Composite {
/** /**
* Check if there is locked text in the specified range of text. * Check if there is locked text in the specified range of text.
* *
* @param offset * @param offset
* The starting point of the locked text search. * The starting point of the locked text search.
* @param length * @param length
* The length of the search. * The length of the search.
* *
* @return Whether or not there is text in the range that contains locked * @return Whether or not there is text in the range that contains locked
* text. * text.
*/ */
@ -835,7 +834,7 @@ public class StyledTextComp extends Composite {
/** /**
* Check if the key being pressed is a "non-edit" key. * Check if the key being pressed is a "non-edit" key.
* *
* @param event * @param event
* Verify event. * Verify event.
* @return True if the key is an arrow or "non-edit" key. * @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. * Handle the mouse down event.
* *
* @param e * @param e
* Event fired. * Event fired.
*/ */
@ -984,7 +983,7 @@ public class StyledTextComp extends Composite {
/** /**
* Checks if the system is editing, e.g. updating the issue time every * Checks if the system is editing, e.g. updating the issue time every
* minute, vs a user typing text in the text area * minute, vs a user typing text in the text area
* *
* @return * @return
*/ */
private boolean isSystemTextChange() { private boolean isSystemTextChange() {
@ -1022,13 +1021,11 @@ public class StyledTextComp extends Composite {
protected void upper() { protected void upper() {
String text = textEditorST.getText(); String text = textEditorST.getText();
if (isUpperCase(text) && !text.contains(",")) { if (isUpperCase(text)) {
return; return;
} }
text = text.toUpperCase();
text = text.replaceAll(", {0,1}", "...");
int topIdx = textEditorST.getTopIndex(); int topIdx = textEditorST.getTopIndex();
setProductText(text); setProductText(textEditorST.getText().toUpperCase());
textEditorST.setTopIndex(topIdx); 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. * Getter for the column at which wrap and auto-wrap will wrap the text.
* *
* @return the column number * @return the column number
*/ */
public int getWrapColumn() { 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. * Getter for the column at which wrap and auto-wrap will wrap the text.
* *
* @param wrapColumn * @param wrapColumn
* the column number * 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 * 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. * value. Create an SWT Color for display from the value and return it.
* *
* @param prefs * @param prefs
* A preference store which might have config values. * A preference store which might have config values.
* @param display * @param display
@ -1213,7 +1210,7 @@ public class StyledTextComp extends Composite {
/** /**
* Send a PROBLEM message if color1 is exactly equal to color2. * Send a PROBLEM message if color1 is exactly equal to color2.
* *
* @param color1 * @param color1
* the first color * the first color
* @param color2 * @param color2
@ -1240,7 +1237,7 @@ public class StyledTextComp extends Composite {
* <p> * <p>
* The getter name is different to avoid confusion with the getFgColor() * The getter name is different to avoid confusion with the getFgColor()
* method of Control. * method of Control.
* *
* @return the foreground Color * @return the foreground Color
*/ */
public Color getFgndColor() { public Color getFgndColor() {
@ -1251,7 +1248,7 @@ public class StyledTextComp extends Composite {
* Get the framed text color of the StyledTextComp. This is the actual * 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 * color, not a copy. It will be disposed when the StyledTextComp is, and
* should not be disposed before then. * should not be disposed before then.
* *
* @return the frameColor * @return the frameColor
*/ */
public Color getFrameColor() { 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 * 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 * a copy. It will be disposed when the StyledTextComp is, and should not be
* disposed before then. * disposed before then.
* *
* @return the insertColor * @return the insertColor
*/ */
public Color getInsertColor() { public Color getInsertColor() {
@ -1273,7 +1270,7 @@ public class StyledTextComp extends Composite {
* Get the locked text color of the StyledTextComp. This is the actual * 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 * color, not a copy. It will be disposed when the StyledTextComp is, and
* should not be disposed before then. * should not be disposed before then.
* *
* @return the lockColor * @return the lockColor
*/ */
public Color getLockColor() { public Color getLockColor() {
@ -1283,7 +1280,7 @@ public class StyledTextComp extends Composite {
/** /**
* Word wrap the text in the block around cursorIndex. Adjust the cursor * Word wrap the text in the block around cursorIndex. Adjust the cursor
* position to account for inserted or deleted whitespace. * position to account for inserted or deleted whitespace.
* *
* @param st * @param st
* The StyledText in which word wrap is to be performed * The StyledText in which word wrap is to be performed
* @param cursorIndex * @param cursorIndex

View file

@ -356,6 +356,7 @@ import com.raytheon.viz.ui.simulatedtime.SimulatedTimeOperations;
* 07Oct2015 RM 18132 D. Friedman Exlucde certain phensigs from automatic ETN incrementing. * 07Oct2015 RM 18132 D. Friedman Exlucde certain phensigs from automatic ETN incrementing.
* 19Nov2015 5141 randerso Replace commas with ellipses if product not enabled for * 19Nov2015 5141 randerso Replace commas with ellipses if product not enabled for
* mixed case transmission * mixed case transmission
* 10Dec2015 5206 randerso Replace commas with ellipses only in WarnGen products
* *
* </pre> * </pre>
* *
@ -387,6 +388,10 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
private static List<String> gfePils = Arrays.asList("WSW", "NPW", "HLS", private static List<String> gfePils = Arrays.asList("WSW", "NPW", "HLS",
"CFW", "WCN", "FFA", "MWW", "RFW"); "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 * Default list of VTEC phenomena significance codes for which the ETN
* should not be changed when sending a NEW-action product. * should not be changed when sending a NEW-action product.
@ -4235,9 +4240,10 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
// section // section
setCurrentHeaderAndBody(); setCurrentHeaderAndBody();
// if product is not enabled for mixed case transmission, // if product a WarnGen product and is not enabled for mixed case
// replace all commas with ellipses // transmission, replace all commas with ellipses
if (!MixedCaseProductSupport.isMixedCase(product.getNnnid())) { if (warngenPils.contains(product.getNnnid())
&& !MixedCaseProductSupport.isMixedCase(product.getNnnid())) {
textEditor.setText(textEditor.getText() textEditor.setText(textEditor.getText()
.replaceAll(", {0,1}", "...")); .replaceAll(", {0,1}", "..."));
} }
@ -7112,9 +7118,10 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
textEditor.append(textProduct); textEditor.append(textProduct);
// if product is not enabled for mixed case transmission, // if product a WarnGen product and is not enabled for mixed case
// replace all commas with ellipses // transmission, replace all commas with ellipses
if (!MixedCaseProductSupport.isMixedCase(product.getNnnid())) { if (warngenPils.contains(product.getNnnid())
&& !MixedCaseProductSupport.isMixedCase(product.getNnnid())) {
textEditor.setText(textEditor.getText() textEditor.setText(textEditor.getText()
.replaceAll(", {0,1}", "...")); .replaceAll(", {0,1}", "..."));
} }