aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorszarnekow2009-02-13 04:44:06 (EST)
committersefftinge2009-02-13 04:44:06 (EST)
commitfae8e4f834d8f1a42145739371468022a8f4d1b6 (patch)
treed676e5524a6b806ab517a176a863330df2492ec6
parenta36bd663673f670998eb5870505f67905c89e7d1 (diff)
downloadorg.eclipse.xtext-fae8e4f834d8f1a42145739371468022a8f4d1b6.zip
org.eclipse.xtext-fae8e4f834d8f1a42145739371468022a8f4d1b6.tar.gz
org.eclipse.xtext-fae8e4f834d8f1a42145739371468022a8f4d1b6.tar.bz2
Fix: Added missing annotation in DefaultTokenScanner
-rw-r--r--plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/syntaxcoloring/AbstractTokenScanner.java15
-rw-r--r--plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/syntaxcoloring/DefaultTokenScanner.java8
2 files changed, 12 insertions, 11 deletions
diff --git a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/syntaxcoloring/AbstractTokenScanner.java b/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/syntaxcoloring/AbstractTokenScanner.java
index 5366a0b..f7d7c3c 100644
--- a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/syntaxcoloring/AbstractTokenScanner.java
+++ b/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/syntaxcoloring/AbstractTokenScanner.java
@@ -13,10 +13,9 @@ import org.eclipse.jface.text.rules.ITokenScanner;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Font;
import org.eclipse.ui.PlatformUI;
-import org.eclipse.xtext.ui.common.editor.preferencepage.CommonPreferenceConstants;
+import org.eclipse.xtext.ui.core.editor.preferences.PreferenceConstants;
import org.eclipse.xtext.ui.core.editor.utils.TextStyle;
-import com.google.inject.Inject;
import com.google.inject.Provider;
import com.google.inject.name.Named;
@@ -26,17 +25,16 @@ import com.google.inject.name.Named;
*/
public abstract class AbstractTokenScanner implements ITokenScanner {
- private PreferenceStoreAccessor preferenceStoreAccessor;
+ private final PreferenceStoreAccessor preferenceStoreAccessor;
- @Inject
- public AbstractTokenScanner(final @Named("languageName") String languageName,
- final Provider<SyntaxColoringPreferencePage> preferencePageProvider,
+ protected AbstractTokenScanner(final @Named("languageName") String languageName,
+ final Provider<SyntaxColoringPreferencePage> preferencePageProvider,
final PreferenceStoreAccessor accessor) {
this.preferenceStoreAccessor = accessor;
// XXX LITTLE HACK, adding PrefPage on the fly
String preferencePagePathSeparator = "/";
String parentPreferencePagePath = languageName + preferencePagePathSeparator + languageName
- + CommonPreferenceConstants.SEPARATOR + CommonPreferenceConstants.EDITOR_NODE_NAME;
+ + PreferenceConstants.SEPARATOR + PreferenceConstants.EDITOR_NODE_NAME;
String syntaxColorerPrefPageTag = PreferenceStoreAccessor.syntaxColorerTag(languageName);
String preferencePagePath = parentPreferencePagePath + preferencePagePathSeparator + syntaxColorerPrefPageTag;
if (PlatformUI.getWorkbench().getPreferenceManager().find(preferencePagePath) == null) {
@@ -64,9 +62,8 @@ public abstract class AbstractTokenScanner implements ITokenScanner {
return false;
}
};
- } else {
- preferenceStoreAccessor.populateTextStyle(tokenStyle.getID(), textStyle, tokenStyle.getDefaultTextStyle());
}
+ preferenceStoreAccessor.populateTextStyle(tokenStyle.getID(), textStyle, tokenStyle.getDefaultTextStyle());
int style = textStyle.getStyle();
Font fontFromFontData = null;
if (style == SWT.NORMAL) {
diff --git a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/syntaxcoloring/DefaultTokenScanner.java b/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/syntaxcoloring/DefaultTokenScanner.java
index bc93e9b..68f3e3d 100644
--- a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/syntaxcoloring/DefaultTokenScanner.java
+++ b/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/syntaxcoloring/DefaultTokenScanner.java
@@ -11,15 +11,19 @@ import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.rules.IToken;
import org.eclipse.jface.text.rules.Token;
+import com.google.inject.Inject;
import com.google.inject.Provider;
+import com.google.inject.name.Named;
/**
* @author Sebastian Zarnekow - Initial contribution and API
*/
public class DefaultTokenScanner extends AbstractTokenScanner {
- public DefaultTokenScanner(String languageName, Provider<SyntaxColoringPreferencePage> preferencePageProvider,
- PreferenceStoreAccessor accessor) {
+ @Inject
+ public DefaultTokenScanner(final @Named("languageName") String languageName,
+ final Provider<SyntaxColoringPreferencePage> preferencePageProvider,
+ final PreferenceStoreAccessor accessor) {
super(languageName, preferencePageProvider, accessor);
}