use of com.twinsoft.convertigo.engine.EnginePropertiesManager.PropertyName in project convertigo by convertigo.
the class EnginePreferenceDialog method applyProceed.
private void applyProceed() {
if (modifiedProperties != null) {
for (PropertyName property : modifiedProperties.keySet()) {
ConvertigoPlugin.logDebug("Updating engine property " + property.name() + ": " + modifiedProperties.get(property));
if (property.getType() == PropertyType.Array) {
String value = modifiedProperties.get(property);
StringTokenizer st = new StringTokenizer(value, "\r\n", false);
String[] propertyAsStringArray = new String[st.countTokens()];
int i = 0;
while (st.hasMoreTokens()) {
String item = st.nextToken();
propertyAsStringArray[i] = item;
i++;
}
EnginePropertiesManager.setPropertyFromStringArray(property, propertyAsStringArray);
} else {
EnginePropertiesManager.setProperty(property, modifiedProperties.get(property));
}
}
try {
EnginePropertiesManager.saveProperties();
} catch (Exception e) {
ConvertigoPlugin.logException(e, "Unable to save engine properties!");
}
}
this.close();
}
use of com.twinsoft.convertigo.engine.EnginePropertiesManager.PropertyName in project convertigo by convertigo.
the class FileCacheManager method onEvent.
@Override
public void onEvent(PropertyChangeEvent event) {
super.onEvent(event);
PropertyName name = event.getKey();
String cacheDir = EnginePropertiesManager.getProperty(PropertyName.CACHE_MANAGER_FILECACHE_DIRECTORY);
if (!cacheDir.equals(Engine.CACHE_PATH) && name.equals(PropertyName.CACHE_MANAGER_FILECACHE_DIRECTORY)) {
try {
destroy();
} catch (EngineException e) {
Engine.logEngine.error("Error on FileCacheManager.destroy", e);
}
try {
init();
} catch (EngineException e) {
Engine.logEngine.error("Error on FileCacheManager.init", e);
}
}
}
use of com.twinsoft.convertigo.engine.EnginePropertiesManager.PropertyName in project convertigo by convertigo.
the class EnginePreferencePage method performOk.
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#performOk()
*/
public boolean performOk() {
for (PropertyName property : modifiedProperties.keySet()) {
ConvertigoPlugin.logDebug("Updating engine property " + property.name() + ": " + modifiedProperties.get(property));
if (property.getType() == PropertyType.Array) {
String value = modifiedProperties.get(property);
StringTokenizer st = new StringTokenizer(value, "\r\n", false);
String[] propertyAsStringArray = new String[st.countTokens()];
int i = 0;
while (st.hasMoreTokens()) {
String item = st.nextToken();
propertyAsStringArray[i] = item;
i++;
}
EnginePropertiesManager.setPropertyFromStringArray(property, propertyAsStringArray);
} else {
EnginePropertiesManager.setProperty(property, modifiedProperties.get(property));
}
}
try {
EnginePropertiesManager.saveProperties();
} catch (Exception e) {
ConvertigoPlugin.logException(e, "Unable to save engine properties!");
}
return super.performOk();
}
Aggregations