Skip to main content



      Home
Home » Modeling » EMF Parsley » AbstractSaveableTreeView 0.5.1(API eliminated menuAboutToShow)
AbstractSaveableTreeView 0.5.1 [message #1712317] Thu, 22 October 2015 18:46 Go to next message
Eclipse UserFriend
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 #1712318 is a reply to message #1712317] Thu, 22 October 2015 18:49 Go to previous messageGo to next message
Eclipse UserFriend
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);

	}
Re: AbstractSaveableTreeView 0.5.1 [message #1712338 is a reply to message #1712318] Fri, 23 October 2015 03:55 Go to previous messageGo to next message
Eclipse UserFriend
Hi John,
since 0.5.0 version you can do all by DSL, see the following part of documentation:
https://www.eclipse.org/emf-parsley/documentation.html#par12

Let me know if you have problem
Best regards
Vincenzo Caselli
Re: AbstractSaveableTreeView 0.5.1 [message #1712379 is a reply to message #1712318] Fri, 23 October 2015 08:21 Go to previous message
Eclipse UserFriend
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
Previous Topic:TreeTable
Next Topic:DateTime Dialog
Goto Forum:
  


Current Time: Tue May 13 14:27:50 EDT 2025

Powered by FUDForum. Page generated in 0.03421 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top