15
15
public class inoToCpp extends IncrementalProjectBuilder {
16
16
17
17
class SampleDeltaVisitor implements IResourceDeltaVisitor {
18
- /*
19
- * (non-Javadoc)
20
- *
21
- * @see org.eclipse.core.resources.IResourceDeltaVisitor#visit(org.eclipse. core.resources.IResourceDelta)
22
- */
23
- @ Override
24
- public boolean visit (IResourceDelta delta ) throws CoreException {
25
- IResource resource = delta .getResource ();
26
- if (resource .getFileExtension () != null ) {
27
- if (resource .getFileExtension ().equalsIgnoreCase ("ino" ) //$NON-NLS-1$
28
- || resource .getFileExtension ().equalsIgnoreCase ("pde" )) { //$NON-NLS-1$
29
- try {
30
- PdePreprocessor .processProject (true ,getProject ());
31
- } catch (CoreException e ) {
32
- e .printStackTrace ();
33
- }
34
- return false ;
35
- }
36
- }
37
- return true ;
38
- }
18
+ /*
19
+ * (non-Javadoc)
20
+ *
21
+ * @see org.eclipse.core.resources.IResourceDeltaVisitor#visit(org.eclipse.
22
+ * core.resources.IResourceDelta)
23
+ */
24
+ @ Override
25
+ public boolean visit (IResourceDelta delta ) throws CoreException {
26
+ IResource resource = delta .getResource ();
27
+ if (resource .getFileExtension () != null ) {
28
+ if (resource .getFileExtension ().equalsIgnoreCase ("ino" ) //$NON-NLS-1$
29
+ || resource .getFileExtension ().equalsIgnoreCase ("pde" )) { //$NON-NLS-1$
30
+ try {
31
+ PdePreprocessor .processProject (true , getProject ());
32
+ } catch (CoreException e ) {
33
+ e .printStackTrace ();
34
+ }
35
+ return false ;
36
+ }
37
+ }
38
+ return true ;
39
+ }
39
40
}
40
41
41
42
/*
42
43
* (non-Javadoc)
43
44
*
44
- * @see org.eclipse.core.internal.events.InternalBuilder#build(int, java.util.Map, org.eclipse.core.runtime.IProgressMonitor)
45
+ * @see org.eclipse.core.internal.events.InternalBuilder#build(int,
46
+ * java.util.Map, org.eclipse.core.runtime.IProgressMonitor)
45
47
*/
46
48
@ Override
47
- protected IProject [] build (int kind , @ SuppressWarnings ("rawtypes" ) Map args , IProgressMonitor monitor ) throws CoreException {
48
- if (kind == FULL_BUILD ) {
49
- fullBuild (monitor );
50
- } else {
51
- IResourceDelta delta = getDelta (getProject ());
52
- if (delta == null ) {
53
- fullBuild (monitor );
54
- } else {
55
- incrementalBuild (delta , monitor );
56
- }
57
- }
58
- return null ;
49
+ protected IProject [] build (int kind , @ SuppressWarnings ("rawtypes" ) Map args , IProgressMonitor monitor )
50
+ throws CoreException {
51
+ if (kind == FULL_BUILD ) {
52
+ fullBuild (monitor );
53
+ } else {
54
+ IResourceDelta delta = getDelta (getProject ());
55
+ if (delta == null ) {
56
+ fullBuild (monitor );
57
+ } else {
58
+ incrementalBuild (delta , monitor );
59
+ }
60
+ }
61
+ return null ;
59
62
}
60
63
61
64
@ Override
@@ -64,18 +67,18 @@ protected void clean(IProgressMonitor monitor) throws CoreException {
64
67
}
65
68
66
69
@ SuppressWarnings ("unused" )
67
- protected void fullBuild (final IProgressMonitor monitor ) {
68
- try {
69
- PdePreprocessor .processProject (false ,getProject ());
70
- } catch (CoreException e ) {
71
- e .printStackTrace ();
72
- }
70
+ protected void fullBuild (final IProgressMonitor monitor ) {
71
+ try {
72
+ PdePreprocessor .processProject (false , getProject ());
73
+ } catch (CoreException e ) {
74
+ e .printStackTrace ();
75
+ }
73
76
}
74
77
75
78
@ SuppressWarnings ("unused" )
76
- protected void incrementalBuild (IResourceDelta delta , IProgressMonitor monitor ) throws CoreException {
77
- // the visitor does the work.
78
- delta .accept (new SampleDeltaVisitor ());
79
+ protected void incrementalBuild (IResourceDelta delta , IProgressMonitor monitor ) throws CoreException {
80
+ // the visitor does the work.
81
+ delta .accept (new SampleDeltaVisitor ());
79
82
80
83
}
81
84
}
0 commit comments