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

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.

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.

Plugins for creating and styling custom Editor Windows like C#/C++ Form Designer or “Web Inspector”?

Unity3d allows to construct window with custom UI. Just need to use EditorGUI/EditorGUILayout classes and their static methods.
Example of custom window:
The problem is that all the components have to be added manually via script. Then need to save, switch to Editor, wait for little compile things, and then we can see the result.
In web-development people use Web Inspector (for example, we can press F12 in chrome, Tab Elements -> Styles). We can add all needed properties to element and can see the result in real-time.
EDIT. another example (better than previous): we know C# winFormApp, C++ MFC e.t.c, which has form designer. We can choose any elements and set their properties:
It would be nice to have similar plugins for Unity
So. Does Unity3d have similar tools, utilities, plugins? Utilities to inspect code and editing styles (position, margin, padding, background, width, height, color e.t.c.)?
Well, I found something interesting...Editor window designer
The plugin is almost what I need
The project had been started but not completed yet.
As the author says: he decided to release Editor Window Designer as an open source project, that code is here
For now plugin allows add elements and styling them (position, padding, width, height, e.t.c)
Base demo window:
And here is hierarchy window and properties of concrete element
I wonder why Unity developers (or someone else) still didn't do something like that? It is very useful and necessary thing...

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.

Showing markers in the Eclipse "file compare" view

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).

eclipse: Do not show references from binary types in call hierarchy

Is there any way to remove binary references from "call hierarchy" (Ctrl-Alt-H) ?
Our project setup is such that for many members we have duplicated references (one reference from source file and one from the jar file with class compiled from that source file). The navigation is inconvenient and I wondering if any ways to fix that is available.
Call hierarchy can be limited in scope to a working set. You just need to set one up to exclude all your libraries.
If you click on the white down arrow in the top right of the Call Hierarchy window a popup menu will appear. Choose Search Scope/Working set and then select or set up the working set you want. A working set can include a source folder or a jar. Once set up your working sets will appear at the bottom of the Search Scope menu so you can access them quickly in future.
I've discovered another way to accomplish this, and since this question is one of the top results in google, I thought it would be good to add it as an answer.
In the Call Hierarchy view, one can click the 'View Menu' (the downward facing arrow) and select "Search In...". In the window that pops up, the user can un-check the options they want to exclude. For example, I only have 'Sources' and 'Required projects' checked.