Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Showing only one editor
Showing only one editor [message #23969] Wed, 30 April 2003 10:50 Go to next message
Eclipse UserFriend
Originally posted by: kgc.rsssolutions.com

I can open several editors with only one in focus for a particulat
TreeObject.

How to I ensure only one is opened?

Kevin
Re: Showing only one editor [message #24070 is a reply to message #23969] Wed, 30 April 2003 11:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: simon.ibm.oti.lab

How are you opening the editor? That is, what API are you using? What is the
editor input?

If you are using the IWorkbenchPage.openEditor api, then it will look for an
exising open editor whose input equals the passed in editor input. If found,
the editor is brought to the top and no new editor is open. So your editor
input should implement the equals method.

Simon :-)

"Kevin Crocker" <kgc@rsssolutions.com> wrote in message
news:b8onse$51f$1@rogue.oti.com...
> I can open several editors with only one in focus for a particulat
> TreeObject.
>
> How to I ensure only one is opened?
>
> Kevin
>
>
Re: Showing only one editor [message #24373 is a reply to message #24070] Wed, 30 April 2003 12:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: kgc.rsssolutions.com

Ok, I think I am doing it all wrong.

I have objects in a tree which I populate an EditorInput object with. And
with this new EditorInput I am using the IWorkbenchPage.openEditor but ,of
course, it is a new object even when I select the same object from the tree.

Are there any good examples of using editors?

"Simon Arsenault" <simon@ibm.oti.lab> wrote in message
news:b8opt8$74r$1@rogue.oti.com...
> How are you opening the editor? That is, what API are you using? What is
the
> editor input?
>
> If you are using the IWorkbenchPage.openEditor api, then it will look for
an
> exising open editor whose input equals the passed in editor input. If
found,
> the editor is brought to the top and no new editor is open. So your editor
> input should implement the equals method.
>
> Simon :-)
>
> "Kevin Crocker" <kgc@rsssolutions.com> wrote in message
> news:b8onse$51f$1@rogue.oti.com...
> > I can open several editors with only one in focus for a particulat
> > TreeObject.
> >
> > How to I ensure only one is opened?
> >
> > Kevin
> >
> >
>
>
Re: Showing only one editor [message #24697 is a reply to message #24373] Wed, 30 April 2003 13:29 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: kgc.rsssolutions.com

Do you mean the exists method? How would I implement that?


"Kevin Crocker" <kgc@rsssolutions.com> wrote in message
news:b8ov9r$bnc$1@rogue.oti.com...
> Ok, I think I am doing it all wrong.
>
> I have objects in a tree which I populate an EditorInput object with. And
> with this new EditorInput I am using the IWorkbenchPage.openEditor but ,of
> course, it is a new object even when I select the same object from the
tree.
>
> Are there any good examples of using editors?
>
> "Simon Arsenault" <simon@ibm.oti.lab> wrote in message
> news:b8opt8$74r$1@rogue.oti.com...
> > How are you opening the editor? That is, what API are you using? What is
> the
> > editor input?
> >
> > If you are using the IWorkbenchPage.openEditor api, then it will look
for
> an
> > exising open editor whose input equals the passed in editor input. If
> found,
> > the editor is brought to the top and no new editor is open. So your
editor
> > input should implement the equals method.
> >
> > Simon :-)
> >
> > "Kevin Crocker" <kgc@rsssolutions.com> wrote in message
> > news:b8onse$51f$1@rogue.oti.com...
> > > I can open several editors with only one in focus for a particulat
> > > TreeObject.
> > >
> > > How to I ensure only one is opened?
> > >
> > > Kevin
> > >
> > >
> >
> >
>
>
Re: Showing only one editor [message #24776 is a reply to message #24697] Wed, 30 April 2003 14:29 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: simon.ibm.oti.lab

I'm assuming you have your own implementation of IEditorInput? If so, then
you only need to add the equals method on it. Here is what we do in the
FileEditorInput class:

/**
* The <code>FileEditorInput</code> implementation of this
<code>Object</code>
* method bases the equality of two <code>FileEditorInput</code> objects on
the
* equality of their underlying <code>IFile</code> resources.
*/
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!(obj instanceof FileEditorInput))
return false;
FileEditorInput other = (FileEditorInput)obj;
return file.equals(other.file);
}

