aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuergen Haug2018-01-24 11:00:20 -0500
committerJuergen Haug2018-01-29 03:37:25 -0500
commitb878f46f731ec93ba9f9eb78b61463dafad53d22 (patch)
tree99790076135b46dc4c4c218a855c371a22dade6a
parent1ca0c386ea828f6829a7f33482f79a20deb31b2e (diff)
downloadorg.eclipse.etrice-b878f46f731ec93ba9f9eb78b61463dafad53d22.zip
org.eclipse.etrice-b878f46f731ec93ba9f9eb78b61463dafad53d22.tar.gz
org.eclipse.etrice-b878f46f731ec93ba9f9eb78b61463dafad53d22.tar.xz
[ui] deactivated spell checking in detail code
-rw-r--r--plugins/org.eclipse.etrice.core.common.ui/src/org/eclipse/etrice/core/common/ui/autoedit/BaseAutoEditStrategyProvider.java10
-rw-r--r--plugins/org.eclipse.etrice.core.common.ui/src/org/eclipse/etrice/core/common/ui/editor/BaseDoubleClickStrategyProvider.xtend31
-rw-r--r--plugins/org.eclipse.etrice.core.common.ui/src/org/eclipse/etrice/core/common/ui/editor/model/BaseTokenTypeToPartitionMapper.xtend7
-rw-r--r--plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/RoomUiModule.java8
4 files changed, 47 insertions, 9 deletions
diff --git a/plugins/org.eclipse.etrice.core.common.ui/src/org/eclipse/etrice/core/common/ui/autoedit/BaseAutoEditStrategyProvider.java b/plugins/org.eclipse.etrice.core.common.ui/src/org/eclipse/etrice/core/common/ui/autoedit/BaseAutoEditStrategyProvider.java
index 98647e0..a4ab438 100644
--- a/plugins/org.eclipse.etrice.core.common.ui/src/org/eclipse/etrice/core/common/ui/autoedit/BaseAutoEditStrategyProvider.java
+++ b/plugins/org.eclipse.etrice.core.common.ui/src/org/eclipse/etrice/core/common/ui/autoedit/BaseAutoEditStrategyProvider.java
@@ -20,7 +20,7 @@ public class BaseAutoEditStrategyProvider extends DefaultAutoEditStrategyProvide
@Override
protected void configureIndentationEditStrategy(IEditStrategyAcceptor acceptor) {
- acceptor.accept(defaultIndentLineAutoEditStrategy.get(), BaseTokenTypeToPartitionMapper.STRING_LITERAL_PARTITION);
+ acceptor.accept(defaultIndentLineAutoEditStrategy.get(), BaseTokenTypeToPartitionMapper.CCSTRING_LITERAL_PARTITION);
super.configureIndentationEditStrategy(acceptor);
}
@@ -31,25 +31,25 @@ public class BaseAutoEditStrategyProvider extends DefaultAutoEditStrategyProvide
}
protected void configureCompoundBracesBlocks(IEditStrategyAcceptor acceptor) {
- acceptor.accept(compoundMultiLineTerminals.newInstanceFor("{", "}").and("[", "]").and("(", ")"), BaseTokenTypeToPartitionMapper.STRING_LITERAL_PARTITION);
+ acceptor.accept(compoundMultiLineTerminals.newInstanceFor("{", "}").and("[", "]").and("(", ")"), BaseTokenTypeToPartitionMapper.CCSTRING_LITERAL_PARTITION);
super.configureCompoundBracesBlocks(acceptor);
}
@Override
protected void configureCurlyBracesBlock(IEditStrategyAcceptor acceptor) {
- acceptor.accept(singleLineTerminals.newInstance("{", "}"), BaseTokenTypeToPartitionMapper.STRING_LITERAL_PARTITION);
+ acceptor.accept(singleLineTerminals.newInstance("{", "}"), BaseTokenTypeToPartitionMapper.CCSTRING_LITERAL_PARTITION);
super.configureCurlyBracesBlock(acceptor);
}
@Override
protected void configureSquareBrackets(IEditStrategyAcceptor acceptor) {
- acceptor.accept(singleLineTerminals.newInstance("[", "]"), BaseTokenTypeToPartitionMapper.STRING_LITERAL_PARTITION);
+ acceptor.accept(singleLineTerminals.newInstance("[", "]"), BaseTokenTypeToPartitionMapper.CCSTRING_LITERAL_PARTITION);
super.configureSquareBrackets(acceptor);
}
@Override
protected void configureParenthesis(IEditStrategyAcceptor acceptor) {
- acceptor.accept(singleLineTerminals.newInstance("(", ")"), BaseTokenTypeToPartitionMapper.STRING_LITERAL_PARTITION);
+ acceptor.accept(singleLineTerminals.newInstance("(", ")"), BaseTokenTypeToPartitionMapper.CCSTRING_LITERAL_PARTITION);
super.configureParenthesis(acceptor);
}
diff --git a/plugins/org.eclipse.etrice.core.common.ui/src/org/eclipse/etrice/core/common/ui/editor/BaseDoubleClickStrategyProvider.xtend b/plugins/org.eclipse.etrice.core.common.ui/src/org/eclipse/etrice/core/common/ui/editor/BaseDoubleClickStrategyProvider.xtend
new file mode 100644
index 0000000..0f7ce64
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.common.ui/src/org/eclipse/etrice/core/common/ui/editor/BaseDoubleClickStrategyProvider.xtend
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2011 protos software gmbh (http://www.protos.de).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * CONTRIBUTORS:
+ * Juergen Haug (initial contribution)
+ *
+ *******************************************************************************/
+
+package org.eclipse.etrice.core.common.ui.editor
+
+import org.eclipse.xtext.ui.editor.doubleClicking.DoubleClickStrategyProvider
+import org.eclipse.jface.text.source.ISourceViewer
+import org.eclipse.xtext.ui.editor.doubleClicking.FixedCharCountPartitionDoubleClickSelector
+
+import static org.eclipse.etrice.core.common.ui.editor.model.BaseTokenTypeToPartitionMapper.*
+
+class BaseDoubleClickStrategyProvider extends DoubleClickStrategyProvider {
+
+ override getStrategy(ISourceViewer sourceViewer, String contentType, String documentPartitioning) {
+ switch contentType {
+ case CCSTRING_LITERAL_PARTITION: return new FixedCharCountPartitionDoubleClickSelector(documentPartitioning, 0, 0)
+ default: return new FixedCharCountPartitionDoubleClickSelector(documentPartitioning, 0, 0)
+ }
+ }
+
+}
+ \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.core.common.ui/src/org/eclipse/etrice/core/common/ui/editor/model/BaseTokenTypeToPartitionMapper.xtend b/plugins/org.eclipse.etrice.core.common.ui/src/org/eclipse/etrice/core/common/ui/editor/model/BaseTokenTypeToPartitionMapper.xtend
index 380529c..53bdc15 100644
--- a/plugins/org.eclipse.etrice.core.common.ui/src/org/eclipse/etrice/core/common/ui/editor/model/BaseTokenTypeToPartitionMapper.xtend
+++ b/plugins/org.eclipse.etrice.core.common.ui/src/org/eclipse/etrice/core/common/ui/editor/model/BaseTokenTypeToPartitionMapper.xtend
@@ -15,12 +15,13 @@ package org.eclipse.etrice.core.common.ui.editor.model
import org.eclipse.xtext.ui.editor.model.TerminalsTokenTypeToPartitionMapper
class BaseTokenTypeToPartitionMapper extends TerminalsTokenTypeToPartitionMapper {
+
+ public val static String CCSTRING_LITERAL_PARTITION = "__ccstring";
override protected calculateId(String tokenName, int tokenType) {
switch tokenName {
- // cc_string has same behavior as string partition
- // -> activates text sensitive double click support
- case 'RULE_CC_STRING': STRING_LITERAL_PARTITION
+ // custom behavior for ccstring
+ case 'RULE_CC_STRING': CCSTRING_LITERAL_PARTITION
default: super.calculateId(tokenName, tokenType)
}
}
diff --git a/plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/RoomUiModule.java b/plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/RoomUiModule.java
index 2b6da57..5e2a9fe 100644
--- a/plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/RoomUiModule.java
+++ b/plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/RoomUiModule.java
@@ -13,6 +13,7 @@
package org.eclipse.etrice.core.ui;
import org.eclipse.etrice.core.common.ui.autoedit.BaseAutoEditStrategyProvider;
+import org.eclipse.etrice.core.common.ui.editor.BaseDoubleClickStrategyProvider;
import org.eclipse.etrice.core.common.ui.editor.model.BaseTokenTypeToPartitionMapper;
import org.eclipse.etrice.core.common.ui.hover.IKeywordHoverContentProvider;
import org.eclipse.etrice.core.common.ui.hover.KeywordHoverProvider;
@@ -28,6 +29,7 @@ import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
import org.eclipse.xtext.ide.editor.syntaxcoloring.ISemanticHighlightingCalculator;
import org.eclipse.xtext.ui.editor.autoedit.AbstractEditStrategyProvider;
+import org.eclipse.xtext.ui.editor.doubleClicking.DoubleClickStrategyProvider;
import org.eclipse.xtext.ui.editor.hover.IEObjectHover;
import org.eclipse.xtext.ui.editor.hover.IEObjectHoverProvider;
import org.eclipse.xtext.ui.editor.hyperlinking.IHyperlinkHelper;
@@ -93,10 +95,14 @@ public class RoomUiModule extends org.eclipse.etrice.core.ui.AbstractRoomUiModul
return BaseAutoEditStrategyProvider.class;
}
- public Class<? extends ITokenTypeToPartitionTypeMapper> bindITokenTypeToPartitionTypeMapper(){
+ public Class<? extends ITokenTypeToPartitionTypeMapper> bindITokenTypeToPartitionTypeMapper() {
return BaseTokenTypeToPartitionMapper.class;
}
+ public Class<? extends DoubleClickStrategyProvider> bindDoubleClickStrategyProvider() {
+ return BaseDoubleClickStrategyProvider.class;
+ }
+
// auto format for quick fix
/*
public Class<? extends ITextEditComposer> bindITextEditComposer() {