How to display popup menu in Eclipse E4 MPart - java

In Eclipse E4, detached view option is not available but this is very important requirement for our project, So i want to add popup menu in MPart to provide the functionality.
Please guide me how can i add popup menu in MPart. I tried adding it in application model but it seems i am doing something wrong.
Thanks in Advance!

Add a popup menu and handled menu item to the MPart in your .e4xmi
Make sure you get the id's correct. The handler will be the code you want to run
see here for an example:
http://www.vogella.com/tutorials/EclipseRCP/article.html#menuadvanced_popup

Related

Open item with context menu action

I'm new to android and java and I'm trying to work on an app.
The reason I'm seeking for help is that I can't figure out how to replicate the action of single tapping on an item of a list (action that opens the item) in a context menu (which appears with a long tap on the item). I can't associate the field I created ("Modify item") to actually open the selected item. I can't post any part of the code and I'm sorry about that, hope you might understand and help anyways.
Thanks

Android Espresso - Closing the SearchView

I'm working on Espresso tests for Android and for one of my actions I want to search a list using a SearchView, select an item and then navigate back to the previous screen (by closing the searchview and then pressing the up button).
I've tried some things to access the up/collapse button of the SearchView to close it (that don't work):
onView(withContentDescription(R.string.abc_action_bar_up_description))
onView(withId(R.id.search_close_btn))
onView(withId(R.id.home))
onView(withId(R.id.homeAsUp))
onView(withId(R.id.collapseActionView))
Espresso.pressBack() (to just navigate back)
I'm hoping someone might know some way to access and close this button, because I have no idea.
Thanks in advance.
Apparantly I had to press the back button twice to navigate out of it, so if anyone would like to know, you need to use Espresso.pressBack(); twice to get out of the search menu.
The correct id is R.id.search_close_btn
onView(withId(R.id.search_close_btn)).perform(click())
I was with the same problem of accessing this up/collapse button and by reading the hierarchy of components I found out that this button has the content description of 'Collapse'. So using the following solved the problem for me:
onView(withContentDescription(androidx.appcompat.R.string.abc_toolbar_collapse_description)).perform(click())

First image selected in coolbar (Eclipse RCP)

After the start of my application the coolbar is loaded and the first item is selected automatically. I don't want that. Is it possible to remove this selection?
Screenshot: http://i.imgur.com/q15X1.png
Thanks in advance.
I think this is because that button (or rather the toolbar) currently has the focus. To remove the focus you have to set it to another control. Did you implement the setFocus() method of your "Übersicht" view?

How can I access the Tabbed Properties View in Eclipse programatically?

I'd like to get access to the Tabbed Properties View in order to change the displayed tab programatically. When the selection is changed, the default behaviour is to show the same tab for the new selection (if they share a tab descriptor) or else to show the last known tab for that selection. I need to be able to set the tab based on program conditions.
Thanks in advance.
You need to ask for IPropertySheetPage.class adapter from Properties View workbench part, then cast it to org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage in order to call setSelectedTab() on it.
Cheers,
Max

Adding menu entries to Blackberry menu list

Blackberry applications have a "menu" list coming up when you hit the Blackberry menu button. (When you inherit from "MainScreen".) But in my application there is only one entry, "Close".
How do I add entries to this menu?
(This is not a dupe of this question, which is about replacing the standard menu with an entirely custom menu.)
create a menu item using the net.rim.device.api.ui.MenuItem. You can add it to a MainScreen with the addMenuItem(MenuItem item) function.
EDIT
sample code
MenuItem mi=new MenuItem("mymenuitem",1,1);
addMenuItem(mi);

Categories