Simon :-)

"Kevin Crocker" <kgc@rsssolutions.com> wrote in message
news:b8p15v$ddd$1@rogue.oti.com...
> Do you mean the exists method? How would I implement that?
>
>
> "Kevin Crocker" <kgc@rsssolutions.com> wrote in message
> news:b8ov9r$bnc$1@rogue.oti.com...
> > Ok, I think I am doing it all wrong.
> >
> > I have objects in a tree which I populate an EditorInput object with.
And
> > with this new EditorInput I am using the IWorkbenchPage.openEditor but
,of
> > course, it is a new object even when I select the same object from the
> tree.
> >
> > Are there any good examples of using editors?
> >
> > "Simon Arsenault" <simon@ibm.oti.lab> wrote in message
> > news:b8opt8$74r$1@rogue.oti.com...
> > > How are you opening the editor? That is, what API are you using? What
is
> > the
> > > editor input?
> > >
> > > If you are using the IWorkbenchPage.openEditor api, then it will look
> for
> > an
> > > exising open editor whose input equals the passed in editor input. If
> > found,
> > > the editor is brought to the top and no new editor is open. So your
> editor
> > > input should implement the equals method.
> > >
> > > Simon :-)
> > >
> > > "Kevin Crocker" <kgc@rsssolutions.com> wrote in message
> > > news:b8onse$51f$1@rogue.oti.com...
> > > > I can open several editors with only one in focus for a particulat
> > > > TreeObject.
> > > >
> > > > How to I ensure only one is opened?
> > > >
> > > > Kevin
> > > >
> > > >
> > >
> > >
> >
> >
>
>
Re: Showing only one editor [message #26535 is a reply to message #24776] Thu, 01 May 2003 14:54 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: kgc.rsssolutions.com

Worked great.

Hey Simon, Do you know if any training course occuring in Canada or if
there are consultants that would come to a corporate office to do in-house
training.

"Simon Arsenault" <simon@ibm.oti.lab> wrote in message
news:b8p4me$gir$1@rogue.oti.com...
> I'm assuming you have your own implementation of IEditorInput? If so, then
> you only need to add the equals method on it. Here is what we do in the
> FileEditorInput class:
>
> /**
> * The <code>FileEditorInput</code> implementation of this
> <code>Object</code>
> * method bases the equality of two <code>FileEditorInput</code> objects
on
> the
> * equality of their underlying <code>IFile</code> resources.
> */
> public boolean equals(Object obj) {
> if (this == obj)
> return true;
> if (!(obj instanceof FileEditorInput))
> return false;
> FileEditorInput other = (FileEditorInput)obj;
> return file.equals(other.file);
> }
>
> Simon :-)
>
> "Kevin Crocker" <kgc@rsssolutions.com> wrote in message
> news:b8p15v$ddd$1@rogue.oti.com...
> > Do you mean the exists method? How would I implement that?
> >
> >
> > "Kevin Crocker" <kgc@rsssolutions.com> wrote in message
> > news:b8ov9r$bnc$1@rogue.oti.com...
> > > Ok, I think I am doing it all wrong.
> > >
> > > I have objects in a tree which I populate an EditorInput object with.
> And
> > > with this new EditorInput I am using the IWorkbenchPage.openEditor but
> ,of
> > > course, it is a new object even when I select the same object from the
> > tree.
> > >
> > > Are there any good examples of using editors?
> > >
> > > "Simon Arsenault" <simon@ibm.oti.lab> wrote in message
> > > news:b8opt8$74r$1@rogue.oti.com...
> > > > How are you opening the editor? That is, what API are you using?
What
> is
> > > the
> > > > editor input?
> > > >
> > > > If you are using the IWorkbenchPage.openEditor api, then it will
look
> > for
> > > an
> > > > exising open editor whose input equals the passed in editor input.
If
> > > found,
> > > > the editor is brought to the top and no new editor is open. So your
> > editor
> > > > input should implement the equals method.
> > > >
> > > > Simon :-)
> > > >
> > > > "Kevin Crocker" <kgc@rsssolutions.com> wrote in message
> > > > news:b8onse$51f$1@rogue.oti.com...
> > > > > I can open several editors with only one in focus for a particulat
> > > > > TreeObject.
> > > > >
> > > > > How to I ensure only one is opened?
> > > > >
> > > > > Kevin
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
Re: Showing only one editor [message #26821 is a reply to message #26535] Thu, 01 May 2003 16:31 Go to previous message
Eclipse UserFriend
Originally posted by: simon.ibm.oti.lab

Not that I'm aware of. You may want to post a new message for this
question...maybe someone else on the forum would have an answer for you.

Simon :-)

