how to allow multi select on gwt combobox - gwt

I have combo-box and i want to allow multiple selection on it
how to do that??
newEmployee = new ComboBox<NctrUserDTO>();
newEmployee.setFieldLabel("Employee");
newEmployee.setDisplayField(NctrUserDTO.NAME);
newEmployee.setTriggerAction(TriggerAction.ALL);
newEmployee.setEditable(true);
newEmployee.setStore(employeeList);
newEmployee.setMaxHeight(200);

I don't know which API's ComboBox you're using since vanilla GWT doesn't have a ComboBox, but I'd guess it's not possible to do this unless you change the ComboBox class itself/write an actual MultiSelectComboBox class. Unless your version happens to have an "enableMultiSelect" method already in-built, but you probably wouldn't be asking here then.
If it helps, I found this thread which seems similar to what you're describing.

Related

What would be the best approach to implement a multi-select combo in SWT/JFace?

I need to implement a multi-select combobox using SWT/JFace, What would be the best approach?should i go for changing the source code or i should try to extend the combo?
It is not possible to extend a Combo It is possible to extend Combo by overriding checkSubclass(), however it is highly disapproved of. The alternative is to create a wrapper for it. But that would be too much work.
Extending a CCombo is an option, but not a very good idea. Again, too much work for the functionality you need.
BUT
As sambi reddy mentioned, you could use a TableComboViewer from Nebula (scroll down to "TableCombo").
Another convenient solution (my favorite) is to have a CheckboxTreeViewer since you need to implement multi selection and such.
screenshot
https://github.com/lawhcd/SWTMultiCheckSelectionCombo
For anyone who is looking for a widget that allows user to select multiple options from a list of check box style options.
It is based on user1438038's idea and extended to provide nearly all of the api required of a widget similar to Combo.

How to programmatically change help contents in Eclipse?

I have an eclipse plugin and I would like to programmatically disable help content TOC's based on a variable I define. In a nut shell, I want to prevent some help docs from showing up in the help contents if a specific type of user is accessing the plugin.
Preferably I would like to do this in the ApplicationWorkbenchAdvisor somewhere.
One thought would be to modify the "primary" value to be false if the variable were set.
Not sure if it would work, but try using the org.eclipse.ui.activities extension point. The tutorial from Vogella tells it is possible to hide only UI elements like wizards, views and so on, but it is from 2009.. Not sure if hiding TOC is now possible. If you try it out, would be nice to give a feedback ;)

Where to Update a JFrame

Hi I have a JFrame class that I update based on information I recieve from another class. I have created an update method within the JFrame which I use to update the different objects on the page. But my Question is is that the correct thing to do?
You can make it however you want, there is no "right" way. It's all a matter of preference. Personally, I like that way of doing it. In almost all of my GUI's I have a method called "update()" or something similar.
its depends on how updates are being triggered, but using event-listeners and actionCommands might be helpful. I don't necessarily like this methods but it is convenient.

Metro Style Apps Two way Binding with XML

Can I do two way binding with an XML document in metro style apps (using WPF/C#)? I want my XML file to get updated as soon as I make a change on the UI
Sure. After update invoke your method that will update your xml file. It won`t work automaticly, you need to manage this yourself
You are asking about XAML's Mode=TwoWay binding (default is Mode=OneWay), but I think you really mean UpdateSourceTrigger=PropertyChanged (as in WPF) which in WinRT is a bit of a trick. Answer is here: “UpdateSourceTrigger=PropertyChanged” equivalent for a TextBox in WinRT-XAML
may be u can call the saveXML() method on 'textChanged' event of the textboxes or any other UI controls of your metro app...

GWT ValueListBox: can it support more than a single selection?

Can GWT's ValueListBox support multiple selections? Also, is there a way to get it to display more than a single value at a time (like ListBox.setVisibleItemCount()) ?
It seems like you'd need to get at the underlying ListBox (or somehow provide a custom one) in order to make this happen. Of course getListBox() is private, so that's out.
No. ValueListBox is intended to operate on single value. That's why it can be easily used as editor (from Editor framework) for wrapped type.
For multiple selection you can use ListBox, but AFAIK there's no straightforward way to use it as editor (you have to write your own custom editor based on ListBox).