use of net.heartsome.cat.common.bean.ProjectInfoBean in project translationstudio8 by heartsome.
the class ProjectConfigerUtil method setDbMementos.
public void setDbMementos() {
if (null == config) {
return;
}
ProjectInfoBean currentProjectConfig = config.getCurrentProjectConfig();
if (null == currentProjectConfig) {
return;
}
this.mementoTbDbs = currentProjectConfig.getTbDb();
this.mementoTmDbs = currentProjectConfig.getTmDb();
}
use of net.heartsome.cat.common.bean.ProjectInfoBean in project translationstudio8 by heartsome.
the class ProjectConfigerUtil method clearConfig.
public void clearConfig() {
if (null == config) {
return;
}
ProjectInfoBean currentProjectBean = config.getCurrentProjectConfig();
if (null == currentProjectBean) {
return;
}
currentProjectBean.setTbDb(new ArrayList<DatabaseModelBean>());
currentProjectBean.setTmDb(new ArrayList<DatabaseModelBean>());
config.updateProjectConfig(currentProjectBean);
try {
projcet.refreshLocal(IResource.DEPTH_ZERO, null);
} catch (CoreException e) {
logger.error("", e);
}
}
use of net.heartsome.cat.common.bean.ProjectInfoBean in project translationstudio8 by heartsome.
the class ArchiveFileExportOperation2 method getProjectSQLiteFiles.
/**
* @param project
* @param type
* @return ;
*/
private List<File> getProjectSQLiteFiles(IProject project, int type) {
ProjectConfiger projectConfiger = ProjectConfigerFactory.getProjectConfiger(project);
ProjectInfoBean currentProjectConfig = projectConfiger.getCurrentProjectConfig();
List<DatabaseModelBean> sqlDbs = null;
if (TM == type) {
sqlDbs = currentProjectConfig.getTmDb();
} else if (TB == type) {
sqlDbs = currentProjectConfig.getTbDb();
}
List<File> files = new ArrayList<File>();
for (DatabaseModelBean bean : sqlDbs) {
if ("SQLite".equals(bean.getDbType())) {
File file = new File(getSqliteFilePath(bean));
if (file.exists() && file.isFile()) {
files.add(file);
}
}
}
return files;
}
use of net.heartsome.cat.common.bean.ProjectInfoBean in project translationstudio8 by heartsome.
the class XLFHandler method getProjectProp.
/**
* 获取 IProject 自定义属性信息
* @param project
* @return ;
*/
public String getProjectProp(IProject project) {
StringBuffer sbProp = new StringBuffer();
ProjectInfoBean projectBean = ProjectConfigerFactory.getProjectConfiger(project).getCurrentProjectConfig();
Map<String, String> mapField = projectBean.getMapField();
if (mapField != null && mapField.size() > 0) {
Iterator<Entry<String, String>> it = mapField.entrySet().iterator();
while (it.hasNext()) {
Entry<String, String> entry = (Entry<String, String>) it.next();
String key = entry.getKey();
String value = entry.getValue();
if (key != null && !key.trim().equals("") && value != null && !value.trim().equals("")) {
sbProp.append("<prop type=\"" + key + "\">" + value + "</prop>\n");
}
}
}
Map<String, Object[]> mapAttr = projectBean.getMapAttr();
if (mapAttr != null && mapAttr.size() > 0) {
Iterator<Entry<String, Object[]>> it = mapAttr.entrySet().iterator();
while (it.hasNext()) {
Entry<String, Object[]> entry = (Entry<String, Object[]>) it.next();
String key = entry.getKey();
String strSel = (String) entry.getValue()[0];
if (key != null && !key.trim().equals("") && strSel != null && !strSel.equals("")) {
sbProp.append("<prop type=\"" + entry.getKey() + "\">" + strSel + "</prop>\n");
}
}
}
return sbProp.toString();
}
Aggregations