From ff0177a6dd3ed8ba74bc49c64284d45e12da8c58 Mon Sep 17 00:00:00 2001 From: "Rici.Yu" Date: Wed, 4 Feb 2015 10:23:30 -0500 Subject: [PATCH] ASM #17039 - Remove HighlightFramingCodes feature Change-Id: I7ee07ef64b1a16cdeb0b6af48ccaf3c228357891 Former-commit-id: 5470139b42f44e733b5c2d6688b715b7dd19b109 [formerly 5470139b42f44e733b5c2d6688b715b7dd19b109 [formerly cb047745b4a5c523bd1ca26692c758d3e72d8ddc]] Former-commit-id: 1188dab0f4c432356a5fdbb4d9aabc81f43fcba2 Former-commit-id: f41d5cffef48d44b26d02097903958dc729b0d48 --- .../gfe/userPython/gfeConfig/gfeConfig.py | 5 +- .../formatterlauncher/ProductEditorComp.java | 17 +---- .../formatterlauncher/StyledTextComp.java | 75 +------------------ 3 files changed, 4 insertions(+), 93 deletions(-) diff --git a/cave/com.raytheon.viz.gfe/localization/gfe/userPython/gfeConfig/gfeConfig.py b/cave/com.raytheon.viz.gfe/localization/gfe/userPython/gfeConfig/gfeConfig.py index 0f3881b6c6..f5fb9e10f4 100644 --- a/cave/com.raytheon.viz.gfe/localization/gfe/userPython/gfeConfig/gfeConfig.py +++ b/cave/com.raytheon.viz.gfe/localization/gfe/userPython/gfeConfig/gfeConfig.py @@ -32,6 +32,7 @@ # 11/20/2013 2488 randerso Changed to use DejaVu fonts # 05/28/2014 2841 randerso Added separate configurable limits for # text formatter and product script tasks +# 02/04/2015 17039 ryu Removed HighlightFramingCodes setting. GFESUITE_HOME = "/awips2/GFESuite" GFESUITE_PRDDIR = "/tmp/products" @@ -759,10 +760,6 @@ QPF_SetValue_zoom = 10 # Edited Data" on the dialog. The default if not specified is "By Gaps". #InterpolateDialogMode = "Gaps" -# In Formatter Launcher, whether to highlight framing codes and the -# text enclosed by them in the text editor component. -HighlightFramingCodes = no - #------------------------------------------------------------------------ # Weather Element Configuration diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/ProductEditorComp.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/ProductEditorComp.java index 848d82180b..1c6d6c6903 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/ProductEditorComp.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/ProductEditorComp.java @@ -163,6 +163,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback; * 12/01/2014 #624 zhao Modified saveFile() * 12/16/2014 #14946 ryu Modified updateIssueExpireTimes() so issuance time is displayed * for the local time zones for each segment. + * 02/04/2014 17039 ryu Removed menu item related to the HighlighFramingCodes feature. * * * @@ -281,8 +282,6 @@ public class ProductEditorComp extends Composite implements private MenuItem autoWrapMI; - private MenuItem framingCodeMI; - /** * Date & time formatter. */ @@ -876,20 +875,6 @@ public class ProductEditorComp extends Composite implements } }); - framingCodeMI = new MenuItem(menuToAddTo, SWT.CHECK); - framingCodeMI.setText("Highlight Framing Codes"); - framingCodeMI.setSelection(Activator.getDefault().getPreferenceStore() - .getBoolean("HighlightFramingCodes")); - framingCodeMI.addSelectionListener(new SelectionAdapter() { - - @Override - public void widgetSelected(SelectionEvent e) { - textComp.setFramingCodeState(framingCodeMI.getSelection()); - textComp.reParse(); - } - - }); - MenuItem wrapLengthMI = new MenuItem(menuToAddTo, SWT.PUSH); wrapLengthMI.setText("Wrap Length..."); wrapLengthMI.addSelectionListener(new SelectionAdapter() { diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/StyledTextComp.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/StyledTextComp.java index b039140294..713a19e52c 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/StyledTextComp.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/StyledTextComp.java @@ -41,7 +41,6 @@ import org.eclipse.swt.custom.StyleRange; import org.eclipse.swt.custom.StyledText; import org.eclipse.swt.events.DisposeEvent; import org.eclipse.swt.events.DisposeListener; -import org.eclipse.swt.events.KeyAdapter; import org.eclipse.swt.events.KeyEvent; import org.eclipse.swt.events.VerifyEvent; import org.eclipse.swt.events.VerifyListener; @@ -84,6 +83,8 @@ import com.raytheon.viz.gfe.textformatter.TextFmtParserUtil; * 29 AUG 2013 #2250 dgilling Better error handling for parseProductText(). * 04 SEP 2013 16534 ryu Fixed word wrap to not insert duplicate text; refactor. * 20 DEC 2013 16854 ryu Force re-parsing of text on type change. + * 04 FEB 2015 17039 ryu Removed HighlightFramingCodes feature which prevented + * editing of framing codes. * * * @@ -148,9 +149,6 @@ public class StyledTextComp extends Composite { */ private Listener mouseListener; - private boolean highlight = Activator.getDefault().getPreferenceStore() - .getBoolean("HighlightFramingCodes"); - private boolean newProduct = false; private Set unlockCitySegs; @@ -276,13 +274,6 @@ public class StyledTextComp extends Composite { textEditorST.setBackground(bgColor); textEditorST.setForeground(fgColor); - textEditorST.addKeyListener(new KeyAdapter() { - @Override - public void keyReleased(KeyEvent ke) { - handleKeyRelease(ke); - } - }); - textEditorST.addVerifyListener(new VerifyListener() { @Override public void verifyText(VerifyEvent e) { @@ -789,27 +780,6 @@ public class StyledTextComp extends Composite { } } - /** - * Handle the key event when a key is released. - * - * @param ke - * Key event. - */ - private void handleKeyRelease(KeyEvent ke) { - int offset = textEditorST.getCaretOffset(); - - StyleRange[] srArray = textEditorST.getStyleRanges(true); - - for (int i = 0; i < srArray.length; i++) { - if (srArray[i].start <= offset - && offset <= srArray[i].start + srArray[i].length) { - if (srArray[i].foreground == frameColor) { - inFramingCode(srArray[i]); - } - } - } - } - /** * Check if there is selected text and if there is locked text in the * selected text. @@ -848,18 +818,6 @@ public class StyledTextComp extends Composite { return false; } - /** - * Select the framing code and the text contained in the framing code. - * - * @param sr - * StyleRange. - */ - private void inFramingCode(StyleRange sr) { - if (highlight) { - textEditorST.setSelection(sr.start, sr.start + sr.length); - } - } - /** * Check if the key being pressed is a "non-edit" key. * @@ -888,8 +846,6 @@ public class StyledTextComp extends Composite { public void handleEvent(Event e) { if (e.type == SWT.MouseDown) { handleMouseDown(e); - } else if (e.type == SWT.MouseUp) { - handleMouseUp(e); } } }; @@ -930,33 +886,6 @@ public class StyledTextComp extends Composite { } } - /** - * Handle the mouse up event - * - * @param e - * Event fired. - */ - private void handleMouseUp(Event e) { - if (e.button == 1) { - int offset = textEditorST.getCaretOffset(); - - StyleRange[] sr = textEditorST.getStyleRanges(true); - - for (int i = 0; i < sr.length; i++) { - if (sr[i].start <= offset - && offset <= sr[i].start + sr[i].length) { - if (sr[i].foreground == frameColor) { - inFramingCode(sr[i]); - } - } - } - } - } - - public void setFramingCodeState(boolean highlight) { - this.highlight = highlight; - } - /** * Cut the selected text if the selection does not contain locked text. */