|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--guk.editIM.FileCommands
Helper for the EditIM Input Method Editor: Responsible for reading, writing and merging files into / from the editor tables. It can pop up confirmation dialogues, but things like selection of file names and file types are done by another component. Knows the MapTable objects to communicate with. When needed, fileCommandProcessor throws an ActionEvent to the assigned listener (given as constructor argument). Receives commands by being an ActionListener through actionPerformed, which is triggered after postEvent on us.
Field Summary | |
(package private) java.lang.String |
headers
All headers that are recognized as such: Lines beginning with option in the case of GIM. |
(package private) java.lang.String |
inComments
All comments after the first parseable assignment that do not belong to an assignment themselves. |
(package private) java.lang.String |
localeName
The locale name and variant, taken from the inputmethod header of GIM. |
(package private) java.lang.String |
localeNameVariant
|
(package private) MenuHelpers |
menu
The MenuHelpers class provides functions like creating menu items and buttons. |
(package private) java.lang.String |
preComments
All comments in the header area. |
(package private) MapTable |
tableLong
|
(package private) MapTable |
tableShort
two tables, one for at most one key sequence for each glyph and one where we can produce several glyphs by one key sequence or assign several key sequences to the same glyphs. |
Constructor Summary | |
FileCommands(MenuHelpers menuHelper,
MapTable glyphTable,
MapTable stringTable)
The constructor initializes important variables, mostly from passed arguments. |
Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent e)
This is an ActionListener, so it must handle actionPerformed. |
boolean |
loadFile(java.lang.String encoding,
int filetype,
java.lang.String filename,
boolean merge)
Load or merge a file into the tables. |
static java.lang.String |
nameAOType(int type)
Describes an AssignObject data type. |
boolean |
saveFile(java.lang.String encoding,
int filetype,
java.lang.String filename)
Save the tables into a file. |
void |
showLog(java.lang.String title,
java.lang.String text,
boolean okay)
Shows a probably long log text in a popup window with a given title. |
Methods inherited from class java.lang.Object |
|
Field Detail |
MenuHelpers menu
MapTable tableShort
MapTable tableLong
java.lang.String localeName
java.lang.String localeNameVariant
java.lang.String headers
java.lang.String preComments
java.lang.String inComments
Constructor Detail |
public FileCommands(MenuHelpers menuHelper, MapTable glyphTable, MapTable stringTable)
menuHelper
- glyphTable
- A MapTable object which is first tried as
data source or destination. Half of the editor window.stringTable
- Elements which do not fit glyphTable are
put into this stringTable. When we export to a file, first
the glyphTable and then the stringTable elements are written,
unless some kind of reordering overrides this (may happen for
some export file formats).Method Detail |
public void showLog(java.lang.String title, java.lang.String text, boolean okay)
title
- The title of the windowtext
- The content of the window.okay
- If false, the icon will be that of a warning
instead of that of an information.public static java.lang.String nameAOType(int type)
type
- An AssignObject type constant.public boolean loadFile(java.lang.String encoding, int filetype, java.lang.String filename, boolean merge)
encoding
- The encoding, typically ISO-8859-1 or UTF-8
(both are implemented on all Java platforms).filetype
- The file type code as used by the
AssignObject
parsing system.filename
- The name of the file to be loaded / merged.merge
- True for merge mode, false for load mode.
Load will flush the tables before importing a file.public boolean saveFile(java.lang.String encoding, int filetype, java.lang.String filename)
encoding
- The encoding, typically ISO-8859-1 or UTF-8
(both are implemented on all Java platforms).filetype
- The file type code as used by the
AssignObject
parsing system.filename
- The name of the file to be loaded / merged.public void actionPerformed(java.awt.event.ActionEvent e)
This is an ActionListener, so it must handle actionPerformed. All requests are coming in through this method. Each type of request should be handled by calling one or more of the private methods of this class. This is the common parser for all. Some of the methods above throw events back at myListener, in turn.
Accepted commands: loadlocalefile encoding filetype filename - load for editing! ... similar to: ... mergelocalefile encoding filetype filename - ADD to edited! savelocalefile encoding filetype filename - create file. headers, footers and comments should be preserved from most recently loaded / merged file if possible!
actionPerformed
in interface java.awt.event.ActionListener
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |