use of org.jcryptool.crypto.flexiprovider.operations.ui.listeners.IOperationChangedListener in project core by jcryptool.
the class OperationsManager method importOperation.
public void importOperation(String fileName) {
try {
// $NON-NLS-1$
LogUtil.logInfo("1");
IFileStore store = EFS.getStore(URIUtil.toURI(fileName));
// $NON-NLS-1$
LogUtil.logInfo("2");
InputStream is = store.openInputStream(SWT.NONE, null);
// $NON-NLS-1$
LogUtil.logInfo("3");
SAXBuilder sax = new SAXBuilder();
// $NON-NLS-1$
LogUtil.logInfo("4");
Document doc = sax.build(is);
// $NON-NLS-1$
LogUtil.logInfo("5");
is.close();
// $NON-NLS-1$
LogUtil.logInfo("6");
ExportRootElement root = new ExportRootElement(doc.getRootElement());
// $NON-NLS-1$
LogUtil.logInfo("7");
IFlexiProviderOperation importEntry = root.getEntryNode();
// $NON-NLS-1$
LogUtil.logInfo("8");
newOperations.put(importEntry.getTimestamp(), importEntry);
// $NON-NLS-1$
LogUtil.logInfo("9");
Iterator<IOperationChangedListener> it = listeners.iterator();
while (it.hasNext()) {
it.next().addOperation();
}
// $NON-NLS-1$
LogUtil.logInfo("10");
} catch (CoreException e) {
LogUtil.logError(FlexiProviderOperationsPlugin.PLUGIN_ID, "CoreException while importing an operation", e, true);
} catch (JDOMException e) {
LogUtil.logError(FlexiProviderOperationsPlugin.PLUGIN_ID, "JDOMException while importing an operation", e, true);
} catch (IOException e) {
LogUtil.logError(FlexiProviderOperationsPlugin.PLUGIN_ID, "IOException while importing an operation", e, false);
}
}
use of org.jcryptool.crypto.flexiprovider.operations.ui.listeners.IOperationChangedListener in project core by jcryptool.
the class OperationsManager method addOperation.
public void addOperation(AlgorithmDescriptor operation) {
// $NON-NLS-1$
LogUtil.logInfo("adding algorithm descriptor: " + operation.getClass().getName());
long timestamp = System.currentTimeMillis();
// $NON-NLS-1$
newOperations.put(timestamp, new EntryNode("no name", timestamp, operation));
Iterator<IOperationChangedListener> it = listeners.iterator();
while (it.hasNext()) {
it.next().addOperation();
}
// $NON-NLS-1$
LogUtil.logInfo("operation 2.0 added");
}
Aggregations