Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [pde-dev] Editor without file?

Hi,

You can make the input implement org.eclipse.ui.IEditorInput.
Therefeore you do have to create an ElementFactory for the object

>From the javadoc:
IEditorInput is a light weight descriptor of editor input, like a file
name but more abstract. It is not a model. It is a description of the
model source for an IEditorPart.

Clients implementing this editor input interface should override
Object.equals(Object) to answer true for two inputs that are the same.
The IWorbenchPage.openEditor APIs are dependent on this to find an
editor with the same input.

Clients should extend this interface to declare new types of editor inputs. 

An editor input is passed to an editor via the IEditorPart.init
method. Due to the wide range of valid editor inputs, it is not
possible to define generic methods for getting and setting bytes.

Editor input must implement the IAdaptable interface; extensions are
managed by the platform's adapter manager.

Please note that it is important that the editor input be light
weight. Within the workbench, the navigation history tends to hold on
to editor inputs as a means of reconstructing the editor at a later
time. The navigation history can hold on to quite a few inputs (i.e.,
the default is fifty). The actual data model should probably not be
held in the input.

See Also:
org.eclipse.ui.IEditorPart
org.eclipse.ui.IWorkbenchPage.openEditor(IEditorInput, String)
org.eclipse.ui.IWorkbenchPage.openEditor(IEditorInput, String, boolean)

Regards,
Leen Toelen


On 9/12/05, Stone <lanlandejia@xxxxxxx> wrote:
>  
>  
> 
> Hi, all, 
> 
> It seems that a editor is always associated with a file, which mean that you
> can't open a editor without a existing file. 
> 
> But sometimes I just want an editor, which doesn't have a file as its input.
> 
> How can I do it? 
> 
>   
> 
> Thanks & Best regards, 
> 
>   
> 
> LAN Sizhong 
> 
>   
> _______________________________________________
> pde-dev mailing list
> pde-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/pde-dev
> 
> 
>


Back to the top