use of org.eclipse.titanium.error.ErrorHandler in project titan.EclipsePlug-ins by eclipse.
the class ComponentGraphAction method doOpenGraphForProject.
/**
* @param project the project whose graph is to be displayed
*/
private void doOpenGraphForProject(final IProject project) {
try {
// looking for a file inside the selected
// project
final IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
IFile input = null;
IResource[] members = project.members();
for (final IResource res : members) {
if (res.getType() == IResource.FILE) {
input = (IFile) res;
break;
}
if (res.getType() == IResource.FOLDER) {
members = ((IFolder) res).members();
}
}
final IEditorPart editor = page.findEditor(new FileEditorInput(input));
if (editor instanceof ComponentGraphEditor) {
((ComponentGraphEditor) editor).refreshGraph();
} else {
page.openEditor(new FileEditorInput(input), ComponentGraphEditor.ID, true, IWorkbenchPage.MATCH_ID | IWorkbenchPage.MATCH_INPUT);
}
} catch (Exception exc) {
final ErrorHandler errorHandler = new GUIErrorHandler();
errorHandler.reportException("Error while parsing the project", exc);
}
}
use of org.eclipse.titanium.error.ErrorHandler in project titan.EclipsePlug-ins by eclipse.
the class SaveComponentNet method exportInformationForProject.
@Override
protected void exportInformationForProject(final String[] args, final IProject project, final IProgressMonitor monitor) {
final ErrorHandler errorHandler = new ConsoleErrorHandler();
final ComponentGraphGenerator generator = new ComponentGraphGenerator(project, errorHandler);
try {
generator.generateGraph();
GraphHandler.saveGraphToPajek(generator.getGraph(), args[0] + project.getName() + ".net");
} catch (Exception e) {
errorHandler.reportException("Error while exporting", e);
}
}
use of org.eclipse.titanium.error.ErrorHandler in project titan.EclipsePlug-ins by eclipse.
the class SaveModuleDot method exportInformationForProject.
@Override
protected void exportInformationForProject(final String[] args, final IProject project, final IProgressMonitor monitor) {
final ErrorHandler errorHandler = new ConsoleErrorHandler();
final ModuleGraphGenerator generator = new ModuleGraphGenerator(project, errorHandler);
try {
generator.generateGraph();
String clusterName = "";
for (int i = 1; i < args.length; ++i) {
if (args[i].startsWith("-c")) {
clusterName = args[i].substring(2);
}
}
if (clusterName.isEmpty()) {
graph = generator.getGraph();
} else {
final BaseCluster clusterer = new ClustererBuilder().setAlgorithm(clusterName).setGraph(generator.getGraph()).setProject(project).build();
clusterer.run(monitor, false);
graph = clusterer.getGraph();
}
final String fileName = args[0] + project.getName() + ".dot";
GraphHandler.saveGraphToDot(graph, fileName, project.getName());
errorHandler.reportInformation("The graphs have been successfully saved. See results at " + new File(fileName).getAbsolutePath());
} catch (Exception e) {
errorHandler.reportException("Error while exporting", e);
}
}
use of org.eclipse.titanium.error.ErrorHandler in project titan.EclipsePlug-ins by eclipse.
the class SaveComponentDot method exportInformationForProject.
@Override
protected void exportInformationForProject(final String[] args, final IProject project, final IProgressMonitor monitor) {
final ErrorHandler errorHandler = new ConsoleErrorHandler();
final ComponentGraphGenerator generator = new ComponentGraphGenerator(project, errorHandler);
try {
generator.generateGraph();
GraphHandler.saveGraphToDot(generator.getGraph(), args[0] + project.getName() + ".dot", project.getName());
} catch (Exception e) {
errorHandler.reportException("Error while exporting", e);
}
}
use of org.eclipse.titanium.error.ErrorHandler in project titan.EclipsePlug-ins by eclipse.
the class SaveModuleNet method exportInformationForProject.
@Override
protected void exportInformationForProject(final String[] args, final IProject project, final IProgressMonitor monitor) {
final ErrorHandler errorHandler = new ConsoleErrorHandler();
final ModuleGraphGenerator generator = new ModuleGraphGenerator(project, errorHandler);
try {
generator.generateGraph();
String clusterName = "";
for (int i = 1; i < args.length; ++i) {
if (args[i].startsWith("-c")) {
clusterName = args[i].substring(2);
}
}
if (clusterName.isEmpty()) {
graph = generator.getGraph();
} else {
final BaseCluster clusterer = new ClustererBuilder().setAlgorithm(clusterName).setGraph(generator.getGraph()).setProject(project).build();
clusterer.run(monitor, false);
graph = clusterer.getGraph();
}
final String fileName = args[0] + project.getName() + ".net";
GraphHandler.saveGraphToPajek(graph, fileName);
errorHandler.reportInformation("The graphs have been successfully saved. See results at " + new File(fileName).getAbsolutePath());
} catch (Exception e) {
errorHandler.reportException("Error while exporting", e);
}
}
Aggregations