Search in sources :

Example 1 with ProjectElement

use of org.erlide.cover.ui.launch.helpers.ProjectElement in project erlide_eclipse by erlang.

the class CoverMainTab method createProjectArray.

private Object[] createProjectArray() {
    Object[] array;
    try {
        final List<ProjectElement> res = new LinkedList<>();
        final Collection<IErlProject> projects = ErlangEngine.getInstance().getModel().getErlangProjects();
        for (final IErlProject p : projects) {
            final ProjectElement elem = new ProjectElement(p.getName(), PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(IDE.SharedImages.IMG_OBJ_PROJECT).createImage());
            res.add(elem);
        }
        array = res.toArray();
    } catch (final ErlModelException e) {
        array = new Object[0];
        ErlLogger.error(e);
    }
    return array;
}
Also used : IErlProject(org.erlide.engine.model.root.IErlProject) ErlModelException(org.erlide.engine.model.ErlModelException) ProjectElement(org.erlide.cover.ui.launch.helpers.ProjectElement) LinkedList(java.util.LinkedList)

Example 2 with ProjectElement

use of org.erlide.cover.ui.launch.helpers.ProjectElement in project erlide_eclipse by erlang.

the class CoverMainTab method createModuleArray.

private Object[] createModuleArray(final IErlProject p) {
    Object[] array;
    try {
        final List<ProjectElement> res = new LinkedList<>();
        final Collection<IErlModule> modules = p.getModules();
        for (final IErlModule m : modules) {
            final ProjectElement elem = new ProjectElement(m.getName(), ErlangElementImageProvider.getErlImageDescriptor(m, ErlangElementImageProvider.SMALL_ICONS).createImage());
            res.add(elem);
        }
        array = res.toArray();
    } catch (final ErlModelException e) {
        array = new Object[0];
        ErlLogger.error(e);
    }
    return array;
}
Also used : ErlModelException(org.erlide.engine.model.ErlModelException) ProjectElement(org.erlide.cover.ui.launch.helpers.ProjectElement) IErlModule(org.erlide.engine.model.root.IErlModule) LinkedList(java.util.LinkedList)

Aggregations

LinkedList (java.util.LinkedList)2 ProjectElement (org.erlide.cover.ui.launch.helpers.ProjectElement)2 ErlModelException (org.erlide.engine.model.ErlModelException)2 IErlModule (org.erlide.engine.model.root.IErlModule)1 IErlProject (org.erlide.engine.model.root.IErlProject)1