diff --git a/plugin/Raven.SQDev.Editors/META-INF/MANIFEST.MF b/plugin/Raven.SQDev.Editors/META-INF/MANIFEST.MF index 9a818d7c..51ae11e4 100644 --- a/plugin/Raven.SQDev.Editors/META-INF/MANIFEST.MF +++ b/plugin/Raven.SQDev.Editors/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Editors Bundle-SymbolicName: raven.sqdev.editors;singleton:=true -Bundle-Version: 0.7.2.stable +Bundle-Version: 0.7.3.stable Bundle-Activator: raven.sqdev.editors.activator.Activator Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, diff --git a/plugin/Raven.SQDev.Editors/src/raven/sqdev/editors/BasicSourceViewerConfiguration.java b/plugin/Raven.SQDev.Editors/src/raven/sqdev/editors/BasicSourceViewerConfiguration.java index 1c4a1880..a270f581 100644 --- a/plugin/Raven.SQDev.Editors/src/raven/sqdev/editors/BasicSourceViewerConfiguration.java +++ b/plugin/Raven.SQDev.Editors/src/raven/sqdev/editors/BasicSourceViewerConfiguration.java @@ -23,7 +23,6 @@ import org.eclipse.jface.util.IPropertyChangeListener; import org.eclipse.jface.util.PropertyChangeEvent; -import raven.sqdev.constants.ISQDevColorConstants; import raven.sqdev.constants.SQDevPreferenceConstants; import raven.sqdev.infoCollection.base.Keyword; import raven.sqdev.misc.SQDevPreferenceUtil; @@ -248,7 +247,7 @@ public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceVie if (containsString) { // colorize strings NonRuleBasedDamagerRepairer ndr_String = new NonRuleBasedDamagerRepairer( - new TextAttribute(colorManager.getColor(ISQDevColorConstants.STRING))); + new TextAttribute(SQDevPreferenceUtil.getStringHighlightingColor())); reconciler.setDamager(ndr_String, BasicPartitionScanner.BASIC_STRING); reconciler.setRepairer(ndr_String, BasicPartitionScanner.BASIC_STRING); } @@ -256,7 +255,7 @@ public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceVie if (containsComment) { // colorize comments NonRuleBasedDamagerRepairer ndr_Comment = new NonRuleBasedDamagerRepairer( - new TextAttribute(colorManager.getColor(ISQDevColorConstants.COMMENT))); + new TextAttribute(SQDevPreferenceUtil.getCommentHighlightingColor())); reconciler.setDamager(ndr_Comment, BasicPartitionScanner.BASIC_COMMENT); reconciler.setRepairer(ndr_Comment, BasicPartitionScanner.BASIC_COMMENT); } @@ -301,6 +300,11 @@ public void propertyChange(PropertyChangeEvent event) { case SQDevPreferenceConstants.SQDEV_EDITOR_ENABLE_AUTOCOMPLETE_KEY: assistant.enableAutoActivation((boolean) event.getNewValue()); break; + + case SQDevPreferenceConstants.SQDEV_EDITOR_STRINGHIGHLIGHTING_COLOR_KEY: + case SQDevPreferenceConstants.SQDEV_EDITOR_COMMENTHIGHLIGHTING_COLOR_KEY: + editor.update(false); + break; default: if (configuredKeywordScanners.containsKey(event.getProperty())) { diff --git a/plugin/Raven.SQDev.Misc/META-INF/MANIFEST.MF b/plugin/Raven.SQDev.Misc/META-INF/MANIFEST.MF index 36e742a0..4dabdb3b 100644 --- a/plugin/Raven.SQDev.Misc/META-INF/MANIFEST.MF +++ b/plugin/Raven.SQDev.Misc/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Misc Bundle-SymbolicName: raven.sqdev.misc;singleton:=true -Bundle-Version: 0.7.0.stable2 +Bundle-Version: 0.7.1.stable Bundle-Activator: raven.sqdev.activator.Activator Require-Bundle: org.eclipse.core.runtime, org.eclipse.swt, diff --git a/plugin/Raven.SQDev.Misc/src/raven/sqdev/constants/SQDevPreferenceConstants.java b/plugin/Raven.SQDev.Misc/src/raven/sqdev/constants/SQDevPreferenceConstants.java index 516752a4..81bf9858 100644 --- a/plugin/Raven.SQDev.Misc/src/raven/sqdev/constants/SQDevPreferenceConstants.java +++ b/plugin/Raven.SQDev.Misc/src/raven/sqdev/constants/SQDevPreferenceConstants.java @@ -6,130 +6,139 @@ * @author Raven */ public class SQDevPreferenceConstants { - + /** * The name of the preference holding the location to the ArmA folder on the * local disk */ public static final String SQDEV_INFO_ARMA_MAIN_DIRECTORY = "raven.sqdev.ArmAProgramDirectory"; - + /** * The name of the preference holding the location of the ArmA folder in the * documents directory on the local disk */ public static final String SQDEV_INFO_ARMA_DOCUMENTS_DIRECTORY = "raven.sqdev.ArmADocumentsDirectory"; - + /** * The name of the preference holding the default profile of the user */ public static final String SQDEV_INFO_DEFAULT_PROFILE = "raven.sqdev.defaultProfile"; - + /** * The name of the preference holding the default terrain */ public static final String SQDEV_INFO_DEFAULT_TERRAIN = "raven.sqdev.defaultTerrain"; - + /** * The name of the preference indicating if autoExport is enabled by default */ public static final String SQDEV_INFO_DEFAULT_AUTOEXPORT = "raven.sqdev.defaultAutoExport"; - + /** - * The name of the preference indicating whether the preference page should - * ask to save unsaved preferences when clicking OK + * The name of the preference indicating whether the preference page should ask + * to save unsaved preferences when clicking OK */ public static final String SQDEV_PROMPT_ALWAYS_SAVE_ON_EXIT = "raven.sqdev.AlwaysSaveOnExit"; - + /** - * The name of the preference indicating whether the user should be asked - * again if he selected an action that will delete a file + * The name of the preference indicating whether the user should be asked again + * if he selected an action that will delete a file */ public static final String SQDEV_PROMPT_ASK_FOR_DELETION = "raven.sqdev.askForDeletion"; - + /** - * The name of the preference indicating whether matching brackets should - * get highlighted + * The name of the preference indicating whether matching brackets should get + * highlighted */ public static final String SQDEV_EDITOR_MATCHING_BRACKETS_KEY = "raven.sqdev.enableBracketMatch"; - + /** * The name of the preference indicating the color of the highlight of a * matching bracket */ public static final String SQDEV_EDITOR_MATCHING_BRACKETS_COLOR_KEY = "raven.sqdev.matchingBracketsColor"; - + /** * The name of the preference indicating whether autoCompletion should be * enabled */ public static final String SQDEV_EDITOR_ENABLE_AUTOCOMPLETE_KEY = "raven.sqdev.enableAutoComplete"; - + /** * The name of the preference indicating whether the current line should get * highlighted */ public static final String SQDEV_EDITOR_HIGHLIGHT_CURRENTLINE_KEY = "raven.sqdev.highlightCurrentLine"; - + /** * The preferences indicating the color of the current line highlighting */ public static final String SQDEV_EDITOR_HIGHLIGHT_CURRENTLINE_COLOR_KEY = "raven.sqdev.currentLineHighlightingColor"; - + /** * The preferences indicating the color of the keyword highlighting */ public static final String SQDEV_EDITOR_KEYWORDHIGHLIGHTING_COLOR_KEY = "raven.sqdev.keywordHighlightingColor"; - + /** * The preference indicating the color of the local variable highlighting */ public static final String SQDEV_EDITOR_LOCALVARIABLEHIGHLIGHTING_COLOR_KEY = "raven.sqdev.localVariableHighlightingColor"; - + /** * The preference indicating the color of the global variable highlighting */ public static final String SQDEV_EDITOR_GLOBALVARIABLEHIGHLIGHTING_COLOR_KEY = "raven.sqdev.globalVariableHighlightingColor"; - + /** * The preference indicating the color of the magic variable highlighting */ public static final String SQDEV_EDITOR_MAGICVARIABLEHIGHLIGHTING_COLOR_KEY = "raven.sqdev.magicVariableHighlightingColor"; - + /** * The preference indicating the color of the macro highlighting */ public static final String SQDEV_EDITOR_MACROHIGHLIGHTING_COLOR_KEY = "raven.sqdev.macroHighlightingColor"; - + + /** + * The preference indicating the color of the string highlighting + */ + public static final String SQDEV_EDITOR_STRINGHIGHLIGHTING_COLOR_KEY = "raven.sqdev.stringHighlightingColor"; + /** - * The preference indicating the delay before parsing after the user typed - * in something + * The preference indicating the color of the string highlighting + */ + public static final String SQDEV_EDITOR_COMMENTHIGHLIGHTING_COLOR_KEY = "raven.sqdev.commentHighlightingColor"; + + /** + * The preference indicating the delay before parsing after the user typed in + * something */ public static final String SQDEV_EDITOR_PARSE_DELAY = "raven.sqdev.parsingInterval"; - + /** - * The preference indicating if a directory should be cleaned without asking - * for permission when exporting a project + * The preference indicating if a directory should be cleaned without asking for + * permission when exporting a project */ public static final String SQDEV_EXPORT_AUTOCLEAN = "raven.sqdev.autoClean"; - + /** * The preference holding the web adress to the BIKI API */ public static final String SQDEV_COLLECTION_API_ADRESS = "raven.sqdev.collection.apiAdress"; - + /** * The preference holding the wname of the main page that lists all the SQF * commands */ public static final String SQDEV_COLLECTION_API_MAINPAGE = "raven.sqdev.collection.apiMainPage"; - + /** * The preference holding the path to the folder where ArmA stores it's RPTs */ public static final String SQDEV_VIEWS_RPTVIEWER_RPT_PATH = "raven.sqdev.rptViewer.rptPath"; /** - * The preference indicating whether the RPTViewer should format it's - * content + * The preference indicating whether the RPTViewer should format it's content */ public static final String SQDEV_VIEWS_RPTVIEWER_FORMAT = "raven.sqdev.views.rptViewer.autoFormatRPTContent"; /** @@ -138,8 +147,8 @@ public class SQDevPreferenceConstants { */ public static final String SQDEV_VIEWS_RPTVIEWER_FORMAT_PREFIXES = "raven.sqdev.views.rptViewer.formatPrefixes"; /** - * The preferences storing the maximum amount of blank lines that may occur - * in a formatted RPT in a row + * The preferences storing the maximum amount of blank lines that may occur in a + * formatted RPT in a row */ public static final String SQDEV_VIEWS_RPTVIEWER_MAX_BLANK_REPETITION = "raven.sqdev.views.rptViewer.maxBlankRepetition"; } diff --git a/plugin/Raven.SQDev.Misc/src/raven/sqdev/misc/SQDevPreferenceUtil.java b/plugin/Raven.SQDev.Misc/src/raven/sqdev/misc/SQDevPreferenceUtil.java index 8eae8878..298c9fa9 100644 --- a/plugin/Raven.SQDev.Misc/src/raven/sqdev/misc/SQDevPreferenceUtil.java +++ b/plugin/Raven.SQDev.Misc/src/raven/sqdev/misc/SQDevPreferenceUtil.java @@ -25,13 +25,13 @@ * */ public class SQDevPreferenceUtil { - + /** * The seperator that is placed in between the different Strings in the * Preferences */ public static final String STRING_SEPERATOR = "_#%NextString%#_"; - + /** * Gets the Bundle of the raven.sqdev.preferences plugin * @@ -40,98 +40,88 @@ public class SQDevPreferenceUtil { public static Bundle getPreferenceBundle() { return Platform.getBundle("raven.sqdev.preferences"); } - + /** * Gets the preferences for the SQDev plugin * * @return */ public static IEclipsePreferences getPreferences() { - IEclipsePreferences preferences = InstanceScope.INSTANCE - .getNode("raven.sqdev.preferences"); - + IEclipsePreferences preferences = InstanceScope.INSTANCE.getNode("raven.sqdev.preferences"); + // check that preferences have been found - Assert.isNotNull(preferences, - "The requested preference can not be resolved!"); - + Assert.isNotNull(preferences, "The requested preference can not be resolved!"); + return preferences; } - + /** * Gets the preference store * * @return */ public static IPreferenceStore getPreferenceStore() { - return SQDevPluginManager.getManager().get("raven.sqdev.preferences") - .getPreferenceStore(); + return SQDevPluginManager.getManager().get("raven.sqdev.preferences").getPreferenceStore(); } - + /** * Gets the value of the - * SQDevPreferenceConstants.SQDEV_ALWAYS_SAVE_ON_EXIT - * preference that indicates whether the preference page shall prompt for - * save when clicking OK + * SQDevPreferenceConstants.SQDEV_ALWAYS_SAVE_ON_EXIT preference + * that indicates whether the preference page shall prompt for save when + * clicking OK * * @see {@linkplain SQDevPreferenceConstants} */ public static boolean alwaysSaveOnExit() { - return getPreferenceStore().getBoolean( - SQDevPreferenceConstants.SQDEV_PROMPT_ALWAYS_SAVE_ON_EXIT); + return getPreferenceStore().getBoolean(SQDevPreferenceConstants.SQDEV_PROMPT_ALWAYS_SAVE_ON_EXIT); } - + /** * Gets the value of the * SQDevPreferenceConstants.SQDEV_PROMPT_ASK_FOR_DELETION - * preference that indicates whether the user should be prompted to validate - * a deletion he initialized + * preference that indicates whether the user should be prompted to validate a + * deletion he initialized * * @see {@linkplain SQDevPreferenceConstants} */ public static boolean promptUserValidationForDeletion() { - return getPreferenceStore().getBoolean( - SQDevPreferenceConstants.SQDEV_PROMPT_ASK_FOR_DELETION); + return getPreferenceStore().getBoolean(SQDevPreferenceConstants.SQDEV_PROMPT_ASK_FOR_DELETION); } - + /** * Gets the value of the * SQDevPreferenceConstants.SQDEV_ARMA_DOCUMENTS_DIRECTORY - * preference that holds the path to the ArmA folder in the documents - * directory + * preference that holds the path to the ArmA folder in the documents directory * * @see {@linkplain SQDevPreferenceConstants} */ public static String getArmaDocumentsDirectory() { - String path = getPreferenceStore().getString( - SQDevPreferenceConstants.SQDEV_INFO_ARMA_DOCUMENTS_DIRECTORY); - + String path = getPreferenceStore().getString(SQDevPreferenceConstants.SQDEV_INFO_ARMA_DOCUMENTS_DIRECTORY); + if (path.isEmpty()) { - SQDevInfobox info = new SQDevInfobox( - "Invalid document's directory in preference!", - SWT.ICON_ERROR, false); + SQDevInfobox info = new SQDevInfobox("Invalid document's directory in preference!", SWT.ICON_ERROR, false); info.open(false); } - + return path; } - + /** - * Get the path to the default directory in the documents coresponding to - * the default user profile + * Get the path to the default directory in the documents coresponding to the + * default user profile */ public static String getDefaultDocumentsDirectory() { IPath path = new Path(getArmaDocumentsDirectory()); - + path.append("Arma 3"); - + if (path.toFile().exists()) { return path.toOSString(); } else { - throw new SQDevCoreException( - "Can't find the default user directory"); + throw new SQDevCoreException("Can't find the default user directory"); } } - + /** * Gets the path to the profile's directory in myDocuments
* If {@link #getArmaDocumentsDirectory()} returns an invalid (e.g. empty) @@ -143,77 +133,70 @@ public static String getDefaultDocumentsDirectory() { */ public static String getProfilesDocumentDirectory() { IPath path = new Path(getArmaDocumentsDirectory()); - + if (path.segmentCount() == 0) { return ""; } - + path = path.append("Arma 3 - Other Profiles"); - + if (!path.toFile().exists()) { return ""; } else { return path.toOSString(); } } - + /** - * Gets the value of the - * SQDevPreferenceConstants.SQDEV_RPT_PATH preference that - * holds the path to the folder ArmA stores it's RPTs + * Gets the value of the SQDevPreferenceConstants.SQDEV_RPT_PATH + * preference that holds the path to the folder ArmA stores it's RPTs * * @see {@linkplain SQDevPreferenceConstants} */ public static String getRPTDirectory() { - String path = getPreferenceStore().getString( - SQDevPreferenceConstants.SQDEV_VIEWS_RPTVIEWER_RPT_PATH); - + String path = getPreferenceStore().getString(SQDevPreferenceConstants.SQDEV_VIEWS_RPTVIEWER_RPT_PATH); + if (path.isEmpty()) { - SQDevInfobox info = new SQDevInfobox( - "Invalid RPT directory in preference!", SWT.ICON_ERROR, - false); + SQDevInfobox info = new SQDevInfobox("Invalid RPT directory in preference!", SWT.ICON_ERROR, false); info.open(false); } - + return path; } - + /** * Gets the value of the - * SQDevPreferenceConstants.SQDEV_VIEWS_RPTVIEWER_FORMAT - * preference that indicates whether the RPT content should be formatted - * before being displayed + * SQDevPreferenceConstants.SQDEV_VIEWS_RPTVIEWER_FORMAT preference + * that indicates whether the RPT content should be formatted before being + * displayed * * @see {@linkplain SQDevPreferenceConstants} */ public static boolean doFormatRPTContent() { - return getPreferenceStore().getBoolean( - SQDevPreferenceConstants.SQDEV_VIEWS_RPTVIEWER_FORMAT); + return getPreferenceStore().getBoolean(SQDevPreferenceConstants.SQDEV_VIEWS_RPTVIEWER_FORMAT); } - + /** * Gets the value of the * SQDevPreferenceConstants.SQDEV_VIEWS_RPTVIEWER_FORMAT_PREFIXES - * preference that stores all the prefixes od the lines that should be - * removed during formatting + * preference that stores all the prefixes od the lines that should be removed + * during formatting * * @see {@linkplain SQDevPreferenceConstants} */ public static ArrayList getRPTFormatPrefixes() { ArrayList list = new ArrayList(); - + for (String current : getPreferenceStore() - .getString( - SQDevPreferenceConstants.SQDEV_VIEWS_RPTVIEWER_FORMAT_PREFIXES) - .split(STRING_SEPERATOR)) { + .getString(SQDevPreferenceConstants.SQDEV_VIEWS_RPTVIEWER_FORMAT_PREFIXES).split(STRING_SEPERATOR)) { if (!current.isEmpty()) { list.add(current); } } - + return list; } - + /** * Gets the value of the * SQDevPreferenceConstants.SQDEV_VIEWS_RPTVIEWER_MAX_BLANK_REPETITION @@ -223,36 +206,31 @@ public static ArrayList getRPTFormatPrefixes() { * @see {@linkplain SQDevPreferenceConstants} */ public static int getMaximumBlankLinesInRPT() { - return getPreferenceStore().getInt( - SQDevPreferenceConstants.SQDEV_VIEWS_RPTVIEWER_MAX_BLANK_REPETITION); + return getPreferenceStore().getInt(SQDevPreferenceConstants.SQDEV_VIEWS_RPTVIEWER_MAX_BLANK_REPETITION); } - + /** * Gets the value of the - * SQDevPreferenceConstants.SQDEV_ARMA_MAIN_DIRECTORY - * preference that holds the path to the ArmA folder in the programs - * directory + * SQDevPreferenceConstants.SQDEV_ARMA_MAIN_DIRECTORY preference + * that holds the path to the ArmA folder in the programs directory * * @see {@linkplain SQDevPreferenceConstants} */ public static String getArmaProgramDirectory() { - return getPreferenceStore().getString( - SQDevPreferenceConstants.SQDEV_INFO_ARMA_MAIN_DIRECTORY); + return getPreferenceStore().getString(SQDevPreferenceConstants.SQDEV_INFO_ARMA_MAIN_DIRECTORY); } - + /** * Gets the value of the * SQDevPreferenceConstants.SQDEV_EDITOR_MATCHING_BRACKETS_KEY - * preference that indicates whether matching brackets should get - * highlighted + * preference that indicates whether matching brackets should get highlighted * * @see {@linkplain SQDevPreferenceConstants} */ public static boolean areMatchingBracketsShown() { - return getPreferenceStore().getBoolean( - SQDevPreferenceConstants.SQDEV_EDITOR_MATCHING_BRACKETS_KEY); + return getPreferenceStore().getBoolean(SQDevPreferenceConstants.SQDEV_EDITOR_MATCHING_BRACKETS_KEY); } - + /** * Gets the value of the * SQDevPreferenceConstants.SQDEV_EDITOR_HIGHLIGHT_CURRENTLINE_KEY @@ -261,23 +239,21 @@ public static boolean areMatchingBracketsShown() { * @see {@linkplain SQDevPreferenceConstants} */ public static boolean isCurrentLineHighlighted() { - return getPreferenceStore().getBoolean( - SQDevPreferenceConstants.SQDEV_EDITOR_HIGHLIGHT_CURRENTLINE_KEY); + return getPreferenceStore().getBoolean(SQDevPreferenceConstants.SQDEV_EDITOR_HIGHLIGHT_CURRENTLINE_KEY); } - + /** * Gets the value of the * SQDevPreferenceConstants.SQDEV_EDITOR_ENABLE_AUTOCOMPLETE_KEY - * preference that indicates whether the content assist will insert the - * proposal automatically when there is only one proposal + * preference that indicates whether the content assist will insert the proposal + * automatically when there is only one proposal * * @see {@linkplain SQDevPreferenceConstants} */ public static boolean isAutoCompleteEnabled() { - return getPreferenceStore().getBoolean( - SQDevPreferenceConstants.SQDEV_EDITOR_ENABLE_AUTOCOMPLETE_KEY); + return getPreferenceStore().getBoolean(SQDevPreferenceConstants.SQDEV_EDITOR_ENABLE_AUTOCOMPLETE_KEY); } - + /** * Gets the value of the * SQDevPreferenceConstants.SQDEV_EDITOR_MATCHING_BRACKETS_COLOR_KEY @@ -286,11 +262,10 @@ public static boolean isAutoCompleteEnabled() { * @see {@linkplain SQDevPreferenceConstants} */ public static Color getMatchingBracketHighlightingColor() { - return new Color(Display.getCurrent(), - ColorUtils.decodeRGB(getPreferenceStore().getString( - SQDevPreferenceConstants.SQDEV_EDITOR_MATCHING_BRACKETS_COLOR_KEY))); + return new Color(Display.getCurrent(), ColorUtils.decodeRGB( + getPreferenceStore().getString(SQDevPreferenceConstants.SQDEV_EDITOR_MATCHING_BRACKETS_COLOR_KEY))); } - + /** * Gets the value of the * SQDevPreferenceConstants.SQDEV_EDITOR_HIGHLIGHT_CURRENTLINE_COLOR_KEY @@ -299,24 +274,46 @@ public static Color getMatchingBracketHighlightingColor() { * @see {@linkplain SQDevPreferenceConstants} */ public static Color getCurrentLineHighlightingColor() { - return new Color(Display.getCurrent(), - ColorUtils.decodeRGB(getPreferenceStore().getString( - SQDevPreferenceConstants.SQDEV_EDITOR_HIGHLIGHT_CURRENTLINE_COLOR_KEY))); + return new Color(Display.getCurrent(), ColorUtils.decodeRGB( + getPreferenceStore().getString(SQDevPreferenceConstants.SQDEV_EDITOR_HIGHLIGHT_CURRENTLINE_COLOR_KEY))); } - + /** * Gets the value of the - * SQDevPreferenceConstants.SQDEV_EDITOR_SYNTAXHIGHLIGHTING_COLOR_KEY - * preference that defines the color for the hihlighting of keywords + * SQDevPreferenceConstants.SQDEV_EDITOR_KEYWORDHIGHLIGHTING_COLOR_KEY + * preference that defines the color for the highlighting of keywords * * @see {@linkplain SQDevPreferenceConstants} */ public static Color getSyntaxHighlightingColor() { - return new Color(Display.getCurrent(), - ColorUtils.decodeRGB(getPreferenceStore().getString( - SQDevPreferenceConstants.SQDEV_EDITOR_KEYWORDHIGHLIGHTING_COLOR_KEY))); + return new Color(Display.getCurrent(), ColorUtils.decodeRGB( + getPreferenceStore().getString(SQDevPreferenceConstants.SQDEV_EDITOR_KEYWORDHIGHLIGHTING_COLOR_KEY))); + } + + /** + * Gets the value of the + * SQDevPreferenceConstants.SQDEV_EDITOR_COMMENTHIGHLIGHTING_COLOR_KEY + * preference that defines the color for the highlighting of keywords + * + * @see {@linkplain SQDevPreferenceConstants} + */ + public static Color getCommentHighlightingColor() { + return new Color(Display.getCurrent(), ColorUtils.decodeRGB( + getPreferenceStore().getString(SQDevPreferenceConstants.SQDEV_EDITOR_COMMENTHIGHLIGHTING_COLOR_KEY))); + } + + /** + * Gets the value of the + * SQDevPreferenceConstants.SQDEV_EDITOR_STRINGHIGHLIGHTING_COLOR_KEY + * preference that defines the color for the highlighting of Strings + * + * @see {@linkplain SQDevPreferenceConstants} + */ + public static Color getStringHighlightingColor() { + return new Color(Display.getCurrent(), ColorUtils.decodeRGB( + getPreferenceStore().getString(SQDevPreferenceConstants.SQDEV_EDITOR_STRINGHIGHLIGHTING_COLOR_KEY))); } - + /** * Gets the value of the * SQDevPreferenceConstants.SQDEV_EDITOR_PARSE_DELAY preference @@ -325,23 +322,21 @@ public static Color getSyntaxHighlightingColor() { * @see {@linkplain SQDevPreferenceConstants} */ public static int getParseDelay() { - return getPreferenceStore() - .getInt(SQDevPreferenceConstants.SQDEV_EDITOR_PARSE_DELAY); + return getPreferenceStore().getInt(SQDevPreferenceConstants.SQDEV_EDITOR_PARSE_DELAY); } - + /** * Gets the value of the - * SQDevPreferenceConstants.SQDEV_EXPORT_AUTOCLEAN preference - * that indicates whether a directory should get cleaned without asking for + * SQDevPreferenceConstants.SQDEV_EXPORT_AUTOCLEAN preference that + * indicates whether a directory should get cleaned without asking for * permission when exporting a project * * @see {@linkplain SQDevPreferenceConstants} */ public static boolean autoClean() { - return getPreferenceStore() - .getBoolean(SQDevPreferenceConstants.SQDEV_EXPORT_AUTOCLEAN); + return getPreferenceStore().getBoolean(SQDevPreferenceConstants.SQDEV_EXPORT_AUTOCLEAN); } - + /** * Gets the value of the * SQDevPreferenceConstants.SQDEV_INFO_DEFAULT_AUTOEXPORT @@ -350,45 +345,42 @@ public static boolean autoClean() { * @see {@linkplain SQDevPreferenceConstants} */ public static boolean getAutoExportDefaultEnabled() { - return getPreferenceStore().getBoolean( - SQDevPreferenceConstants.SQDEV_INFO_DEFAULT_AUTOEXPORT); + return getPreferenceStore().getBoolean(SQDevPreferenceConstants.SQDEV_INFO_DEFAULT_AUTOEXPORT); } - + /** * Gets the value of the - * SQDevPreferenceConstants.SQDEV_INFO_DEFAULT_PROFILE - * preference that holds the default profile + * SQDevPreferenceConstants.SQDEV_INFO_DEFAULT_PROFILE preference + * that holds the default profile * * @see {@linkplain SQDevPreferenceConstants} */ public static String getDefaultProfile() { - return getPreferenceStore() - .getString(SQDevPreferenceConstants.SQDEV_INFO_DEFAULT_PROFILE); + return getPreferenceStore().getString(SQDevPreferenceConstants.SQDEV_INFO_DEFAULT_PROFILE); } - + /** * Gets the value of the - * SQDevPreferenceConstants.SQDEV_INFO_DEFAULT_TERRAIN - * preference that holds the default terrain + * SQDevPreferenceConstants.SQDEV_INFO_DEFAULT_TERRAIN preference + * that holds the default terrain * * @see {@linkplain SQDevPreferenceConstants} */ public static String getDefaultTerrain() { - return getPreferenceStore() - .getString(SQDevPreferenceConstants.SQDEV_INFO_DEFAULT_TERRAIN); + return getPreferenceStore().getString(SQDevPreferenceConstants.SQDEV_INFO_DEFAULT_TERRAIN); } - + /** * Gets the value of the - * SQDevPreferenceConstants.SQDEV_COLLECTION_API_ADRESS - * preference that holds the default terrain + * SQDevPreferenceConstants.SQDEV_COLLECTION_API_ADRESS preference + * that holds the default terrain * * @see {@linkplain SQDevPreferenceConstants} */ public static String getAPIAdress() { return getPreferenceStore().getString(SQDevPreferenceConstants.SQDEV_COLLECTION_API_ADRESS); } - + /** * Gets the value of the * SQDevPreferenceConstants.SQDEV_COLLECTION_API_MAINPAGE diff --git a/plugin/Raven.SQDev/feature.xml b/plugin/Raven.SQDev/feature.xml index 22d8f981..1cc3038f 100644 --- a/plugin/Raven.SQDev/feature.xml +++ b/plugin/Raven.SQDev/feature.xml @@ -2,7 +2,7 @@ diff --git a/plugin/RavenSQDev.Preferences/META-INF/MANIFEST.MF b/plugin/RavenSQDev.Preferences/META-INF/MANIFEST.MF index a64ba0d3..f9d1fdf8 100644 --- a/plugin/RavenSQDev.Preferences/META-INF/MANIFEST.MF +++ b/plugin/RavenSQDev.Preferences/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Preferences Bundle-SymbolicName: raven.sqdev.preferences;singleton:=true -Bundle-Version: 0.5.6.stable +Bundle-Version: 0.5.7.stable Bundle-Activator: raven.sqdev.preferences.activator.Activator Bundle-Vendor: Raven Require-Bundle: org.eclipse.ui, diff --git a/plugin/RavenSQDev.Preferences/src/raven/sqdev/preferences/initializer/SQDevPreferenceInitializer.java b/plugin/RavenSQDev.Preferences/src/raven/sqdev/preferences/initializer/SQDevPreferenceInitializer.java index 1922ad65..1e05a66a 100644 --- a/plugin/RavenSQDev.Preferences/src/raven/sqdev/preferences/initializer/SQDevPreferenceInitializer.java +++ b/plugin/RavenSQDev.Preferences/src/raven/sqdev/preferences/initializer/SQDevPreferenceInitializer.java @@ -16,130 +16,100 @@ * Class used to initialize default preference values. */ public class SQDevPreferenceInitializer extends AbstractPreferenceInitializer { - + @Override public void initializeDefaultPreferences() { IPreferenceStore store = Activator.getDefault().getPreferenceStore(); - + // find the ArmA directory in programs folder - store.setDefault( - SQDevPreferenceConstants.SQDEV_INFO_ARMA_MAIN_DIRECTORY, - locateArmaMainDirectory()); - + store.setDefault(SQDevPreferenceConstants.SQDEV_INFO_ARMA_MAIN_DIRECTORY, locateArmaMainDirectory()); + // find ArmA directory in documents folder - store.setDefault( - SQDevPreferenceConstants.SQDEV_INFO_ARMA_DOCUMENTS_DIRECTORY, - locateArmaDocumentsDirectory()); - + store.setDefault(SQDevPreferenceConstants.SQDEV_INFO_ARMA_DOCUMENTS_DIRECTORY, locateArmaDocumentsDirectory()); + // set default profile - store.setDefault(SQDevPreferenceConstants.SQDEV_INFO_DEFAULT_PROFILE, - System.getProperty("user.name")); - - // set deafult map - store.setDefault(SQDevPreferenceConstants.SQDEV_INFO_DEFAULT_TERRAIN, - "Altis"); - + store.setDefault(SQDevPreferenceConstants.SQDEV_INFO_DEFAULT_PROFILE, System.getProperty("user.name")); + + // set default map + store.setDefault(SQDevPreferenceConstants.SQDEV_INFO_DEFAULT_TERRAIN, "Altis"); + // set default autoExport - store.setDefault(SQDevPreferenceConstants.SQDEV_INFO_DEFAULT_AUTOEXPORT, - false); - + store.setDefault(SQDevPreferenceConstants.SQDEV_INFO_DEFAULT_AUTOEXPORT, false); + // let the preference page always ask for saving - store.setDefault( - SQDevPreferenceConstants.SQDEV_PROMPT_ALWAYS_SAVE_ON_EXIT, - false); - + store.setDefault(SQDevPreferenceConstants.SQDEV_PROMPT_ALWAYS_SAVE_ON_EXIT, false); + // ask for deleting files - store.setDefault(SQDevPreferenceConstants.SQDEV_PROMPT_ASK_FOR_DELETION, - true); - + store.setDefault(SQDevPreferenceConstants.SQDEV_PROMPT_ASK_FOR_DELETION, true); + // enable matching brackets highlighting - store.setDefault( - SQDevPreferenceConstants.SQDEV_EDITOR_MATCHING_BRACKETS_KEY, - true); - store.setDefault( - SQDevPreferenceConstants.SQDEV_EDITOR_MATCHING_BRACKETS_COLOR_KEY, - ColorUtils.getRGBValuesAsString( - ISQDevColorConstants.BRACKETMATCH)); - + store.setDefault(SQDevPreferenceConstants.SQDEV_EDITOR_MATCHING_BRACKETS_KEY, true); + store.setDefault(SQDevPreferenceConstants.SQDEV_EDITOR_MATCHING_BRACKETS_COLOR_KEY, + ColorUtils.getRGBValuesAsString(ISQDevColorConstants.BRACKETMATCH)); + // enable currentLine highlighting - store.setDefault( - SQDevPreferenceConstants.SQDEV_EDITOR_HIGHLIGHT_CURRENTLINE_KEY, - true); - store.setDefault( - SQDevPreferenceConstants.SQDEV_EDITOR_HIGHLIGHT_CURRENTLINE_COLOR_KEY, - ColorUtils.getRGBValuesAsString( - ISQDevColorConstants.CURRENTLINE)); - + store.setDefault(SQDevPreferenceConstants.SQDEV_EDITOR_HIGHLIGHT_CURRENTLINE_KEY, true); + store.setDefault(SQDevPreferenceConstants.SQDEV_EDITOR_HIGHLIGHT_CURRENTLINE_COLOR_KEY, + ColorUtils.getRGBValuesAsString(ISQDevColorConstants.CURRENTLINE)); + // enable autoComplete - store.setDefault( - SQDevPreferenceConstants.SQDEV_EDITOR_ENABLE_AUTOCOMPLETE_KEY, - true); - + store.setDefault(SQDevPreferenceConstants.SQDEV_EDITOR_ENABLE_AUTOCOMPLETE_KEY, true); + // set keyword highlighting - store.setDefault( - SQDevPreferenceConstants.SQDEV_EDITOR_KEYWORDHIGHLIGHTING_COLOR_KEY, + store.setDefault(SQDevPreferenceConstants.SQDEV_EDITOR_KEYWORDHIGHLIGHTING_COLOR_KEY, ColorUtils.getRGBValuesAsString(ISQDevColorConstants.KEYWORD)); - + // set local variable highlighting - store.setDefault( - SQDevPreferenceConstants.SQDEV_EDITOR_LOCALVARIABLEHIGHLIGHTING_COLOR_KEY, - ColorUtils.getRGBValuesAsString( - ISQDevColorConstants.LOCAL_VARIABLE)); - + store.setDefault(SQDevPreferenceConstants.SQDEV_EDITOR_LOCALVARIABLEHIGHLIGHTING_COLOR_KEY, + ColorUtils.getRGBValuesAsString(ISQDevColorConstants.LOCAL_VARIABLE)); + // set global variable highlighting - store.setDefault( - SQDevPreferenceConstants.SQDEV_EDITOR_GLOBALVARIABLEHIGHLIGHTING_COLOR_KEY, - ColorUtils.getRGBValuesAsString( - ISQDevColorConstants.GLOBAL_VARIABLE)); - + store.setDefault(SQDevPreferenceConstants.SQDEV_EDITOR_GLOBALVARIABLEHIGHLIGHTING_COLOR_KEY, + ColorUtils.getRGBValuesAsString(ISQDevColorConstants.GLOBAL_VARIABLE)); + // set magic variable highlighting - store.setDefault( - SQDevPreferenceConstants.SQDEV_EDITOR_MAGICVARIABLEHIGHLIGHTING_COLOR_KEY, - ColorUtils.getRGBValuesAsString( - ISQDevColorConstants.MAGIC_VARIABLE)); - + store.setDefault(SQDevPreferenceConstants.SQDEV_EDITOR_MAGICVARIABLEHIGHLIGHTING_COLOR_KEY, + ColorUtils.getRGBValuesAsString(ISQDevColorConstants.MAGIC_VARIABLE)); + // set macro highlighting - store.setDefault( - SQDevPreferenceConstants.SQDEV_EDITOR_MACROHIGHLIGHTING_COLOR_KEY, + store.setDefault(SQDevPreferenceConstants.SQDEV_EDITOR_MACROHIGHLIGHTING_COLOR_KEY, ColorUtils.getRGBValuesAsString(ISQDevColorConstants.MACRO)); - + + // set String highlighting + store.setDefault(SQDevPreferenceConstants.SQDEV_EDITOR_STRINGHIGHLIGHTING_COLOR_KEY, + ColorUtils.getRGBValuesAsString(ISQDevColorConstants.STRING)); + + // set comment highlighting + store.setDefault(SQDevPreferenceConstants.SQDEV_EDITOR_COMMENTHIGHLIGHTING_COLOR_KEY, + ColorUtils.getRGBValuesAsString(ISQDevColorConstants.COMMENT)); + // set parsing interval - store.setDefault(SQDevPreferenceConstants.SQDEV_EDITOR_PARSE_DELAY, - 1500); - + store.setDefault(SQDevPreferenceConstants.SQDEV_EDITOR_PARSE_DELAY, 1000); + // set autoClean - store.setDefault(SQDevPreferenceConstants.SQDEV_EXPORT_AUTOCLEAN, - false); - + store.setDefault(SQDevPreferenceConstants.SQDEV_EXPORT_AUTOCLEAN, false); + // set default API adress store.setDefault(SQDevPreferenceConstants.SQDEV_COLLECTION_API_ADRESS, "https://community.bistudio.com/wikidata/api.php"); - + // set default API main page - store.setDefault(SQDevPreferenceConstants.SQDEV_COLLECTION_API_MAINPAGE, - "Category:Scripting_Commands_Arma_3"); - + store.setDefault(SQDevPreferenceConstants.SQDEV_COLLECTION_API_MAINPAGE, "Category:Scripting_Commands_Arma_3"); + // set path to the RPT logs - store.setDefault( - SQDevPreferenceConstants.SQDEV_VIEWS_RPTVIEWER_RPT_PATH, - locateRPT()); - + store.setDefault(SQDevPreferenceConstants.SQDEV_VIEWS_RPTVIEWER_RPT_PATH, locateRPT()); + // set default formatting preference to true - store.setDefault(SQDevPreferenceConstants.SQDEV_VIEWS_RPTVIEWER_FORMAT, - true); - + store.setDefault(SQDevPreferenceConstants.SQDEV_VIEWS_RPTVIEWER_FORMAT, true); + // set default prefixes for RPT formatting - store.setDefault( - SQDevPreferenceConstants.SQDEV_VIEWS_RPTVIEWER_FORMAT_PREFIXES, - "Updating base class" + SQDevPreferenceUtil.STRING_SEPERATOR - + "Attempt to override final function"); - + store.setDefault(SQDevPreferenceConstants.SQDEV_VIEWS_RPTVIEWER_FORMAT_PREFIXES, + "Updating base class" + SQDevPreferenceUtil.STRING_SEPERATOR + "Attempt to override final function"); + // set default max blank lines - store.setDefault( - SQDevPreferenceConstants.SQDEV_VIEWS_RPTVIEWER_MAX_BLANK_REPETITION, - 2); + store.setDefault(SQDevPreferenceConstants.SQDEV_VIEWS_RPTVIEWER_MAX_BLANK_REPETITION, 2); } - + /** * Finds the Arma 3 directory in the programs folder * @@ -149,7 +119,7 @@ public void initializeDefaultPreferences() { public static String locateArmaMainDirectory() { // navigate to the desired folder through the Steam folder String path; - + if (System.getProperty("os.name").toLowerCase().contains("windows")) { // Windows if (System.getenv("ProgramFiles(x86)") != null) { @@ -163,17 +133,16 @@ public static String locateArmaMainDirectory() { // linux path = System.getProperty("user.home") + "/.local/share/"; } - - path += "\\Steam\\steamapps\\common\\Arma 3".replace("\\", - File.separator); - + + path += "\\Steam\\steamapps\\common\\Arma 3".replace("\\", File.separator); + if (new File(path).exists()) { return path; } else { return ""; } } - + /** * Finds the Arma 3 directory in the documents folder * @@ -182,39 +151,37 @@ public static String locateArmaMainDirectory() { */ public static String locateArmaDocumentsDirectory() { String path; - + if (System.getProperty("os.name").toLowerCase().contains("windows")) { // Windows - path = FileSystemView.getFileSystemView().getDefaultDirectory() - .getPath(); + path = FileSystemView.getFileSystemView().getDefaultDirectory().getPath(); } else { // Linux path = System.getProperty("user.home") + File.separator + ".local/share/bohemiainteractive/arma3/GameDocuments"; } - + String tempPath = path + File.separator + "Arma 3"; - + if (new File(tempPath).exists()) { return path; } else { return ""; } } - + /** * Gets the default RPT-directory */ public static String locateRPT() { String path = System.getProperty("user.home"); - + if (System.getProperty("os.name").toLowerCase().contains("windows")) { path += "/AppData/Local/Arma 3".replace("/", File.separator); } else { - path += "/.local/share/bohemiainteractive/arma3/AppDataLocal/Arma 3/" - .replace("/", File.separator); + path += "/.local/share/bohemiainteractive/arma3/AppDataLocal/Arma 3/".replace("/", File.separator); } - + if (new File(path).exists()) { return path; } else { diff --git a/plugin/RavenSQDev.Preferences/src/raven/sqdev/preferences/pages/SQDevEditorPreferencePage.java b/plugin/RavenSQDev.Preferences/src/raven/sqdev/preferences/pages/SQDevEditorPreferencePage.java index 93c07623..e806baf5 100644 --- a/plugin/RavenSQDev.Preferences/src/raven/sqdev/preferences/pages/SQDevEditorPreferencePage.java +++ b/plugin/RavenSQDev.Preferences/src/raven/sqdev/preferences/pages/SQDevEditorPreferencePage.java @@ -24,8 +24,8 @@ public SQDevEditorPreferencePage() { public void init(IWorkbench workbench) { setDescription("Preferences changing the appearance of the editor"); - // preferences for the behaviour - Group behaviour = createGroup("Behaviour"); + // preferences for the behavior + Group behaviour = createGroup("Behavior"); createDescription(behaviour, "Here you can change the behaviour of the editor"); @@ -114,6 +114,20 @@ public void init(IWorkbench workbench) { "Defines the color in which matching bracket pairs are highlighted", colors); addPreferenceEditor(matchingBracketHighlightingColorEditor); + + ColorSQDevPreferenceEditor stringHighlightingColorEditor = new ColorSQDevPreferenceEditor( + SQDevPreferenceConstants.SQDEV_EDITOR_STRINGHIGHLIGHTING_COLOR_KEY, + "&String highlighting:", + "Defines the color in which Strings are highlighted", + colors); + addPreferenceEditor(stringHighlightingColorEditor); + + ColorSQDevPreferenceEditor commentHighlightingColorEditor = new ColorSQDevPreferenceEditor( + SQDevPreferenceConstants.SQDEV_EDITOR_COMMENTHIGHLIGHTING_COLOR_KEY, + "&Comment highlighting:", + "Defines the color in which comments are highlighted", + colors); + addPreferenceEditor(commentHighlightingColorEditor); } } diff --git a/plugin/SQDev/plugins/raven.sqdev.misc_0.7.0.stable2.jar b/plugin/SQDev/SQDev_0.7.7.zip similarity index 56% rename from plugin/SQDev/plugins/raven.sqdev.misc_0.7.0.stable2.jar rename to plugin/SQDev/SQDev_0.7.7.zip index 062c4229..35938ed2 100644 Binary files a/plugin/SQDev/plugins/raven.sqdev.misc_0.7.0.stable2.jar and b/plugin/SQDev/SQDev_0.7.7.zip differ diff --git a/plugin/SQDev/features/raven.sqdev_0.7.6.stable1.jar b/plugin/SQDev/features/raven.sqdev_0.7.6.stable1.jar deleted file mode 100644 index 41d204fd..00000000 Binary files a/plugin/SQDev/features/raven.sqdev_0.7.6.stable1.jar and /dev/null differ diff --git a/plugin/SQDev/plugins/raven.sqdev.editors.sqfeditor_0.7.5.stable1.jar b/plugin/SQDev/plugins/raven.sqdev.editors.sqfeditor_0.7.5.stable1.jar deleted file mode 100644 index dce65b7a..00000000 Binary files a/plugin/SQDev/plugins/raven.sqdev.editors.sqfeditor_0.7.5.stable1.jar and /dev/null differ diff --git a/plugin/SQDev/plugins/raven.sqdev.editors_0.7.2.stable.jar b/plugin/SQDev/plugins/raven.sqdev.editors_0.7.2.stable.jar deleted file mode 100644 index 43ada5a6..00000000 Binary files a/plugin/SQDev/plugins/raven.sqdev.editors_0.7.2.stable.jar and /dev/null differ diff --git a/plugin/SQDev/plugins/raven.sqdev.preferences_0.5.6.stable.jar b/plugin/SQDev/plugins/raven.sqdev.preferences_0.5.6.stable.jar deleted file mode 100644 index 6cdd1b98..00000000 Binary files a/plugin/SQDev/plugins/raven.sqdev.preferences_0.5.6.stable.jar and /dev/null differ diff --git a/plugin/SQDev/plugins/raven.sqdev.ui_0.3.2.stable.jar b/plugin/SQDev/plugins/raven.sqdev.ui_0.3.2.stable.jar deleted file mode 100644 index df49905f..00000000 Binary files a/plugin/SQDev/plugins/raven.sqdev.ui_0.3.2.stable.jar and /dev/null differ diff --git a/plugin/SQDev/plugins/raven.sqdev.util_0.7.3.stable.jar b/plugin/SQDev/plugins/raven.sqdev.util_0.7.3.stable.jar deleted file mode 100644 index f6f8c1a4..00000000 Binary files a/plugin/SQDev/plugins/raven.sqdev.util_0.7.3.stable.jar and /dev/null differ diff --git a/plugin/SQDev/plugins/raven.sqdev.wizards_0.3.5.stable.jar b/plugin/SQDev/plugins/raven.sqdev.wizards_0.3.5.stable.jar deleted file mode 100644 index aba0e28a..00000000 Binary files a/plugin/SQDev/plugins/raven.sqdev.wizards_0.3.5.stable.jar and /dev/null differ diff --git a/plugin/SQDev/site.xml b/plugin/SQDev/site.xml index 9db1e613..a3d217b9 100644 --- a/plugin/SQDev/site.xml +++ b/plugin/SQDev/site.xml @@ -1,6 +1,6 @@ - +