Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How to open a custom IEditorInput in a single instance?
How to open a custom IEditorInput in a single instance? [message #436858] Sun, 18 September 2005 20:07 Go to next message
imre farkas is currently offline imre farkasFriend
Messages: 26
Registered: July 2009
Junior Member
Hi,

I want to open a custom IEditorInput in a single instance, as I know I
have to write the exist() method. Is there the only way to check the
opened editorInputs or exist the simplier way? Another question how to
activate the already opened IEditorInput?

Thanks in advance
-imre
Re: How to open a custom IEditorInput in a single instance? [message #436868 is a reply to message #436858] Mon, 19 September 2005 13:30 Go to previous messageGo to next message
James Leotta is currently offline James LeottaFriend
Messages: 202
Registered: July 2009
Senior Member
Got this from the Hyperbola example


Session session = Session.getIntance();
ChatEditorInput input = new ChatEditorInput(session, entry.getUser());
IEditorPart editor = page.findEditor(input);
if (editor != null) {
page.activate(editor);
return;
}
try {
page.openEditor(input, ChatEditor.ID);
} catch (PartInitException e) {
HyperbolaUtils.log("Unable to open chat editor", e);
}

farkas wrote:
> Hi,
>
> I want to open a custom IEditorInput in a single instance, as I know I
> have to write the exist() method. Is there the only way to check the
> opened editorInputs or exist the simplier way? Another question how to
> activate the already opened IEditorInput?
>
> Thanks in advance
> -imre
Re: How to open a custom IEditorInput in a single instance? [message #436876 is a reply to message #436868] Mon, 19 September 2005 15:52 Go to previous messageGo to next message
imre farkas is currently offline imre farkasFriend
Messages: 26
Registered: July 2009
Junior Member
James Leotta wrote:
> Got this from the Hyperbola example
>
>
> Session session = Session.getIntance();
> ChatEditorInput input = new ChatEditorInput(session,
> entry.getUser());
> IEditorPart editor = page.findEditor(input);
> if (editor != null) {
> page.activate(editor);
> return;
> }
> try {
> page.openEditor(input, ChatEditor.ID);
> } catch (PartInitException e) {
> HyperbolaUtils.log("Unable to open chat editor", e);
> }
>
> farkas wrote:
>
>> Hi,
>>
>> I want to open a custom IEditorInput in a single instance, as I know I
>> have to write the exist() method. Is there the only way to check the
>> opened editorInputs or exist the simplier way? Another question how to
>> activate the already opened IEditorInput?
>>
>> Thanks in advance
>> -imre

thanks a lot.

-imre
Re: How to open a custom IEditorInput in a single instance? [message #436886 is a reply to message #436876] Mon, 19 September 2005 20:53 Go to previous messageGo to next message
imre farkas is currently offline imre farkasFriend
Messages: 26
Registered: July 2009
Junior Member
farkas wrote:
> James Leotta wrote:
>
>> Got this from the Hyperbola example
>>
>>
>> Session session = Session.getIntance();
>> ChatEditorInput input = new ChatEditorInput(session,
>> entry.getUser());
>> IEditorPart editor = page.findEditor(input);
>> if (editor != null) {
>> page.activate(editor);
>> return;
>> }
>> try {
>> page.openEditor(input, ChatEditor.ID);
>> } catch (PartInitException e) {
>> HyperbolaUtils.log("Unable to open chat editor", e);
>> }
>>
>> farkas wrote:
>>
>>> Hi,
>>>
>>> I want to open a custom IEditorInput in a single instance, as I know
>>> I have to write the exist() method. Is there the only way to check
>>> the opened editorInputs or exist the simplier way? Another question
>>> how to activate the already opened IEditorInput?
>>>
>>> Thanks in advance
>>> -imre
>
>
> thanks a lot.
>
> -imre

Hi,

Everything is working fine, but if I push the right click on the editor
tab there is a New Editor menuItem. How can I disabled it?

thx
-imre
Re: How to open a custom IEditorInput in a single instance? [message #436932 is a reply to message #436886] Tue, 20 September 2005 12:11 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

farkas wrote:
> Hi,
>
> Everything is working fine, but if I push the right click on the editor
> tab there is a New Editor menuItem. How can I disabled it?
>


Check out the activities extension point and
Preferences>General>Capabilities. You can use activities to remove
certain menu items ... you just have to find the id for the menu item
you wish to remove.

Later,
PW


Previous Topic:Hook before the workbench state is closed?
Next Topic:browser in a viewpart
Goto Forum:
  


Current Time: Sun Dec 08 18:59:04 GMT 2024

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

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

Back to the top