GContextFileManagement : Différence entre versions

De Wiki
Aller à : navigation, rechercher
 
Ligne 23 : Ligne 23 :
  
 
Note that flags set at the end of the <font color=#4169E1>selectLoadFile()</font> and <font color=#4169E1>selectSaveFile()</font> methods follow the same principle as described in the [[GReadWrite_interface|GReadWrite interface and data files management]] topic for the <font color=#4169E1>GFileManipulation.readConfig()</font> and <font color=#4169E1>GFileManipulation.readConfig()</font> methods.
 
Note that flags set at the end of the <font color=#4169E1>selectLoadFile()</font> and <font color=#4169E1>selectSaveFile()</font> methods follow the same principle as described in the [[GReadWrite_interface|GReadWrite interface and data files management]] topic for the <font color=#4169E1>GFileManipulation.readConfig()</font> and <font color=#4169E1>GFileManipulation.readConfig()</font> methods.
 +
  
 
[[File:GContextFileManagement.jpg]]
 
[[File:GContextFileManagement.jpg]]
 +
  
 
[[WELCOME_TO_THE_GENIUS_WIKI|Return to the introduction ↑]]  
 
[[WELCOME_TO_THE_GENIUS_WIKI|Return to the introduction ↑]]  
 
[[How_to_build_a_standard_application|Go to the next page →]]
 
[[How_to_build_a_standard_application|Go to the next page →]]

Version actuelle en date du 5 mai 2017 à 13:59

GENIUS proposes classes to simplify the search of files into directories: GFileFilter and GContextFileManagement class

String prefix  = "TEST_"; 
String suffix  = ".xml";
String comment = "Test Files";
GFileFilter filter = new GFileFilter(prefix ,suffix ,comment);
 
String initDir = "."; 
String xmlName = "Test"; 
GContextFileManagement gfm = new GContextFileManagement(initDir, xmlName , filter);
 
…
 
public void after(GEvent e) throws GFileManipulatorException {
 
  // "obj" is the object to load or save ...
  if ( e.contains(butLoad) ) { gfm.selectLoadFile(obj, false); }
  if ( e.contains(butSave) ) { gfm.selectSaveFile(obj, true); }
 
}

Note that flags set at the end of the selectLoadFile() and selectSaveFile() methods follow the same principle as described in the GReadWrite interface and data files management topic for the GFileManipulation.readConfig() and GFileManipulation.readConfig() methods.


GContextFileManagement.jpg


Return to the introduction ↑ Go to the next page →