use of com.ericsson.otp.erlang.OtpErlangBoolean in project erlide_eclipse by erlang.
the class GraphResultingInspectionHandler method execute.
@Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
final String actionId = event.getCommand().getId();
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor().setFocus();
try {
GlobalParameters.setSelection(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getSelection());
} catch (final WranglerException e1) {
MessageDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "Error", e1.getMessage());
return null;
}
try {
final File tmpFile = File.createTempFile("wrangler_graph_", ".dot");
tmpFile.deleteOnExit();
final IErlSelection wranglerSelection = GlobalParameters.getWranglerSelection();
if ("org.erlide.wrangler.refactoring.codeinspection.cyclicdependencies".equals(actionId)) {
final Boolean answer = MessageDialog.openQuestion(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "Labels", "Label edges with function names called?");
runInspection("Cyclic module dependency", GraphResultingInspectionHandler.CYCLYC_VIEW_ID, "There is no cyclic dependent modules in the project!", tmpFile, "cyclic_dependent_modules", "ssx", tmpFile.getAbsolutePath(), wranglerSelection.getSearchPath(), new OtpErlangBoolean(answer));
} else if ("org.erlide.wrangler.refactoring.codeinspection.generatefunctioncallgraph".equals(actionId)) {
runInspection("Function callgraph", GraphResultingInspectionHandler.FUNCTION_CALL_GRAPH_VIEW_ID, "There is no dependent functions in the module!", tmpFile, "gen_function_callgraph", "sss", tmpFile.getAbsolutePath(), wranglerSelection.getFilePath(), wranglerSelection.getSearchPath());
} else if ("org.erlide.wrangler.refactoring.codeinspection.generatemodulegraph".equals(actionId)) {
final Boolean answer = MessageDialog.openQuestion(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "Labels", "Label edges with function names called?");
runInspection("Module dependency graph", GraphResultingInspectionHandler.MODULE_GRAPH_VIEW_ID, "There is no dependent modules in the project!", tmpFile, "gen_module_graph", "ssx", tmpFile.getAbsolutePath(), wranglerSelection.getSearchPath(), new OtpErlangBoolean(answer));
} else if ("org.erlide.wrangler.refactoring.codeinspection.improperdependecies".equals(actionId)) {
runInspection("Improper module dependencies", GraphResultingInspectionHandler.IMPROPER_DEPENDECIES_VIEW_ID, "There is no improper module dependecies!", tmpFile, "improper_inter_module_calls", "ss", tmpFile.getAbsolutePath(), wranglerSelection.getSearchPath());
}
} catch (final Exception e) {
ErlLogger.error(e);
}
return event;
}
Aggregations