Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMickael Istria2019-08-18 14:56:29 -0400
committerMickael Istria2019-08-18 15:34:35 -0400
commitc0daf761389a45a439c0cf3c2af1c68b22894308 (patch)
tree17908581f08b863f7b09cdd9cda44ec1f5d75e6a
parente4cd3301424512368c53114fd477bbb3503adc73 (diff)
downloadeclipse.platform.text-c0daf761389a45a439c0cf3c2af1c68b22894308.tar.gz
eclipse.platform.text-c0daf761389a45a439c0cf3c2af1c68b22894308.tar.xz
eclipse.platform.text-c0daf761389a45a439c0cf3c2af1c68b22894308.zip
Bug 550101 - [Quicksearch] Strings not externalizedI20190818-1800
Change-Id: I6dc5042b7b5a59a53114935642cffb2fa6e5dad6 Signed-off-by: Mickael Istria <mistria@redhat.com>
-rw-r--r--org.eclipse.text.quicksearch/.settings/org.eclipse.jdt.core.prefs108
-rw-r--r--org.eclipse.text.quicksearch/plugin.properties3
-rw-r--r--org.eclipse.text.quicksearch/plugin.xml41
-rw-r--r--org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/LineItem.java2
-rw-r--r--org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/QuickTextQuery.java14
-rw-r--r--org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/QuickTextSearcher.java5
-rw-r--r--org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/ResourceWalker.java5
-rw-r--r--org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/pathmatch/ResourceMatchers.java14
-rw-r--r--org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/preferences/QuickSearchPreferences.java14
-rw-r--r--org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/priority/DefaultPriorityFunction.java12
-rw-r--r--org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/priority/PrioriTree.java8
-rw-r--r--org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/ui/Messages.java9
-rw-r--r--org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/ui/QuickSearchDialog.java64
-rw-r--r--org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/ui/QuickSearchHandler.java6
-rw-r--r--org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/ui/messages.properties10
-rw-r--r--org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/util/LineReader.java2
16 files changed, 223 insertions, 94 deletions
diff --git a/org.eclipse.text.quicksearch/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.text.quicksearch/.settings/org.eclipse.jdt.core.prefs
index 0c68a61dc..c23717a47 100644
--- a/org.eclipse.text.quicksearch/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.text.quicksearch/.settings/org.eclipse.jdt.core.prefs
@@ -1,7 +1,115 @@
eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnull.secondary=
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary=
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.APILeak=warning
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
+org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=error
+org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
+org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning
+org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled
+org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unstableAutoModuleName=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameter=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8
diff --git a/org.eclipse.text.quicksearch/plugin.properties b/org.eclipse.text.quicksearch/plugin.properties
index a2292cbc5..2bffb3fa9 100644
--- a/org.eclipse.text.quicksearch/plugin.properties
+++ b/org.eclipse.text.quicksearch/plugin.properties
@@ -14,3 +14,6 @@
pluginName= Quick Search
providerName= Eclipse.org
searchMenu.label= Se&arch
+quickSearch.label= Quick Search
+quickSearch.ellipsis= Quick Search...
+quickSearch.tooltip=Search for a text pattern in the workspace
diff --git a/org.eclipse.text.quicksearch/plugin.xml b/org.eclipse.text.quicksearch/plugin.xml
index 2ea1d4123..f4b036856 100644
--- a/org.eclipse.text.quicksearch/plugin.xml
+++ b/org.eclipse.text.quicksearch/plugin.xml
@@ -14,14 +14,13 @@
<?eclipse version="3.4"?>
<plugin>
- <extension
- point="org.eclipse.ui.commands">
+ <extension point="org.eclipse.ui.commands">
<category
- name="Quick Search"
+ name="%quickSearch.label"
id="org.eclipse.text.quicksearch.commands.category">
</category>
<command
- name="Quick Search"
+ name="%quickSearch.label"
categoryId="org.eclipse.text.quicksearch.commands.category"
id="org.eclipse.text.quicksearch.commands.quicksearchCommand">
</command>
@@ -32,11 +31,10 @@
So we have to use the old mechanism using actionSets
See here https://stackoverflow.com/questions/7113380/how-to-extend-the-source-menu-in-eclipse-or-what-is-its-locationuri
-->
- <extension
- point="org.eclipse.ui.actionSets">
+ <extension point="org.eclipse.ui.actionSets">
<actionSet
- label="Quick Search"
+ label="%quickSearch.label"
visible="true"
id="org.eclipse.text.quicksearch.actionSet">
@@ -65,36 +63,34 @@
id="org.eclipse.text.quicksearch.commands.quicksearchAction"
class="org.eclipse.text.quicksearch.internal.ui.QuickSearchAction"
definitionId="org.eclipse.text.quicksearch.commands.quicksearchCommand"
- label="Quick Search..."
+ label="%quickSearch.ellipsis"
menubarPath="org.eclipse.search.menu/extraSearchGroup"
- tooltip="Search for a text pattern in the workspace">
+ tooltip="%quickSearch.tooltip">
</action>
</actionSet>
</extension>
-<!-- This doesn't work unfortunately...
- <extension point="org.eclipse.ui.menus">
+ <!-- This doesn't work unfortunately...
+ <extension point="org.eclipse.ui.menus">
<menuContribution locationURI="menu:navigate?after=additions">
<command commandId="org.eclipse.text.quicksearch.commands.quicksearchCommand"
- label="Quick Search"
+ label="%quickSearch.label"
mnemonic="Q">
</command>
</menuContribution>
</extension> -->
-
+
<!-- Allthough we have an action defined, it seems the action isn't always working. So for good measure
also define a handler -->
- <extension
- point="org.eclipse.ui.handlers">
+ <extension point="org.eclipse.ui.handlers">
<handler
commandId="org.eclipse.text.quicksearch.commands.quicksearchCommand"
class="org.eclipse.text.quicksearch.internal.ui.QuickSearchHandler">
</handler>
</extension>
-
-<!-- Define keybinding -->
- <extension
- point="org.eclipse.ui.bindings">
+
+ <!-- Define keybinding -->
+ <extension point="org.eclipse.ui.bindings">
<key
commandId="org.eclipse.text.quicksearch.commands.quicksearchCommand"
contextId="org.eclipse.ui.contexts.window"
@@ -103,12 +99,11 @@
</key>
</extension>
-<extension
- point = "org.eclipse.ui.preferencePages">
+ <extension point = "org.eclipse.ui.preferencePages">
<page id="org.eclipse.text.quicksearch.PreferencesPage"
class="org.eclipse.text.quicksearch.internal.ui.QuickSearchPreferencesPage"
- name="Quick Search">
+ name="%quickSearch.label">
</page>
-</extension>
+ </extension>
</plugin>
diff --git a/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/LineItem.java b/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/LineItem.java
index 6867e96d9..018cbae85 100644
--- a/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/LineItem.java
+++ b/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/LineItem.java
@@ -39,7 +39,7 @@ public class LineItem {
@Override
public String toString() {
- return lineNumber + ": " + line + " (" +f.getProjectRelativePath() + ")";
+ return lineNumber + ": " + line + " (" +f.getProjectRelativePath() + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
public String getText() {
diff --git a/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/QuickTextQuery.java b/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/QuickTextQuery.java
index e7ff3b1d5..29f11a853 100644
--- a/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/QuickTextQuery.java
+++ b/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/QuickTextQuery.java
@@ -52,7 +52,7 @@ public class QuickTextQuery {
* A query that matches anything.
*/
public QuickTextQuery() {
- this("", true);
+ this("", true); //$NON-NLS-1$
}
public QuickTextQuery(String substring, boolean caseSensitive) {
@@ -75,11 +75,11 @@ public class QuickTextQuery {
switch (c) {
case '?':
appendSegment(segment, regexp);
- regexp.append(".");
+ regexp.append('.');
break;
case '*':
appendSegment(segment, regexp);
- regexp.append(".*");
+ regexp.append(".*"); //$NON-NLS-1$
break;
case '\\':
if (pos<len) {
@@ -146,8 +146,8 @@ public class QuickTextQuery {
* whether one pattern is sub-pattern of the other.
*/
private String normalize(String pat, boolean caseSensitive) {
- if (pat.endsWith("\\")) {
- pat = pat + "\\";
+ if (pat.endsWith("\\")) { //$NON-NLS-1$
+ pat = pat + "\\"; //$NON-NLS-1$
}
if (!caseSensitive) {
pat = pat.toLowerCase();
@@ -182,12 +182,12 @@ public class QuickTextQuery {
* of the search.
*/
public boolean isTrivial() {
- return "".equals(this.orgPattern);
+ return "".equals(this.orgPattern); //$NON-NLS-1$
}
@Override
public String toString() {
- return "QTQuery("+orgPattern+", "+(caseSensitive?"caseSens":"caseInSens")+")";
+ return "QTQuery("+orgPattern+", "+(caseSensitive?"caseSens":"caseInSens")+")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
}
public List<TextRange> findAll(String text) {
diff --git a/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/QuickTextSearcher.java b/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/QuickTextSearcher.java
index d8a23e1cc..735553954 100644
--- a/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/QuickTextSearcher.java
+++ b/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/QuickTextSearcher.java
@@ -27,6 +27,7 @@ import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.text.quicksearch.internal.core.pathmatch.ResourceMatcher;
import org.eclipse.text.quicksearch.internal.core.pathmatch.ResourceMatchers;
import org.eclipse.text.quicksearch.internal.core.priority.PriorityFunction;
+import org.eclipse.text.quicksearch.internal.ui.Messages;
import org.eclipse.text.quicksearch.internal.util.LightSchedulingRule;
import org.eclipse.text.quicksearch.internal.util.LineReader;
@@ -43,7 +44,7 @@ public class QuickTextSearcher {
/**
* Scheduling rule used by Jobs that work on the matches collection.
*/
- private ISchedulingRule matchesRule = new LightSchedulingRule("QuickSearchMatchesRule");
+ private ISchedulingRule matchesRule = new LightSchedulingRule("QuickSearchMatchesRule"); //$NON-NLS-1$
private SearchInFilesWalker walker = null;
private IncrementalUpdateJob incrementalUpdate;
@@ -189,7 +190,7 @@ public class QuickTextSearcher {
*/
private class IncrementalUpdateJob extends Job {
public IncrementalUpdateJob() {
- super("Update matches");
+ super(Messages.QuickTextSearch_updateMatchesJob);
this.setRule(matchesRule);
//This job isn't started automatically. It should be schedule every time
// there's a 'newQuery' set by the user/client.
diff --git a/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/ResourceWalker.java b/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/ResourceWalker.java
index e3535a011..5d592e9b8 100644
--- a/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/ResourceWalker.java
+++ b/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/ResourceWalker.java
@@ -26,6 +26,7 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.text.quicksearch.internal.core.priority.DefaultPriorityFunction;
import org.eclipse.text.quicksearch.internal.core.priority.PriorityFunction;
+import org.eclipse.text.quicksearch.internal.ui.Messages;
import org.eclipse.text.quicksearch.internal.ui.QuickSearchActivator;
/**
@@ -53,7 +54,7 @@ public abstract class ResourceWalker extends Job {
}
public ResourceWalker() {
- super("QuickSearch");
+ super(Messages.QuickSearchDialog_title);
init();
}
@@ -185,7 +186,7 @@ public abstract class ResourceWalker extends Job {
* in 'mid-run'.
*/
public void setPriorityFun(PriorityFunction f) {
- Assert.isNotNull(f, "PriorityFunction should never be null");
+ Assert.isNotNull(f, "PriorityFunction should never be null"); //$NON-NLS-1$
this.prioritFun = f;
}
diff --git a/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/pathmatch/ResourceMatchers.java b/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/pathmatch/ResourceMatchers.java
index 46b1288dd..841bd19ec 100644
--- a/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/pathmatch/ResourceMatchers.java
+++ b/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/pathmatch/ResourceMatchers.java
@@ -22,7 +22,7 @@ public class ResourceMatchers {
public static ResourceMatcher ANY = new ResourceMatcher() {
@Override
public String toString() {
- return "ResourceMatcher(ANY)";
+ return "ResourceMatcher(ANY)"; //$NON-NLS-1$
}
@Override
public boolean matches(IResource resource) {
@@ -35,7 +35,7 @@ public class ResourceMatchers {
if (text.isEmpty()) {
return ANY;
}
- String[] paths = text.split(",");
+ String[] paths = text.split(","); //$NON-NLS-1$
if (paths.length==1) {
return path(paths[0]);
} else {
@@ -52,14 +52,14 @@ public class ResourceMatchers {
@Override
public String toString() {
- StringBuilder buf = new StringBuilder("ResourceMatcher(");
+ StringBuilder buf = new StringBuilder("ResourceMatcher("); //$NON-NLS-1$
for (int i = 0; i < matchers.length; i++) {
if (i>0) {
- buf.append(", ");
+ buf.append(", "); //$NON-NLS-1$
}
buf.append(matchers[i]);
}
- buf.append(")");
+ buf.append(")"); //$NON-NLS-1$
return buf.toString();
}
@@ -76,8 +76,8 @@ public class ResourceMatchers {
}
private static ResourceMatcher path(String _pat) {
- if (!_pat.startsWith("/") && !_pat.startsWith("**/")) {
- _pat = "**/"+_pat;
+ if (!_pat.startsWith("/") && !_pat.startsWith("**/")) { //$NON-NLS-1$ //$NON-NLS-2$
+ _pat = "**/"+_pat; //$NON-NLS-1$
}
final String pat = _pat;
TokenizedPattern matcher = new TokenizedPattern(pat);
diff --git a/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/preferences/QuickSearchPreferences.java b/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/preferences/QuickSearchPreferences.java
index aff2ec923..5123d1429 100644
--- a/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/preferences/QuickSearchPreferences.java
+++ b/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/preferences/QuickSearchPreferences.java
@@ -28,10 +28,10 @@ import org.eclipse.text.quicksearch.internal.util.LineReader;
public class QuickSearchPreferences {
//Keys used to fetch 'raw' preferences values from the preferences store.
- public static final String IGNORED_EXTENSIONS = "ignored.extensions";
- public static final String IGNORED_NAMES = "ignored.names";
- public static final String IGNORED_PREFIXES = "ignored.prefixes";
- public static final String MAX_LINE_LEN = "LineReader.MAX_LINE_LEN";
+ public static final String IGNORED_EXTENSIONS = "ignored.extensions"; //$NON-NLS-1$
+ public static final String IGNORED_NAMES = "ignored.names"; //$NON-NLS-1$
+ public static final String IGNORED_PREFIXES = "ignored.prefixes"; //$NON-NLS-1$
+ public static final String MAX_LINE_LEN = "LineReader.MAX_LINE_LEN"; //$NON-NLS-1$
private static boolean initializedDefaults;
private IPreferenceStore store;
@@ -73,11 +73,11 @@ public class QuickSearchPreferences {
* dropped.
*/
private String[] parseStringList(String raw) {
- String[] elements = raw.split("[,\n]");
+ String[] elements = raw.split("[,\n]"); //$NON-NLS-1$
List<String> list = new ArrayList<String>(elements.length);
for (String e : elements) {
e = e.trim();
- if (!"".equals(e)) {
+ if (!e.isEmpty()) {
list.add(e);
}
}
@@ -101,7 +101,7 @@ public class QuickSearchPreferences {
StringBuilder encoded = new StringBuilder();
for (int i = 0; i < strings.length; i++) {
if (i>0) {
- encoded.append(", ");
+ encoded.append(", "); //$NON-NLS-1$
}
encoded.append(strings[i]);
}
diff --git a/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/priority/DefaultPriorityFunction.java b/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/priority/DefaultPriorityFunction.java
index cd8e72f7e..3eac6bc47 100644
--- a/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/priority/DefaultPriorityFunction.java
+++ b/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/priority/DefaultPriorityFunction.java
@@ -43,9 +43,11 @@ public class DefaultPriorityFunction extends PriorityFunction {
* be ignored.
*/
public String[] ignoredExtensions = {
- "~", ".bin", ".bmp", ".class", ".com", ".doc", ".docx", ".exe", ".gif",
- ".jar", ".jpg", ".jpeg", ".odp", ".odt", ".p12", ".pdf", ".png",
- ".ppt", ".pptx", ".psd", ".svg", ".xls", ".xlsx", ".zip"
+ "~", ".bin", ".bmp", ".class", ".com", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+ ".doc", ".docx", ".exe", ".gif", ".jar", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+ ".jpg", ".jpeg", ".odp", ".odt", ".p12", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+ ".pdf", ".png", ".ppt", ".pptx", ".psd", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+ ".svg", ".xls", ".xlsx", ".zip" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
};
/**
@@ -53,7 +55,7 @@ public class DefaultPriorityFunction extends PriorityFunction {
* starts with any of these Strings to be ignored.
*/
public String[] ignoredPrefixes = {
- "."
+ "." //$NON-NLS-1$
};
/**
@@ -61,7 +63,7 @@ public class DefaultPriorityFunction extends PriorityFunction {
* Strings to be ignored.
*/
public String[] ignoredNames = {
- "bin", "build", "target"
+ "bin", "build", "target" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
};
public Set<IResource> ignoredResources = null;
diff --git a/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/priority/PrioriTree.java b/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/priority/PrioriTree.java
index 812cb795a..76e0f8e85 100644
--- a/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/priority/PrioriTree.java
+++ b/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/priority/PrioriTree.java
@@ -171,7 +171,7 @@ public class PrioriTree extends DefaultPriorityFunction {
//ancestor node found
result = node.childPriority;
}
- debug("Priority for "+r.getFullPath() + " = " + result);
+ debug("Priority for "+r.getFullPath() + " = " + result); //$NON-NLS-1$ //$NON-NLS-2$
return result;
}
@@ -208,12 +208,12 @@ public class PrioriTree extends DefaultPriorityFunction {
* For debugging purposes. Dumps tree data onto System.out
*/
public void dump() {
- dump("/", 0);
+ dump("/", 0); //$NON-NLS-1$
}
private void dump(String name, int indent) {
indent(indent);
- System.out.println(name + " : " +priority);
+ System.out.println(name + " : " +priority); //$NON-NLS-1$
if (children!=null) {
for (Entry<String, PrioriTree> c : children.entrySet()) {
c.getValue().dump(c.getKey(), indent+1);
@@ -223,7 +223,7 @@ public class PrioriTree extends DefaultPriorityFunction {
private void indent(int i) {
for (int j = 0; j < i; j++) {
- System.out.print(" ");
+ System.out.print(" "); //$NON-NLS-1$
}
}
diff --git a/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/ui/Messages.java b/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/ui/Messages.java
index e62a02509..7f92dfc60 100644
--- a/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/ui/Messages.java
+++ b/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/ui/Messages.java
@@ -31,6 +31,15 @@ public class Messages extends NLS {
public static String QuickSearchDialog_line;
public static String QuickSearchDialog_text;
public static String QuickSearchDialog_path;
+ public static String QuickSearchDialog_RefreshJob;
+ public static String QuickSearchDialog_searching;
+ public static String QuickSearchDialog_keepOpen_toggle;
+ public static String QuickSearchDialog_caseSensitive_toggle;
+ public static String QuickSearchDialog_title;
+ public static String QuickSearchDialog_caseSensitive_label;
+ public static String QuickSearchDialog_caseInsensitive_label;
+ public static String QuickSearchDialog_patternHint;
+ public static String QuickTextSearch_updateMatchesJob;
static {
// initialize resource bundle
diff --git a/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/ui/QuickSearchDialog.java b/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/ui/QuickSearchDialog.java
index d3d332a1b..785e7fdc5 100644
--- a/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/ui/QuickSearchDialog.java
+++ b/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/ui/QuickSearchDialog.java
@@ -26,6 +26,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
+import java.util.Objects;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
@@ -63,6 +64,7 @@ import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.TableViewerColumn;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerCell;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.search.internal.ui.text.EditorOpener;
import org.eclipse.swt.SWT;
import org.eclipse.swt.accessibility.ACC;
@@ -139,7 +141,7 @@ public class QuickSearchDialog extends SelectionStatusDialog {
public static final Styler HIGHLIGHT_STYLE = org.eclipse.search.internal.ui.text.DecoratingFileSearchLabelProvider.HIGHLIGHT_STYLE;
- private UIJob refreshJob = new UIJob("Refresh") {
+ private UIJob refreshJob = new UIJob(Messages.QuickSearchDialog_RefreshJob) {
@Override
public IStatus runInUIThread(IProgressMonitor monitor) {
refreshWidgets();
@@ -169,7 +171,7 @@ public class QuickSearchDialog extends SelectionStatusDialog {
* Job that shows a simple busy indicator while a search is active.
* The job must be scheduled when a search starts/resumes.
*/
- private UIJob progressJob = new UIJob("Refresh") {
+ private UIJob progressJob = new UIJob(Messages.QuickSearchDialog_RefreshJob) {
int animate = 0; // number of dots to display.
protected String dots(int animate) {
@@ -186,7 +188,7 @@ public class QuickSearchDialog extends SelectionStatusDialog {
if (path.length()<=30) {
return path;
}
- return "..."+path.substring(path.length()-30);
+ return "..."+path.substring(path.length()-30); //$NON-NLS-1$
}
return dots(animate);
}
@@ -195,9 +197,9 @@ public class QuickSearchDialog extends SelectionStatusDialog {
public IStatus runInUIThread(IProgressMonitor mon) {
if (!mon.isCanceled() && progressLabel!=null && !progressLabel.isDisposed()) {
if (searcher==null || searcher.isDone()) {
- progressLabel.setText("");
+ progressLabel.setText(""); //$NON-NLS-1$
} else {
- progressLabel.setText("Searching"+currentFileInfo(searcher.getCurrentFile(), animate));
+ progressLabel.setText(NLS.bind(Messages.QuickSearchDialog_searching, currentFileInfo(searcher.getCurrentFile(), animate)));
animate = (animate+1)%4;
this.schedule(333);
}
@@ -211,9 +213,9 @@ public class QuickSearchDialog extends SelectionStatusDialog {
public void update(ViewerCell cell) {
LineItem item = (LineItem) cell.getElement();
if (item!=null) {
- cell.setText(""+item.getLineNumber());
+ cell.setText(Integer.toString(item.getLineNumber()));
} else {
- cell.setText("?");
+ cell.setText("?"); //$NON-NLS-1$
}
cell.setImage(getBlankImage());
};
@@ -231,7 +233,7 @@ public class QuickSearchDialog extends SelectionStatusDialog {
cell.setText(text.getString());
cell.setStyleRanges(text.getStyleRanges());
} else {
- cell.setText("");
+ cell.setText(""); //$NON-NLS-1$
cell.setStyleRanges(null);
}
cell.setImage(getBlankImage());
@@ -260,16 +262,16 @@ public class QuickSearchDialog extends SelectionStatusDialog {
IPath path = item.getFile().getFullPath();
String name = path.lastSegment();
String dir = path.removeLastSegments(1).toString();
- if (dir.startsWith("/")) {
+ if (dir.startsWith("/")) { //$NON-NLS-1$
dir = dir.substring(1);
}
- cell.setText(name + " - " + dir);
+ cell.setText(name + " - " + dir); //$NON-NLS-1$
StyleRange[] styleRanges = new StyleRange[] {
new StyleRange(name.length(), dir.length()+3, GREY, null)
};
cell.setStyleRanges(styleRanges);
} else {
- cell.setText("");
+ cell.setText(""); //$NON-NLS-1$
cell.setStyleRanges(null);
}
cell.setImage(getBlankImage());
@@ -293,21 +295,21 @@ public class QuickSearchDialog extends SelectionStatusDialog {
// };
};
- private static final String DIALOG_SETTINGS = QuickSearchDialog.class.getName()+".DIALOG_SETTINGS";
+ private static final String DIALOG_SETTINGS = QuickSearchDialog.class.getName()+".DIALOG_SETTINGS"; //$NON-NLS-1$
private static final String DIALOG_BOUNDS_SETTINGS = "DialogBoundsSettings"; //$NON-NLS-1$
private static final String DIALOG_HEIGHT = "DIALOG_HEIGHT"; //$NON-NLS-1$
private static final String DIALOG_WIDTH = "DIALOG_WIDTH"; //$NON-NLS-1$
- private static final String DIALOG_COLUMNS = "COLUMN_WIDTHS";
- private static final String DIALOG_SASH_WEIGHTS = "SASH_WEIGHTS";
+ private static final String DIALOG_COLUMNS = "COLUMN_WIDTHS"; //$NON-NLS-1$
+ private static final String DIALOG_SASH_WEIGHTS = "SASH_WEIGHTS"; //$NON-NLS-1$
- private static final String DIALOG_LAST_QUERY = "LAST_QUERY";
- private static final String DIALOG_PATH_FILTER = "PATH_FILTER";
- private static final String CASE_SENSITIVE = "CASE_SENSITIVE";
+ private static final String DIALOG_LAST_QUERY = "LAST_QUERY"; //$NON-NLS-1$
+ private static final String DIALOG_PATH_FILTER = "PATH_FILTER"; //$NON-NLS-1$
+ private static final String CASE_SENSITIVE = "CASE_SENSITIVE"; //$NON-NLS-1$
private static final boolean CASE_SENSITIVE_DEFAULT = true;
- private static final String KEEP_OPEN = "KEEP_OPEN";
+ private static final String KEEP_OPEN = "KEEP_OPEN"; //$NON-NLS-1$
private static final boolean KEEP_OPEN_DEFAULT = false;
/**
@@ -391,7 +393,7 @@ public class QuickSearchDialog extends SelectionStatusDialog {
this.window = window;
setShellStyle(SWT.CLOSE | SWT.MODELESS | SWT.BORDER | SWT.TITLE | SWT.RESIZE);
setBlockOnOpen(false);
- this.setTitle("Quick Search");
+ this.setTitle(Messages.QuickSearchDialog_title);
this.context = new QuickSearchContext(window);
this.multi = false;
contentProvider = new ContentProvider();
@@ -418,7 +420,7 @@ public class QuickSearchDialog extends SelectionStatusDialog {
if (initialPatternText==null) {
String lastSearch = settings.get(DIALOG_LAST_QUERY);
if (lastSearch==null) {
- lastSearch = "";
+ lastSearch = ""; //$NON-NLS-1$
}
pattern.setText(lastSearch);
pattern.setSelection(0, lastSearch.length());
@@ -461,7 +463,7 @@ public class QuickSearchDialog extends SelectionStatusDialog {
private class ToggleKeepOpenAction extends Action {
public ToggleKeepOpenAction(IDialogSettings settings) {
super(
- "Keep Open",
+ Messages.QuickSearchDialog_keepOpen_toggle,
IAction.AS_CHECK_BOX
);
if (settings.get(KEEP_OPEN)==null) {
@@ -482,7 +484,7 @@ public class QuickSearchDialog extends SelectionStatusDialog {
public ToggleCaseSensitiveAction(IDialogSettings settings) {
super(
- "Case Sensitive",
+ Messages.QuickSearchDialog_caseSensitive_toggle,
IAction.AS_CHECK_BOX
);
if (settings.get(CASE_SENSITIVE)==null) {
@@ -547,7 +549,7 @@ public class QuickSearchDialog extends SelectionStatusDialog {
if (table.getColumnCount()>0) {
String[] columnWidths = new String[table.getColumnCount()];
for (int i = 0; i < columnWidths.length; i++) {
- columnWidths[i] = ""+table.getColumn(i).getWidth();
+ columnWidths[i] = Integer.toString(table.getColumn(i).getWidth());
}
settings.put(DIALOG_COLUMNS, columnWidths);
}
@@ -555,7 +557,7 @@ public class QuickSearchDialog extends SelectionStatusDialog {
int[] w = sashForm.getWeights();
String[] ws = new String[w.length];
for (int i = 0; i < ws.length; i++) {
- ws[i] = ""+w[i];
+ ws[i] = Integer.toString(w[i]);
}
settings.put(DIALOG_SASH_WEIGHTS, ws);
}
@@ -597,8 +599,9 @@ public class QuickSearchDialog extends SelectionStatusDialog {
}
private void refreshHeaderLabel() {
- String msg = toggleCaseSensitiveAction.isChecked() ? "Case SENSITIVE" : "Case INSENSITIVE";
- msg += " Pattern (? = any character, * = any string)";
+ String msg = toggleCaseSensitiveAction.isChecked() ? Messages.QuickSearchDialog_caseSensitive_label : Messages.QuickSearchDialog_caseInsensitive_label;
+ msg += ' ';
+ msg += Messages.QuickSearchDialog_patternHint;
headerLabel.setText(msg);
}
@@ -960,7 +963,7 @@ public class QuickSearchDialog extends SelectionStatusDialog {
}
IStructuredSelection sel = (IStructuredSelection) list.getSelection();
if (sel==null || sel.isEmpty()) {
- details.setText("");
+ details.setText(""); //$NON-NLS-1$
} else {
//Not empty selection
int numLines = computeLines();
@@ -991,7 +994,7 @@ public class QuickSearchDialog extends SelectionStatusDialog {
}
}
//empty selection or some error:
- details.setText("");
+ details.setText(""); //$NON-NLS-1$
}
}
@@ -1267,7 +1270,7 @@ public class QuickSearchDialog extends SelectionStatusDialog {
* @return status of the dialog to be set
*/
protected IStatus validateItem(Object item) {
- return new Status(IStatus.OK, QuickSearchActivator.PLUGIN_ID, "fine");
+ return Status.OK_STATUS;
}
/**
@@ -1350,8 +1353,7 @@ public class QuickSearchDialog extends SelectionStatusDialog {
* @return name of the given item
*/
public String getElementName(Object item) {
- return ""+item;
-// return (String)item; // Assuming the items are strings for now
+ return Objects.toString(item);
}
/**
diff --git a/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/ui/QuickSearchHandler.java b/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/ui/QuickSearchHandler.java
index 166ea6416..1d906b1bc 100644
--- a/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/ui/QuickSearchHandler.java
+++ b/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/ui/QuickSearchHandler.java
@@ -54,14 +54,14 @@ public class QuickSearchHandler extends AbstractHandler {
* Based on the current active selection initialize the priority function and/or
* the initial contents of the search box.
*/
- static private void initializeFromSelection(IWorkbenchWindow workbench, QuickSearchDialog dialog) {
+ private static void initializeFromSelection(IWorkbenchWindow workbench, QuickSearchDialog dialog) {
if (workbench!=null) {
ISelectionService selectionService = workbench.getSelectionService();
ISelection selection = selectionService.getSelection();
- if (selection!=null && selection instanceof ITextSelection) {
+ if (selection instanceof ITextSelection) {
//Use text selection to set initial search pattern.
String text = ((ITextSelection) selection).getText();
- if (text!=null && !"".equals(text)) {
+ if (text!=null && !text.isEmpty()) {
dialog.setInitialPattern(text, QuickSearchDialog.FULL_SELECTION);
}
}
diff --git a/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/ui/messages.properties b/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/ui/messages.properties
index e5c2b1c12..9797bb825 100644
--- a/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/ui/messages.properties
+++ b/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/ui/messages.properties
@@ -13,4 +13,12 @@ QuickSearchDialog_InTooltip=Search in (comma-separated list of '.gitignore' styl
QuickSearchDialog_line=Line
QuickSearchDialog_text=Text
QuickSearchDialog_path=Path
-
+QuickSearchDialog_RefreshJob=Refresh
+QuickSearchDialog_searching=Searching {0}
+QuickSearchDialog_keepOpen_toggle=Keep Open
+QuickSearchDialog_caseSensitive_toggle=Case sensitive
+QuickSearchDialog_title=Quick Search
+QuickSearchDialog_caseSensitive_label=Case SENSITIVE
+QuickSearchDialog_caseInsensitive_label=Case INSENSITIVE
+QuickSearchDialog_patternHint=Pattern (? = any character, * = any string)
+QuickTextSearch_updateMatchesJob=Update matches \ No newline at end of file
diff --git a/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/util/LineReader.java b/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/util/LineReader.java
index 065076f0a..e26d2a181 100644
--- a/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/util/LineReader.java
+++ b/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/util/LineReader.java
@@ -95,7 +95,7 @@ public class LineReader {
line.append((char)c);
c = read();
if (offset>maxOffset) {
- throw new IOException("Very long lines of text. Minified file?");
+ throw new IOException("Very long lines of text. Minified file?"); //$NON-NLS-1$
}
}
//Last char read was some kind of line terminator. But only read first char of it.

Back to the top