blob: 04fbae275938b406e3cbb734d845726a52451f09 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
/**
* 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.ui.hover;
import com.google.inject.Inject;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.etrice.core.common.ui.hover.KeywordEObjectTextHover;
import org.eclipse.etrice.core.room.ActorClass;
import org.eclipse.etrice.core.services.RoomGrammarAccess;
import org.eclipse.jface.text.IRegion;
import org.eclipse.xtext.resource.XtextResource;
import org.eclipse.xtext.util.Pair;
@SuppressWarnings("all")
public class RoomHoverProvider extends KeywordEObjectTextHover {
@Inject
private RoomGrammarAccess grammar;
@Override
protected Pair<EObject, IRegion> getXtextElementAt(final XtextResource resource, final int offset) {
return super.getXtextElementAt(resource, offset);
}
private ActorClass findActorClass(final EObject model) {
EObject parent = model;
while ((parent != null)) {
{
if ((parent instanceof ActorClass)) {
return ((ActorClass) parent);
}
EObject _eContainer = parent.eContainer();
parent = _eContainer;
}
}
return null;
}
}
|