use of org.pentaho.di.core.LastUsedFile in project pentaho-kettle by pentaho.
the class PropsUI method getLastTypes.
public boolean[] getLastTypes() {
boolean[] retval = new boolean[lastUsedFiles.size()];
for (int i = 0; i < retval.length; i++) {
LastUsedFile lastUsedFile = lastUsedFiles.get(i);
retval[i] = lastUsedFile.isSourceRepository();
}
return retval;
}
use of org.pentaho.di.core.LastUsedFile in project pentaho-kettle by pentaho.
the class PropsUI method loadOpenTabFiles.
public void loadOpenTabFiles() {
openTabFiles = new ArrayList<LastUsedFile>();
int nr = Const.toInt(properties.getProperty("tabfiles"), 0);
for (int i = 0; i < nr; i++) {
String fileType = properties.getProperty("tabtype" + (i + 1), LastUsedFile.FILE_TYPE_TRANSFORMATION);
String filename = properties.getProperty("tabfile" + (i + 1), "");
String directory = properties.getProperty("tabdir" + (i + 1), "");
boolean sourceRepository = YES.equalsIgnoreCase(properties.getProperty("tabrep" + (i + 1), NO));
String repositoryName = properties.getProperty("tabrepname" + (i + 1));
boolean isOpened = YES.equalsIgnoreCase(properties.getProperty("tabopened" + (i + 1), NO));
int openItemTypes = Const.toInt(properties.getProperty("tabopentypes" + (i + 1), "0"), 0);
openTabFiles.add(new LastUsedFile(fileType, filename, directory, sourceRepository, repositoryName, isOpened, openItemTypes));
}
}
use of org.pentaho.di.core.LastUsedFile in project pentaho-kettle by pentaho.
the class PropsUI method getLastFileTypes.
public String[] getLastFileTypes() {
String[] retval = new String[lastUsedFiles.size()];
for (int i = 0; i < retval.length; i++) {
LastUsedFile lastUsedFile = lastUsedFiles.get(i);
retval[i] = lastUsedFile.getFileType();
}
return retval;
}
use of org.pentaho.di.core.LastUsedFile in project pentaho-kettle by pentaho.
the class PropsUI method getLastFiles.
public String[] getLastFiles() {
String[] retval = new String[lastUsedFiles.size()];
for (int i = 0; i < retval.length; i++) {
LastUsedFile lastUsedFile = lastUsedFiles.get(i);
retval[i] = lastUsedFile.getFilename();
}
return retval;
}
use of org.pentaho.di.core.LastUsedFile in project pentaho-kettle by pentaho.
the class PropsUI method addLastFile.
/**
* Add a last opened file to the top of the recently used list.
*
* @param fileType the type of file to use @see LastUsedFile
* @param filename The name of the file or transformation
* @param directory The repository directory path, null in case lf is an XML file
* @param sourceRepository True if the file was loaded from repository, false if ld is an XML file.
* @param repositoryName The name of the repository the file was loaded from or save to.
*/
public void addLastFile(String fileType, String filename, String directory, boolean sourceRepository, String repositoryName, String username, Date lastOpened) {
LastUsedFile lastUsedFile = new LastUsedFile(fileType, filename, directory, sourceRepository, repositoryName, username, false, LastUsedFile.OPENED_ITEM_TYPE_MASK_GRAPH, lastOpened);
int idx = lastUsedFiles.indexOf(lastUsedFile);
if (idx >= 0) {
lastUsedFiles.remove(idx);
}
// Add it to position 0
lastUsedFiles.add(0, lastUsedFile);
// If we have more than Const.MAX_FILE_HIST, top it off
while (lastUsedFiles.size() > Const.MAX_FILE_HIST) {
lastUsedFiles.remove(lastUsedFiles.size() - 1);
}
addLastRepoFile(lastUsedFile);
}
Aggregations