Eclipse PDE, markerAnnotationSpecification - define without icon - java

I am developing an PDE for Eclipse, i have created annotations via markerAnnotationSpecification (see PDB help). I need those annotations without icon on left side (where breakpoints are), but problem is that when i do not specify icon parameter for my annotation, it will use default icon from symbolicIcon parameter. Currently i am using a bit hacky solution - loading an empty image. Still cursor changes when user targets icon place, which is not desired behavior.
TL;DR; Is there a way remove (do not use) this icon completely?
Here is one of my specification extension point elements
<specification
annotationType="com.xxx.profiler.editor.highlight.highannotation"
colorPreferenceKey="covc_h"
colorPreferenceValue="255,120,120"
highlightPreferenceKey="covh_h"
highlightPreferenceValue="true"
icon="/icons/ph_icon.gif" <!-- empty icon -->
label="High Coverage"
overviewRulerPreferenceKey="covr_h"
overviewRulerPreferenceValue="false"
presentationLayer="1"
textPreferenceKey="covt_h"
textPreferenceValue="false"
textStylePreferenceKey="covs_h"
textStylePreferenceValue="BOX"
verticalRulerPreferenceKey="covv_h"
verticalRulerPreferenceValue="false">
</specification>
//EDIT: I found out that this should be done with verticalRulerPreferenceValue="false" but for some reason, even that it is disabled in annotations preferences, the image is shown at my annotation

OK found the problem. org.eclipse.ui.editors.markerAnnotationSpecification was linked to markerType via org.eclipse.ui.editors.annotationTypes plug-in. In this plug-in i (following tutorial) automatically set parameter super to some value, which covered my settings in markerAnnotationSpecification. After removing inheritance parameter here, everything works as expected.

Related

How to extend Eclipse's Java editor to recognize my own elements

I want to add references to other elements inside javadoc. The javadoc should look similar to:
/**
* ...
* #my.tag SomeElement
*/
I want to reuse the existing Java editor inside Eclipse. Of course I can type above javadoc already, however I'd like to add some features:
Navigation: upon Ctrl-Click / F3 I want to navigate to the editor showing SomeElement
Auto-completion: Ctrl-Space should complete the text / show valid alternatives
Checking: I want to create a warning marker and underline the SomeElement if it cannot be found
I already figured out that I can do the auto-completion by using the extension point org.eclipse.jdt.ui.javaCompletionProposalComputer, though this seems to be little more complex than I had hoped, so I might be on the wrong track here?
For checking my elements I might be able to use org.eclipse.jdt.core.compilationParticipant, which can generate markers upon compilation which afaik happens with every save operation.
But how can I can manage the navigation feature? Any pointers are welcome!
For navigation you can provide a Hyperlink Detector. You'll want to look at how the Java Editor and its existing detectors are declared in the org.eclipse.jdt.ui plug-in to determine the correct target ID.

How to change file/folder resource icons from existing eclipse views

