org.freehep.jas.services
Interface TextEditorService


public interface TextEditorService

An interface to be implemented by all TextEditor systems

Version:
$Id: TextEditorService.java 13876 2011-09-20 00:52:21Z tonyj $
Author:
tonyj

Method Summary
 void addMimeType(String mimeType, Icon icon)
          Associates a given icon with a mime-type.
 List editors()
          Get a list of all active editors.
 TextEditor getCurrentEditor()
          Get the "current" text editor.
 Icon getIconForMimeType(String mimeType)
          Retrieve the icon for a mime-type
 void show(File f, String mimeType)
          Show a file in an editor window
 void show(Reader reader, String mimeType, String title)
          Show text read from a Reader in an editor
 void show(String text, String mimeType, String title)
          Show the given text in a new editor window
 void show(URL url, String mimeType)
          Show a file from an URL in an editor window
 

Method Detail

show

void show(String text,
          String mimeType,
          String title)
Show the given text in a new editor window

Parameters:
text - The text to display
mimeType - The mime-type to be associated with the editor
title - The title for the editor

show

void show(File f,
          String mimeType)
          throws IOException
Show a file in an editor window

Parameters:
f - The file to show
mimeType - The mime-type for the file
Throws:
IOException - If there is a problem reading the file.

show

void show(URL url,
          String mimeType)
          throws IOException
Show a file from an URL in an editor window

Parameters:
url - The URL of the file
mimeType - The mime-type for the file
Throws:
IOException - If there is a problem reading the file.

show

void show(Reader reader,
          String mimeType,
          String title)
          throws IOException
Show text read from a Reader in an editor

Parameters:
reader - The reader to read from.
mimeType - The mime-type to associate with the read text
title - The title for the editor window
Throws:
IOException - If there is a problem reading from the Reader.

addMimeType

void addMimeType(String mimeType,
                 Icon icon)
Associates a given icon with a mime-type.

Parameters:
mimeType - The mime-type
icon - The associated icon

getIconForMimeType

Icon getIconForMimeType(String mimeType)
Retrieve the icon for a mime-type

Parameters:
mimeType - The mime-type to search for
Returns:
The icon, or null if none exists.

getCurrentEditor

TextEditor getCurrentEditor()
Get the "current" text editor.

Returns:
The currently selected text editor, or null if none is selected

editors

List editors()
Get a list of all active editors.

Returns:
The List of TextEditors
See Also:
TextEditor


Copyright © 2013. All Rights Reserved.