AbstractSaveableTreeView 0.5.1 [message #1712317] |
Thu, 22 October 2015 18:46  |
Eclipse User |
|
|
|
After upgrading to 0.5.1 I followed the migration guides, but I am stumped by the change to the AbstractSaveableTreeView. Here is how I used it before to add actions to the the view menu:
class MasterTreeView extends AbstractSaveaclass MasterTreeView extends AbstractSaveableTreeView {
protected List<Action> actions = new Arclass MasterTreeView extends AbstractSaveableTreeView {
protected List<Action> actions = new Arclass MasterTreeView extends AbstractSaveableTreeView {
protected List<Action> actions = new ArrayList<Action>();
private RemoveAllViewSelectorsAction removeAllViewerSelectors;
private OCLFilterSelectionAction oclFilterSelectionAction;
@Override
public void menuAboutToShow(IMenuManager manager) {
super.menuAboutToShow(manager);
manager.add(removeAllViewerSelectors);
}rayList<Action>();
private RemoveAllViewSelectorsAction removeAllViewerSelectors;
private OCLFilterSelectionAction oclFilterSelectionAction;
@Override
public void menuAboutToShow(IMenuManager manager) {
super.menuAboutToShow(manager);
manager.add(removeAllViewerSelectors);
}rayList<Action>();
private RemoveAllViewSelectorsAction removeAllViewerSelectors;
private OCLFilterSelectionAction oclFilterSelectionAction;
@Override
public void menuAboutToShow(IMenuManager manager) {
super.menuAboutToShow(manager);
manager.add(removeAllViewerSelectors);
}bleTreeView {
protected List<Action> actions = new ArrayList<Action>();
private RemoveAllViewSelectorsAction removeAllViewerSelectors;
private OCLFilterSelectionAction oclFilterSelectionAction;
@Override
public void menuAboutToShow(IMenuManager manager) {
super.menuAboutToShow(manager);
manager.add(removeAllViewerSelectors);
}
I see that there now there is no longer a menuAboutToShow method. How with 5.1 can I add actions to the View menu?
thanks
John
|
|
|
|
|
Re: AbstractSaveableTreeView 0.5.1 [message #1712379 is a reply to message #1712318] |
Fri, 23 October 2015 08:21  |
Eclipse User |
|
|
|
On 23/10/2015 00:49, John Conlon wrote:
> Sorry for the format problems code snippet should be:
>
>
> class MasterTreeView extends AbstractSaveableTreeView {
> protected List<Action> actions = new ArrayList<Action>();
> private RemoveAllViewSelectorsAction removeAllViewerSelectors;
> private OCLFilterSelectionAction oclFilterSelectionAction;
>
> @Override
> public void menuAboutToShow(IMenuManager manager) {
> super.menuAboutToShow(manager);
> manager.add(removeAllViewerSelectors);
>
> }
>
Hi John
as described in the migration guide, we changed the context menu
handling to make it easier; in particular, it should be easier to
customize the context menu in the DSL.
Can you implement the actions with the DSL section?
If you can't, and you really want to manage the menu yourself, I think
you can still retrieve the Menu of the underlying viewer:
viewer.getControl().getMenu()
and then create a new menu menager on top of that. (You can get
inspiration from ViewerContextMenuHelper).
It might also be worthwhile to reintroduce some API in our views to get
access to the menu manager... in that case, please file a bug.
cheers
Lorenzo
--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book
|
|
|
Powered by
FUDForum. Page generated in 0.03421 seconds