Showing markers in the Eclipse "file compare" view - eclipse

I've added some functionality to the standard Eclipse "compare view" via a handler which is activated on the Compare view's popup (context) menu. One of the things that this handler does is add a marker at the selection location. However, markers are not shown in the compare view. How can I enhance the compare view to show markers? Do I have to build my own view?

The compare editor is really different from the standard editors, every functionality has to be reimplemented for it. You have to code it yourself (as far as I know), but you can look at the implementation of the original editor for hints.
In case of Eclipse, AbstractDecoratedTextEditor implements the marker display functionality (that is a descendant of the TextEditor class). What makes this functionality hard to implement in case of Compare editors is the fact, that the compare editor opens two resources at once, so it is harder to put every marker into its correct place (I think that's why it is not implemented generically).

Related

Build a Perspective from Fragment with Eclipse e4

Is it possible to define a perspective stack and perspective in the fragment.e4xmi?
The Eclipse 4 model editor doesn't seem to allow it. Why?
I add a new Model Fragment and for Feature Name I click Find ....
When I want to add a Perspective or a Perspective Stack, the dialog greys out the OK-Button.
Also, I have a lack of understanding what this Dialog is showing in general. It lists certain UI Elements and a lot of items below them, like
children
handlers
menus
and so on.
But those are listed multiple times. For example children is listed under CompositePart and under Dialog. But it doesn't make any difference which one I chose.
I know I can define the Perspective in the plugin.xml using the extension point and implementing IPerspectiveFactory. Is there no way to do it with the fragment.e4xmi?
Not sure about that dialog as I don't usually use it.
What you want to add is a Model Fragment with the 'Extended Element-ID' set to the id of the TrimmedWindow you want to put the perspective in. The 'Feature Name' would be children.
The model editor should then let you add a "Perspective Stack" as a child.
You can add the Perspective to the stack.
Note: Using the plugin.xml and IPerspectiveFactory is for Eclipse 3.x compatability mode, not pure e4. If you are using compatability mode I'm not sure how defining a perspective in the model editor fits.

In RCP / Plugin development, what should be written for properties, args, and values to be written in 'activewhen' and 'enabledwhen'?

I am currently developing RCP.
The first picture plugin.xml file is included in the com.aaa.bbb.core project.
And the plugin.xml file in the second picture is included in the com.ccc.ddd.validator project.
What I'm trying to do is disable the popup's menu if there is no name(assist-provider) for the selected item on the UI.
The list of items that can be selected on the UI refers to the extension points of the com.ccc.ddd.validator project in the second figure, and only some of these extension points have the name (assist-provider) property as indicated by the red square. You have.
I don't know how to write conditions (property, args, value, etc.) in the com.aaa.bbb.core.command.assistValidationResult extension point in the com.aaa.bbb.core project with the above content.
The menu popup is always displayed, but I think you should use enabledwhen not activewhen because it will only be disabled depending on the situation.
Any advice on the matter would be appreciated.

What is the use of # Javadoc view in eclipse

I noticed #javadoc view in my eclipse. Could you please tell me what is the use of this and how to use it.
Eclipse actually does provide decent tools for creating your own JavaDoc, which is a good idea, as then others who have to use your code will have the ability to see what it does.
There is a keyboard shortcut for adding a block for a class or method (on Mac it's Command-Shift-J I think, but search Javadoc in the key mappings.
You can define templates for adding things like links, which are pretty important, that make creation of JavaDoc go very quickly
When you document in Eclipse, it is intelligent enough to point to existing docs, so say you make an interface, you document the methods in the interface, then inside each implementer, if you created them after the interface, you will get a block that points you back to the interface
When you have added your own, or other people on your team have, this view let's you see what that will look like, so it's got a dual purpose: for making it easier to read the markup of others' JavaDoc, and for previewing your own.
The view you are showing is the Eclipse # Javadoc view. The Javadoc view shows the Javadoc of the element selected in the Java editor or in a Java view.
To use it, simply open a Java file that contains Javadoc in the Java view (or use the Java perspective). Once you do so the Javadoc view will automatically populate.

How to control a View on selecting particular File Type in Eclipse Editor

I want to control a view , like if I select a .js type of file , a particular view should be visible else for all other type it shouldn't.
I dont want to use perspective as for just a single selection, it will be an overhead.
Please suggest me any way to achieve the same through Eclipse plug-in Development.
When you contribute the view, you either don't mention a perspective (in which case when the view is shown it defaults to the bottom right) or you use the org.eclipse.ui.perspectiveExtensions extension point to contribute it to a specific location. You can make it visible or invisible by default.
You make the view visible/invisible at runtime using the org.eclipse.ui.IWorkbenchCommandConstants.VIEWS_SHOW_VIEW command and the view ID parameter, or by using the showView()/hideView() API in org.eclipse.ui.IWorkbenchPage
See Plugging into the Workbench for more information.

Is there a way to integrate Properties View within the Eclipse Multipage editor?

I am trying to implement an Eclipse editor which consists of a design part, Palette part and the Properties part for the selected palette item. All in the same editor page.
After a long time of googling, I have come to know that there are no proper articles or examples for this issue. Is there some solution that I could get from anyone here?
The SWT Design editor implements this feature in its editor. However, I am unable to access its source.
To access the properties view, you have to have three things:
Your editor must define its SelectionProvider (getSite().setSelectionProvider()). A SelectionProvider is either a JFace Viewer, or can be any class that return a corresponding ISelection interface.
The objects returned by the ISelection must either implement IPropertySource or return an IPropertySource adapter using the getAdapter(IPropertySource.class).
In multi-page editors you have to make sure, that the SelectionProvider also returns what expected.
For details about the first two point, see the following Eclipse Corner article: Take control of your properties, or if you would like to use the Tabbed properties view seen in GMF editors, The Eclipse Tabbed Properties View.