Where exactly is "scm/change/title"? - visual-studio-code

I'm trying to add a scm/change/title menu item for some manipulations of the scm changes, but I cannot find where it goes after being added. I've tested with other menus and the command works. The official doc states that
The scm/change/title allows you to contribute commands to the title bar of an inline change.
I'm wondering where exactly is this "title bar of an inline change"? Is it hidden somewhere in the window below? I've tried to right click almost everywhere inside the window but still failed to find it ...

The 1.18 release note shows this:
The doc mentions:
There are five Source Control menu ids where you can place menu items, in order to provide the user with a much richer user interface.
The scm/title menu is located to the right of the SCM view title.
The menu items in the navigation group will be inline, while all the others will be within the … dropdown.

Related

Where is the Variables Menu gone in the new Dymola UI?

Until Dymola 2020, now and then I used the Edit->Variables menu to set annotations. Where do I find it in the new UI in 2020x?
Edit->Variables:
I think the dialog you are referring to is available using one of two ways:
via the context menu, after a right-click. Within the "Variables" menu you will need to select the variable you want to edit from the list shown there.
If you select a variable before doing the right-click, it will be highlighted and moved to the top of the list of available variables as shown in the above screenshot.
Additionally it should be possible to access the dialog by highlighting the variable and pressing CTRL+Shift+N, but that does not work reliably for me...
Using the component browser (after enabling the "Include non-graphical" option, which is marked red) by right-clicking the variable you want to edit and then select "Variable..."
You can also find it in the GUI in the Text tab - well hidden inside the Insert button:

Adding menu listener for Paste option in SWT Browser

I have a org.eclipse.swt.browser.Browser instance created in a composite. I would like to know when some content is pasted in the browser using the (platform specific) right click context menu and selecting the paste option.
In the menuDetected() of MenuDetectListener, I get a notification when the context menu is detected in the browser.
How can I know if the Paste option is selected from the context menu?
Regards,
Noopur
No you can't access the selected context menu item. There is no direct provision for that. At least not in eclipse 3.7. Although, you could try different combinations of events for determining the menu item. For example, in windows the internet explorer populates the status bar with 'inserts the clipboard...' when your mouse pointer hovers over the Paste menu item, you can capture this using StatusTextListener event.
Note: The hack is not an elegant solution, even if you get it working, there is still some possibility that it may break with new or older releases of SWT or in fact its behavior may vary with operating systems !!

Is it possible to hide/remove arbitrary context menu items in Eclipse (3.6)

My question can be split into three:
Is it possible to hide/remove arbitrary context menu items in Eclipse (3.6) by ...
standard UI?
some existing plug-in?
custom plug-in?
I failed to find ways to do this by methods 1 and 2. If the only option is creating custom plug-in, could anyone push me towards the right direction where to start (I have some experience in Java, but not in Eclipse plug-ins).
You can hide menus or menu entries through the standard GUI: see help
To hide a menu item or toolbar button:
Switch to the perspective that you want to configure.
Select Window > Customize Perspective....
Open the Menu Visibility or Tool Bar Visibility tab.
Find the item you want to hide.
Uncheck the check box next to the item. Uncheck a menu to hide all its children.
Click OK to cause the changes to take effect.
But that will hide this entry from all the menus (contextual or not) in which it is present.
So it may not be as fine-grained as you want through the GUI.
You can also try it through a plugin (see also Menu contribution)
The first steps are pretty standard for using extensions in Eclipse.
Open the plugin.xml file and add the org.eclipse.ui.activities extension.
Then create an activity node and give it a unique ID.
Then create an activityPatternBinding node and use the unique ID for the activity to find the pattern node to the activity node.
The activityPatternBinding node requires that you supply a regular expression for the ID string of the UI element that you wish to hide.
The problem is that there appears to be at least 3 ways that menu items and toolbar buttons are added to the UI.
The first way is through the newer Command/Menu Extensions.
The second way is through the older ActionSets Extension.
Then there are other UI elements that appear to be hard coded into the Workbench and do not have ID strings and cannot be hidden using the Activities Extension. Luckily there are few of this third type of UI element.
Considering you are talking about the latest Eclipse, I will copy only the first way:
1/ Use the Plug-In Spy
The first way is to use the Plug-In Spy.
Press alt-shift-F2 and click on a menu item or toolbar button that you want to be hidden.
If there is an ID string under the heading "active action definition identifier" then you are in luck.
This item has been added using the Command Extension and you can use this ID as the pattern argument for the Activities Extension.
But not all items that have been added using the Command Extension present their ID string to the plug-in spy.
As a side note, the ID strings are period separated.
For instance the ID for a button might be "org.eclipse.ui.navigate.backwardHistory".
Regular expressions use the period to stand for any character. Luckily the period used as a wild card matches with actual period characters so you don't need to escape them if you don't want to. I find it makes it a bit easier to read if they are not escaped and it is highly unlikely it will cause any ambiguous matches.

