Merge remote-tracking branch 'asm/asm_16.1.1' into master_16.1.1
Conflicts: cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/StyledTextComp.java Former-commit-id: 713eca23ad654688d6e2d83f2311fda973ca0d4c
This commit is contained in:
commit
0aa4bff53c
2 changed files with 51 additions and 40 deletions
|
@ -167,14 +167,16 @@ import com.raytheon.viz.ui.simulatedtime.SimulatedTimeOperations;
|
|||
* 01/28/2015 #4018 randerso Code cleanup.
|
||||
* 02/04/2014 17039 ryu Removed menu item related to the HighlighFramingCodes feature.
|
||||
* 04/20/2015 4027 randerso Renamed ProductStateEnum with an initial capital
|
||||
* Expunged Calendar from ActiveTableReco
|
||||
* Expunged Calendar from ActiveTableRecord
|
||||
* 07/02/2015 13753 lshi Update times for products in Product Editor
|
||||
* 07/22/2015 13753 lshi Keeps issue time unchanged
|
||||
* 08/06/2015 13753 lshi removed updateTime flag, undo the change of updateIssueExpireTimes, etc.
|
||||
* 08/10/2015 4721 randerso Changed getNNNid() to use the productID field (not textdbPil)
|
||||
* 09/15/2015 4858 dgilling Disable store/transmit in DRT mode.
|
||||
* 10/26/2015 18244 lshi fixed NullPointerException (pds, updateIssueExpireTimes)
|
||||
* 12/04/2015 13753 lshi Revert 13753
|
||||
* 12/14/2015 18367 ryu Disable finalization of ETN when product is stored to text database.
|
||||
* 12/16/2015 18410 lshi For corrected products, both WMO time and MND time should
|
||||
* match the current time
|
||||
* </pre>
|
||||
*
|
||||
* @author lvenable
|
||||
|
@ -1148,7 +1150,8 @@ public class ProductEditorComp extends Composite implements
|
|||
// prevent the launching of another dialog until the modal dialog is
|
||||
// closed.
|
||||
StoreTransmitDlg storeDlg = new StoreTransmitDlg(parent.getShell(),
|
||||
showStore, this, transmissionCB, pid, !textComp.isCorMode());
|
||||
showStore, this, transmissionCB, pid,
|
||||
!textComp.isCorMode() && (action == Action.TRANSMIT));
|
||||
storeDlg.open();
|
||||
}
|
||||
}
|
||||
|
@ -1206,9 +1209,7 @@ public class ProductEditorComp extends Composite implements
|
|||
Date tt = GMT.getTime();
|
||||
|
||||
tweakVTEC(tt);
|
||||
|
||||
updateIssueExpireTimes(tt);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1714,6 +1715,7 @@ public class ProductEditorComp extends Composite implements
|
|||
textComp.startUpdate();
|
||||
textComp.patchMND(txt, true);
|
||||
textComp.updatePType(val);
|
||||
|
||||
textComp.endUpdate();
|
||||
}
|
||||
|
||||
|
@ -1956,7 +1958,7 @@ public class ProductEditorComp extends Composite implements
|
|||
this.expireDate = cal.getTime();
|
||||
dateTimeLbl.setText(expireLabelFmt.format(expireDate));
|
||||
|
||||
if (!dead && !editorCorrectionMode) { // && !spellDialog) {
|
||||
if (!dead) {
|
||||
changeTimes();
|
||||
}
|
||||
}
|
||||
|
@ -1973,28 +1975,29 @@ public class ProductEditorComp extends Composite implements
|
|||
// I know this time string has been replaced. If the lengths of the
|
||||
// before and after strings are different, a reParse() will be made,
|
||||
// else it will continue on.
|
||||
|
||||
if (textComp != null) {
|
||||
try {
|
||||
textComp.startUpdate();
|
||||
ProductDataStruct pds = textComp.getProductDataStruct();
|
||||
|
||||
if (pds != null) {
|
||||
// update WMO time
|
||||
//if (!textComp.isCorMode()) { ## uncomment this if want to keep WMO time original
|
||||
TextIndexPoints pit = pds.getPIT();
|
||||
if (pit != null) {
|
||||
String time = purgeTimeFmt.format(now);
|
||||
textComp.replaceText(pit, time);
|
||||
}
|
||||
// }
|
||||
|
||||
// Update MND time
|
||||
TextIndexPoints tip = pds.getMndMap().get("nwstime");
|
||||
if (tip != null) {
|
||||
SimpleDateFormat fmt = new SimpleDateFormat(
|
||||
longLocalFmtStr);
|
||||
fmt.setTimeZone(localTimeZone);
|
||||
String issueTime = fmt.format(now).toUpperCase();
|
||||
|
||||
if (tip != null) {
|
||||
textComp.replaceText(tip, issueTime);
|
||||
}
|
||||
textComp.replaceText(tip, issueTime);
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
|
@ -2007,6 +2010,8 @@ public class ProductEditorComp extends Composite implements
|
|||
// StyledTextComp to re-evaluate whether a reParse() is needed and
|
||||
// ask it for the segment information each time through the loop (in
|
||||
// case we're at one of the 4 transition points).
|
||||
|
||||
// Update segments' time
|
||||
try {
|
||||
ProductDataStruct pds = textComp.getProductDataStruct();
|
||||
|
||||
|
@ -2176,6 +2181,8 @@ public class ProductEditorComp extends Composite implements
|
|||
*/
|
||||
private void loadPrevious() {
|
||||
String initialValue;
|
||||
textComp.setCorMode(true);
|
||||
|
||||
if (!testVTEC) {
|
||||
initialValue = "cccnnnxxx";
|
||||
} else {
|
||||
|
@ -2220,9 +2227,10 @@ public class ProductEditorComp extends Composite implements
|
|||
}
|
||||
parseIDs();
|
||||
revive();
|
||||
|
||||
// Enter res mode
|
||||
setPTypeCategory(PTypeCategory.PE);
|
||||
textComp.setCorMode(true);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -3068,4 +3076,5 @@ public class ProductEditorComp extends Composite implements
|
|||
callToActionsMI.setMenu(callToActionsSubMenu);
|
||||
createCallToActionsMenu(callToActionsSubMenu);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@ import com.raytheon.viz.gfe.textformatter.TextFmtParserUtil;
|
|||
|
||||
/**
|
||||
* Composite containing the product editor.
|
||||
*
|
||||
*
|
||||
* <pre>
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
|
@ -94,12 +94,15 @@ import com.raytheon.viz.gfe.textformatter.TextFmtParserUtil;
|
|||
* 12/04/2015 13753 lshi revert 13753
|
||||
*
|
||||
*
|
||||
* 11/19/2015 5141 randerso Changed upper() to also replace commas with ellipses
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* @author lvenable
|
||||
* @version 1.0
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
public class StyledTextComp extends Composite {
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(StyledTextComp.class);
|
||||
|
@ -202,7 +205,7 @@ public class StyledTextComp extends Composite {
|
|||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
*
|
||||
* @param parent
|
||||
* Parent composite.
|
||||
* @param wrapMode
|
||||
|
@ -306,7 +309,7 @@ public class StyledTextComp extends Composite {
|
|||
updateTextStyle(event);
|
||||
checkAutoWrap(event);
|
||||
|
||||
if (corMode && !updatingForCor) {
|
||||
if (corMode && !updatingForCor && !isSystemTextChange()) {
|
||||
updatingForCor = true;
|
||||
try {
|
||||
makeCorrections();
|
||||
|
@ -324,7 +327,7 @@ public class StyledTextComp extends Composite {
|
|||
|
||||
/**
|
||||
* Get the StyledText editor.
|
||||
*
|
||||
*
|
||||
* @return The StyledText editor.
|
||||
*/
|
||||
public StyledText getTextEditorST() {
|
||||
|
@ -333,17 +336,15 @@ public class StyledTextComp extends Composite {
|
|||
|
||||
/**
|
||||
* Set the product text.
|
||||
*
|
||||
*
|
||||
* @param text
|
||||
* The product text.
|
||||
*/
|
||||
public void setProductText(String text) {
|
||||
newProduct = true;
|
||||
textEditorST.setText(EMPTY);
|
||||
textEditorST.setStyleRange(null);
|
||||
|
||||
try {
|
||||
parseProductText(text);
|
||||
textEditorST.setStyleRange(null);
|
||||
textEditorST.setText(text);
|
||||
lockText();
|
||||
findFramingCodes();
|
||||
|
@ -351,6 +352,7 @@ public class StyledTextComp extends Composite {
|
|||
newProduct = false;
|
||||
} catch (JepException e) {
|
||||
statusHandler.error(PRODUCT_PARSE_ERROR, e);
|
||||
textEditorST.setText(EMPTY);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -504,7 +506,7 @@ public class StyledTextComp extends Composite {
|
|||
|
||||
/**
|
||||
* Parse the product text string.
|
||||
*
|
||||
*
|
||||
* @param productText
|
||||
* Complete product text.
|
||||
* @throws JepException
|
||||
|
@ -600,7 +602,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
|
||||
|
@ -709,7 +711,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.
|
||||
*/
|
||||
|
@ -799,7 +801,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() {
|
||||
|
@ -813,12 +815,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.
|
||||
*/
|
||||
|
@ -836,7 +838,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.
|
||||
|
@ -870,7 +872,7 @@ public class StyledTextComp extends Composite {
|
|||
|
||||
/**
|
||||
* Handle the mouse down event.
|
||||
*
|
||||
*
|
||||
* @param e
|
||||
* Event fired.
|
||||
*/
|
||||
|
@ -985,7 +987,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() {
|
||||
|
@ -1141,7 +1143,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() {
|
||||
|
@ -1150,7 +1152,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
|
||||
*/
|
||||
|
@ -1189,7 +1191,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
|
||||
|
@ -1212,7 +1214,7 @@ public class StyledTextComp extends Composite {
|
|||
|
||||
/**
|
||||
* Send a PROBLEM message if color1 is exactly equal to color2.
|
||||
*
|
||||
*
|
||||
* @param color1
|
||||
* the first color
|
||||
* @param color2
|
||||
|
@ -1239,7 +1241,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() {
|
||||
|
@ -1250,7 +1252,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() {
|
||||
|
@ -1261,7 +1263,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() {
|
||||
|
@ -1272,7 +1274,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() {
|
||||
|
@ -1282,7 +1284,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
|
||||
|
|
Loading…
Add table
Reference in a new issue