Medical Imaging Interaction Toolkit  2023.04.00
Medical Imaging Interaction Toolkit
berry::IEditorRegistry Struct Referenceabstract

#include <berryIEditorRegistry.h>

Public Member Functions

virtual ~IEditorRegistry ()
 
virtual IEditorDescriptor::Pointer FindEditor (const QString &editorId)=0
 
virtual IEditorDescriptor::Pointer GetDefaultEditor ()=0
 
virtual IEditorDescriptor::Pointer GetDefaultEditor (const QString &fileName)=0
 
virtual QList< IEditorDescriptor::PointerGetEditors (const QString &fileName)=0
 
virtual QList< IFileEditorMapping::PointerGetFileEditorMappings ()=0
 
virtual void SetDefaultEditor (const QString &fileNameOrExtension, const QString &editorId)=0
 
virtual bool IsSystemInPlaceEditorAvailable (const QString &filename)=0
 
virtual bool IsSystemExternalEditorAvailable (const QString &filename)=0
 

Static Public Attributes

static const int PROP_CONTENTS
 
static const QString SYSTEM_EXTERNAL_EDITOR_ID
 
static const QString SYSTEM_INPLACE_EDITOR_ID
 

Detailed Description

Registry of editors known to the workbench.

An editor can be created in one of two ways:

  • An editor can be defined by an extension to the workbench.
  • The user manually associates an editor with a given resource extension type. This will override any default workbench or platform association.

The registry does not keep track of editors that are "implicitly" determined. For example a bitmap (.bmp) file will typically not have a registered editor. Instead, when no registered editor is found, the underlying OS is consulted.

This interface is not intended to be implemented by clients.

See also
org.blueberry.ui.IWorkbench::getEditorRegistry()

Definition at line 47 of file berryIEditorRegistry.h.

Constructor & Destructor Documentation

◆ ~IEditorRegistry()

virtual berry::IEditorRegistry::~IEditorRegistry ( )
virtual

Member Function Documentation

◆ FindEditor()

virtual IEditorDescriptor::Pointer berry::IEditorRegistry::FindEditor ( const QString &  editorId)
pure virtual

Finds and returns the descriptor of the editor with the given editor id.

Parameters
editorIdthe editor id
Returns
the editor descriptor with the given id, or null if not found

◆ GetDefaultEditor() [1/2]

virtual IEditorDescriptor::Pointer berry::IEditorRegistry::GetDefaultEditor ( )
pure virtual

Returns the default editor. The default editor always exist.

Returns
the descriptor of the default editor
Deprecated:
The system external editor is the default editor. Use findEditor(IEditorRegistry.SYSTEM_EXTERNAL_EDITOR_ID) instead.

◆ GetDefaultEditor() [2/2]

virtual IEditorDescriptor::Pointer berry::IEditorRegistry::GetDefaultEditor ( const QString &  fileName)
pure virtual

Returns the default editor for a given file name. This method assumes an unknown content type for the given file.

The default editor is determined by taking the file extension for the file and obtaining the default editor for that extension.

Parameters
fileNamethe file name in the system
Returns
the descriptor of the default editor, or null if not found

◆ GetEditors()

virtual QList<IEditorDescriptor::Pointer> berry::IEditorRegistry::GetEditors ( const QString &  fileName)
pure virtual

Returns the list of file editors registered to work against the file with the given file name. This method assumes an unknown content type for the given file.

Note: Use getDefaultEditor(String) if you only the need the default editor rather than all candidate editors.

Parameters
fileNamethe file name in the system
Returns
a list of editor descriptors

◆ GetFileEditorMappings()

virtual QList<IFileEditorMapping::Pointer> berry::IEditorRegistry::GetFileEditorMappings ( )
pure virtual

Returns a list of mappings from file type to editor. The resulting list is sorted in ascending order by file extension.

Each mapping defines an extension and the set of editors that are available for that type. The set of editors includes those registered via plug-ins and those explicitly associated with a type by the user in the workbench preference pages.

Returns
a list of mappings sorted alphabetically by extension

◆ IsSystemExternalEditorAvailable()

virtual bool berry::IEditorRegistry::IsSystemExternalEditorAvailable ( const QString &  filename)
pure virtual

Returns whether the system has an editor that could handle a file with the given name.

Parameters
filenamethe file name
Returns
true if an external editor available, and false otherwise
Since
3.0

◆ IsSystemInPlaceEditorAvailable()

virtual bool berry::IEditorRegistry::IsSystemInPlaceEditorAvailable ( const QString &  filename)
pure virtual

Returns whether there is an in-place editor that could handle a file with the given name.

Parameters
filenamethe file name
Returns
true if an in-place editor is available, and false otherwise
Since
3.0

◆ SetDefaultEditor()

virtual void berry::IEditorRegistry::SetDefaultEditor ( const QString &  fileNameOrExtension,
const QString &  editorId 
)
pure virtual

Sets the default editor id for the files that match that specified file name or extension. The specified editor must be defined as an editor for that file name or extension.

Parameters
fileNameOrExtensionthe file name or extension pattern (e.g. "*.xml");
editorIdthe editor id or null for no default

Member Data Documentation

◆ PROP_CONTENTS

const int berry::IEditorRegistry::PROP_CONTENTS
static

The property identifier for the contents of this registry.

Definition at line 52 of file berryIEditorRegistry.h.

◆ SYSTEM_EXTERNAL_EDITOR_ID

const QString berry::IEditorRegistry::SYSTEM_EXTERNAL_EDITOR_ID
static

The identifier for the system external editor descriptor. This descriptor is always present in the registry on all platforms. Use FindEditor to access the editor descriptor for this identifier.

Since
3.0

Definition at line 61 of file berryIEditorRegistry.h.

◆ SYSTEM_INPLACE_EDITOR_ID

const QString berry::IEditorRegistry::SYSTEM_INPLACE_EDITOR_ID
static

The identifier for the system in-place editor descriptor. This descriptor is only present in the registry on platforms that support in-place editing (for example Win32). Use FindEditor to access the editor descriptor for this identifier.

Since
3.0

Definition at line 71 of file berryIEditorRegistry.h.


The documentation for this struct was generated from the following file: