Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » how to open an empty editor at startup
how to open an empty editor at startup [message #654011] Sat, 12 February 2011 22:26 Go to next message
Carlo Salinari is currently offline Carlo SalinariFriend
Messages: 66
Registered: October 2010
Member
Hi,

I've made a simple rcp app with a view and a non-textual editor.

I would like the app to show an empty editor at startup, something with
a name like "Unnamed_1.ext".

I think I have to implement a sort of "New File" command that creates a
dummy file handler with the extension for which the editor is
registered, and then ask the Workbench to load it.

But how do I do that?
Where and when do I place the call to such a command?


Cheers,
Carlo
Re: how to open an empty editor at startup [message #654165 is a reply to message #654011] Mon, 14 February 2011 13:09 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

The workbench uses
org.eclipse.ui.internal.editors.text.UntitledTextFileWizard

and hooks into New>Untitle Text file.

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Platform_Expression_Framework
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Re: how to open an empty editor at startup [message #654178 is a reply to message #654165] Mon, 14 February 2011 13:49 Go to previous messageGo to next message
Carlo Salinari is currently offline Carlo SalinariFriend
Messages: 66
Registered: October 2010
Member
On 2/14/2011 2:09 PM, Paul Webster wrote:
> The workbench uses
> org.eclipse.ui.internal.editors.text.UntitledTextFileWizard
>
> and hooks into New>Untitle Text file.
>
> PW
>

Ok, but I'd like the application (i.e. the workbench) to present the
user with an already-open new untitled file at startup. That is: the
user shouldn't have to click the New button or menuitem.

Perhaps I could invoke my New_Untitled command in
ApplicationWorkbenchWindowAdvisor.postWindowOpen()?

Does it sound as the right place to do that?
Re: how to open an empty editor at startup [message #654205 is a reply to message #654178] Mon, 14 February 2011 15:14 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

On 02/14/2011 08:49 AM, Carlo Salinari wrote:
> Perhaps I could invoke my New_Untitled command in
> ApplicationWorkbenchWindowAdvisor.postWindowOpen()?


In your RCP app, I think that would be OK, as the window will have been
opened and possibly restored.

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Platform_Expression_Framework
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Previous Topic:[Mac] where is the ".log" file?
Next Topic:RCP dependant OS executables
Goto Forum:
  


Current Time: Fri Apr 19 12:46:40 GMT 2024

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

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

Back to the top