A vote for IStorageEditorInput

September 11, 2006

Now that Eclipse editors are reaching out beyond the confines of the workspace more and more (with pluggable file systems and files that can link to resources at remote locations e.g. HTTP accessible resources), editors that expect to be working with files should be coded to support IStorageEditorInput, and not just IFileEditorInput. All too often when developing editors the assumption is made that the editor is dealing with a local resource, and worse, often casts are made to IFileEditorInput. Remember that an editor is a viewer before it is anything else, a lot of the time the purpose of opening a file in its editor is purely to browse its contents. In fact, probably more than half of the time, when a file is opened in a editor, it is never updated, it is only read. IStorageEditorInput is the super interface of IFileEditorInput, and its API contract states: File-oriented editors should support this as a valid input type, and display its content for viewing (but not allow modification). So if you are not supporting IStorageEditorInput properly, you are potentially failing to support a large number of use cases.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: