Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
de.nittka.tooling.jtag.ui/src/de/nittka/tooling/jtag/ui/hover/JTagEObjectHover.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package de.nittka.tooling.jtag.ui.hover; | ||
|
||
import org.eclipse.emf.ecore.EObject; | ||
import org.eclipse.xtext.ui.editor.hover.html.DefaultHoverDocumentationProvider; | ||
|
||
import de.nittka.tooling.jtag.jtag.File; | ||
import de.nittka.tooling.jtag.jtag.FileName; | ||
import de.nittka.tooling.jtag.ui.JtagFileURIs; | ||
|
||
public class JTagEObjectHover extends DefaultHoverDocumentationProvider { | ||
|
||
private static String SPACING_POSTFIX="<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>"; | ||
|
||
@Override | ||
public String getDocumentation(EObject object) { | ||
if(object instanceof FileName){ | ||
String location=JtagFileURIs.getImageLocation((File)object.eContainer()); | ||
if(location!=null){ | ||
String folder=new java.io.File(location).getParent(); | ||
return "<img src=\"file://"+location+"\" height=120px><br>"+folder+SPACING_POSTFIX; | ||
} | ||
} | ||
return super.getDocumentation(object); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
de.nittka.tooling.jtag.ui/src/de/nittka/tooling/jtag/ui/hover/JtagHoverProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package de.nittka.tooling.jtag.ui.hover; | ||
|
||
import org.eclipse.emf.ecore.EObject; | ||
import org.eclipse.xtext.ui.editor.hover.html.DefaultEObjectHoverProvider; | ||
|
||
import de.nittka.tooling.jtag.jtag.FileName; | ||
|
||
public class JtagHoverProvider extends DefaultEObjectHoverProvider { | ||
|
||
@Override | ||
protected boolean hasHover(EObject o) { | ||
if(o instanceof FileName){ | ||
return true; | ||
} | ||
return super.hasHover(o); | ||
} | ||
|
||
@Override | ||
protected String getFirstLine(EObject o) { | ||
if(o instanceof FileName){ | ||
return "<b>"+getLabel(o)+"</b>"; | ||
} | ||
return super.getFirstLine(o); | ||
} | ||
} |