Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Property pages for my own classes.
Property pages for my own classes. [message #310389] Thu, 30 November 2006 12:38 Go to next message
Eclipse UserFriend
Originally posted by: matt.querix.com

Hi all,

I have a view which shows objects of my own classes from my model layer.
I would like to add a 'properties' action on the context menu that shows
the property pages I have declared using the
org.eclipse.ui.propertyPages extension point. Do I have to implement
this action myself? If not how do I get it to appear - my context menu
is registered with the IViewSite and has the MB_EXTENSIONS groups.

Thanks in advance

Matt
Re: Property pages for my own classes. [message #310390 is a reply to message #310389] Thu, 30 November 2006 12:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

This is a multi-part message in MIME format.
--------------010504090708060804000701
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Matt,

In EMF's org.eclipse.emf.ecore.presentation.EcoreActionBarContributor we
do it like this:

protected IAction showPropertiesViewAction =
new
Action(EcoreEditorPlugin.INSTANCE.getString("_UI_ShowPropertiesView_menu_item "))
{
public void run()
{
try
{
getPage().showView("org.eclipse.ui.views.PropertySheet");
}
catch (PartInitException exception)
{
EcoreEditorPlugin.INSTANCE.log(exception);
}
}
};

protected void addGlobalActions(IMenuManager menuManager)
{
menuManager.insertAfter("additions-end", new
Separator("ui-actions"));
menuManager.insertAfter("ui-actions", showPropertiesViewAction);


refreshViewerAction.setEnabled(refreshViewerAction.isEnabled ());
menuManager.insertAfter("ui-actions", refreshViewerAction);

super.addGlobalActions(menuManager);
}


Matt Dickie wrote:
> Hi all,
>
> I have a view which shows objects of my own classes from my model
> layer. I would like to add a 'properties' action on the context menu
> that shows the property pages I have declared using the
> org.eclipse.ui.propertyPages extension point. Do I have to implement
> this action myself? If not how do I get it to appear - my context menu
> is registered with the IViewSite and has the MB_EXTENSIONS groups.
>
> Thanks in advance
>
> Matt


--------------010504090708060804000701
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Matt,<br>
<br>
In EMF's org.eclipse.emf.ecore.presentation.EcoreActionBarContributor
we do it like this:<br>
<blockquote><small>&nbsp; protected IAction showPropertiesViewAction =</small><br>
<small>&nbsp;&nbsp;&nbsp; new
Action(EcoreEditorPlugin.INSTANCE.getString("_UI_ShowPropertiesView_menu_item "))</small><br>
<small>&nbsp;&nbsp;&nbsp; {</small><br>
<small>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public void run()</small><br>
<small>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</small><br>
<small> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; try</small><br>
<small> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; {</small><br>
<small> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
getPage().showView("org.eclipse.ui.views.PropertySheet");</small ><br>
<small> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; }</small><br>
<small> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; catch (PartInitException exception)</small><br>
<small> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; {</small><br>
<small> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; EcoreEditorPlugin.INSTANCE.log(exception);</small><br>
<small> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; }</small><br>
<small>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</small><br>
<small>&nbsp;&nbsp;&nbsp; };</small><br>
<br>
<small>&nbsp; protected void addGlobalActions(IMenuManager menuManager)</small><br>
<small>&nbsp; {</small><br>
<small>&nbsp;&nbsp;&nbsp; menuManager.insertAfter("additions-end", new
Separator("ui-actions"));</small><br>
<small>&nbsp;&nbsp;&nbsp; menuManager.insertAfter("ui-actions",
showPropertiesViewAction);</small><br>
<br>
<small>&nbsp;&nbsp;&nbsp;
refreshViewerAction.setEnabled(refreshViewerAction.isEnabled ());&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
</small><br>
<small>&nbsp;&nbsp;&nbsp; menuManager.insertAfter("ui-actions", refreshViewerAction);</small><br>
<br>
<small>&nbsp;&nbsp;&nbsp; super.addGlobalActions(menuManager);</small><br>
<small>&nbsp; }</small><br>
</blockquote>
<br>
Matt Dickie wrote:
<blockquote cite="midekmjbq$qac$1@utils.eclipse.org" type="cite">Hi
all,
<br>
<br>
I have a view which shows objects of my own classes from my model
layer. I would like to add a 'properties' action on the context menu
that shows the property pages I have declared using the
org.eclipse.ui.propertyPages extension point. Do I have to implement
this action myself? If not how do I get it to appear - my context menu
is registered with the IViewSite and has the MB_EXTENSIONS groups.
<br>
<br>
Thanks in advance
<br>
<br>
Matt
<br>
</blockquote>
<br>
</body>
</html>

--------------010504090708060804000701--
Re: Property pages for my own classes. [message #310393 is a reply to message #310390] Thu, 30 November 2006 15:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: matt.querix.com

Hi Ed,

Thanks, but I think you misunderstood, I want to display the property
pages dialog, not the properties view. I think I'll just write my own
action to do it.

Matt

Ed Merks wrote:
> Matt,
>
> In EMF's org.eclipse.emf.ecore.presentation.EcoreActionBarContributor we
> do it like this:
>
> protected IAction showPropertiesViewAction =
> new
> Action(EcoreEditorPlugin.INSTANCE.getString("_UI_ShowPropertiesView_menu_item "))
> {
> public void run()
> {
> try
> {
> getPage().showView("org.eclipse.ui.views.PropertySheet");
> }
> catch (PartInitException exception)
> {
> EcoreEditorPlugin.INSTANCE.log(exception);
> }
> }
> };
>
> protected void addGlobalActions(IMenuManager menuManager)
> {
> menuManager.insertAfter("additions-end", new
> Separator("ui-actions"));
> menuManager.insertAfter("ui-actions", showPropertiesViewAction);
>
>
> refreshViewerAction.setEnabled(refreshViewerAction.isEnabled ());
> menuManager.insertAfter("ui-actions", refreshViewerAction);
>
> super.addGlobalActions(menuManager);
> }
>
>
> Matt Dickie wrote:
>
>> Hi all,
>>
>> I have a view which shows objects of my own classes from my model
>> layer. I would like to add a 'properties' action on the context menu
>> that shows the property pages I have declared using the
>> org.eclipse.ui.propertyPages extension point. Do I have to implement
>> this action myself? If not how do I get it to appear - my context menu
>> is registered with the IViewSite and has the MB_EXTENSIONS groups.
>>
>> Thanks in advance
>>
>> Matt
>
>
Re: Property pages for my own classes. [message #310394 is a reply to message #310393] Thu, 30 November 2006 15:08 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Matt,

Yep, I did misunderstand. Sorry.


Matt Dickie wrote:
> Hi Ed,
>
> Thanks, but I think you misunderstood, I want to display the property
> pages dialog, not the properties view. I think I'll just write my own
> action to do it.
>
> Matt
>
> Ed Merks wrote:
>> Matt,
>>
>> In EMF's org.eclipse.emf.ecore.presentation.EcoreActionBarContributor
>> we do it like this:
>>
>> protected IAction showPropertiesViewAction =
>> new
>>
>> Action(EcoreEditorPlugin.INSTANCE.getString("_UI_ShowPropertiesView_menu_item "))
>>
>> {
>> public void run()
>> {
>> try
>> {
>> getPage().showView("org.eclipse.ui.views.PropertySheet");
>> }
>> catch (PartInitException exception)
>> {
>> EcoreEditorPlugin.INSTANCE.log(exception);
>> }
>> }
>> };
>>
>> protected void addGlobalActions(IMenuManager menuManager)
>> {
>> menuManager.insertAfter("additions-end", new
>> Separator("ui-actions"));
>> menuManager.insertAfter("ui-actions", showPropertiesViewAction);
>>
>>
>> refreshViewerAction.setEnabled(refreshViewerAction.isEnabled ());
>> menuManager.insertAfter("ui-actions", refreshViewerAction);
>>
>> super.addGlobalActions(menuManager);
>> }
>>
>>
>> Matt Dickie wrote:
>>
>>> Hi all,
>>>
>>> I have a view which shows objects of my own classes from my model
>>> layer. I would like to add a 'properties' action on the context menu
>>> that shows the property pages I have declared using the
>>> org.eclipse.ui.propertyPages extension point. Do I have to implement
>>> this action myself? If not how do I get it to appear - my context
>>> menu is registered with the IViewSite and has the MB_EXTENSIONS groups.
>>>
>>> Thanks in advance
>>>
>>> Matt
>>
>>
Re: Property pages for my own classes. [message #310395 is a reply to message #310394] Thu, 30 November 2006 15:20 Go to previous message
Eclipse UserFriend
Originally posted by: matt.querix.com

Hi Ed,

I've just found org.eclipse.ui.dialogs.PropertyDialogAction - that seems
to be what I need. Thanks

Matt

Ed Merks wrote:
> Matt,
>
> Yep, I did misunderstand. Sorry.
>
>
> Matt Dickie wrote:
>
>> Hi Ed,
>>
>> Thanks, but I think you misunderstood, I want to display the property
>> pages dialog, not the properties view. I think I'll just write my own
>> action to do it.
>>
>> Matt
>>
>> Ed Merks wrote:
>>
>>> Matt,
>>>
>>> In EMF's org.eclipse.emf.ecore.presentation.EcoreActionBarContributor
>>> we do it like this:
>>>
>>> protected IAction showPropertiesViewAction =
>>> new
>>>
>>> Action(EcoreEditorPlugin.INSTANCE.getString("_UI_ShowPropertiesView_menu_item "))
>>>
>>> {
>>> public void run()
>>> {
>>> try
>>> {
>>> getPage().showView("org.eclipse.ui.views.PropertySheet");
>>> }
>>> catch (PartInitException exception)
>>> {
>>> EcoreEditorPlugin.INSTANCE.log(exception);
>>> }
>>> }
>>> };
>>>
>>> protected void addGlobalActions(IMenuManager menuManager)
>>> {
>>> menuManager.insertAfter("additions-end", new
>>> Separator("ui-actions"));
>>> menuManager.insertAfter("ui-actions", showPropertiesViewAction);
>>>
>>>
>>> refreshViewerAction.setEnabled(refreshViewerAction.isEnabled ());
>>> menuManager.insertAfter("ui-actions", refreshViewerAction);
>>>
>>> super.addGlobalActions(menuManager);
>>> }
>>>
>>>
>>> Matt Dickie wrote:
>>>
>>>> Hi all,
>>>>
>>>> I have a view which shows objects of my own classes from my model
>>>> layer. I would like to add a 'properties' action on the context menu
>>>> that shows the property pages I have declared using the
>>>> org.eclipse.ui.propertyPages extension point. Do I have to implement
>>>> this action myself? If not how do I get it to appear - my context
>>>> menu is registered with the IViewSite and has the MB_EXTENSIONS groups.
>>>>
>>>> Thanks in advance
>>>>
>>>> Matt
>>>
>>>
>>>
Previous Topic:How to stop a Launch which dynamically has processes from terminating
Next Topic:questions re a non-ui plugin
Goto Forum:
  


Current Time: Thu Mar 28 19:04:26 GMT 2024

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

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

Back to the top