diff --git a/qt/org.eclipse.cdt.qt.core/META-INF/MANIFEST.MF b/qt/org.eclipse.cdt.qt.core/META-INF/MANIFEST.MF index 4b9cfc45a01..7ea0d2ac47e 100644 --- a/qt/org.eclipse.cdt.qt.core/META-INF/MANIFEST.MF +++ b/qt/org.eclipse.cdt.qt.core/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.cdt.qt.core;singleton:=true -Bundle-Version: 2.2.300.qualifier +Bundle-Version: 2.2.400.qualifier Bundle-Activator: org.eclipse.cdt.internal.qt.core.Activator Bundle-Vendor: %providerName Require-Bundle: org.eclipse.core.runtime, diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/ASTUtil.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/ASTUtil.java index 0623dee3a60..246b075ec55 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/ASTUtil.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/ASTUtil.java @@ -94,7 +94,7 @@ public class ASTUtil { } String ownerName = getFullyQualifiedName(binding.getOwner()); - return (ownerName == null ? "" : ownerName) + "::" + binding.getName(); + return (ownerName == null ? "" : ownerName) + "::" + binding.getName(); //$NON-NLS-1$ //$NON-NLS-2$ } /** @@ -108,7 +108,7 @@ public class ASTUtil { if (first) first = false; else - str.append("::"); + str.append("::"); //$NON-NLS-1$ str.append(name); } return str.toString(); @@ -122,7 +122,7 @@ public class ASTUtil { // The regex trims leading and trailing whitespace within the expansion parameter. This is needed // so that the start of the capture group provides the proper offset into the expansion. public static final Pattern Regex_MacroExpansion = Pattern - .compile("(?s)([_a-zA-Z]\\w*)\\s*\\(\\s*(.*?)\\s*\\)\\s*"); + .compile("(?s)([_a-zA-Z]\\w*)\\s*\\(\\s*(.*?)\\s*\\)\\s*"); //$NON-NLS-1$ public static IType getBaseType(IType type) { while (type instanceof ITypeContainer) diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtFunctionCallUtil.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtFunctionCallUtil.java index a3d44028d6d..d7253c8a6ef 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtFunctionCallUtil.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtFunctionCallUtil.java @@ -60,9 +60,9 @@ import org.eclipse.cdt.core.dom.ast.IType; */ public class QtFunctionCallUtil { - private static final Pattern SignalRegex = Pattern.compile("^\\s*" + QtKeywords.SIGNAL + ".*"); + private static final Pattern SignalRegex = Pattern.compile("^\\s*" + QtKeywords.SIGNAL + ".*"); //$NON-NLS-1$ //$NON-NLS-2$ private static final Pattern MethodRegex = Pattern - .compile("^\\s*(?:" + QtKeywords.SIGNAL + '|' + QtKeywords.SLOT + ").*"); + .compile("^\\s*(?:" + QtKeywords.SIGNAL + '|' + QtKeywords.SLOT + ").*"); //$NON-NLS-1$ //$NON-NLS-2$ /** * Return true if the specified name is a QObject::connect or QObject::disconnect function diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtIncludePaths.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtIncludePaths.java index 53fbb559603..f9996d70036 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtIncludePaths.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtIncludePaths.java @@ -66,10 +66,10 @@ public class QtIncludePaths extends LanguageSettingsSerializableProvider { */ private long qtInstallHeadersModTime; - private static final String ATTR_QMAKE = "qmake"; - private static final String ATTR_QMAKE_MOD = "qmakeModification"; - private static final String ATTR_QT_INSTALL_HEADERS = "QT_INSTALL_HEADERS"; - private static final String ATTR_QT_INSTALL_HEADERS_MOD = "qtInstallHeadersModification"; + private static final String ATTR_QMAKE = "qmake"; //$NON-NLS-1$ + private static final String ATTR_QMAKE_MOD = "qmakeModification"; //$NON-NLS-1$ + private static final String ATTR_QT_INSTALL_HEADERS = "QT_INSTALL_HEADERS"; //$NON-NLS-1$ + private static final String ATTR_QT_INSTALL_HEADERS_MOD = "qtInstallHeadersModification"; //$NON-NLS-1$ /** * Create a new instance of the include path wrapper for the Qt installation for @@ -198,7 +198,7 @@ public class QtIncludePaths extends LanguageSettingsSerializableProvider { try { return Long.parseLong(value); } catch (NumberFormatException e) { - Activator.log("attribute name:" + attr + " value:" + value, e); + Activator.log("attribute name:" + attr + " value:" + value, e); //$NON-NLS-1$ //$NON-NLS-2$ return 0; } } @@ -223,7 +223,7 @@ public class QtIncludePaths extends LanguageSettingsSerializableProvider { BufferedReader reader = null; Process process = null; try { - process = ProcessFactory.getFactory().exec(new String[] { qmakePath, "-query", "QT_INSTALL_HEADERS" }); + process = ProcessFactory.getFactory().exec(new String[] { qmakePath, "-query", "QT_INSTALL_HEADERS" }); //$NON-NLS-1$ //$NON-NLS-2$ reader = new BufferedReader(new InputStreamReader(process.getInputStream())); qtInstallHeadersPath = reader.readLine(); } catch (IOException e) { diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtIncludePathsProvider.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtIncludePathsProvider.java index 2dcd0e02ffa..cdbb579134e 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtIncludePathsProvider.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtIncludePathsProvider.java @@ -44,9 +44,9 @@ public class QtIncludePathsProvider extends LanguageSettingsSerializableProvider /** * The build configuration stores the path to the qmake binary as an environment variable. */ - private static final String ENVVAR_QMAKE = "QMAKE"; + private static final String ENVVAR_QMAKE = "QMAKE"; //$NON-NLS-1$ - private static final String ELEMENT_QMAKE = "qmake"; + private static final String ELEMENT_QMAKE = "qmake"; //$NON-NLS-1$ @Override public boolean equals(Object obj) { diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtKeywords.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtKeywords.java index c9613d433bb..28de83e6b80 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtKeywords.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtKeywords.java @@ -21,30 +21,30 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction; * Declares constants related to tokens that are special in Qt applications. */ public class QtKeywords { - public static final String CONNECT = "connect"; - public static final String DISCONNECT = "disconnect"; - public static final String Q_CLASSINFO = "Q_CLASSINFO"; - public static final String Q_DECLARE_FLAGS = "Q_DECLARE_FLAGS"; - public static final String Q_ENUMS = "Q_ENUMS"; - public static final String Q_FLAGS = "Q_FLAGS"; - public static final String Q_GADGET = "Q_GADGET"; - public static final String Q_INVOKABLE = "Q_INVOKABLE"; - public static final String Q_OBJECT = "Q_OBJECT"; - public static final String Q_PROPERTY = "Q_PROPERTY"; - public static final String Q_REVISION = "Q_REVISION"; - public static final String Q_SIGNAL = "Q_SIGNAL"; - public static final String Q_SIGNALS = "Q_SIGNALS"; - public static final String Q_SLOT = "Q_SLOT"; - public static final String Q_SLOTS = "Q_SLOTS"; - public static final String QMETAMETHOD = "QMetaMethod"; - public static final String QML_ATTACHED_PROPERTIES = "qmlAttachedProperties"; - public static final String QML_REGISTER_TYPE = "qmlRegisterType"; - public static final String QML_REGISTER_UNCREATABLE_TYPE = "qmlRegisterUncreatableType"; - public static final String QOBJECT = "QObject"; - public static final String SIGNAL = "SIGNAL"; - public static final String SIGNALS = "signals"; - public static final String SLOT = "SLOT"; - public static final String SLOTS = "slots"; + public static final String CONNECT = "connect"; //$NON-NLS-1$ + public static final String DISCONNECT = "disconnect"; //$NON-NLS-1$ + public static final String Q_CLASSINFO = "Q_CLASSINFO"; //$NON-NLS-1$ + public static final String Q_DECLARE_FLAGS = "Q_DECLARE_FLAGS"; //$NON-NLS-1$ + public static final String Q_ENUMS = "Q_ENUMS"; //$NON-NLS-1$ + public static final String Q_FLAGS = "Q_FLAGS"; //$NON-NLS-1$ + public static final String Q_GADGET = "Q_GADGET"; //$NON-NLS-1$ + public static final String Q_INVOKABLE = "Q_INVOKABLE"; //$NON-NLS-1$ + public static final String Q_OBJECT = "Q_OBJECT"; //$NON-NLS-1$ + public static final String Q_PROPERTY = "Q_PROPERTY"; //$NON-NLS-1$ + public static final String Q_REVISION = "Q_REVISION"; //$NON-NLS-1$ + public static final String Q_SIGNAL = "Q_SIGNAL"; //$NON-NLS-1$ + public static final String Q_SIGNALS = "Q_SIGNALS"; //$NON-NLS-1$ + public static final String Q_SLOT = "Q_SLOT"; //$NON-NLS-1$ + public static final String Q_SLOTS = "Q_SLOTS"; //$NON-NLS-1$ + public static final String QMETAMETHOD = "QMetaMethod"; //$NON-NLS-1$ + public static final String QML_ATTACHED_PROPERTIES = "qmlAttachedProperties"; //$NON-NLS-1$ + public static final String QML_REGISTER_TYPE = "qmlRegisterType"; //$NON-NLS-1$ + public static final String QML_REGISTER_UNCREATABLE_TYPE = "qmlRegisterUncreatableType"; //$NON-NLS-1$ + public static final String QOBJECT = "QObject"; //$NON-NLS-1$ + public static final String SIGNAL = "SIGNAL"; //$NON-NLS-1$ + public static final String SIGNALS = "signals"; //$NON-NLS-1$ + public static final String SLOT = "SLOT"; //$NON-NLS-1$ + public static final String SLOTS = "slots"; //$NON-NLS-1$ /** * Returns true if the argument type is for Qt's QObject class and false otherwise. diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtMethodReference.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtMethodReference.java index 0bd322cd9e1..79b045eea85 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtMethodReference.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtMethodReference.java @@ -41,7 +41,8 @@ import org.eclipse.core.resources.IProject; public class QtMethodReference extends ASTNameReference { public static enum Type { - Signal("sender", "SIGNAL", "signal"), Slot("receiver", "SLOT", "member"); + Signal("sender", "SIGNAL", "signal"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + Slot("receiver", "SLOT", "member"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ public final String roleName; public final String macroName; diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtMethodUtil.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtMethodUtil.java index 42233f6e361..f197f946c18 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtMethodUtil.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtMethodUtil.java @@ -116,7 +116,7 @@ public class QtMethodUtil { boolean first = true; List signatures = new ArrayList<>(); qtEncSignatures = qtEncSignatures.substring(i + 1); - Pattern p = Pattern.compile("^([a-zA-Z0-9+/=]*)(@?).*$"); + Pattern p = Pattern.compile("^([a-zA-Z0-9+/=]*)(@?).*$"); //$NON-NLS-1$ while (!qtEncSignatures.isEmpty()) { Matcher m = p.matcher(qtEncSignatures); if (!m.matches()) @@ -193,21 +193,22 @@ public class QtMethodUtil { } private static String stripWS(String str) { - return str.trim().replaceAll("\\s+", " ").replaceAll(" ([\\*&,()<>]+)", "$1").replaceAll("([\\*&,()<>]+) ", - "$1"); + return str.trim().replaceAll("\\s+", " "). //$NON-NLS-1$ //$NON-NLS-2$ + replaceAll(" ([\\*&,()<>]+)", "$1"). //$NON-NLS-1$ //$NON-NLS-2$ + replaceAll("([\\*&,()<>]+) ", "$1"); //$NON-NLS-1$ //$NON-NLS-2$ } private static String asString(IASTPointerOperator ptr) { if (ptr instanceof ICPPASTReferenceOperator) - return "&"; + return "&"; //$NON-NLS-1$ if (ptr instanceof IASTPointer) { StringBuilder str = new StringBuilder(); IASTPointer astPtr = (IASTPointer) ptr; str.append('*'); if (astPtr.isConst()) - str.append(" const"); + str.append(" const"); //$NON-NLS-1$ if (astPtr.isVolatile()) - str.append(" volatile"); + str.append(" volatile"); //$NON-NLS-1$ return str.toString(); } @@ -239,7 +240,7 @@ public class QtMethodUtil { if (isConst || stripLastPtrConst) { if (!pruneConst) - result.append("const "); + result.append("const "); //$NON-NLS-1$ else { // Qt signature generation converts const value and const reference types // into simple value types. E.g., @@ -255,14 +256,14 @@ public class QtMethodUtil { if (lastPtr instanceof ICPPASTReferenceOperator) ptrs = Arrays.copyOf(ptrs, ptrs.length - 1); else if (!(lastPtr instanceof IASTPointer) || !((IASTPointer) lastPtr).isConst()) - result.append("const "); + result.append("const "); //$NON-NLS-1$ } } } // Qt does no special handling for volatile. This is likely an oversight. if (cppSpec.isVolatile()) - result.append("volatile "); + result.append("volatile "); //$NON-NLS-1$ IASTNode[] children = cppSpec.getChildren(); if (children == null || children.length <= 0) { @@ -270,8 +271,8 @@ public class QtMethodUtil { // type (without following typedefs, etc.), and then strip out all const // which has already been handled. String raw = cppSpec.toString(); - raw = raw.replaceAll("const\\s", ""); - raw = raw.replaceAll("\\sconst", ""); + raw = raw.replaceAll("const\\s", ""); //$NON-NLS-1$ //$NON-NLS-2$ + raw = raw.replaceAll("\\sconst", ""); //$NON-NLS-1$ //$NON-NLS-2$ result.append(raw); } else { for (IASTNode child : children) { @@ -294,7 +295,7 @@ public class QtMethodUtil { if (!stripLastPtrConst || i < ptrs.length - 1) result.append(asString(ptrs[i])); else - result.append(asString(ptrs[i]).replaceAll("const", "")); + result.append(asString(ptrs[i]).replaceAll("const", "")); //$NON-NLS-1$ //$NON-NLS-2$ } } @@ -332,7 +333,7 @@ public class QtMethodUtil { if (first) first = false; else - result.append(", "); + result.append(", "); //$NON-NLS-1$ append(result, child); } result.append('>'); diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtNature.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtNature.java index 9cf0f896fe0..e8f1e79ba36 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtNature.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtNature.java @@ -97,7 +97,7 @@ public class QtNature implements IProjectNature { // this doesn't happen then the PDOM could have the current version (so // nothing would trigger // an update) but no Qt content. - CCorePlugin.log(IStatus.INFO, "Reindexing " + project.getName() + " because Qt nature has been added"); + CCorePlugin.log(IStatus.INFO, "Reindexing " + project.getName() + " because Qt nature has been added"); //$NON-NLS-1$ //$NON-NLS-2$ CCorePlugin.getIndexManager().reindex(cProject); } diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/IQProperty.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/IQProperty.java index 27585a937fa..c5351c6eeae 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/IQProperty.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/IQProperty.java @@ -39,8 +39,16 @@ public interface IQProperty extends IQObject.IMember { // This enum is used when scanning Q_PROPERTY expansions, only attributes listed here // will be extracted from the expansion. This enum should be expanded with new values // as needed (based on the version of Qt). See QProperty#scanAttributes. - READ("getFunction"), WRITE("setFunction"), RESET("resetFunction"), NOTIFY("notifySignal"), REVISION("int"), - DESIGNABLE("bool"), SCRIPTABLE("bool"), STORED("bool"), USER("bool"), CONSTANT(null), FINAL(null); + READ("getFunction"), //$NON-NLS-1$ + WRITE("setFunction"), //$NON-NLS-1$ + RESET("resetFunction"), //$NON-NLS-1$ + NOTIFY("notifySignal"), //$NON-NLS-1$ + REVISION("int"), //$NON-NLS-1$ + DESIGNABLE("bool"), //$NON-NLS-1$ + SCRIPTABLE("bool"), //$NON-NLS-1$ + STORED("bool"), //$NON-NLS-1$ + USER("bool"), //$NON-NLS-1$ + CONSTANT(null), FINAL(null); /** * A string containing the C++ identifier for this attribute. diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeInfo.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeInfo.java index ce32f7e70ad..326ab0785dd 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeInfo.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeInfo.java @@ -29,9 +29,9 @@ import org.eclipse.cdt.utils.spawner.ProcessFactory; public final class QMakeInfo implements IQMakeInfo { // reg. exp. for parsing output of "qmake -query" command - public static final Pattern PATTERN_QUERY_LINE = Pattern.compile("^(\\w+):(.*)$"); + public static final Pattern PATTERN_QUERY_LINE = Pattern.compile("^(\\w+):(.*)$"); //$NON-NLS-1$ // reg. exp. for parsing output of "qmake -E file.pro" command (for QMake 3.0 only) - public static final Pattern PATTERN_EVAL_LINE = Pattern.compile("^([a-zA-Z0-9_\\.]+)\\s*=\\s*(.*)$"); + public static final Pattern PATTERN_EVAL_LINE = Pattern.compile("^([a-zA-Z0-9_\\.]+)\\s*=\\s*(.*)$"); //$NON-NLS-1$ /** * Instance that is used to present an invalid IQMakeInfo. @@ -88,7 +88,7 @@ public final class QMakeInfo implements IQMakeInfo { } // run "qmake -query" - Map qmake1 = exec(PATTERN_QUERY_LINE, extraEnv, qmakePath, "-query"); + Map qmake1 = exec(PATTERN_QUERY_LINE, extraEnv, qmakePath, "-query"); //$NON-NLS-1$ if (qmake1 == null) { return INVALID; } @@ -99,7 +99,7 @@ public final class QMakeInfo implements IQMakeInfo { // TODO - no support for pre-3.0 // for QMake version 3.0 or newer, run "qmake -E file.pro" Map qmake2 = version != null && version.getMajor() >= 3 - ? exec(PATTERN_EVAL_LINE, extraEnv, qmakePath, "-E", proPath) + ? exec(PATTERN_EVAL_LINE, extraEnv, qmakePath, "-E", proPath) //$NON-NLS-1$ : Collections.emptyMap(); return new QMakeInfo(true, qmake1, qmake2); } @@ -184,7 +184,7 @@ public final class QMakeInfo implements IQMakeInfo { */ private static Map exec(Pattern regex, String[] extraEnv, String... command) { if (command.length < 1 || !new File(command[0]).exists()) { - Activator.log("qmake: cannot run command: " + (command.length > 0 ? command[0] : "")); + Activator.log("qmake: cannot run command: " + (command.length > 0 ? command[0] : "")); //$NON-NLS-1$ //$NON-NLS-2$ return null; } BufferedReader reader = null; diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeParser.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeParser.java index b9b5485d933..658c1a533f8 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeParser.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeParser.java @@ -27,20 +27,20 @@ import org.eclipse.cdt.internal.qt.core.Activator; */ public final class QMakeParser { - public static final String KEY_QMAKE_VERSION = "QMAKE_VERSION"; - public static final String KEY_QT_VERSION = "QT_VERSION"; - public static final String KEY_QT_INSTALL_IMPORTS = "QT_INSTALL_IMPORTS"; - public static final String KEY_QT_INSTALL_QML = "QT_INSTALL_QML"; - public static final String KEY_QT_INSTALL_DOCS = "QT_INSTALL_DOCS"; - public static final String KEY_QMAKE_INTERNAL_INCLUDED_FILES = "QMAKE_INTERNAL_INCLUDED_FILES"; - public static final String KEY_SOURCES = "SOURCES"; - public static final String KEY_HEADERS = "HEADERS"; - public static final String KEY_INCLUDEPATH = "INCLUDEPATH"; - public static final String KEY_DEFINES = "DEFINES"; - public static final String KEY_RESOURCES = "RESOURCES"; - public static final String KEY_FORMS = "FORMS"; - public static final String KEY_OTHER_FILES = "OTHER_FILES"; - public static final String KEY_QML_IMPORT_PATH = "QML_IMPORT_PATH"; + public static final String KEY_QMAKE_VERSION = "QMAKE_VERSION"; //$NON-NLS-1$ + public static final String KEY_QT_VERSION = "QT_VERSION"; //$NON-NLS-1$ + public static final String KEY_QT_INSTALL_IMPORTS = "QT_INSTALL_IMPORTS"; //$NON-NLS-1$ + public static final String KEY_QT_INSTALL_QML = "QT_INSTALL_QML"; //$NON-NLS-1$ + public static final String KEY_QT_INSTALL_DOCS = "QT_INSTALL_DOCS"; //$NON-NLS-1$ + public static final String KEY_QMAKE_INTERNAL_INCLUDED_FILES = "QMAKE_INTERNAL_INCLUDED_FILES"; //$NON-NLS-1$ + public static final String KEY_SOURCES = "SOURCES"; //$NON-NLS-1$ + public static final String KEY_HEADERS = "HEADERS"; //$NON-NLS-1$ + public static final String KEY_INCLUDEPATH = "INCLUDEPATH"; //$NON-NLS-1$ + public static final String KEY_DEFINES = "DEFINES"; //$NON-NLS-1$ + public static final String KEY_RESOURCES = "RESOURCES"; //$NON-NLS-1$ + public static final String KEY_FORMS = "FORMS"; //$NON-NLS-1$ + public static final String KEY_OTHER_FILES = "OTHER_FILES"; //$NON-NLS-1$ + public static final String KEY_QML_IMPORT_PATH = "QML_IMPORT_PATH"; //$NON-NLS-1$ /** * Parses QMake output via a specified reg. exp. @@ -57,13 +57,13 @@ public final class QMakeParser { while ((line = reader.readLine()) != null) { Matcher m = regex.matcher(line); if (!m.matches() || m.groupCount() != 2) { - Activator.log("qmake: cannot decode query line '" + line + '\''); + Activator.log("qmake: cannot decode query line '" + line + '\''); //$NON-NLS-1$ } else { String key = m.group(1); String value = m.group(2); String oldValue = result.put(key, value); if (oldValue != null) - Activator.log("qmake: duplicate keys in query info '" + line + "' was '" + oldValue + '\''); + Activator.log("qmake: duplicate keys in query info '" + line + "' was '" + oldValue + '\''); //$NON-NLS-1$ //$NON-NLS-2$ } } diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeProjectInfo.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeProjectInfo.java index 63e66f69742..9641c288b84 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeProjectInfo.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeProjectInfo.java @@ -194,7 +194,7 @@ public final class QMakeProjectInfo implements IQMakeProjectInfo { Map envMap = qmakeEnvInfo != null ? qmakeEnvInfo.getEnvironment() : Collections.emptyMap(); for (Map.Entry entry : envMap.entrySet()) { - envList.add(entry.getKey() + "=" + entry.getValue()); + envList.add(entry.getKey() + "=" + entry.getValue()); //$NON-NLS-1$ } // calculates actual QMake info diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeVersion.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeVersion.java index c2c21caa007..592443e8e3c 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeVersion.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeVersion.java @@ -21,7 +21,7 @@ import org.eclipse.cdt.internal.qt.core.Activator; public final class QMakeVersion implements IQtVersion { // QMAKE_VERSION looks like 2.01a or 3.0 - private static final Pattern REGEXP = Pattern.compile("([\\d]+)\\.([\\d]+).*"); + private static final Pattern REGEXP = Pattern.compile("([\\d]+)\\.([\\d]+).*"); //$NON-NLS-1$ // parses major and minor version numbers only public static QMakeVersion create(String version) { diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QProperty.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QProperty.java index d2556b13fe6..5f5b25cb167 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QProperty.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QProperty.java @@ -22,7 +22,7 @@ public class QProperty extends AbstractQField implements IQProperty { } public void setAttribute(IQProperty.Attribute attr, String value) { - values[attr.ordinal()] = (value == null ? "" : value); + values[attr.ordinal()] = (value == null ? "" : value); //$NON-NLS-1$ } @Override diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QmlRegistration.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QmlRegistration.java index 73c8e16e6bd..fbefaa5f282 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QmlRegistration.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QmlRegistration.java @@ -42,7 +42,7 @@ public class QmlRegistration implements IQmlRegistration { this.kind = IQmlRegistration.Kind.Type; String qobjName = pdom.getQObjectName(); - this.ownerName = qobjName == null ? null : qobjName.split("::"); + this.ownerName = qobjName == null ? null : qobjName.split("::"); //$NON-NLS-1$ this.version = pdom.getVersion(); this.uri = pdom.getUri(); @@ -57,7 +57,7 @@ public class QmlRegistration implements IQmlRegistration { this.kind = IQmlRegistration.Kind.Uncreatable; String qobjName = pdom.getQObjectName(); - this.ownerName = qobjName == null ? null : qobjName.split("::"); + this.ownerName = qobjName == null ? null : qobjName.split("::"); //$NON-NLS-1$ this.version = pdom.getVersion(); this.uri = pdom.getUri(); diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QtFactory.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QtFactory.java index c77a9701708..25431cb8eb5 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QtFactory.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QtFactory.java @@ -27,18 +27,18 @@ import org.eclipse.core.runtime.CoreException; public class QtFactory { - private static final char[] QT_VERSION = "QT_VERSION".toCharArray(); + private static final char[] QT_VERSION = "QT_VERSION".toCharArray(); //$NON-NLS-1$ public static QtIndex create(IProject project) { CDTIndex cdtIndex = getCDTIndex(project); if (cdtIndex == null) { - Activator.log("could not get CDT index from project " + project.getName()); + Activator.log("could not get CDT index from project " + project.getName()); //$NON-NLS-1$ return null; } QtVersion qtVersion = cdtIndex.get(QtVersionAccessor); if (qtVersion == null) { - Activator.log("could not find Qt version in CDT index from project " + project.getName()); + Activator.log("could not find Qt version in CDT index from project " + project.getName()); //$NON-NLS-1$ return null; } @@ -79,7 +79,7 @@ public class QtFactory { // QT_VERSION looks like 0x040805 private static final Pattern Version_regex = Pattern - .compile("0x([a-fA-F\\d]{1,2})([a-fA-F\\d]{2})([a-fA-F\\d]{2})"); + .compile("0x([a-fA-F\\d]{1,2})([a-fA-F\\d]{2})([a-fA-F\\d]{2})"); //$NON-NLS-1$ public static QtVersion create(String version) { Matcher m = Version_regex.matcher(version); diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QtIndexImpl.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QtIndexImpl.java index f049cc248d2..a9572ff6ef8 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QtIndexImpl.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QtIndexImpl.java @@ -31,7 +31,7 @@ public class QtIndexImpl extends QtIndex { private final CDTIndex cdtIndex; private static final Pattern QmlTypeNameRegex = Pattern.compile( - "^(?:" + QtKeywords.QML_REGISTER_TYPE + '|' + QtKeywords.QML_REGISTER_UNCREATABLE_TYPE + ")<.*>\0(.*)$"); + "^(?:" + QtKeywords.QML_REGISTER_TYPE + '|' + QtKeywords.QML_REGISTER_UNCREATABLE_TYPE + ")<.*>\0(.*)$"); //$NON-NLS-1$ //$NON-NLS-2$ private static final IndexFilter QtLinkageFilter = new IndexFilter() { @Override diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/parser/QtParser.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/parser/QtParser.java index 49e3c975d77..89796ec4e4c 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/parser/QtParser.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/parser/QtParser.java @@ -47,7 +47,7 @@ public class QtParser extends GNUCPPSourceParser { public static ICPPASTFunctionDeclarator parseQtMethodReference(String str) { // Reject strings that have embedded line terminators. This is needed to properly check that // one that is about to be added. - if (str == null || str.contains(";")) + if (str == null || str.contains(";")) //$NON-NLS-1$ return null; QtParser parser = new QtParser(str + ';'); diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QmlTypeRegistration.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QmlTypeRegistration.java index a24cec1f743..2c7409102ad 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QmlTypeRegistration.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QmlTypeRegistration.java @@ -49,7 +49,7 @@ public class QmlTypeRegistration extends ASTDelegatedName implements IQtASTName if (simpleID == null) { IASTInitializerClause[] args = fnCall.getArguments(); simpleID = (functionInstanceBinding.getName() - + ASTTypeUtil.getArgumentListString(functionInstanceBinding.getTemplateArguments(), true) + "\0(" + + ASTTypeUtil.getArgumentListString(functionInstanceBinding.getTemplateArguments(), true) + "\0(" //$NON-NLS-1$ + asStringForName(args, 0) + ',' + asStringForName(args, 1) + ',' + asStringForName(args, 2) + ',' + asStringForName(args, 3) + ')').toCharArray(); } @@ -108,7 +108,7 @@ public class QmlTypeRegistration extends ASTDelegatedName implements IQtASTName private String asStringForName(IASTInitializerClause[] args, int index) { String arg = args.length <= index ? null : asString(args[index]); - return arg == null ? "" : arg; + return arg == null ? "" : arg; //$NON-NLS-1$ } private String getArgAsStringOrNull(int index) { diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtASTClass.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtASTClass.java index 10b15df5a7f..78a02a7328a 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtASTClass.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtASTClass.java @@ -320,7 +320,7 @@ public class QtASTClass { // and long suffixes are allowed but are excluded from the capture group. The matcher's // input string should be trimmed and have all newlines replaced. private static final Pattern QREVISION_REGEX = Pattern - .compile("^Q_REVISION\\s*\\(\\s*((?:0x)?[\\da-fA-F]+)[ulUL]*\\s*\\)$"); + .compile("^Q_REVISION\\s*\\(\\s*((?:0x)?[\\da-fA-F]+)[ulUL]*\\s*\\)$"); //$NON-NLS-1$ public Revision(int offset, Long revision) { this.offset = offset; @@ -351,7 +351,7 @@ public class QtASTClass { return null; // Trim leading and trailing whitespace and remove all newlines. - Matcher m = QREVISION_REGEX.matcher(raw.trim().replaceAll("\\s+", "")); + Matcher m = QREVISION_REGEX.matcher(raw.trim().replaceAll("\\s+", "")); //$NON-NLS-1$ //$NON-NLS-2$ if (m.matches()) { try { return new Revision(offset, Long.parseLong(m.group(1))); diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtASTVisitor.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtASTVisitor.java index 1b07883e68c..5e5221fe8b7 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtASTVisitor.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtASTVisitor.java @@ -57,12 +57,12 @@ public class QtASTVisitor extends ASTVisitor { private final IIndexSymbols symbols; private final LocationMap locationMap; - private static final Pattern expansionParamRegex = Pattern.compile("^(?:Q_ENUMS|Q_FLAGS)\\s*\\((.*)\\)$", + private static final Pattern expansionParamRegex = Pattern.compile("^(?:Q_ENUMS|Q_FLAGS)\\s*\\((.*)\\)$", //$NON-NLS-1$ Pattern.DOTALL); - private static final Pattern qualNameRegex = Pattern.compile("\\s*((?:[^\\s:]+\\s*::\\s*)*[^\\s:]+).*"); + private static final Pattern qualNameRegex = Pattern.compile("\\s*((?:[^\\s:]+\\s*::\\s*)*[^\\s:]+).*"); //$NON-NLS-1$ private static final Pattern declareFlagsRegex = Pattern - .compile("^Q_DECLARE_FLAGS\\s*\\(\\s*([^\\s]+),\\s*([^\\s]+)\\s*\\)$", Pattern.DOTALL); + .compile("^Q_DECLARE_FLAGS\\s*\\(\\s*([^\\s]+),\\s*([^\\s]+)\\s*\\)$", Pattern.DOTALL); //$NON-NLS-1$ /** * A regular expression for scanning the Q_CLASSINFO expansion and extracting the @@ -73,12 +73,12 @@ public class QtASTVisitor extends ASTVisitor { * The key must not have embedded quotes. */ private static final Pattern classInfoRegex = Pattern - .compile("^Q_CLASSINFO\\s*\\(\\s*\"([^\"]+)\"\\s*,\\s*\"(.*)\"\\s*\\)$", Pattern.DOTALL); + .compile("^Q_CLASSINFO\\s*\\(\\s*\"([^\"]+)\"\\s*,\\s*\"(.*)\"\\s*\\)$", Pattern.DOTALL); //$NON-NLS-1$ - private static final Pattern leadingWhitespaceRegex = Pattern.compile("^\\s*([^\\s].*)$"); + private static final Pattern leadingWhitespaceRegex = Pattern.compile("^\\s*([^\\s].*)$"); //$NON-NLS-1$ private static final Pattern qPropertyRegex = Pattern.compile( - "^Q_PROPERTY\\s*\\(\\s*(.+?)\\s*([a-zA-Z_][\\w]*+)(?:(?:\\s+(READ\\s+.*))|\\s*)\\s*\\)$", Pattern.DOTALL); + "^Q_PROPERTY\\s*\\(\\s*(.+?)\\s*([a-zA-Z_][\\w]*+)(?:(?:\\s+(READ\\s+.*))|\\s*)\\s*\\)$", Pattern.DOTALL); //$NON-NLS-1$ /** * A regular expression for scanning Q_PROPERTY attributes. The regular expression is built @@ -97,9 +97,9 @@ public class QtASTVisitor extends ASTVisitor { for (IQProperty.Attribute attr : IQProperty.Attribute.values()) { if (attr.ordinal() > 0) regexBuilder.append('|'); - regexBuilder.append("(:?"); + regexBuilder.append("(:?"); //$NON-NLS-1$ regexBuilder.append(attr.identifier); - regexBuilder.append(")"); + regexBuilder.append(")"); //$NON-NLS-1$ } qPropertyAttributeRegex = Pattern.compile(regexBuilder.toString()); } diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtPDOMProperty.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtPDOMProperty.java index 204b73c5ea3..a893e8efdb0 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtPDOMProperty.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtPDOMProperty.java @@ -151,7 +151,7 @@ public class QtPDOMProperty extends QtPDOMBinding { IQProperty.Attribute attr = IQProperty.Attribute.values()[attrId]; - String val = valRec == 0 ? "" : linkage.getDB().getString(valRec).getString(); + String val = valRec == 0 ? "" : linkage.getDB().getString(valRec).getString(); //$NON-NLS-1$ return new Attribute(attr, val, cppRec); } diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/provider/LinuxQtInstallProvider.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/provider/LinuxQtInstallProvider.java index fdd499aef6d..f24cd3f955d 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/provider/LinuxQtInstallProvider.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/provider/LinuxQtInstallProvider.java @@ -34,7 +34,7 @@ public class LinuxQtInstallProvider implements IQtInstallProvider { Path qmakePath = Paths.get("/usr/bin/qmake"); //$NON-NLS-1$ if (Files.exists(qmakePath)) { QtInstall install = new QtInstall(qmakePath); - install.setProperty(IToolChain.ATTR_PACKAGE, "system"); + install.setProperty(IToolChain.ATTR_PACKAGE, "system"); //$NON-NLS-1$ return Arrays.asList(install); } } diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/provider/QtInstallProvider.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/provider/QtInstallProvider.java index 5b6554d45ac..1f73d24e2ce 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/provider/QtInstallProvider.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/provider/QtInstallProvider.java @@ -42,7 +42,7 @@ public class QtInstallProvider implements IQtInstallProvider { return Files.walk(root, 2).filter((path) -> Files.exists(path.resolve(qmake))).map((path) -> { QtInstall install = new QtInstall(path.resolve(qmake)); if (isWin32 && "win32-g++".equals(install.getSpec())) { //$NON-NLS-1$ - install.setProperty(IToolChain.ATTR_PACKAGE, "qt"); //$NON-NLS-1$ //$NON-NLS-2$ + install.setProperty(IToolChain.ATTR_PACKAGE, "qt"); //$NON-NLS-1$ } return install; }).collect(Collectors.toList()); diff --git a/qt/org.eclipse.cdt.qt.ui/META-INF/MANIFEST.MF b/qt/org.eclipse.cdt.qt.ui/META-INF/MANIFEST.MF index 0e393f3f555..322730de4b7 100644 --- a/qt/org.eclipse.cdt.qt.ui/META-INF/MANIFEST.MF +++ b/qt/org.eclipse.cdt.qt.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.cdt.qt.ui;singleton:=true -Bundle-Version: 2.0.200.qualifier +Bundle-Version: 2.0.300.qualifier Bundle-Activator: org.eclipse.cdt.internal.qt.ui.Activator Bundle-Vendor: %providerName Bundle-Localization: plugin diff --git a/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/QObjectConnectCompletion.java b/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/QObjectConnectCompletion.java index 68293764986..c3d8dffb175 100644 --- a/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/QObjectConnectCompletion.java +++ b/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/QObjectConnectCompletion.java @@ -81,8 +81,8 @@ public class QObjectConnectCompletion { public final String display; public final int cursorOffset; - public static final Data SIGNAL = new Data("SIGNAL()", "SIGNAL(a)", -1); - public static final Data SLOT = new Data("SLOT()", "SLOT(a)", -1); + public static final Data SIGNAL = new Data("SIGNAL()", "SIGNAL(a)", -1); //$NON-NLS-1$ //$NON-NLS-2$ + public static final Data SLOT = new Data("SLOT()", "SLOT(a)", -1); //$NON-NLS-1$ //$NON-NLS-2$ public Data(String replacement) { this(replacement, replacement, 0); @@ -228,7 +228,7 @@ public class QObjectConnectCompletion { int parseOffset = context.getParseOffset(); int invocationOffset = context.getInvocationOffset(); - String unparsed = ""; + String unparsed = ""; //$NON-NLS-1$ try { unparsed = context.getDocument().get(parseOffset, invocationOffset - parseOffset); } catch (BadLocationException e) { diff --git a/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/QObjectDeclarationCompletion.java b/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/QObjectDeclarationCompletion.java index 473afce493c..c75451a21c2 100644 --- a/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/QObjectDeclarationCompletion.java +++ b/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/QObjectDeclarationCompletion.java @@ -32,7 +32,7 @@ import org.eclipse.ui.texteditor.ITextEditor; @SuppressWarnings("restriction") public class QObjectDeclarationCompletion { - private static final String TEMPLATE = "class ${name} : public ${QObject}\n{\nQ_OBJECT\n\n${cursor}\n};"; + private static final String TEMPLATE = "class ${name} : public ${QObject}\n{\nQ_OBJECT\n\n${cursor}\n};"; //$NON-NLS-1$ private final static TranslationUnitContextType context; static { @@ -44,7 +44,7 @@ public class QObjectDeclarationCompletion { IASTName name) { String token = name.getLastName().toString(); - if (token.isEmpty() || !"class".startsWith(token)) + if (token.isEmpty() || !"class".startsWith(token)) //$NON-NLS-1$ return null; Position position = getPosition(ctx); diff --git a/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/QPropertyCompletion.java b/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/QPropertyCompletion.java index d32bb50e356..bc39fa98868 100644 --- a/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/QPropertyCompletion.java +++ b/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/QPropertyCompletion.java @@ -30,10 +30,10 @@ import org.eclipse.jface.text.templates.TemplateContextType; @SuppressWarnings("restriction") public class QPropertyCompletion { - private static final String CONTEXT_ID = Activator.PLUGIN_ID + ".proposal.Q_PROPERTY"; + private static final String CONTEXT_ID = Activator.PLUGIN_ID + ".proposal.Q_PROPERTY"; //$NON-NLS-1$ - private static final Template QPropertyTemplate = new Template("Q_PROPERTY", "Q_PROPERTY declaration", CONTEXT_ID, - "Q_PROPERTY( ${type} ${name} READ ${accessor} ${cursor} )", true); + private static final Template QPropertyTemplate = new Template("Q_PROPERTY", "Q_PROPERTY declaration", CONTEXT_ID, //$NON-NLS-1$ //$NON-NLS-2$ + "Q_PROPERTY( ${type} ${name} READ ${accessor} ${cursor} )", true); //$NON-NLS-1$ public static Collection getAttributeProposals( ICEditorContentAssistInvocationContext context) { diff --git a/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/assist/QPropertyAttributeProposal.java b/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/assist/QPropertyAttributeProposal.java index ea0b2865fd0..133a5e09c38 100644 --- a/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/assist/QPropertyAttributeProposal.java +++ b/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/assist/QPropertyAttributeProposal.java @@ -89,8 +89,8 @@ public class QPropertyAttributeProposal { case SCRIPTABLE: case STORED: case USER: - return Arrays.asList(new QPropertyAttributeProposal("true", IMethodAttribute.BaseRelevance + 11), - new QPropertyAttributeProposal("false", IMethodAttribute.BaseRelevance + 10)); + return Arrays.asList(new QPropertyAttributeProposal("true", IMethodAttribute.BaseRelevance + 11), //$NON-NLS-1$ + new QPropertyAttributeProposal("false", IMethodAttribute.BaseRelevance + 10)); //$NON-NLS-1$ // propose appropriate methods for method-based attributes case READ: @@ -200,7 +200,7 @@ public class QPropertyAttributeProposal { sig.append(' '); if (includeClassname) { sig.append(method.getOwner().getName()); - sig.append("::"); + sig.append("::"); //$NON-NLS-1$ } sig.append(method.getName()); sig.append('('); @@ -209,7 +209,7 @@ public class QPropertyAttributeProposal { if (first) first = false; else - sig.append(", "); + sig.append(", "); //$NON-NLS-1$ String defValue = null; if (param instanceof CPPParameter) { @@ -299,12 +299,12 @@ public class QPropertyAttributeProposal { return BaseRelevance + 20; // accessor with "get" prefix is the 2nd highest rank - if (methodName.equalsIgnoreCase("get" + propertyName)) + if (methodName.equalsIgnoreCase("get" + propertyName)) //$NON-NLS-1$ return BaseRelevance + 19; // method names that include the property name anywhere are the next // most relevant - if (methodName.matches(".*(?i)" + propertyName + ".*")) + if (methodName.matches(".*(?i)" + propertyName + ".*")) //$NON-NLS-1$ //$NON-NLS-2$ return BaseRelevance + 18; // otherwise return default relevance @@ -357,12 +357,12 @@ public class QPropertyAttributeProposal { return BaseRelevance + 20; // accessor with "get" prefix is the 2nd highest rank - if (methodName.equalsIgnoreCase("set" + propertyName)) + if (methodName.equalsIgnoreCase("set" + propertyName)) //$NON-NLS-1$ return BaseRelevance + 19; // method names that include the property name anywhere are the next // most relevant - if (methodName.matches(".*(?i)" + propertyName + ".*")) + if (methodName.matches(".*(?i)" + propertyName + ".*")) //$NON-NLS-1$ //$NON-NLS-2$ return BaseRelevance + 18; // otherwise return default relevance @@ -408,12 +408,12 @@ public class QPropertyAttributeProposal { return 0; // accessor with "reet" prefix is the most relevant - if (methodName.equalsIgnoreCase("reset" + propertyName)) + if (methodName.equalsIgnoreCase("reset" + propertyName)) //$NON-NLS-1$ return BaseRelevance + 20; // method names that include the property name anywhere are the next // most relevant - if (methodName.matches(".*(?i)" + propertyName + ".*")) + if (methodName.matches(".*(?i)" + propertyName + ".*")) //$NON-NLS-1$ //$NON-NLS-2$ return BaseRelevance + 18; // otherwise return default relevance diff --git a/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/assist/QPropertyExpansion.java b/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/assist/QPropertyExpansion.java index 4b7c1519991..2e49be707d7 100644 --- a/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/assist/QPropertyExpansion.java +++ b/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/assist/QPropertyExpansion.java @@ -73,15 +73,15 @@ public class QPropertyExpansion { private static final Pattern TYPENAME_REGEX; static { StringBuilder regexBuilder = new StringBuilder(); - regexBuilder.append("^(?:Q_PROPERTY\\s*\\()?\\s*(.*?)(\\s+)(?:"); + regexBuilder.append("^(?:Q_PROPERTY\\s*\\()?\\s*(.*?)(\\s+)(?:"); //$NON-NLS-1$ for (IQProperty.Attribute attr : IQProperty.Attribute.values()) { if (attr.ordinal() > 0) regexBuilder.append('|'); - regexBuilder.append("(?:"); + regexBuilder.append("(?:"); //$NON-NLS-1$ regexBuilder.append(attr.identifier); - regexBuilder.append(")"); + regexBuilder.append(")"); //$NON-NLS-1$ } - regexBuilder.append(").*$"); + regexBuilder.append(").*$"); //$NON-NLS-1$ TYPENAME_REGEX = Pattern.compile(regexBuilder.toString()); } @@ -295,12 +295,12 @@ public class QPropertyExpansion { // Otherwise create a template where the content depends on the type of the attribute's parameter. String display = attribute.identifier + ' ' + attribute.paramName; String replacement = attribute.identifier; - if ("bool".equals(attribute.paramName)) - replacement += " ${true}"; - else if ("int".equals(attribute.paramName)) - replacement += " ${0}"; + if ("bool".equals(attribute.paramName)) //$NON-NLS-1$ + replacement += " ${true}"; //$NON-NLS-1$ + else if ("int".equals(attribute.paramName)) //$NON-NLS-1$ + replacement += " ${0}"; //$NON-NLS-1$ else if (attribute.paramName != null) - replacement += " ${" + attribute.paramName + '}'; + replacement += " ${" + attribute.paramName + '}'; //$NON-NLS-1$ return templateProposal(contextId, context, display, replacement, relevance); } @@ -308,7 +308,7 @@ public class QPropertyExpansion { private static ICompletionProposal templateProposal(String contextId, ICEditorContentAssistInvocationContext context, String display, String replacement, int relevance) { - Template template = new Template(display, "Q_PROPERTY declaration parameter", contextId, replacement, true); + Template template = new Template(display, "Q_PROPERTY declaration parameter", contextId, replacement, true); //$NON-NLS-1$ TemplateContextType ctxType = new CContextType(); ctxType.setId(contextId); @@ -366,10 +366,10 @@ public class QPropertyExpansion { } if (prefix != null) { - if (attr.identifier.startsWith(prefix) && (!expansion.matches(".*\\s+" + attr.identifier + "\\s+.*") + if (attr.identifier.startsWith(prefix) && (!expansion.matches(".*\\s+" + attr.identifier + "\\s+.*") //$NON-NLS-1$ //$NON-NLS-2$ || attr.identifier.equals(currIdentifier.ident))) unspecifiedAttributes.add(new Attribute(attr)); - } else if (!expansion.matches(".*\\s+" + attr.identifier + "\\s+.*")) + } else if (!expansion.matches(".*\\s+" + attr.identifier + "\\s+.*")) //$NON-NLS-1$ //$NON-NLS-2$ unspecifiedAttributes.add(new Attribute(attr)); } @@ -417,7 +417,7 @@ public class QPropertyExpansion { if (cursor >= expansion.length()) return expansion + '|'; if (cursor < 0) - return "|" + expansion; + return "|" + expansion; //$NON-NLS-1$ return expansion.substring(0, cursor) + '|' + expansion.substring(cursor); }