Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuergen Haug2019-05-16 12:15:04 -0400
committerJuergen Haug2019-05-16 13:25:19 -0400
commit291b16e1d0c0084e15d0dca0ad7f5010f6057324 (patch)
tree1a3319e93c22d9111adc9ac93248d2fc0ddc2f65 /plugins
parent8ec8992bb0b274ab02ed374ccab55494cd2087e5 (diff)
downloadorg.eclipse.etrice-291b16e1d0c0084e15d0dca0ad7f5010f6057324.tar.gz
org.eclipse.etrice-291b16e1d0c0084e15d0dca0ad7f5010f6057324.tar.xz
org.eclipse.etrice-291b16e1d0c0084e15d0dca0ad7f5010f6057324.zip
[ui] hover text shows elements namespace
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.etrice.core.common.ui/src/org/eclipse/etrice/core/common/ui/hover/BaseHoverDocumentationProvider.java5
-rw-r--r--plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/RoomUiModule.java6
-rw-r--r--plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/hover/RoomEObjectHover.xtend (renamed from plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/hover/RoomHoverProvider.xtend)2
-rw-r--r--plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/hover/RoomHoverProvider.java36
-rw-r--r--plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/labeling/RoomLabelProvider.java6
5 files changed, 43 insertions, 12 deletions
diff --git a/plugins/org.eclipse.etrice.core.common.ui/src/org/eclipse/etrice/core/common/ui/hover/BaseHoverDocumentationProvider.java b/plugins/org.eclipse.etrice.core.common.ui/src/org/eclipse/etrice/core/common/ui/hover/BaseHoverDocumentationProvider.java
index 8bc349c61..af3c3379f 100644
--- a/plugins/org.eclipse.etrice.core.common.ui/src/org/eclipse/etrice/core/common/ui/hover/BaseHoverDocumentationProvider.java
+++ b/plugins/org.eclipse.etrice.core.common.ui/src/org/eclipse/etrice/core/common/ui/hover/BaseHoverDocumentationProvider.java
@@ -16,6 +16,7 @@ package org.eclipse.etrice.core.common.ui.hover;
import static org.eclipse.etrice.core.common.documentation.DocumentationMarkup.MARKUP_ASCIIDOC;
import static org.eclipse.etrice.core.common.documentation.DocumentationMarkup.getMarkupType;
+import static org.eclipse.etrice.core.common.documentation.DocumentationMarkup.trimMarkupTag;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.xtext.ui.editor.hover.html.DefaultHoverDocumentationProvider;
@@ -31,7 +32,7 @@ public class BaseHoverDocumentationProvider extends DefaultHoverDocumentationPro
protected String processMarkup(String text) {
String markup = getMarkupType(text);
- String normText = text.replace("\r\n", "\n");
+ String normText = text.replace("\r\n", "\n").trim();
// return eclipse hover output html
if(MARKUP_ASCIIDOC.equals(markup)) {
@@ -39,7 +40,7 @@ public class BaseHoverDocumentationProvider extends DefaultHoverDocumentationPro
// simulate asciidoctor line break behavior
// 1. asciidoc new paragraph
// 2. asciidoc new line
- return normText
+ return trimMarkupTag(normText).trim()
.replaceAll("\\n\\n", "<br><br>")
.replaceAll(" \\+\\n", "<br>");
}
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 d6a8333e4..c7eb390ef 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
@@ -19,10 +19,10 @@ 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.BaseHoverDocumentationProvider;
import org.eclipse.etrice.core.common.ui.hover.IKeywordHoverContentProvider;
-import org.eclipse.etrice.core.common.ui.hover.KeywordHoverProvider;
import org.eclipse.etrice.core.common.ui.linking.GlobalNonPlatformURIEditorOpener;
import org.eclipse.etrice.core.ui.highlight.RoomHighlightingConfiguration;
import org.eclipse.etrice.core.ui.highlight.RoomSemanticHighlightingCalculator;
+import org.eclipse.etrice.core.ui.hover.RoomEObjectHover;
import org.eclipse.etrice.core.ui.hover.RoomHoverProvider;
import org.eclipse.etrice.core.ui.internal.RoomActivator;
import org.eclipse.etrice.core.ui.linking.RoomHyperlinkHelper;
@@ -58,7 +58,7 @@ public class RoomUiModule extends org.eclipse.etrice.core.ui.AbstractRoomUiModul
// keyword hover stuff
binder.bind(IKeywordHoverContentProvider.class).to(KeywordHoverContentProvider.class);
- binder.bind(IEObjectHoverProvider.class).to(KeywordHoverProvider.class);
+ binder.bind(IEObjectHoverProvider.class).to(RoomHoverProvider.class);
binder.bind(IEObjectHoverDocumentationProvider.class).to(BaseHoverDocumentationProvider.class);
}
@@ -95,7 +95,7 @@ public class RoomUiModule extends org.eclipse.etrice.core.ui.AbstractRoomUiModul
@Override
public Class<? extends IEObjectHover> bindIEObjectHover() {
- return RoomHoverProvider.class;
+ return RoomEObjectHover.class;
}
public Class<? extends AbstractEditStrategyProvider> bindAbstractEditStrategyProvider() {
diff --git a/plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/hover/RoomHoverProvider.xtend b/plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/hover/RoomEObjectHover.xtend
index 428b519fc..8043af85f 100644
--- a/plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/hover/RoomHoverProvider.xtend
+++ b/plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/hover/RoomEObjectHover.xtend
@@ -26,7 +26,7 @@ import org.eclipse.xtext.nodemodel.util.NodeModelUtils
import org.eclipse.xtext.resource.XtextResource
import org.eclipse.xtext.util.Tuples
-class RoomHoverProvider extends KeywordEObjectTextHover {
+class RoomEObjectHover extends KeywordEObjectTextHover {
@Inject
RoomGrammarAccess grammar
diff --git a/plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/hover/RoomHoverProvider.java b/plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/hover/RoomHoverProvider.java
new file mode 100644
index 000000000..c3245448d
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/hover/RoomHoverProvider.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2010 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 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * CONTRIBUTORS:
+ * Juergen Haug (initial contribution)
+ *
+ *******************************************************************************/
+
+package org.eclipse.etrice.core.ui.hover;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.etrice.core.common.ui.hover.KeywordHoverProvider;
+import org.eclipse.etrice.core.room.RoomClass;
+import org.eclipse.xtext.naming.IQualifiedNameProvider;
+
+import com.google.inject.Inject;
+
+public class RoomHoverProvider extends KeywordHoverProvider {
+
+ @Inject protected IQualifiedNameProvider fqnProvider;
+
+ @Override
+ protected String getLabel(EObject o) {
+ if(o instanceof RoomClass) {
+ return fqnProvider.getFullyQualifiedName(o).toString();
+ }
+ return super.getLabel(o);
+ }
+
+}
diff --git a/plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/labeling/RoomLabelProvider.java b/plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/labeling/RoomLabelProvider.java
index 0cdd92af1..6ac514465 100644
--- a/plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/labeling/RoomLabelProvider.java
+++ b/plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/labeling/RoomLabelProvider.java
@@ -349,12 +349,6 @@ public class RoomLabelProvider extends FSMLabelProvider {
return lt.getName();
}
- StyledString text(EnumerationType et) {
- StyledString txt = new StyledString("enum "+et.getName());
- txt.setStyle(0, 4, getKeywordStyler());
- return txt;
- }
-
String text (EnumLiteral lit) {
return lit.getName()+" = "+lit.getLiteralValue();
}

Back to the top