I want to change the appearance of project explorer view in eclipse by changing the default file/folder icons for my custom plugin resources. I am aware of Decorators - https://eclipse.org/articles/Article-Decorators/decorators.html , But how can I change the existing icons itself inspite of just putting an overlay or underlay image?
Also I don't want to create a new view , just want to reuse the project explorer with my icons.
The main icon used is taken from the default editor used for the file as defined by the org.eclipse.ui.editors extension point.
If you defining new file types and editors you can specify the icon, but you can't override the icon for existing types and editors.
To modify existing project explorer content first add a org.eclipse.ui.navigator.viewer extension point. Under that add a viewerContentBinding element with the id org.eclipse.ui.navigator.ProjectExplorer (that's the id of the standard Eclipse project explorer view).
Under that add a (includes) with a contentExtension element. The pattern identifies the IDs of navigator content to include and can contain wildcards, e.g. com.example.mycontent.*.
Next define a org.eclipse.ui.navigator.navigatorContent extension point with a navigatorContent element. Make sure the id you provide matches the above pattern. Set the content and label providers. If the content provider implements IPipelinedTreeContentProvider it will allow you to modify existing content (possibly wrapping things like IFolder inside classes your label provider understands). You'll also need to define triggerPoints to identify the items for which your content provider should be called.
It may be useful/necessary to suppress standard navigator content. You can do this by specifying an override element under navigatorContent with the policy InvokeAlwaysRegardlessOfSuppressedExt and id org.eclipse.ui.navigator.resourceContent.

how to add image plugin under rteplugins for richtext component

I have a rich text component, I need to configure it in such a way that we can drag and drop the image in the rich text component.For that under rte plugins I have added one plugin called image which is of primary type nt:unstructured having features of String[] and value as *.Even,after adding that above image plugin, Im not able to drag and drop the image.Please let me know what I have done wrong.
Thanks,
Balaji
Due to documentation:
To activate all features for that plugin:
Name features
Type String
Value * (asterisk)
To activate specific features (any not explicitly defined will be deactivated):
Name features
Type String[] (multi-string; set Type to String and click Multi in CRXDE Lite)
Value(s) set to one, or more, feature values
Even if you are only setting one specific value of features you do
have to use String[].
String is only valid when defining features as *.
So if your type is String[], you have to explicitly put the feature name.I suggest you to change String[] to String ("*" in this situation will be ok).This
adds context menu entries for setting some image properties (currently only alignment is supported).
The Richtext Image plugin (and indeed most of the rtePlugins) seems to only be compatible with Mozilla Firefox. Try that browser and see if it works.

PDF annotations in Java

Actually, still now I have not got the exact way to add different types of annotation/lines/boxes/highlights using the mouse directly on PDF.
I have tried different API (pdfbox, icepdf, iText, aspose) and successfully able to add text, text annotation, box annotation, images, but for each one i have some issue like:
when i add object, it add in a new page
when i add object it remove the old data
i want use the existing ICEPDF viewer to add text, but it does not allow it. and if i try to mix other API with ICEPDF, then I am not able to get the mouse click position where need to add.
There is only one API (ICE PDF) which allow to add box annotation direct on GUI by mouse but it does allow other things.
If not possible in pdf viewer then is there any class which will allow to do this?
I'm also open for any commercial library/class with a one time fee to do that.
I think BFO have added quite a few annotation tools. Have you looked at their tool?

How to configure Eclipse to autocomplete using java.util.List and not java.awt.List? [duplicate]

When auto-completing a class name in Eclipse, e.g. if you type:
ListITab
A pop-up menu appears offering you matching class names for completion (which you can select with the mouse or by using the arrow keys:
In this example, I almost certainly want java.util.ListIterator and I almost never want com.sun.xml.internal.bind.v2.runtime.reflect.ListIterator (or anything else from that package).
This particular class will appear in the list frequently (every time I declare a ListIterator). I would like to be able to exclude packages from autocomplete searches, so that java.util.ListIterator is auto-completed without the need for a pop-up menu.
Is this possible?
Window > Preferences > Java > Appearance > Type Filters
You should be able to specify there the packages you do not want to see.
See Java Tips and Tricks
To exclude certain types from appearing in content assist, use the type filter feature configured on the Java > Appearance > Type Filters preference page.
Types matching one of these filter patterns will not appear in the Open Type dialog and will not be available to content assist, quick fix and organize imports.
These filter patterns do not affect the Package Explorer and Hierarchy views.
finnw (the OP) adds in the comments:
Now how do you add a single class to this list? I'm not interested in java.awt.List but occasionally I want java.awt.Window or java.awt.Dimension. –
"Type filter" is actually based on class pattern matching, meaning if you add:
java.awt.List
that class will disappear from the content assist propositions.
If you know all java.awt.Lxxx classes are of no interest, you could add
java.awt.L*
All other classes from java.awt would still be there for the content assist.
With a recent eclipse (I have right now a eclipse 3.6Mx, but this should work for 3.5.x as well), you are not limited to package pattern only in the Type Filter.
Window > Preferences > Java > Appearance > Type Filters

Categories