It is bit similar to the question asked in Disable Chrome paste menu on text inputs while on a touch screen
Needs to get rid of the context menu showing and also needs to get rid of this blue drop completely from the input fields.
Is there a way to achieve that?
I could find ways to disable the right click context menu completely, but could not find a way to completely get rid of this paste menu and this annoying blue drop in input fields.
I need to know how to override and disable the behaviour in CEF-java?
Related
Current GUI with the buttons in question
My problem is that I need to prevent the user from clicking the Next Button when specific conditions are not met, I thought the best way for this would be to overwrite the onClickEvent for this Button but it seems impossible to the required field access to these buttons.
I looked through the available methods in the documentation as well as the source code but I was not able to find anything which would help to achieve my goal.
Google Chrome Recently had an update that added an extra button onto to the top of the window that allowed you edit your account settings. I have a great use for an extra button like this one but I do not know how to make it. So, how can I add an extra button at the top of the window?
This is what I would like to do or have in mind.
This is more of an amateur/simple answer but it could be possible just to make a title bar with all of the drop downs without text until you reach the button you want and customize that
I'm developing an Eclipse plugin that has a toolbar menu item that will be enabling/disabling a feature. I know how to set the icon and tooltip text for it using the plugin.xml file, but I want to be able to change the icon and especially the tooltip text for it depending on the state of the project being worked on. I.e., if the feature is not enabled, I want an icon that shows turning the feature on along with tooltip text that says "enable feature", but if the feature is enabled, I want an icon that shows turning the feature off along with tooltip text that says "disable feature". Right now, the only option I can see is a generic icon and tooltip text that says "enable/disable feature", but that feels clumsy to me.
Edit to add: In response to indigomonkey's answer, which is a good one based on what I originally wrote, I would like to clarify that the behavior that is being enabled by the toolbar button is one that we really discourage ever disabling once it has been enabled (and a dialog pops up both to when enabling it to verify that they want to enable it because it should not be started lightly as well as to discourage them from disabling it once it is enabled). Because of this, I would like the icon to change to one that suggests "don't click on me".
If your command Handler implements IElementUpdater the updateElement method will be called whenever the command is run.
The UIElement parameter of updateElement has setIcon and setTooltip methods.
I would suggest that you choose to create your toolbar contribution as a 'checkbox' type, rather than the standard 'push'. This will mean that the button will toggle between a selected and unselected state, allowing you to equate this behaviour to the enabled and disabled state of your feature.
If you're using org.eclipse.ui.commands and org.eclipse.ui.handlers along with the org.eclipse.ui.menus extension point to contribute your button with a <command> element, you'll need to set its style attribute to check. You can then read and toggle the command's selection from inside the handler.
For more information, see http://blog.eclipse-tips.com/2009/03/commands-part-6-toggle-radio-menu.html.
In rcp E4 the solution seems to be a bit different. Since I first stumbled accross this question, I want to summerize/link the solution for future developers.
The relevant questions, where I found the answer are Switch Image of a Handler in a e4 rcp and RCP 4 Toggle a button in the toolbar.
Basically you need to add the argument MToolItem to your Execute-method like this:
#Execute
public void execute(final MToolItem item)
{
item.setIconURI("platform:/plugin/......");
//additional changes e.g. to the tooltip are also possible.
}
If you additionally give your toolbarbutton type checked
<elements xsi:type="menu:HandledToolItem" type="Check" ...
the item will automatically toggle between selected/unselected with each click. You can get the current state with
item.isSelected(). As a side effect, the toolbar icon will be highlighed in the selected-state. If you don't want that, you need to keep track of the state yourself.
I don't always want it up, I'm on a laptop screen so it'd be nice to have the vertical screen real estate for the code, and then to enable the console only when I want it. I know I can toggle it on, but it only seems to work for toggling it on, triggering the shortcut again won't hide it.
You could bind the Minimize Active View or Editor command in Preferences > General > Keys to any key combination you want, and if you do it the Console, it will minimize it. However when you do this, it will minimize all the views that share docking space with the Console. You can bring it up again with Alt+Shift+Q,C but this will show the Console as a floating view, it won't maximize the dock to it's original position. Hit Esc in this floating Console and it will go away.
If you can live with this, then it's probably OK.
Another way would be to maximize the Code view with Ctrl+M, in case you want to focus just on the code.
You can define different perspectives for that purpose.
See How To Add Perspectives In Eclipse
You can add or edit existing shortcuts in Preferences > General > Keys (or press Ctrl+3, type Keys and select)... type in console to filter out all the irrelevant shortcuts.
Here's an article with more details, and a video :)
http://eclipse.dzone.com/articles/how-manage-keyboard-shortcuts
I have a menu with a few JCheckBoxMnuItems. How do I ensure that the Menu stays open until I have done all my selections (i.e. checked the menuitems) and does not close on just clicking one of them?
I'd rather not try to change the normal menu behavior for an application or for a part of the menu tree. A User expects that the menu closes automatically after a menu item is clicked. And, if you kept the menu expanded, what kind of action would you invent to close it manually after you've done your last selection?
If there's a requirement to change more then one setting within one use case, then you should consider to provide a small dialog where the use can apply the changes and confirm them at once. I believe, that's more consistent with typical behaviors of UIs.
And it declutters the menu bar, you'll have just one 'setup' menu item instead of a dozen (?) check box actions :)
I guess menu's aren't supposed to allow multi-selection.
But you may offer keyboard shortcuts to set the menuitems without using the menu at all.
If the set-operation of your flags is a central aspect in your application, I would tend to use a dialog here. These are all suggestions which do not require to change the internal implementation of the existing controls, even though I know, that it would be possible in swing.
I agree that it is better to do this with standard UI. However, if do you want to add checkboxes that do not close the menu it is surprisingly easy:
JCheckBox checkBox = new JCheckBox("Text");
checkBox.setOpaque(false);
checkBox.setRequestFocusEnabled(false);
menu.add(checkBox);
This may not work on every look and feel and the check boxes will not line up with menu items in the same manner as JMenuItems but it seems to be a reasonable place to start.