|
13 | 13 | import org.eclipse.cdt.core.index.IIndexerStateListener;
|
14 | 14 | import org.eclipse.core.resources.IProject;
|
15 | 15 | import org.eclipse.core.runtime.CoreException;
|
16 |
| -import org.eclipse.core.runtime.IProgressMonitor; |
17 | 16 | import org.eclipse.core.runtime.IStatus;
|
18 |
| -import org.eclipse.core.runtime.QualifiedName; |
19 | 17 | import org.eclipse.core.runtime.Status;
|
20 |
| -import org.eclipse.core.runtime.jobs.Job; |
21 | 18 |
|
22 | 19 | import io.sloeber.core.Activator;
|
23 | 20 | import io.sloeber.core.Messages;
|
@@ -63,30 +60,16 @@ public void indexChanged(IIndexerStateEvent event) {
|
63 | 60 | }
|
64 | 61 | }
|
65 | 62 |
|
66 |
| - private static void updateLibraries(IProject updateProject) { |
67 |
| - final QualifiedName PROJECT = new QualifiedName("SLOEBER", "project"); //$NON-NLS-1$ //$NON-NLS-2$ |
68 |
| - Job installLibJob = new Job("Adding Arduino libraries to project " + updateProject.getName()) { //$NON-NLS-1$ |
69 |
| - |
70 |
| - @Override |
71 |
| - protected IStatus run(IProgressMonitor monitor) { |
72 |
| - IProject project = (IProject) getProperty(PROJECT); |
73 |
| - try { |
74 |
| - Common.log(new Status(Const.SLOEBER_STATUS_DEBUG, Activator.getId(), |
75 |
| - "Looking for libraries for project :" + project.getName())); //$NON-NLS-1$ |
76 |
| - Libraries.checkLibraries(project); |
77 |
| - |
78 |
| - } catch (Exception e) { |
79 |
| - Common.log(new Status(IStatus.WARNING, Activator.getId(), Messages.Failed_To_Add_Libraries, e)); |
80 |
| - } |
81 |
| - Common.log(new Status(Const.SLOEBER_STATUS_DEBUG, Activator.getId(), |
82 |
| - "libraries added for project " + project.getName())); //$NON-NLS-1$ |
83 |
| - return Status.OK_STATUS; |
84 |
| - } |
85 |
| - |
86 |
| - }; |
87 |
| - installLibJob.setProperty(PROJECT, updateProject); |
88 |
| - installLibJob.setPriority(Job.DECORATE); |
89 |
| - installLibJob.schedule(); |
| 63 | + private static void updateLibraries(IProject project) { |
| 64 | + try { |
| 65 | + Common.log(new Status(Const.SLOEBER_STATUS_DEBUG, Activator.getId(), |
| 66 | + "Looking for libraries for project :" + project.getName())); //$NON-NLS-1$ |
| 67 | + Libraries.checkLibraries(project); |
| 68 | + } catch (Exception e) { |
| 69 | + Common.log(new Status(IStatus.WARNING, Activator.getId(), Messages.Failed_To_Add_Libraries, e)); |
| 70 | + } |
| 71 | + Common.log(new Status(Const.SLOEBER_STATUS_DEBUG, Activator.getId(), |
| 72 | + "libraries added for project " + project.getName())); //$NON-NLS-1$ |
90 | 73 | }
|
91 | 74 |
|
92 | 75 | }
|
0 commit comments