Eclipse code template to insert a bookmark?

Eclipse has a nifty feature which allows you to define "templates" for code. I have created one to automatically put in a println and add a "TODO" comment. I'd like for this to also add a bookmark so I can easily find it again.
(The codebase I am working with makes it unfeasible to use just the Task List to find what I need to do since there are a lot of TODOs laying around.)
My current template is simply System.out.println("don't commit me!"); //TODO: fix this ${cursor}.
A bookmark is part of the editor.
You can find all of your TODO comments in the Eclipse Tasks view. If the Tasks view isn't open, just left click on Window -> Show View -> Tasks (not Task List).
If you left click on the Tasks description to make sure the Tasks view has focus, then double click on the Tasks description, Eclipse will open the editor and take you to the TODO line.
If you have the code already open in the Eclipse editor, Eclipse draws blue rectangles on the right side of the editor to mark all of the TODO comments. Left clicking on the blue rectangles will take you to the TODO comment line.
Edited to add: You can sort the Tasks view by clicking on any of the titles, like Resource.
I don't think it's possible via a code template.
It's certainly possible with the a key shortcut that can be assigned to add bookmark in:
Window->Preferences->Keys
but you still have the prompt to enter the name of the bookmark (rather than use a default set of text).
If you really want to get close to the functionality you want you could take a look at the Eclipse Bookmarks plugin:
http://www.etc.to/eclipse_bookmarks_plugin
and maybe hack it to do what you want... (if it doesn't already)...

How can I create a YUI menu where you can click to open the submenus?

We have a multi-tiered/hierarchical YUI menu activated via a YUI menu button. Everything in this menu works pretty well. If you mouseover a menu item with a submenu, the submenu appears as expected. You can select an item from this submenu just fine.
The problem, however, is that you can also click on the parent items of this menu which closes the entire menu. In fact, I want the opposite. I'd like a click of a parent menu item leave the top level menu open and open the submenu (i.e. I want a click to be identical to a mouseover event in terms of functionality).
Side note: This isn't an issue on a typical web browser (e.g. Firefox) where the click event doesn't matter because you can't have a click without a mouseover. This is an issue on the iPhone which doesn't have a mouseover event.
I've been playing with the autosubmenudisplay properties and keepopen properties, hoping I can just handle the parent item click events to do what I want but, so far, I've been unsuccessful. If I set autosubmenudisplay to false, I can't figure out how to get the submenus to display manually. The keepopen property doesn't seem to work rather I set it on the menu or submenus.
Is there a way to get the behavior I want so our iPhone users are happy?
Todd Kloots, author of the YUI Button and Menu widgets here. Took at look at your request. Unfortunately the current version YUI Button and Menu aren't designed to support the type of interaction you are looking to create. Feel free to file a feature request via SourceForge and I'll try to work on this for a future version of YUI.
Todd
It's not exactly what you asked for, but have you looked at iUI? You may be able to pick up some tricks from the implementation.