public class EditUIUtil
extends java.lang.Object
Constructor and Description |
---|
EditUIUtil() |
Modifier and Type | Method and Description |
---|---|
static IEditorDescriptor |
getDefaultEditor(java.io.InputStream contents,
java.lang.String fileName)
Returns the default editor for a given contents and file name.
|
static IEditorDescriptor |
getDefaultEditor(java.lang.String fileName)
Returns the default editor for a given file name.
|
static IEditorDescriptor |
getDefaultEditor(URI uri,
URIConverter uriConverter)
Returns the default editor for a given URI.
|
static IEditorDescriptor[] |
getEditors(java.io.InputStream contents,
java.lang.String fileName,
boolean defaultsOnly)
Returns the editors for a given contents and file name.
|
static IEditorDescriptor[] |
getEditors(java.lang.String fileName,
boolean defaultsOnly)
Returns the editors for a given file name.
|
static IEditorDescriptor[] |
getEditors(URI uri,
URIConverter uriConverter,
boolean defaultsOnly)
Returns the editors for a given URI.
|
static URI |
getURI(IEditorInput editorInput) |
static boolean |
openEditor(EObject eObject)
Opens the default editor for the resource that contains the specified
EObject.
|
public static boolean openEditor(EObject eObject) throws PartInitException
PartInitException
public static URI getURI(IEditorInput editorInput)
public static IEditorDescriptor getDefaultEditor(java.lang.String fileName)
IEditorRegistry#getDefaultEditor(String)
,
but it will not return null
unless all applicable content types have no associated editor.fileName
- the file name in the systemnull
if not foundpublic static IEditorDescriptor getDefaultEditor(java.io.InputStream contents, java.lang.String fileName)
If a file name is not provided, the entire content type registry will be queried. For performance reasons, it is highly recommended to provide a file name if available.
contents
- an input streamfileName
- the file name associated to the contents, or null
null
if not foundpublic static IEditorDescriptor getDefaultEditor(URI uri, URIConverter uriConverter)
If a URI converter is specified, it is used to open the stream. Otherwise, the global default
instance
is used.
uri
- a URIuriConverter
- URI converter from which to obtain an input stream, or null
null
if not foundpublic static IEditorDescriptor[] getEditors(java.lang.String fileName, boolean defaultsOnly)
IEditorRegistry#getEditors(String)
,
but its result will include editors for all applicable content types.fileName
- the file name in the systemdefaultsOnly
- if true
, only the default editor for each content type will be included in the resultpublic static IEditorDescriptor[] getEditors(java.io.InputStream contents, java.lang.String fileName, boolean defaultsOnly)
If a file name is not provided, the entire content type registry will be queried. For performance reasons, it is highly recommended to provide a file name if available.
contents
- an input streamfileName
- the file name associated to the contents, or null
defaultsOnly
- if true
, only the default editor for each content type will be included in the resultpublic static IEditorDescriptor[] getEditors(URI uri, URIConverter uriConverter, boolean defaultsOnly)
If a URI converter is specified, it is used to open the stream. Otherwise, the global default
instance
is used.
uri
- a URIuriConverter
- a URI converter from which to obtain an input stream, or null
defaultsOnly
- if true
, only the default editor for each content type will be included in the result