"Kevin Crocker" <kgc@rsssolutions.com> wrote in message
news:b8rqhs$cen$1@rogue.oti.com...
> Worked great.
>
> Hey Simon, Do you know if any training course occuring in Canada or if
> there are consultants that would come to a corporate office to do in-house
> training.
>
> "Simon Arsenault" <simon@ibm.oti.lab> wrote in message
> news:b8p4me$gir$1@rogue.oti.com...
> > I'm assuming you have your own implementation of IEditorInput? If so,
then
> > you only need to add the equals method on it. Here is what we do in the
> > FileEditorInput class:
> >
> > /**
> > * The <code>FileEditorInput</code> implementation of this
> > <code>Object</code>
> > * method bases the equality of two <code>FileEditorInput</code> objects
> on
> > the
> > * equality of their underlying <code>IFile</code> resources.
> > */
> > public boolean equals(Object obj) {
> > if (this == obj)
> > return true;
> > if (!(obj instanceof FileEditorInput))
> > return false;
> > FileEditorInput other = (FileEditorInput)obj;
> > return file.equals(other.file);
> > }
> >
> > Simon :-)
> >
> > "Kevin Crocker" <kgc@rsssolutions.com> wrote in message
> > news:b8p15v$ddd$1@rogue.oti.com...
> > > Do you mean the exists method? How would I implement that?
> > >
> > >
> > > "Kevin Crocker" <kgc@rsssolutions.com> wrote in message
> > > news:b8ov9r$bnc$1@rogue.oti.com...
> > > > Ok, I think I am doing it all wrong.
> > > >
> > > > I have objects in a tree which I populate an EditorInput object
with.
> > And
> > > > with this new EditorInput I am using the IWorkbenchPage.openEditor
but
> > ,of
> > > > course, it is a new object even when I select the same object from
the
> > > tree.
> > > >
> > > > Are there any good examples of using editors?
> > > >
> > > > "Simon Arsenault" <simon@ibm.oti.lab> wrote in message
> > > > news:b8opt8$74r$1@rogue.oti.com...
> > > > > How are you opening the editor? That is, what API are you using?
> What
> > is
> > > > the
> > > > > editor input?
> > > > >
> > > > > If you are using the IWorkbenchPage.openEditor api, then it will
> look
> > > for
> > > > an
> > > > > exising open editor whose input equals the passed in editor input.
> If
> > > > found,
> > > > > the editor is brought to the top and no new editor is open. So
your
> > > editor
> > > > > input should implement the equals method.
> > > > >
> > > > > Simon :-)
> > > > >
> > > > > "Kevin Crocker" <kgc@rsssolutions.com> wrote in message
> > > > > news:b8onse$51f$1@rogue.oti.com...
> > > > > > I can open several editors with only one in focus for a
particulat
> > > > > > TreeObject.
> > > > > >
> > > > > > How to I ensure only one is opened?
> > > > > >
> > > > > > Kevin
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
Previous Topic:Updating Changes to a object in a TreeViewer
Next Topic:What java command is run when the eclipse.exe file is run?
Goto Forum:
  


Current Time: Tue Jul 22 14:38:01 EDT 2025

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

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

Back to the top