Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF Parsley » AbstractSaveableTreeView 0.5.1(API eliminated menuAboutToShow)
AbstractSaveableTreeView 0.5.1 [message #1712317] Thu, 22 October 2015 22:46 Go to next message
John Conlon is currently offline John ConlonFriend
Messages: 35
Registered: July 2009
Member
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 22:49 Go to previous messageGo to next message
John Conlon is currently offline John ConlonFriend
Messages: 35
Registered: July 2009
Member
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 07:55 Go to previous messageGo to next message
Vincenzo Caselli is currently offline Vincenzo CaselliFriend
Messages: 235
Registered: January 2012
Senior Member

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 12:21 Go to previous message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1812
Registered: July 2009
Location: Firenze, Italy
Senior Member
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: Thu Apr 25 12:51:52 GMT 2024

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

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

Back to the top