How to link the selections in Nattable shown in a custom editor view to the sirius property view in eclipse? - eclipse

I have a question regarding the linkage of the selection made on the nattable in a custom editor view and the sirius property view. Any ideas, how should i go for it, it will be really kind of you if you can highlight the steps in an easy to understand manner, because i have researched a lot on it and nothing is concrete enough to get me started to solve this task.
I am attaching two screenshots describing, what is the nature of the issue i am facing and what i want to implement.
Screenshots>
1. https://imgur.com/bVqfGc4
In the first screenshot, when i click on the element in the model explorer , its properties show up in the sirius properties view, and they should as that is how sirius property view works
2. https://imgur.com/DKsFQBi
In the second screenshot, when i click on any element on the nattable in a custom editor view containing my nattable, the sirius property view does not respond to the selection made on the nattable in that custom editor view.
I want to implement a solution where when i click on any element in the nattable, its properties hsow up in the sirius property view.
Your help and guidance in this regard will be highly appreciated. Thanks in advance.
Best Regards,
Abu

You need to implement and register an ISelectionProvider. NatTable provides currently only row based providers like the RowSelectionProvider or the E4SelectionListener.
The corresponding examples can be found here:
https://github.com/eclipse/nebula.widgets.nattable/blob/master/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_500_Layers/_505_Selection/_5054_SelectionProviderExample.java
https://github.com/eclipse/nebula.widgets.nattable/blob/master/org.eclipse.nebula.widgets.nattable.examples.e4/src/org/eclipse/nebula/widgets/nattable/examples/e4/part/SelectionListenerExample.java

Related

How can I add a custom column menu tab in ag-grid?

Is there a way to add a custom column menu tab with my own favourite icon which on click would render my custom react component?
something like
myColDef.menuTabs: ['generalMenuTab', 'filterMenuTab', 'myCustomMenuTab']
FYI I'm using v12.0.2
What you're after can't be done I'm afraid. The grid supports React components in all sorts of ways (renderers, editors, filters etc), but not via the column menu.
I've updated the docs page to remove the gibberish issue - it'll be fixed properly in the next release, thanks for highlighting this.
This would be helpful to have. In particular for us, we'd like to filter based off row properties, and not row values. Creating our own tab to filter by cell colors that we have assigned with our own set of labels would be useful.
I agree that it would be a nice feature to have. Apparently, there's no quick out-of-the-box solution to do it. The only workaround I see is to implement your own custom Header component which would display any buttons your want.
There you can put a button to open your own custom menu, which you can implement as any regular UI component. It also means you'll need to manually implement all standard menu options that Ag-Grid provides out of the box if you need them.

How can I customize partstack header in rcp application

I am trying to customize PartStack header of a view in rcp application. My goal is to customize the coloring of the header and to add date and time to it and hide minimize and maximize buttons. Buttons can be hidden using css but other goals give me hard time. At the moment I am looking to use a custom renderer by overriding some methods in StackRenderer class. Is that a right approach or is there another renderer that I shoud use?
If you don't want the min/max buttons then do not include MinMaxAddon in the Add On list in the Application.e4xmi.
Using a custom renderer for StackRenderer is useful for changing the text of the part tabs items. If you want to put text elsewhere on the part stack line you will probably need to look at the MinMaxAddon to see how it does that.

How to Programmatically Add Items to Eclipse's Problems View

I'm developing an Eclipse plugin where I need to add custom items to Eclipse's problems view. Custom items under maybe custom categories (for example list a bunch of problems under a category named "security").
I have looked into marker, but these are for file editors. I want to add custom items to the problems view without having to do anything with a source editor. Is that possible? Or do I have to create my own view?
Thanks!
I think you just need to add the problem view to your plug-in.
org.eclipse.ui.views.ProblemView
You can create markers on Folders/Projects. You don't need to have a File to create a marker. The markers can be grouped via the type of Marker in the Problems View
The Problems view only supports displaying markers.
Markers are associated with resources (usually files) but any plugin can create them, they don't have to done by editors.

Add/remove usercontrol in panorama item using MVVM - Windows Phone

I have a panorama app that has two panorama items so far, "recent" and "popular." These get populated with data using binding from a viewmodel. I would like to add a third ("search") panorama item that initially shows just a text box and a button.
When the user inputs text and clicks on the button, I want the text box and button to be replaced with the ListBox control that shows the search results.
I cannot find any examples on how to do this using the MVVM pattern. I am not using a MVVM framework and would like not to since I am just learning all this.
If you can explain or better, point me to examples that will allow me to do this, I would very much appreciate the help. If I left out any required info in my request, please let me know.
Sincerely,
Kamal
Typically for something like this you would have a property in your ViewModel that would tell the view what to show. You have lots of different options for how you could do this.
One option would be to have a Results property that your list box is bound to. Put the textbox and button in a Grid and bind the Visibility property of the grid to a property that is Visible is there are no results and not visible if there are.
Lots of different ways to do this.
Examples here and here.
You could probably bind a list of a custom class to the panorama ite .
The custom class contains a title and/or description and a page class.
You can maintain your views in your main viewmodel.
Another solution would be adding the items in xaml and using the same viewmodel for the whole panorama item control. With a property you can control the visibility of each item.
Like Bryant said: there are so many solutions. It depends on your application and requirements... :)

SWT Tree, JFaces, TreeViewer

Could you give me some ideas on how I can achieve this.
I have SWT Tree with me, which is managed by means of Tree Viewer.
I want every item in the tree to be editable (I mean, if you put mouse on it and start editing its string value , it should change). But the Root item should not change.
User should not be able to modify the top item's name.
As of now Editing Support is provided for all the items in the tree including the top item.
But top item shouldn't be editable.
Kindly give me some idea about it.
Regards,
Venkata Vineel.
If you use JFace you should set a org.eclipse.jface.viewers.EditingSupport implemetation on your org.eclipse.jface.viewers.TreeViewerColumn. The editing-support class has a method org.eclipse.jface.viewers.EditingSupport.canEdit(Object) you have to implement and that should return false for your top-items. For some examples how to use TreeViewers, EditingSupport and all the other stuff regarding JFace see also the JFace Snippets page.