Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » activate an graphicaleditor with a contextMenu in Eclipse
activate an graphicaleditor with a contextMenu in Eclipse [message #148709] Thu, 26 August 2004 12:41 Go to next message
Eclipse UserFriend
Originally posted by: jerome.lafon.bull.net

Hi
I have a graphicalEditor named "Editor" and I would like to launch it
with a context menu in the workspace.
So in plugin.xml I have put:
<extension
point="org.eclipse.ui.popupMenus">
<objectContribution
objectClass="org.eclipse.core.resources.IFolder"
adaptable="true"
id="org.objectweb.jinha.IFolderContributions">
<filter
name="projectNature"
value="org.eclipse.jdt.core.javanature">
</filter>
<action
label="Launch..."
tooltip="Launch JINHa"
class="org.objectweb.jinha.actions.LaunchJINHaAction"
menubarPath="JINHa.main/group1"
enablesFor="1"
id="org.objectweb.jinha.launchJinha">
</action>

But I don't really know how to implement the run(IAction) metho in
LaunchJINHaAction class !
I have written:
public void run(IAction action) {
Editor editor=new Editor();
}
but nothing happens!

is someone can help me ?
thanks
Jerome
Re: activate an graphicaleditor with a contextMenu in Eclipse [message #148917 is a reply to message #148709] Mon, 30 August 2004 10:55 Go to previous message
Eclipse UserFriend
Originally posted by: nospam.gmx.net

Hi Jerome,

perhaps this helps:

IWorkbenchWindow dwindow =
PlatformUI.getWorkbench().getActiveWorkbenchWindow();
IWorkbenchPage page = dwindow.getActivePage();

if (page != null)
{
try
{
page.openEditor(new YourEditorInput(......), "YourEditorId", true);
}
catch (PartInitException e)
{
}
}

HTH, Ingo


"jerome lafon" <jerome.lafon@bull.net> wrote in message
news:412DDA6B.D8C8C22@bull.net...
> Hi
> I have a graphicalEditor named "Editor" and I would like to launch it
> with a context menu in the workspace.
> So in plugin.xml I have put:
> <extension
> point="org.eclipse.ui.popupMenus">
> <objectContribution
> objectClass="org.eclipse.core.resources.IFolder"
> adaptable="true"
> id="org.objectweb.jinha.IFolderContributions">
> <filter
> name="projectNature"
> value="org.eclipse.jdt.core.javanature">
> </filter>
> <action
> label="Launch..."
> tooltip="Launch JINHa"
> class="org.objectweb.jinha.actions.LaunchJINHaAction"
> menubarPath="JINHa.main/group1"
> enablesFor="1"
> id="org.objectweb.jinha.launchJinha">
> </action>
>
> But I don't really know how to implement the run(IAction) metho in
> LaunchJINHaAction class !
> I have written:
> public void run(IAction action) {
> Editor editor=new Editor();
> }
> but nothing happens!
>
> is someone can help me ?
> thanks
> Jerome
>
Previous Topic:Accessing source for Logic and Flow examples
Next Topic:IFigure z-order
Goto Forum:
  


Current Time: Fri Apr 19 13:50:33 GMT 2024

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

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

Back to the top