use of com.kyj.fx.voeditor.visual.momory.ResourceLoader in project Gargoyle by callakrsos.
the class ResourcesConfigView method btnSaveOnMouseClick.
@FXML
public void btnSaveOnMouseClick(MouseEvent event) {
try {
ResourceLoader instance = ResourceLoader.getInstance();
Map<String, Object> bufMap = new HashMap<>();
tbDatabase.getItems().forEach(item -> {
Object key = item.get("key");
Object value = item.get("value");
if (key == null)
return;
bufMap.put(key.toString(), value.toString());
});
instance.putAll(bufMap);
DialogUtil.showMessageDialog("Save Complete...");
} catch (Exception e) {
DialogUtil.showExceptionDailog(e);
}
}
use of com.kyj.fx.voeditor.visual.momory.ResourceLoader in project Gargoyle by callakrsos.
the class SVNConfigView method btnSaveOnMouseClick.
@FXML
public void btnSaveOnMouseClick(MouseEvent event) {
try {
ResourceLoader instance = ResourceLoader.getInstance();
Map<String, Object> bufMap = new HashMap<>();
tbDatabase.getItems().forEach(item -> {
Object key = item.get("key");
Object value = item.get("value");
if (key == null)
return;
bufMap.put(key.toString(), value.toString());
});
instance.putAll(bufMap);
DialogUtil.showMessageDialog("Save Complete...");
} catch (Exception e) {
DialogUtil.showExceptionDailog(e);
}
}
use of com.kyj.fx.voeditor.visual.momory.ResourceLoader in project Gargoyle by callakrsos.
the class SVNConfigView method loadResource.
/**
* 화면에 리소스를 읽어들인다.
*
* @return
*
* @작성자 : KYJ
* @작성일 : 2015. 11. 4.
*/
public ObservableList<Map<String, Object>> loadResource() {
ResourceLoader instance = ResourceLoader.getInstance();
Set<Entry<Object, Object>> entry = instance.getEntry();
return load(entry);
}
use of com.kyj.fx.voeditor.visual.momory.ResourceLoader in project Gargoyle by callakrsos.
the class DatabaseUrlManagementView method loadResource.
/**
* 화면에 리소스를 읽어들인다.
*
*
* 변경이력 : 2015.11.30, kyj, static 으로 변경
*
* @return
*
* @작성자 : KYJ
* @작성일 : 2015. 11. 4.
*/
@SuppressWarnings("unchecked")
public static ObservableList<Map<String, Object>> loadResource() {
ResourceLoader instance = ResourceLoader.getInstance();
ObservableList<Map<String, Object>> observableArrayList = FXCollections.observableArrayList();
Enumeration<Object> keySet = instance.keySet();
while (keySet.hasMoreElements()) {
Object _key = keySet.nextElement();
if (_key == null)
continue;
String key = (String) _key;
if (!key.startsWith("database.info."))
continue;
String value = instance.get(key);
if ("jdbc.pass".equals(key))
value = decryp(value);
JSONObject json = ValueUtil.toJSONObject(value);
Map<String, Object> map = new HashMap<String, Object>(json);
map.put("seqNum", key);
observableArrayList.add(0, map);
}
return observableArrayList;
}
use of com.kyj.fx.voeditor.visual.momory.ResourceLoader in project Gargoyle by callakrsos.
the class DatabaseUrlManagementView method btnSaveOnMouseClick.
@SuppressWarnings("unchecked")
@FXML
public void btnSaveOnMouseClick(MouseEvent event) {
FileOutputStream out = null;
ResourceLoader instance = ResourceLoader.getInstance();
instance.initDataBaseInfo();
try {
String prefiixKey = "database.info.";
Map<String, Object> map = new HashMap<>();
List<String> colList = new ArrayList<String>();
for (int i = 0; i < tbDatabase.getItems().size(); i++) {
Map<String, Object> item = tbDatabase.getItems().get(i);
// item.get("seqNum");
Object key = prefiixKey + i;
JSONObject json = new JSONObject();
json.put("seqNum", /*item.get("seqNum")*/
key);
json.put("dbms", item.get("dbms"));
json.put("alias", item.get("alias"));
json.put(ResourceLoader.BASE_KEY_JDBC_URL, item.get(ResourceLoader.BASE_KEY_JDBC_URL));
json.put(ResourceLoader.BASE_KEY_JDBC_ID, item.get(ResourceLoader.BASE_KEY_JDBC_ID));
json.put(ResourceLoader.BASE_KEY_JDBC_PASS, item.get(ResourceLoader.BASE_KEY_JDBC_PASS));
json.put("color", item.get("color"));
map.put(key.toString(), json.toJSONString());
}
tbDatabase.getColumns().forEach(col -> {
if (col.isVisible())
colList.add(col.getId());
});
map.put("database.column.order", colList.toString());
{
/*하나의 트랜잭션*/
removeKeys();
instance.putAll(map);
delItems.clear();
}
// tbDatabase.getItems().clear();
tbDatabase.getItems().setAll(loadResource());
DialogUtil.showMessageDialog("Save Complete...");
} catch (Exception e) {
DialogUtil.showExceptionDailog(e);
} finally {
try {
if (out != null)
out.close();
} catch (IOException e) {
LOGGER.error(ValueUtil.toString(e));
}
}
}
Aggregations