Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » How to display an Editor without File Input
How to display an Editor without File Input [message #254042] Sat, 19 June 2004 13:14 Go to next message
Eclipse UserFriend
Originally posted by: cburleso.us.ibm.com

I am creating an Editor for editing properties of a model object. The
model is already instantiated, so I do not want to edit a file - I just
want to edit the properties of the model object. I want to use an editor
instead of a property page because I want more control of the UI for the
editor. Does anyone know how I can instantiate and display the editor so
that I can set its input to be my model object? All I can find about
editors is how to associate them with file resources for opening and
displaying. What is a simple call to just display my editor like you would
a viewer?

Thanks in advance!

- Cody
Re: How to display an Editor without File Input [message #254051 is a reply to message #254042] Sat, 19 June 2004 14:46 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: itheg._spam_no_hotmail.com

hi cody-
pls check my thread from yesterday...i had the same situation.
i solved it by deriving a class from my model...the derived class implements
IEditorInput...
pass an instance of this class to IWorkbenchPage.openEditor().

i am not sure it this is the right way, but it works for me (so far at
leaset;-)

-sri

<cburleso@us.ibm.com> wrote in message news:cb1s95$5qn$1@eclipse.org...
> I am creating an Editor for editing properties of a model object. The
> model is already instantiated, so I do not want to edit a file - I just
> want to edit the properties of the model object. I want to use an editor
> instead of a property page because I want more control of the UI for the
> editor. Does anyone know how I can instantiate and display the editor so
> that I can set its input to be my model object? All I can find about
> editors is how to associate them with file resources for opening and
> displaying. What is a simple call to just display my editor like you would
> a viewer?
>
> Thanks in advance!
>
> - Cody
Re: How to display an Editor without File Input [message #254055 is a reply to message #254051] Sat, 19 June 2004 15:59 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cburleso.us.ibm.com

Thanks!

Can you supply a few more lines of code? I'm not sure what comes before or
after. Off of what do I make this call? My dot syntax produces no such
method for IWorkbenchPage.

Any more you can provide is greatly appreciated.

- Cody
Re: How to display an Editor without File Input [message #254059 is a reply to message #254055] Sat, 19 June 2004 17:02 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: itheg._spam_no_hotmail.com

hi-
what version of the SDK are u using ? i am using Eclipse3.0 M9 build
this is what i do from my view to open an editor -

// create a new model for the editor
MyEditorModel newModel = new MyEditorModel();
// open editor
IWorkbenchPage page =
getSite().getWorkbenchWindow().getActivePage();
if (page != null)
{
try {
page.openEditor(newModel, "com.mytest.editors.mappingEditor", true);
} catch (PartInitException e) {
MessageDialog.openError(getSite().getShell(), "Editor", "cannot open
editor");
e.printStackTrace();
}
}

hope this helps.
-sri

<cburleso@us.ibm.com> wrote in message news:cb25ub$g1a$1@eclipse.org...
> Thanks!
>
> Can you supply a few more lines of code? I'm not sure what comes before or
> after. Off of what do I make this call? My dot syntax produces no such
> method for IWorkbenchPage.
>
> Any more you can provide is greatly appreciated.
>
> - Cody
Re: How to display an Editor without File Input [message #254114 is a reply to message #254059] Sun, 20 June 2004 11:46 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cburleso.us.ibm.com

<br><font size=2 face="sans-serif">That's exactly what I needed. Thank
you so much for taking the time to help out.</font>
<br>
<br><font size=2 face="sans-serif">- Cody</font>
Re: How to display an Editor without File Input [message #254276 is a reply to message #254114] Mon, 21 June 2004 11:04 Go to previous message
Eclipse UserFriend
Originally posted by: nick_edgar._no.spam.please_.ca.ibm.com

Yes, it's nice to see the Eclipse community supporting itself like this.

Nick

<cburleso@us.ibm.com> wrote in message news:cb4bh2$q67$1@eclipse.org...

That's exactly what I needed. Thank you so much for taking the time to help
out.

- Cody
Previous Topic:RCP: how to change perspective bar location ?
Next Topic:problem with multiple views and perspective placeholders
Goto Forum:
  


Current Time: Sat Jun 07 10:27:10 EDT 2025

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

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

Back to the top