Author: scabanovich
Date: 2011-07-01 18:15:04 -0400 (Fri, 01 Jul 2011)
New Revision: 32535
Added:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/IIncrementalProjectBuilderExtension.java
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbProjectFactory.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbBuilder.java
Log:
JBIDE-5046
https://issues.jboss.org/browse/JBIDE-5046
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbProjectFactory.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbProjectFactory.java 2011-07-01
22:01:41 UTC (rev 32534)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbProjectFactory.java 2011-07-01
22:15:04 UTC (rev 32535)
@@ -18,6 +18,7 @@
import org.eclipse.core.internal.resources.BuildConfiguration;
import org.eclipse.core.resources.IBuildConfiguration;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.QualifiedName;
@@ -124,7 +125,7 @@
return mock;
}
- static void setProjectToBuilder(KbBuilder builder, IProject project) {
+ public static void setProjectToBuilder(IncrementalProjectBuilder builder, IProject
project) {
try {
Method m = InternalBuilder.class.getDeclaredMethod("setBuildConfig", new
Class[]{IBuildConfiguration.class});
m.setAccessible(true);
Added:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/IIncrementalProjectBuilderExtension.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/IIncrementalProjectBuilderExtension.java
(rev 0)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/IIncrementalProjectBuilderExtension.java 2011-07-01
22:15:04 UTC (rev 32535)
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.internal;
+
+import java.util.Map;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+
+public interface IIncrementalProjectBuilderExtension {
+ public IProject[] build(int kind, Map<String,String> args, IProgressMonitor
monitor) throws CoreException;
+}
Property changes on:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/IIncrementalProjectBuilderExtension.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbBuilder.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbBuilder.java 2011-07-01
22:01:41 UTC (rev 32534)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbBuilder.java 2011-07-01
22:15:04 UTC (rev 32535)
@@ -20,6 +20,7 @@
import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.osgi.util.NLS;
import org.jboss.tools.common.el.core.resolver.TypeInfoCollector;
import org.jboss.tools.jst.web.WebModelPlugin;
@@ -29,6 +30,7 @@
import org.jboss.tools.jst.web.kb.internal.scanner.IFileScanner;
import org.jboss.tools.jst.web.kb.internal.scanner.LibraryScanner;
import org.jboss.tools.jst.web.kb.internal.scanner.XMLScanner;
+import org.osgi.framework.Bundle;
/**
*
@@ -79,7 +81,7 @@
* @see org.eclipse.core.resource.InternalProjectBuilder#build(int,
* java.util.Map, org.eclipse.core.runtime.IProgressMonitor)
*/
- protected IProject[] build(int kind, Map args, IProgressMonitor monitor)
+ protected IProject[] build(int kind, Map<String,String> args, IProgressMonitor
monitor)
throws CoreException {
KbProject sp = getKbProject();
if(sp == null) {
@@ -126,6 +128,8 @@
sp.fireChanges();
}
resourceVisitor = null;
+
+ buildExtensionModels(kind, args, monitor);
return null;
}
@@ -169,4 +173,26 @@
PageContextFactory.getInstance().cleanUp(getProject());
}
+ static String[][] builders = {
+ {"org.jboss.tools.jsf",
"org.jboss.tools.jsf.jsf2.bean.build.JSF2ProjectBuilder"}
+ };
+
+ void buildExtensionModels(int kind, Map args, IProgressMonitor monitor) throws
CoreException {
+ for (int i = 0; i < builders.length; i++) {
+ Bundle b = Platform.getBundle(builders[i][0]);
+ if(b != null) {
+ try {
+ IncrementalProjectBuilder builder =
(IncrementalProjectBuilder)b.loadClass(builders[i][1]).newInstance();
+ KbProjectFactory.setProjectToBuilder(builder, getProject());
+ ((IIncrementalProjectBuilderExtension)builder).build(kind, args, monitor);
+ } catch (InstantiationException e) {
+ WebKbPlugin.getDefault().logError(e);
+ } catch (IllegalAccessException e) {
+ WebKbPlugin.getDefault().logError(e);
+ } catch (ClassNotFoundException e) {
+ WebKbPlugin.getDefault().logError(e);
+ }
+ }
+ }
+ }
}