Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » context menu and properties
context menu and properties [message #184076] Fri, 10 June 2005 08:54 Go to next message
Eclipse UserFriend
Originally posted by: sidney.lee.ibs.net

hi! have looked through the posts here but found nothing on providing an
entry point to the properties view on the context menu. This would
enable the properties view to be displayed for a component (at present,
one has to do this via 'Window': 'Show View' -> 'Properties'). I have
created customized actions before so am purely interested in how to link
to the workbench action. I might have to customise it anyway so as not
to make the option available where multiple components have been selected.

any suggestions?

many thanks!
Re: context menu and properties [message #184255 is a reply to message #184076] Fri, 10 June 2005 21:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: harsh.ti.com

Here are the steps...

1. Make sure the object you want to display implements the IAdaptable
method
2. Create an action to show the property view
3. In the getAdapter(Class key) method of your object, return the
IPropertySource object.
4. If you are using a TreeViewer, you will also need to fire selection
change events.

I hope this helps,
Harsh
Re: context menu and properties [message #184359 is a reply to message #184255] Mon, 13 June 2005 08:08 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sidney.lee.ibs.net

Thanks, but I think u have misunderstood... I have properties already
enabled in my application. What I want is to have a properties option on
the context menu such that when an edit part is selected and the context
menu invoked, a 'properties' option can be used to display the
properties view rather than going the 'Window': 'Show View' ->
'Properties' route. I want know what I need to invoke in my custom
action to enable this.

Many Thanks!

Harsh Sabikhi wrote:
> Here are the steps...
>
> 1. Make sure the object you want to display implements the IAdaptable
> method
> 2. Create an action to show the property view
> 3. In the getAdapter(Class key) method of your object, return the
> IPropertySource object.
> 4. If you are using a TreeViewer, you will also need to fire selection
> change events.
>
> I hope this helps,
> Harsh
>
Re: context menu and properties [message #184402 is a reply to message #184255] Mon, 13 June 2005 12:45 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sidney.lee.ibs.net

Sorry, seems it was I who misunderstood. However, u merely outlined what
I already knew. What I was after were the details in step 2, i.e. what
do I need to do in my action to show the properties view?

Many Thanks!


Harsh Sabikhi wrote:
> Here are the steps...
>
> 1. Make sure the object you want to display implements the IAdaptable
> method
> 2. Create an action to show the property view
> 3. In the getAdapter(Class key) method of your object, return the
> IPropertySource object.
> 4. If you are using a TreeViewer, you will also need to fire selection
> change events.
>
> I hope this helps,
> Harsh
>
Re: context menu and properties [message #184425 is a reply to message #184402] Mon, 13 June 2005 14:57 Go to previous message
Eclipse UserFriend
Originally posted by: harsh.ti.com

Not a problem. Here you go...

showProperties = new Action() {
public void run() {
String viewId "org.eclipse.ui.views.PropertySheet";
IWorkbench wb = RtaPlugin.getDefault().getWorkbench();
IWorkbenchWindow window = wb.getActiveWorkbenchWindow();
IWorkbenchPage page = window.getActivePage();
try {
page.showView(viewId, null,
IWorkbenchPage.VIEW_ACTIVATE);

} catch (PartInitException e) {
ErrorDialog.openError(window.getShell(),
WorkbenchMessages.getString("ShowView.errorTitle"), //$NON-NLS-1$
e.getMessage(), e.getStatus());
}

Sorry about the formating.

Harsh

}

};
showProperties.setText("Properties");
Previous Topic:An interesting blog for you to read dad
Next Topic:GEF SDK v3.1.0RC1: bug in class NodeCluster?
Goto Forum:
  


Current Time: Tue Dec 03 05:42:59 GMT 2024

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

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

Back to the top