popupmenu

Enable/disable menu item in Eclipse plugin

青春壹個敷衍的年華 提交于 2019-12-04 05:24:05
I've made a pop-up menu with one menu item, I want to enable it only when I do a right click on a tree item of a certain class type otherwise disable it. How can I achieve this? You can add a handler that uses activeWhen and associate it with that menu's command id. Here is a handler that makes a command active only when the current selection is not empty, and the selection is an item that can be adapted to an object of type Widget : <extension point="org.eclipse.ui.handlers"> <handler class="com.myproject.handlers.ExportWidgetHandler" commandId="com.myproject.commands.exportWidget">

I Use ShareActionProvider in PopupMenu, but show two PopupMenu?

允我心安 提交于 2019-12-04 05:19:10
I use a ShareActionProvider in a PopupMenu, but when I click the share menu item, it shows two PopupMenus on the screen, one covered by the other. And one shows the application icon and name, the other one only shows the application name. It works fine except this problem... How can I fix it? P.S.: please forgive me for my bad expression My code is: PopupMenu popup = new PopupMenu(this, button); popup.getMenuInflater().inflate(R.menu.scrawl_popup_menu, popup.getMenu()); MenuItem overflowItem = popup.getMenu().findItem(R.id.popup_share); ShareActionProvider overflowProvider =

How to get the position of an Item from a PopupMenu in a custom ListView

穿精又带淫゛_ 提交于 2019-12-04 05:11:30
Here's the problem: I've got a custom ArrayAdapter (overriden getView). Each item has got 2 ImageView 2 EditText One of those ImageView is clickable and enables a PopupMenu, so I've got a little PopupMenu for each item of the list. Now, for that menu I need some parameters from the item to wich is anchored. So, how to pass informations (like position) to the method called from the PopupMenu voice? Attached the xml files. item_list.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android

Android Popup Menu fill parent

你说的曾经没有我的故事 提交于 2019-12-04 04:57:12
问题 I try set my popup menu in way to fill hole item on grid. Currently it look like on attached first picture and the next one is effect which I would like to have. My code: private void showPopupMenu(View view) { // inflate menu ContextThemeWrapper ctw = new ContextThemeWrapper(context, R.style.PopupMenu); PopupMenu popup = new PopupMenu(ctw, view); Menu menu = popup.getMenu(); menu.add(Menu.NONE, 1, Menu.NONE, "Remove"); menu.add(Menu.NONE, 2, Menu.NONE, "Block"); popup

PopupMenu click causing RecyclerView to scroll

无人久伴 提交于 2019-12-04 01:52:52
I have an overflow button inside a CardView in Recyclerview . Whenever I am clicking the button,I show a popup menu but also RecyclerView is scrolling down one item. Can anyone please help me stop this unwanted scrolling? Basically I am trying to replicate the same overflow button behavior as in Playstore. Layout: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_margin="5dp"> <android.support.v7.widget.CardView android:id="@+id/cv_tracks" android:layout_width="match_parent" android

Android popupmenu position

半世苍凉 提交于 2019-12-04 00:11:23
问题 I am trying make an android app where clicking a button raises a popupmenu . The popupmenu is being generated but not at the correct position. The code is as follows: menu.xml <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android"> <group android:checkableBehavior="single"> <item android:id="@+id/genderMale" android:title="Male" /> <item android:id="@+id/genderFemale" android:title="Female" /> </group> </menu> The function to execute the popup

How to create popup menu

余生颓废 提交于 2019-12-03 09:22:22
问题 I am newbie on javafx. I want to show popup menu on Right Mouse click. I find one tutorial Here and Here but don't understand. I want to create popup menu which show in image on this link. Right now i am creating stage but i don't want stage. I need to show popup menu which show on right click and close when i click anywhere. Here is my code in which i am using stage but i need to ope popup menu like above link. public void MouseClickedOnTree(MouseEvent event) { if (event

QTreeWidget right click menu

▼魔方 西西 提交于 2019-12-03 07:39:38
问题 I looked around and it seems that the problem is present not only for tree widget but also for other widgets. But in my case, I found a solution, although an incomplete one. I am adding actions to my tree widget, so that when you right click on it, a popup with these actions appears. However, when I add items to my tree widget and I right click on them, the same popup appears. What I would like to do is that when you right click on the tree widget, a tree widget popup menu appears and when

How do you line up a TPopupMenu so that it accurately positions itself above a button?

纵饮孤独 提交于 2019-12-03 07:33:36
I want a popup menu above a button: Delphi wraps the Win32 menu system in a way that seems to preclude every mode or flag that the underlying Win32 API provides that was not in the VCL author's brain on that day. One such example appears to be the TPM_BOTTOMALIGN which can be passed into TrackPopupMenu but, the Delphi wrapper appears to render this not only impossible in the stock VCL, but by injudicious use of private and protected methods, is impossible (at least seems to me to be impossible) to do either accurately at runtime, or by overrides. The VCL component TPopupMenu is not very well

What's the name of the little widget with three dots inside a cardview in android?

≡放荡痞女 提交于 2019-12-03 01:39:36
问题 What's the little widget with three dots? How can I add it to my app? 回答1: This is not a widget at all. It is an ImageButton (borderless in style) using the overflow Icon that includes a PopupMenu For documentation tutorial visits http://developer.android.com/guide/topics/ui/menus.html#PopupMenu This refers to a nice code snippet from the link above: <ImageButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_overflow_holo_dark" android