diff --git a/qt/org.eclipse.cdt.qt.core/.classpath b/qt/org.eclipse.cdt.qt.core/.classpath index 098194ca4b7..27ef2aeea4f 100644 --- a/qt/org.eclipse.cdt.qt.core/.classpath +++ b/qt/org.eclipse.cdt.qt.core/.classpath @@ -1,5 +1,6 @@ + diff --git a/qt/org.eclipse.cdt.qt.core/META-INF/MANIFEST.MF b/qt/org.eclipse.cdt.qt.core/META-INF/MANIFEST.MF index 2b9e2478af0..49518054b12 100644 --- a/qt/org.eclipse.cdt.qt.core/META-INF/MANIFEST.MF +++ b/qt/org.eclipse.cdt.qt.core/META-INF/MANIFEST.MF @@ -2,8 +2,8 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.cdt.qt.core;singleton:=true -Bundle-Version: 1.1.0.qualifier -Bundle-Activator: org.eclipse.cdt.qt.core.QtPlugin +Bundle-Version: 2.0.0.qualifier +Bundle-Activator: org.eclipse.cdt.internal.qt.core.QtPlugin Bundle-Vendor: %providerName Require-Bundle: org.eclipse.core.runtime, org.eclipse.core.resources, @@ -16,7 +16,9 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Bundle-ActivationPolicy: lazy Bundle-Localization: plugin Export-Package: org.eclipse.cdt.internal.qt.core;x-friends:="org.eclipse.cdt.qt.ui,org.eclipse.cdt.qt.tests", + org.eclipse.cdt.internal.qt.core.build;x-friends:="org.eclipse.cdt.qt.ui", org.eclipse.cdt.internal.qt.core.index;x-friends:="org.eclipse.cdt.qt.tests", org.eclipse.cdt.internal.qt.core.parser;x-friends:="org.eclipse.cdt.qt.ui", - org.eclipse.cdt.qt.core, - org.eclipse.cdt.qt.core.index + org.eclipse.cdt.internal.qt.core.project;x-friends:="org.eclipse.cdt.qt.ui" +Bundle-ClassPath: libs/freemarker-2.3.22.jar, + . diff --git a/qt/org.eclipse.cdt.qt.core/build.properties b/qt/org.eclipse.cdt.qt.core/build.properties index f2748e1059a..9773163cbb8 100644 --- a/qt/org.eclipse.cdt.qt.core/build.properties +++ b/qt/org.eclipse.cdt.qt.core/build.properties @@ -5,6 +5,7 @@ bin.includes = META-INF/,\ plugin.xml,\ templates/,\ about.html,\ - plugin.properties + plugin.properties,\ + libs/freemarker-2.3.22.jar src.includes = about.html,\ schema/ diff --git a/qt/org.eclipse.cdt.qt.core/libs/freemarker-2.3.22.jar b/qt/org.eclipse.cdt.qt.core/libs/freemarker-2.3.22.jar new file mode 100644 index 00000000000..a67a1c127e3 Binary files /dev/null and b/qt/org.eclipse.cdt.qt.core/libs/freemarker-2.3.22.jar differ diff --git a/qt/org.eclipse.cdt.qt.core/plugin.xml b/qt/org.eclipse.cdt.qt.core/plugin.xml index 74ecc70a820..4c7e0cd7d39 100644 --- a/qt/org.eclipse.cdt.qt.core/plugin.xml +++ b/qt/org.eclipse.cdt.qt.core/plugin.xml @@ -41,9 +41,12 @@ point="org.eclipse.core.resources.natures"> + class="org.eclipse.cdt.internal.qt.core.QtNature"> + + + + + + + diff --git a/qt/org.eclipse.cdt.qt.core/pom.xml b/qt/org.eclipse.cdt.qt.core/pom.xml index 1320c0d990b..19eb92eed73 100644 --- a/qt/org.eclipse.cdt.qt.core/pom.xml +++ b/qt/org.eclipse.cdt.qt.core/pom.xml @@ -11,7 +11,7 @@ ../../pom.xml - 1.1.0-SNAPSHOT + 2.0.0-SNAPSHOT org.eclipse.cdt.qt.core eclipse-plugin diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/ASTUtil.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/ASTUtil.java index e18152b0b95..f38286159c2 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/ASTUtil.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/ASTUtil.java @@ -39,9 +39,8 @@ import org.eclipse.cdt.internal.core.dom.parser.ITypeContainer; import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPEvaluation; import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding; import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor; -import org.eclipse.cdt.qt.core.QtPlugin; -import org.eclipse.cdt.qt.core.index.IQMethod; -import org.eclipse.cdt.qt.core.index.IQObject; +import org.eclipse.cdt.internal.qt.core.index.IQMethod; +import org.eclipse.cdt.internal.qt.core.index.IQObject; import org.eclipse.core.resources.IProject; @SuppressWarnings("restriction") diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtFunctionCall.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtFunctionCall.java index 256001196d1..3e83ac057b5 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtFunctionCall.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtFunctionCall.java @@ -20,7 +20,6 @@ import org.eclipse.cdt.core.dom.ast.IType; import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType; import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction; import org.eclipse.cdt.core.dom.ast.cpp.ICPPParameter; -import org.eclipse.cdt.qt.core.QtKeywords; /** * Extracts required information from FunctionCallExpressions that call diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtFunctionCallUtil.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtFunctionCallUtil.java index 1e050cb51e5..0e8e48efee6 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtFunctionCallUtil.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtFunctionCallUtil.java @@ -16,7 +16,6 @@ import org.eclipse.cdt.core.dom.ast.IASTInitializerClause; import org.eclipse.cdt.core.dom.ast.IASTName; import org.eclipse.cdt.core.dom.ast.IBinding; import org.eclipse.cdt.core.dom.ast.IType; -import org.eclipse.cdt.qt.core.QtKeywords; /** * Utility for managing interaction with QObject::connect and QObject::disconnect function diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtIncludePaths.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtIncludePaths.java index 3ab4504e18e..654654a817d 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtIncludePaths.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtIncludePaths.java @@ -21,7 +21,6 @@ import org.eclipse.cdt.core.settings.model.CIncludePathEntry; import org.eclipse.cdt.core.settings.model.ICConfigurationDescription; import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry; import org.eclipse.cdt.core.settings.model.ICSettingEntry; -import org.eclipse.cdt.qt.core.QtPlugin; import org.eclipse.cdt.utils.spawner.ProcessFactory; import org.eclipse.core.resources.IResource; import org.w3c.dom.Element; diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/QtKeywords.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtKeywords.java similarity index 98% rename from qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/QtKeywords.java rename to qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtKeywords.java index 57884473422..97080df0e6c 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/QtKeywords.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtKeywords.java @@ -6,7 +6,7 @@ * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.cdt.qt.core; +package org.eclipse.cdt.internal.qt.core; import org.eclipse.cdt.core.dom.ast.DOMException; import org.eclipse.cdt.core.dom.ast.IBinding; diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtMethodReference.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtMethodReference.java index 5501383f5fe..cbde756f05a 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtMethodReference.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtMethodReference.java @@ -21,13 +21,11 @@ import org.eclipse.cdt.core.dom.ast.IBinding; import org.eclipse.cdt.core.dom.ast.IType; import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType; import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPSemantics; +import org.eclipse.cdt.internal.qt.core.index.IQMethod; +import org.eclipse.cdt.internal.qt.core.index.IQObject; +import org.eclipse.cdt.internal.qt.core.index.QtIndex; import org.eclipse.cdt.internal.qt.core.pdom.ASTNameReference; import org.eclipse.cdt.internal.qt.core.pdom.QtASTImageLocation; -import org.eclipse.cdt.qt.core.QtKeywords; -import org.eclipse.cdt.qt.core.QtPlugin; -import org.eclipse.cdt.qt.core.index.IQMethod; -import org.eclipse.cdt.qt.core.index.IQObject; -import org.eclipse.cdt.qt.core.index.QtIndex; import org.eclipse.core.resources.IProject; /** diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/QtNature.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtNature.java similarity index 87% rename from qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/QtNature.java rename to qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtNature.java index 52786918e02..cadb9bb2546 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/QtNature.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtNature.java @@ -8,7 +8,7 @@ * Contributors: * Doug Schaefer (QNX) - Initial implementation *******************************************************************************/ -package org.eclipse.cdt.qt.core; +package org.eclipse.cdt.internal.qt.core; import java.util.Arrays; @@ -28,7 +28,7 @@ import org.eclipse.core.runtime.IStatus; @SuppressWarnings("restriction") public class QtNature implements IProjectNature { - private static final String ID = "org.eclipse.cdt.qt.core.qtNature"; + public static final String ID = "org.eclipse.cdt.qt.core.qtNature"; //$NON-NLS-1$ private IProject project; @@ -65,15 +65,18 @@ public class QtNature implements IProjectNature { if (!(index instanceof CIndex)) return; - // Don't reindex the project if it already has a Qt linkage. The index will be updated + // Don't reindex the project if it already has a Qt linkage. The index + // will be updated // by the normal triggers. - for(IIndexFragment fragment : ((CIndex) index).getFragments()) - for(IIndexLinkage linkage : fragment.getLinkages()) + for (IIndexFragment fragment : ((CIndex) index).getFragments()) + for (IIndexLinkage linkage : fragment.getLinkages()) if (linkage.getLinkageID() == ILinkage.QT_LINKAGE_ID) return; - // We need to force the index to be rebuilt the first time the Qt nature is added. If - // this doesn't happen then the PDOM could have the current version (so nothing would trigger + // We need to force the index to be rebuilt the first time the Qt nature + // is added. If + // this doesn't happen then the PDOM could have the current version (so + // nothing would trigger // an update) but no Qt content. CCorePlugin.log(IStatus.INFO, "Reindexing " + project.getName() + " because Qt nature has been added"); CCorePlugin.getIndexManager().reindex(cProject); diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/QtPlugin.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtPlugin.java similarity index 66% rename from qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/QtPlugin.java rename to qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtPlugin.java index 130ec7a1e39..ddce9d52034 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/QtPlugin.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtPlugin.java @@ -5,7 +5,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.cdt.qt.core; +package org.eclipse.cdt.internal.qt.core; import java.util.concurrent.atomic.AtomicBoolean; @@ -19,35 +19,37 @@ import org.eclipse.core.runtime.Status; import org.osgi.framework.BundleContext; import org.osgi.framework.BundleEvent; import org.osgi.framework.BundleListener; +import org.osgi.framework.ServiceReference; public class QtPlugin extends Plugin { - public static final String ID = "org.eclipse.cdt.qt.core"; - public static final String SIGNAL_SLOT_TAGGER_ID = ID + ".signalslot.tagger"; + public static final String ID = "org.eclipse.cdt.qt.core"; + public static final String SIGNAL_SLOT_TAGGER_ID = ID + ".signalslot.tagger"; - public static final int SignalSlot_Mask_signal = 1; - public static final int SignalSlot_Mask_slot = 2; + public static final int SignalSlot_Mask_signal = 1; + public static final int SignalSlot_Mask_slot = 2; public static final String QMAKE_ENV_PROVIDER_EXT_POINT_NAME = "qmakeEnvProvider"; //$NON-NLS-1$ public static final String QMAKE_ENV_PROVIDER_ID = ID + "." + QMAKE_ENV_PROVIDER_EXT_POINT_NAME; //$NON-NLS-1$ - public static final String QT_SYNTAX_ERR_ID = "org.eclipse.cdt.qt.core.qtproblem"; //$NON-NLS-1$ + public static final String QT_SYNTAX_ERR_ID = "org.eclipse.cdt.qt.core.qtproblem"; //$NON-NLS-1$ - /** - * Instances of QtIndex are cached within the session properties of the project from - * which they are created. This name is used to store the property. - */ - public static final QualifiedName QTINDEX_PROP_NAME = new QualifiedName(ID, "qtindex"); + /** + * Instances of QtIndex are cached within the session properties of the + * project from which they are created. This name is used to store the + * property. + */ + public static final QualifiedName QTINDEX_PROP_NAME = new QualifiedName(ID, "qtindex"); - private static QtPlugin instance; + private static QtPlugin instance; - public static QtPlugin getDefault() { - return instance; - } + public static QtPlugin getDefault() { + return instance; + } - public QtPlugin() { - instance = this; - } + public QtPlugin() { + instance = this; + } @Override public void start(BundleContext context) throws Exception { @@ -56,6 +58,7 @@ public class QtPlugin extends Plugin { // since the CoreModel is not completely initialized at this time BundleListener bundleListener = new BundleListener() { final AtomicBoolean initStarted = new AtomicBoolean(false); + @Override public void bundleChanged(BundleEvent bundleEvent) { if (bundleEvent.getType() == BundleEvent.STARTED) { @@ -75,9 +78,9 @@ public class QtPlugin extends Plugin { super.stop(context); } - public static CoreException coreException(String msg) { - return new CoreException(new Status(IStatus.INFO, ID, msg)); - } + public static CoreException coreException(String msg) { + return new CoreException(new Status(IStatus.INFO, ID, msg)); + } public static IStatus info(String msg) { return new Status(IStatus.INFO, ID, msg); @@ -96,7 +99,7 @@ public class QtPlugin extends Plugin { } public static void log(Throwable e) { - String msg= e.getMessage(); + String msg = e.getMessage(); if (msg == null) { log("Error", e); //$NON-NLS-1$ } else { @@ -106,8 +109,7 @@ public class QtPlugin extends Plugin { public static void log(String message, Throwable e) { Throwable nestedException; - if (e instanceof CModelException - && (nestedException = ((CModelException)e).getException()) != null) { + if (e instanceof CModelException && (nestedException = ((CModelException) e).getException()) != null) { e = nestedException; } log(IStatus.ERROR, message, e); @@ -116,4 +118,11 @@ public class QtPlugin extends Plugin { public static void log(int code, String msg, Throwable e) { getDefault().getLog().log(new Status(code, ID, msg, e)); } + + public static T getService(Class service) { + BundleContext context = instance.getBundle().getBundleContext(); + ServiceReference ref = context.getServiceReference(service); + return ref != null ? context.getService(ref) : null; + } + } diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtTemplateGenerator.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtTemplateGenerator.java new file mode 100644 index 00000000000..b84d0adb4f6 --- /dev/null +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtTemplateGenerator.java @@ -0,0 +1,57 @@ +package org.eclipse.cdt.internal.qt.core; + +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.IOException; +import java.io.StringWriter; +import java.net.URISyntaxException; +import java.net.URL; +import java.nio.charset.StandardCharsets; + +import org.eclipse.core.resources.IFile; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.FileLocator; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Path; +import org.eclipse.core.runtime.Status; + +import freemarker.template.Configuration; +import freemarker.template.Template; +import freemarker.template.TemplateException; + +public class QtTemplateGenerator { + + private final Configuration config; + + public QtTemplateGenerator() throws CoreException { + config = new Configuration(Configuration.VERSION_2_3_22); + URL templateDirURL = FileLocator.find(QtPlugin.getDefault().getBundle(), new Path("/templates"), null); //$NON-NLS-1$ + try { + config.setDirectoryForTemplateLoading(new File(FileLocator.toFileURL(templateDirURL).toURI())); + } catch (IOException | URISyntaxException e) { + throw new CoreException(new Status(IStatus.ERROR, QtPlugin.ID, "Template configuration", e)); + } + } + + public void generateFile(final Object model, String templateFile, final IFile outputFile, IProgressMonitor monitor) + throws CoreException { + try { + final Template template = config.getTemplate(templateFile); + try (StringWriter writer = new StringWriter()) { + template.process(model, writer); + try (ByteArrayInputStream in = new ByteArrayInputStream( + writer.getBuffer().toString().getBytes(StandardCharsets.UTF_8))) { + if (outputFile.exists()) { + outputFile.setContents(in, true, true, monitor); + } else { + outputFile.create(in, true, monitor); + } + } + } + } catch (IOException | TemplateException e) { + throw new CoreException(new Status(IStatus.ERROR, QtPlugin.ID, "Processing template " + templateFile, e)); + } + } + +} diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/build/IConsoleService.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/build/IConsoleService.java new file mode 100644 index 00000000000..bac8e25d50b --- /dev/null +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/build/IConsoleService.java @@ -0,0 +1,14 @@ +package org.eclipse.cdt.internal.qt.core.build; + +import java.io.IOException; + +public interface IConsoleService { + + // TODO add error parsers + void monitor(Process process) throws IOException; + + void writeOutput(String msg) throws IOException; + + void writeError(String msg) throws IOException; + +} diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/build/QtBuilder.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/build/QtBuilder.java new file mode 100644 index 00000000000..83c0d5b8042 --- /dev/null +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/build/QtBuilder.java @@ -0,0 +1,60 @@ +package org.eclipse.cdt.internal.qt.core.build; + +import java.io.File; +import java.io.IOException; +import java.util.Map; + +import org.eclipse.cdt.internal.qt.core.QtPlugin; +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IFolder; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.resources.IncrementalProjectBuilder; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; + +public class QtBuilder extends IncrementalProjectBuilder { + + public static final String ID = QtPlugin.ID + ".qtBuilder"; //$NON-NLS-1$ + + private static final String qmake = "/Users/dschaefer/Qt/5.5/clang_64/bin/qmake"; //$NON-NLS-1$ + + @Override + protected IProject[] build(int kind, Map args, IProgressMonitor monitor) throws CoreException { + IProject project = getProject(); + try { + IConsoleService console = QtPlugin.getService(IConsoleService.class); + + IFolder buildFolder = project.getFolder("build"); //$NON-NLS-1$ + if (!buildFolder.exists()) { + buildFolder.create(IResource.FORCE | IResource.DERIVED, true, monitor); + } + + IFile makeFile = buildFolder.getFile("Makefile"); //$NON-NLS-1$ + if (!makeFile.exists()) { + // Need to run qmake + String[] command = new String[] { qmake, "../main.pro", "CONFIG+=debug" }; //$NON-NLS-1$ //$NON-NLS-2$ + Process process = new ProcessBuilder(command).directory(new File(buildFolder.getLocationURI())).start(); + StringBuffer msg = new StringBuffer(); + for (String arg : command) { + msg.append(arg).append(' '); + } + msg.append('\n'); + console.writeOutput(msg.toString()); + console.monitor(process); + } + + // run make + Process process = new ProcessBuilder("make").directory(new File(buildFolder.getLocationURI())).start(); //$NON-NLS-1$ + console.monitor(process); + + buildFolder.refreshLocal(IResource.DEPTH_INFINITE, monitor); + return new IProject[] { project }; + } catch (IOException e) { + throw new CoreException(new Status(IStatus.ERROR, QtPlugin.ID, "Building " + project.getName(), e)); + } + } + +} diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/codan/QtSyntaxChecker.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/codan/QtSyntaxChecker.java index 93a5896ccd2..e4d54f86f9a 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/codan/QtSyntaxChecker.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/codan/QtSyntaxChecker.java @@ -21,9 +21,9 @@ import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit; import org.eclipse.cdt.internal.qt.core.ASTUtil; import org.eclipse.cdt.internal.qt.core.QtFunctionCall; import org.eclipse.cdt.internal.qt.core.QtMethodReference; -import org.eclipse.cdt.qt.core.QtNature; -import org.eclipse.cdt.qt.core.QtPlugin; -import org.eclipse.cdt.qt.core.index.IQMethod; +import org.eclipse.cdt.internal.qt.core.QtNature; +import org.eclipse.cdt.internal.qt.core.QtPlugin; +import org.eclipse.cdt.internal.qt.core.index.IQMethod; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.OperationCanceledException; import org.eclipse.osgi.util.NLS; diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/AbstractQField.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/AbstractQField.java index a9f77cb2417..55fc6fcb00c 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/AbstractQField.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/AbstractQField.java @@ -7,8 +7,7 @@ */ package org.eclipse.cdt.internal.qt.core.index; -import org.eclipse.cdt.qt.core.index.IQObject; -import org.eclipse.cdt.qt.core.index.IQObject.IMember; +import org.eclipse.cdt.internal.qt.core.index.IQObject.IMember; public abstract class AbstractQField implements IQObject.IMember { diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/CDTIndex.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/CDTIndex.java index 8886eb6d7e7..3c541c2109f 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/CDTIndex.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/CDTIndex.java @@ -8,7 +8,7 @@ package org.eclipse.cdt.internal.qt.core.index; import org.eclipse.cdt.core.index.IIndex; -import org.eclipse.cdt.qt.core.QtPlugin; +import org.eclipse.cdt.internal.qt.core.QtPlugin; import org.eclipse.core.runtime.CoreException; /** diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/IQElement.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/IQElement.java similarity index 92% rename from qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/IQElement.java rename to qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/IQElement.java index cdabffdddb9..7df7df47d7e 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/IQElement.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/IQElement.java @@ -5,7 +5,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.cdt.qt.core.index; +package org.eclipse.cdt.internal.qt.core.index; import org.eclipse.cdt.core.dom.ast.IBinding; diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/IQEnum.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/IQEnum.java similarity index 98% rename from qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/IQEnum.java rename to qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/IQEnum.java index 062c47c3cef..9be12d72ce6 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/IQEnum.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/IQEnum.java @@ -5,7 +5,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.cdt.qt.core.index; +package org.eclipse.cdt.internal.qt.core.index; import java.util.Collection; diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/IQGadget.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/IQGadget.java similarity index 94% rename from qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/IQGadget.java rename to qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/IQGadget.java index 4271557f562..bfe0917bf91 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/IQGadget.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/IQGadget.java @@ -5,7 +5,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.cdt.qt.core.index; +package org.eclipse.cdt.internal.qt.core.index; import java.util.Collection; diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/IQMakeEnv.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/IQMakeEnv.java similarity index 96% rename from qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/IQMakeEnv.java rename to qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/IQMakeEnv.java index adafb0680ca..2b9963a09f7 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/IQMakeEnv.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/IQMakeEnv.java @@ -5,7 +5,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.cdt.qt.core.index; +package org.eclipse.cdt.internal.qt.core.index; /** * Represents a QMake environment. It is usually created by IQMakeEnvProvider.createEnv() method for a specific project configuration. diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/IQMakeEnv2.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/IQMakeEnv2.java similarity index 95% rename from qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/IQMakeEnv2.java rename to qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/IQMakeEnv2.java index 9dc8839141c..c9a683db409 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/IQMakeEnv2.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/IQMakeEnv2.java @@ -5,7 +5,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.cdt.qt.core.index; +package org.eclipse.cdt.internal.qt.core.index; /** * Represents a QMake environment similarly to IQMakeEnv but it has an explicit init method which is called to notify diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/IQMakeEnvProvider.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/IQMakeEnvProvider.java similarity index 97% rename from qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/IQMakeEnvProvider.java rename to qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/IQMakeEnvProvider.java index deb851665d4..4ccba756c68 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/IQMakeEnvProvider.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/IQMakeEnvProvider.java @@ -5,7 +5,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.cdt.qt.core.index; +package org.eclipse.cdt.internal.qt.core.index; import org.eclipse.cdt.core.settings.model.ICConfigurationDescription; diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/IQMakeInfo.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/IQMakeInfo.java similarity index 98% rename from qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/IQMakeInfo.java rename to qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/IQMakeInfo.java index 6534f907673..71b20d01af3 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/IQMakeInfo.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/IQMakeInfo.java @@ -5,7 +5,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.cdt.qt.core.index; +package org.eclipse.cdt.internal.qt.core.index; import java.util.List; import java.util.Map; diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/IQMakeProjectInfo.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/IQMakeProjectInfo.java similarity index 96% rename from qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/IQMakeProjectInfo.java rename to qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/IQMakeProjectInfo.java index 4a06cbabade..a0f53187437 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/IQMakeProjectInfo.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/IQMakeProjectInfo.java @@ -5,7 +5,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.cdt.qt.core.index; +package org.eclipse.cdt.internal.qt.core.index; /** * Represents provider of QMake information. diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/IQMakeProjectInfoListener.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/IQMakeProjectInfoListener.java similarity index 95% rename from qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/IQMakeProjectInfoListener.java rename to qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/IQMakeProjectInfoListener.java index 7ae7641729e..83d3b284130 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/IQMakeProjectInfoListener.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/IQMakeProjectInfoListener.java @@ -5,7 +5,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.cdt.qt.core.index; +package org.eclipse.cdt.internal.qt.core.index; /** * A listener used for notifying that a QMake information provided by IQMakeProjectInfo might have changed. diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/IQMethod.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/IQMethod.java similarity index 97% rename from qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/IQMethod.java rename to qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/IQMethod.java index c2efe891e5f..c47c3e729b0 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/IQMethod.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/IQMethod.java @@ -5,7 +5,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.cdt.qt.core.index; +package org.eclipse.cdt.internal.qt.core.index; import java.util.Collection; diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/IQObject.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/IQObject.java similarity index 98% rename from qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/IQObject.java rename to qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/IQObject.java index 26fd590c775..6a30af9628d 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/IQObject.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/IQObject.java @@ -5,7 +5,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.cdt.qt.core.index; +package org.eclipse.cdt.internal.qt.core.index; import java.util.Collection; import java.util.List; diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/IQProperty.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/IQProperty.java similarity index 98% rename from qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/IQProperty.java rename to qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/IQProperty.java index 663ec7b8a5e..fd3a6cc5fde 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/IQProperty.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/IQProperty.java @@ -5,7 +5,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.cdt.qt.core.index; +package org.eclipse.cdt.internal.qt.core.index; /** * A container for things declared as Q_PROPERTY within a subclass of QObject. In Qt 4.8, diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/IQmlRegistration.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/IQmlRegistration.java similarity index 98% rename from qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/IQmlRegistration.java rename to qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/IQmlRegistration.java index b3ff7520fad..4c20810d53f 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/IQmlRegistration.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/IQmlRegistration.java @@ -5,7 +5,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.cdt.qt.core.index; +package org.eclipse.cdt.internal.qt.core.index; /** * Represents a specific QML type registration. diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/IQtVersion.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/IQtVersion.java similarity index 92% rename from qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/IQtVersion.java rename to qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/IQtVersion.java index 5acdc9373d1..870b6280515 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/IQtVersion.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/IQtVersion.java @@ -5,7 +5,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.cdt.qt.core.index; +package org.eclipse.cdt.internal.qt.core.index; /** * Represents a Qt version in form of major and minor number. diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QEnum.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QEnum.java index 255a41efb88..37f33c5d257 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QEnum.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QEnum.java @@ -13,7 +13,6 @@ import java.util.List; import org.eclipse.cdt.core.dom.ast.IEnumerator; import org.eclipse.cdt.core.dom.ast.IValue; -import org.eclipse.cdt.qt.core.index.IQEnum; public class QEnum implements IQEnum { diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QGadget.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QGadget.java index c88d4f7e206..67ff6fe41e9 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QGadget.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QGadget.java @@ -13,8 +13,6 @@ import java.util.List; import org.eclipse.cdt.internal.qt.core.pdom.QtPDOMQEnum; import org.eclipse.cdt.internal.qt.core.pdom.AbstractQtPDOMClass; -import org.eclipse.cdt.qt.core.index.IQEnum; -import org.eclipse.cdt.qt.core.index.IQGadget; import org.eclipse.core.runtime.CoreException; public class QGadget implements IQGadget { diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/QMakeEnvInfo.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeEnvInfo.java similarity index 97% rename from qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/QMakeEnvInfo.java rename to qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeEnvInfo.java index cd7dee6ff58..1ee87c5b53b 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/QMakeEnvInfo.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeEnvInfo.java @@ -5,7 +5,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.cdt.qt.core.index; +package org.eclipse.cdt.internal.qt.core.index; import java.util.Collection; import java.util.Collections; diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeEnvProviderDescriptor.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeEnvProviderDescriptor.java index e24476deed5..1d4492378bf 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeEnvProviderDescriptor.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeEnvProviderDescriptor.java @@ -11,10 +11,8 @@ import java.util.Arrays; import java.util.concurrent.atomic.AtomicReference; import org.eclipse.cdt.core.settings.model.ICConfigurationDescription; -import org.eclipse.cdt.qt.core.QtPlugin; -import org.eclipse.cdt.qt.core.index.IQMakeEnv; -import org.eclipse.cdt.qt.core.index.IQMakeEnvProvider; -import org.eclipse.cdt.qt.core.index.IQMakeEnvProvider.IController; +import org.eclipse.cdt.internal.qt.core.QtPlugin; +import org.eclipse.cdt.internal.qt.core.index.IQMakeEnvProvider.IController; import org.eclipse.core.expressions.EvaluationContext; import org.eclipse.core.expressions.EvaluationResult; import org.eclipse.core.expressions.Expression; diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeEnvProviderManager.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeEnvProviderManager.java index 8b4490922d0..a4b29fb6b3d 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeEnvProviderManager.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeEnvProviderManager.java @@ -14,11 +14,7 @@ import java.util.List; import org.eclipse.cdt.core.CCorePlugin; import org.eclipse.cdt.core.envvar.IEnvironmentVariable; import org.eclipse.cdt.core.settings.model.ICConfigurationDescription; -import org.eclipse.cdt.qt.core.QtPlugin; -import org.eclipse.cdt.qt.core.index.IQMakeEnv; -import org.eclipse.cdt.qt.core.index.IQMakeEnv2; -import org.eclipse.cdt.qt.core.index.IQMakeEnvProvider; -import org.eclipse.cdt.qt.core.index.QMakeEnvInfo; +import org.eclipse.cdt.internal.qt.core.QtPlugin; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.IConfigurationElement; diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeInfo.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeInfo.java index 37ba713bc26..f715abe455e 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeInfo.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeInfo.java @@ -17,9 +17,7 @@ import java.util.List; import java.util.Map; import java.util.regex.Pattern; -import org.eclipse.cdt.qt.core.QtPlugin; -import org.eclipse.cdt.qt.core.index.IQtVersion; -import org.eclipse.cdt.qt.core.index.IQMakeInfo; +import org.eclipse.cdt.internal.qt.core.QtPlugin; import org.eclipse.cdt.utils.spawner.ProcessFactory; /** diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeParser.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeParser.java index 601003f78b5..0107155fdc4 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeParser.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeParser.java @@ -17,7 +17,7 @@ import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.eclipse.cdt.qt.core.QtPlugin; +import org.eclipse.cdt.internal.qt.core.QtPlugin; /** * Provides a parser for QMake output. diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeProjectInfo.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeProjectInfo.java index d611febd0b8..e6b1c2c6517 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeProjectInfo.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeProjectInfo.java @@ -20,13 +20,7 @@ import java.util.concurrent.CopyOnWriteArrayList; import org.eclipse.cdt.core.model.CoreModel; import org.eclipse.cdt.core.settings.model.ICConfigurationDescription; import org.eclipse.cdt.core.settings.model.ICProjectDescription; -import org.eclipse.cdt.qt.core.index.IQMakeEnv; -import org.eclipse.cdt.qt.core.index.IQMakeEnv2; -import org.eclipse.cdt.qt.core.index.IQMakeEnvProvider.IController; -import org.eclipse.cdt.qt.core.index.IQMakeInfo; -import org.eclipse.cdt.qt.core.index.IQMakeProjectInfo; -import org.eclipse.cdt.qt.core.index.IQMakeProjectInfoListener; -import org.eclipse.cdt.qt.core.index.QMakeEnvInfo; +import org.eclipse.cdt.internal.qt.core.index.IQMakeEnvProvider.IController; import org.eclipse.core.filesystem.URIUtil; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IProject; diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/QMakeProjectInfoFactory.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeProjectInfoFactory.java similarity index 89% rename from qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/QMakeProjectInfoFactory.java rename to qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeProjectInfoFactory.java index 4337a6baed3..414bf3bb16c 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/QMakeProjectInfoFactory.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeProjectInfoFactory.java @@ -5,9 +5,8 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.cdt.qt.core.index; +package org.eclipse.cdt.internal.qt.core.index; -import org.eclipse.cdt.internal.qt.core.index.QMakeProjectInfoManager; import org.eclipse.core.resources.IProject; /** diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeVersion.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeVersion.java index b3052bea094..1e338138a04 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeVersion.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeVersion.java @@ -10,8 +10,7 @@ package org.eclipse.cdt.internal.qt.core.index; import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.eclipse.cdt.qt.core.QtPlugin; -import org.eclipse.cdt.qt.core.index.IQtVersion; +import org.eclipse.cdt.internal.qt.core.QtPlugin; /** * A container class to interpret and store value of the the qmake version. diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMethod.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMethod.java index 7bf8e3188cd..1f9f6a42b58 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMethod.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMethod.java @@ -12,10 +12,8 @@ import java.util.Collections; import org.eclipse.cdt.core.dom.ast.IBinding; import org.eclipse.cdt.internal.qt.core.QtMethodUtil; +import org.eclipse.cdt.internal.qt.core.index.IQObject.IMember; import org.eclipse.cdt.internal.qt.core.pdom.QtPDOMQMethod; -import org.eclipse.cdt.qt.core.index.IQMethod; -import org.eclipse.cdt.qt.core.index.IQObject; -import org.eclipse.cdt.qt.core.index.IQObject.IMember; import org.eclipse.core.runtime.CoreException; public class QMethod implements IQMethod { diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QObject.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QObject.java index 3ced0623db9..b5bcf83f31f 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QObject.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QObject.java @@ -18,11 +18,6 @@ import org.eclipse.cdt.internal.qt.core.pdom.QtPDOMQEnum; import org.eclipse.cdt.internal.qt.core.pdom.QtPDOMQMethod; import org.eclipse.cdt.internal.qt.core.pdom.QtPDOMQObject; import org.eclipse.cdt.internal.qt.core.pdom.QtPDOMQmlRegistration; -import org.eclipse.cdt.qt.core.index.IQEnum; -import org.eclipse.cdt.qt.core.index.IQMethod; -import org.eclipse.cdt.qt.core.index.IQObject; -import org.eclipse.cdt.qt.core.index.IQProperty; -import org.eclipse.cdt.qt.core.index.IQmlRegistration; import org.eclipse.core.runtime.CoreException; public class QObject implements IQObject { diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QObjectMembers.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QObjectMembers.java index faf09377a6a..5c8df4a1b09 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QObjectMembers.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QObjectMembers.java @@ -13,8 +13,6 @@ import java.util.Collections; import java.util.Iterator; import java.util.List; -import org.eclipse.cdt.qt.core.index.IQObject; - public class QObjectMembers implements IQObject.IMembers { private final List all; diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QProperty.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QProperty.java index 9e8b2c14b20..c1b09a5b07f 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QProperty.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QProperty.java @@ -7,9 +7,6 @@ */ package org.eclipse.cdt.internal.qt.core.index; -import org.eclipse.cdt.qt.core.index.IQObject; -import org.eclipse.cdt.qt.core.index.IQProperty; - public class QProperty extends AbstractQField implements IQProperty { private String type; diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QmlRegistration.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QmlRegistration.java index 674dc8c0911..68c4c231674 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QmlRegistration.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QmlRegistration.java @@ -8,11 +8,9 @@ package org.eclipse.cdt.internal.qt.core.index; import org.eclipse.cdt.core.dom.ast.IBinding; +import org.eclipse.cdt.internal.qt.core.index.IQObject.IMember; import org.eclipse.cdt.internal.qt.core.pdom.QtPDOMQmlRegistration; import org.eclipse.cdt.internal.qt.core.pdom.QtPDOMQmlUncreatable; -import org.eclipse.cdt.qt.core.index.IQObject; -import org.eclipse.cdt.qt.core.index.IQObject.IMember; -import org.eclipse.cdt.qt.core.index.IQmlRegistration; import org.eclipse.core.runtime.CoreException; public class QmlRegistration implements IQmlRegistration { diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QtFactory.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QtFactory.java index 4b6e9576e92..c1831bc70cf 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QtFactory.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QtFactory.java @@ -18,8 +18,7 @@ import org.eclipse.cdt.core.index.IIndexMacro; import org.eclipse.cdt.core.index.IndexFilter; import org.eclipse.cdt.core.model.CoreModel; import org.eclipse.cdt.core.model.ICProject; -import org.eclipse.cdt.qt.core.QtPlugin; -import org.eclipse.cdt.qt.core.index.QtIndex; +import org.eclipse.cdt.internal.qt.core.QtPlugin; import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.CoreException; diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/QtIndex.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QtIndex.java similarity index 95% rename from qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/QtIndex.java rename to qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QtIndex.java index 996b2adc255..fb66625a3b0 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/QtIndex.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QtIndex.java @@ -5,12 +5,11 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.cdt.qt.core.index; +package org.eclipse.cdt.internal.qt.core.index; import java.util.Collection; -import org.eclipse.cdt.internal.qt.core.index.QtFactory; -import org.eclipse.cdt.qt.core.QtPlugin; +import org.eclipse.cdt.internal.qt.core.QtPlugin; import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.CoreException; diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QtIndexImpl.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QtIndexImpl.java index 605c7def83d..e64b75a2061 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QtIndexImpl.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QtIndexImpl.java @@ -18,13 +18,9 @@ import org.eclipse.cdt.core.index.IIndex; import org.eclipse.cdt.core.index.IIndexBinding; import org.eclipse.cdt.core.index.IndexFilter; import org.eclipse.cdt.internal.qt.core.ASTUtil; +import org.eclipse.cdt.internal.qt.core.QtKeywords; import org.eclipse.cdt.internal.qt.core.pdom.AbstractQtPDOMClass; import org.eclipse.cdt.internal.qt.core.pdom.QtPDOMQObject; -import org.eclipse.cdt.qt.core.QtKeywords; -import org.eclipse.cdt.qt.core.index.IQGadget; -import org.eclipse.cdt.qt.core.index.IQObject; -import org.eclipse.cdt.qt.core.index.IQmlRegistration; -import org.eclipse.cdt.qt.core.index.QtIndex; import org.eclipse.core.runtime.CoreException; public class QtIndexImpl extends QtIndex { diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/AbstractQtPDOMClass.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/AbstractQtPDOMClass.java index 474e8300fb7..bd521d8129b 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/AbstractQtPDOMClass.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/AbstractQtPDOMClass.java @@ -20,7 +20,7 @@ import org.eclipse.cdt.internal.core.pdom.dom.IPDOMBinding; import org.eclipse.cdt.internal.core.pdom.dom.PDOMBinding; import org.eclipse.cdt.internal.core.pdom.dom.PDOMLinkage; import org.eclipse.cdt.internal.core.pdom.dom.PDOMNode; -import org.eclipse.cdt.qt.core.QtPlugin; +import org.eclipse.cdt.internal.qt.core.QtPlugin; import org.eclipse.core.runtime.CoreException; /** diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/PDOMQtLinkageFactory.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/PDOMQtLinkageFactory.java index 79d3fad1836..fe87b9f43e2 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/PDOMQtLinkageFactory.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/PDOMQtLinkageFactory.java @@ -10,7 +10,7 @@ package org.eclipse.cdt.internal.qt.core.pdom; import org.eclipse.cdt.internal.core.pdom.PDOM; import org.eclipse.cdt.internal.core.pdom.dom.IPDOMLinkageFactory; import org.eclipse.cdt.internal.core.pdom.dom.PDOMLinkage; -import org.eclipse.cdt.qt.core.QtPlugin; +import org.eclipse.cdt.internal.qt.core.QtPlugin; import org.eclipse.core.runtime.CoreException; @SuppressWarnings("restriction") diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QMethodName.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QMethodName.java index b0da79542d2..9a4ec8d2c03 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QMethodName.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QMethodName.java @@ -8,7 +8,7 @@ package org.eclipse.cdt.internal.qt.core.pdom; import org.eclipse.cdt.core.dom.ast.IASTName; -import org.eclipse.cdt.qt.core.index.IQMethod; +import org.eclipse.cdt.internal.qt.core.index.IQMethod; import org.eclipse.core.runtime.CoreException; public class QMethodName extends AbstractQObjectMemberName implements IQtASTName { diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QmlTypeRegistration.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QmlTypeRegistration.java index a7cfd0f6471..e37dfde74c5 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QmlTypeRegistration.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QmlTypeRegistration.java @@ -18,8 +18,8 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPBinding; import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateArgument; import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateInstance; import org.eclipse.cdt.internal.qt.core.ASTUtil; -import org.eclipse.cdt.qt.core.QtKeywords; -import org.eclipse.cdt.qt.core.index.IQmlRegistration; +import org.eclipse.cdt.internal.qt.core.QtKeywords; +import org.eclipse.cdt.internal.qt.core.index.IQmlRegistration; import org.eclipse.core.runtime.CoreException; public class QmlTypeRegistration extends ASTDelegatedName implements IQtASTName { diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtASTClass.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtASTClass.java index 6fb7a19ae1f..10d224d9eb3 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtASTClass.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtASTClass.java @@ -21,8 +21,8 @@ import org.eclipse.cdt.core.dom.ast.IASTNodeLocation; import org.eclipse.cdt.core.dom.ast.IASTPreprocessorMacroExpansion; import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier; import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTVisibilityLabel; -import org.eclipse.cdt.qt.core.QtKeywords; -import org.eclipse.cdt.qt.core.index.IQMethod; +import org.eclipse.cdt.internal.qt.core.QtKeywords; +import org.eclipse.cdt.internal.qt.core.index.IQMethod; /** * The AST for a QObject is separated into regions based on macro expansions. These diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtASTVisitor.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtASTVisitor.java index a26e1612834..3dee7c6d51b 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtASTVisitor.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtASTVisitor.java @@ -41,12 +41,12 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPSemantics; import org.eclipse.cdt.internal.core.parser.scanner.LocationMap; import org.eclipse.cdt.internal.qt.core.ASTUtil; import org.eclipse.cdt.internal.qt.core.QtFunctionCall; +import org.eclipse.cdt.internal.qt.core.QtKeywords; import org.eclipse.cdt.internal.qt.core.QtMethodReference; import org.eclipse.cdt.internal.qt.core.QtMethodUtil; +import org.eclipse.cdt.internal.qt.core.index.IQMethod; +import org.eclipse.cdt.internal.qt.core.index.IQProperty; import org.eclipse.cdt.internal.qt.core.index.QProperty; -import org.eclipse.cdt.qt.core.QtKeywords; -import org.eclipse.cdt.qt.core.index.IQMethod; -import org.eclipse.cdt.qt.core.index.IQProperty; @SuppressWarnings("restriction") public class QtASTVisitor extends ASTVisitor { diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtPDOMLinkage.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtPDOMLinkage.java index 2c0020904e9..285e6a081b5 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtPDOMLinkage.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtPDOMLinkage.java @@ -31,7 +31,7 @@ import org.eclipse.cdt.internal.core.pdom.dom.PDOMLinkage; import org.eclipse.cdt.internal.core.pdom.dom.PDOMName; import org.eclipse.cdt.internal.core.pdom.dom.PDOMNode; import org.eclipse.cdt.internal.core.pdom.dom.cpp.PDOMCPPGlobalScope; -import org.eclipse.cdt.qt.core.QtPlugin; +import org.eclipse.cdt.internal.qt.core.QtPlugin; import org.eclipse.core.runtime.CoreException; @SuppressWarnings("restriction") diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtPDOMProperty.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtPDOMProperty.java index 91123a91301..8fc268c94c3 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtPDOMProperty.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtPDOMProperty.java @@ -10,8 +10,8 @@ package org.eclipse.cdt.internal.qt.core.pdom; import org.eclipse.cdt.internal.core.pdom.db.Database; import org.eclipse.cdt.internal.core.pdom.db.IString; import org.eclipse.cdt.internal.core.pdom.dom.PDOMBinding; -import org.eclipse.cdt.qt.core.QtPlugin; -import org.eclipse.cdt.qt.core.index.IQProperty; +import org.eclipse.cdt.internal.qt.core.QtPlugin; +import org.eclipse.cdt.internal.qt.core.index.IQProperty; import org.eclipse.core.runtime.CoreException; @SuppressWarnings("restriction") diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtPDOMQMethod.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtPDOMQMethod.java index 0cd317e5782..5449cc16aa3 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtPDOMQMethod.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtPDOMQMethod.java @@ -10,7 +10,7 @@ package org.eclipse.cdt.internal.qt.core.pdom; import org.eclipse.cdt.core.dom.ast.IASTName; import org.eclipse.cdt.internal.core.pdom.db.Database; import org.eclipse.cdt.internal.core.pdom.dom.PDOMBinding; -import org.eclipse.cdt.qt.core.index.IQMethod; +import org.eclipse.cdt.internal.qt.core.index.IQMethod; import org.eclipse.core.runtime.CoreException; @SuppressWarnings("restriction") diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtPropertyName.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtPropertyName.java index 12a4cfa4819..29a8565a0e5 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtPropertyName.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtPropertyName.java @@ -13,7 +13,7 @@ import java.util.List; import org.eclipse.cdt.core.dom.ast.IASTName; import org.eclipse.cdt.core.dom.ast.IBinding; import org.eclipse.cdt.internal.core.pdom.dom.PDOMBinding; -import org.eclipse.cdt.qt.core.index.IQProperty; +import org.eclipse.cdt.internal.qt.core.index.IQProperty; import org.eclipse.core.runtime.CoreException; @SuppressWarnings("restriction") diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/project/QtProjectGenerator.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/project/QtProjectGenerator.java new file mode 100644 index 00000000000..36f71b83a76 --- /dev/null +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/project/QtProjectGenerator.java @@ -0,0 +1,61 @@ +package org.eclipse.cdt.internal.qt.core.project; + +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.cdt.core.CCProjectNature; +import org.eclipse.cdt.core.CProjectNature; +import org.eclipse.cdt.internal.qt.core.QtNature; +import org.eclipse.cdt.internal.qt.core.QtTemplateGenerator; +import org.eclipse.cdt.internal.qt.core.build.QtBuilder; +import org.eclipse.core.resources.ICommand; +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IProjectDescription; +import org.eclipse.core.resources.IncrementalProjectBuilder; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IProgressMonitor; + +public class QtProjectGenerator { + + private final IProject project; + + public QtProjectGenerator(IProject project) { + this.project = project; + } + + public void generate(IProgressMonitor monitor) throws CoreException { + // Add natures to project: C, C++, Arduino + IProjectDescription projDesc = project.getDescription(); + String[] oldIds = projDesc.getNatureIds(); + String[] newIds = new String[oldIds.length + 3]; + System.arraycopy(oldIds, 0, newIds, 0, oldIds.length); + newIds[newIds.length - 3] = CProjectNature.C_NATURE_ID; + newIds[newIds.length - 2] = CCProjectNature.CC_NATURE_ID; + newIds[newIds.length - 1] = QtNature.ID; + projDesc.setNatureIds(newIds); + + // Add Arduino Builder + ICommand command = projDesc.newCommand(); + command.setBuilderName(QtBuilder.ID); + command.setBuilding(IncrementalProjectBuilder.AUTO_BUILD, false); + projDesc.setBuildSpec(new ICommand[] { command }); + + project.setDescription(projDesc, monitor); + + // Generate the project + QtTemplateGenerator templateGen = new QtTemplateGenerator(); + Map fmModel = new HashMap<>(); + fmModel.put("projectName", project.getName()); //$NON-NLS-1$ + + IFile sourceFile = project.getFile("main.cpp"); //$NON-NLS-1$ + templateGen.generateFile(fmModel, "project2/appProject/main.cpp", sourceFile, monitor); //$NON-NLS-1$ + sourceFile = project.getFile("main.qml"); //$NON-NLS-1$ + templateGen.generateFile(fmModel, "project2/appProject/main.qml", sourceFile, monitor); //$NON-NLS-1$ + sourceFile = project.getFile("main.qrc"); //$NON-NLS-1$ + templateGen.generateFile(fmModel, "project2/appProject/main.qrc", sourceFile, monitor); //$NON-NLS-1$ + sourceFile = project.getFile("main.pro"); //$NON-NLS-1$ + templateGen.generateFile(fmModel, "project2/appProject/main.pro", sourceFile, monitor); //$NON-NLS-1$ + } + +} diff --git a/qt/org.eclipse.cdt.qt.core/templates/project2/appProject/main.cpp b/qt/org.eclipse.cdt.qt.core/templates/project2/appProject/main.cpp new file mode 100644 index 00000000000..d76049d67eb --- /dev/null +++ b/qt/org.eclipse.cdt.qt.core/templates/project2/appProject/main.cpp @@ -0,0 +1,12 @@ +#include +#include + +int main(int argc, char *argv[]) +{ + QGuiApplication app(argc, argv); + + QQmlApplicationEngine engine; + engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); + + return app.exec(); +} diff --git a/qt/org.eclipse.cdt.qt.core/templates/project2/appProject/main.pro b/qt/org.eclipse.cdt.qt.core/templates/project2/appProject/main.pro new file mode 100644 index 00000000000..9ec8d9075ba --- /dev/null +++ b/qt/org.eclipse.cdt.qt.core/templates/project2/appProject/main.pro @@ -0,0 +1,8 @@ +TEMPLATE = app + +QT += qml quick +CONFIG += c++11 + +SOURCES += main.cpp + +RESOURCES += main.qrc diff --git a/qt/org.eclipse.cdt.qt.core/templates/project2/appProject/main.qml b/qt/org.eclipse.cdt.qt.core/templates/project2/appProject/main.qml new file mode 100644 index 00000000000..603cd9461d2 --- /dev/null +++ b/qt/org.eclipse.cdt.qt.core/templates/project2/appProject/main.qml @@ -0,0 +1,18 @@ +import QtQuick 2.3 +import QtQuick.Window 2.2 + +Window { + visible: true + + MouseArea { + anchors.fill: parent + onClicked: { + Qt.quit(); + } + } + + Text { + text: qsTr("Hello World") + anchors.centerIn: parent + } +} diff --git a/qt/org.eclipse.cdt.qt.core/templates/project2/appProject/main.qrc b/qt/org.eclipse.cdt.qt.core/templates/project2/appProject/main.qrc new file mode 100644 index 00000000000..5f6483ac33f --- /dev/null +++ b/qt/org.eclipse.cdt.qt.core/templates/project2/appProject/main.qrc @@ -0,0 +1,5 @@ + + + main.qml + + diff --git a/qt/org.eclipse.cdt.qt.tests/src/org/eclipse/cdt/qt/tests/BaseQtTestCase.java b/qt/org.eclipse.cdt.qt.tests/src/org/eclipse/cdt/qt/tests/BaseQtTestCase.java index 1eff2090694..9fad71d5a7c 100644 --- a/qt/org.eclipse.cdt.qt.tests/src/org/eclipse/cdt/qt/tests/BaseQtTestCase.java +++ b/qt/org.eclipse.cdt.qt.tests/src/org/eclipse/cdt/qt/tests/BaseQtTestCase.java @@ -16,7 +16,7 @@ import org.eclipse.cdt.core.model.ICProject; import org.eclipse.cdt.core.testplugin.CProjectHelper; import org.eclipse.cdt.core.testplugin.util.BaseTestCase; import org.eclipse.cdt.core.testplugin.util.TestSourceReader; -import org.eclipse.cdt.qt.core.QtNature; +import org.eclipse.cdt.internal.qt.core.QtNature; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IWorkspace; diff --git a/qt/org.eclipse.cdt.qt.tests/src/org/eclipse/cdt/qt/tests/QGadgetTests.java b/qt/org.eclipse.cdt.qt.tests/src/org/eclipse/cdt/qt/tests/QGadgetTests.java index 4bc698e43d4..14ef616a97e 100644 --- a/qt/org.eclipse.cdt.qt.tests/src/org/eclipse/cdt/qt/tests/QGadgetTests.java +++ b/qt/org.eclipse.cdt.qt.tests/src/org/eclipse/cdt/qt/tests/QGadgetTests.java @@ -9,9 +9,9 @@ package org.eclipse.cdt.qt.tests; import java.util.Collection; -import org.eclipse.cdt.qt.core.index.IQEnum; -import org.eclipse.cdt.qt.core.index.IQGadget; -import org.eclipse.cdt.qt.core.index.QtIndex; +import org.eclipse.cdt.internal.qt.core.index.IQEnum; +import org.eclipse.cdt.internal.qt.core.index.IQGadget; +import org.eclipse.cdt.internal.qt.core.index.QtIndex; public class QGadgetTests extends BaseQtTestCase { diff --git a/qt/org.eclipse.cdt.qt.tests/src/org/eclipse/cdt/qt/tests/QMakeTests.java b/qt/org.eclipse.cdt.qt.tests/src/org/eclipse/cdt/qt/tests/QMakeTests.java index 0a4ee50ac1b..90a644dfa0c 100644 --- a/qt/org.eclipse.cdt.qt.tests/src/org/eclipse/cdt/qt/tests/QMakeTests.java +++ b/qt/org.eclipse.cdt.qt.tests/src/org/eclipse/cdt/qt/tests/QMakeTests.java @@ -15,10 +15,10 @@ import java.util.Map; import junit.framework.TestCase; +import org.eclipse.cdt.internal.qt.core.index.IQMakeInfo; import org.eclipse.cdt.internal.qt.core.index.QMakeInfo; import org.eclipse.cdt.internal.qt.core.index.QMakeParser; import org.eclipse.cdt.internal.qt.core.index.QMakeVersion; -import org.eclipse.cdt.qt.core.index.IQMakeInfo; public class QMakeTests extends TestCase { diff --git a/qt/org.eclipse.cdt.qt.tests/src/org/eclipse/cdt/qt/tests/QObjectTests.java b/qt/org.eclipse.cdt.qt.tests/src/org/eclipse/cdt/qt/tests/QObjectTests.java index 7fd4e96ad4b..b6febcf072a 100644 --- a/qt/org.eclipse.cdt.qt.tests/src/org/eclipse/cdt/qt/tests/QObjectTests.java +++ b/qt/org.eclipse.cdt.qt.tests/src/org/eclipse/cdt/qt/tests/QObjectTests.java @@ -18,12 +18,12 @@ import java.util.Set; import org.eclipse.cdt.core.index.IIndexBinding; import org.eclipse.cdt.core.index.IIndexName; import org.eclipse.cdt.core.index.IndexFilter; -import org.eclipse.cdt.qt.core.index.IQEnum; -import org.eclipse.cdt.qt.core.index.IQMethod; -import org.eclipse.cdt.qt.core.index.IQObject; -import org.eclipse.cdt.qt.core.index.IQProperty; -import org.eclipse.cdt.qt.core.index.IQProperty.Attribute; -import org.eclipse.cdt.qt.core.index.QtIndex; +import org.eclipse.cdt.internal.qt.core.index.IQEnum; +import org.eclipse.cdt.internal.qt.core.index.IQMethod; +import org.eclipse.cdt.internal.qt.core.index.IQObject; +import org.eclipse.cdt.internal.qt.core.index.IQProperty; +import org.eclipse.cdt.internal.qt.core.index.QtIndex; +import org.eclipse.cdt.internal.qt.core.index.IQProperty.Attribute; public class QObjectTests extends BaseQtTestCase { diff --git a/qt/org.eclipse.cdt.qt.tests/src/org/eclipse/cdt/qt/tests/QmlRegistrationTests.java b/qt/org.eclipse.cdt.qt.tests/src/org/eclipse/cdt/qt/tests/QmlRegistrationTests.java index bd39de5511c..7a94180da4e 100644 --- a/qt/org.eclipse.cdt.qt.tests/src/org/eclipse/cdt/qt/tests/QmlRegistrationTests.java +++ b/qt/org.eclipse.cdt.qt.tests/src/org/eclipse/cdt/qt/tests/QmlRegistrationTests.java @@ -9,9 +9,9 @@ package org.eclipse.cdt.qt.tests; import java.util.Collection; -import org.eclipse.cdt.qt.core.index.IQObject; -import org.eclipse.cdt.qt.core.index.IQmlRegistration; -import org.eclipse.cdt.qt.core.index.QtIndex; +import org.eclipse.cdt.internal.qt.core.index.IQObject; +import org.eclipse.cdt.internal.qt.core.index.IQmlRegistration; +import org.eclipse.cdt.internal.qt.core.index.QtIndex; public class QmlRegistrationTests extends BaseQtTestCase { diff --git a/qt/org.eclipse.cdt.qt.tests/src/org/eclipse/cdt/qt/tests/QtIndexTests.java b/qt/org.eclipse.cdt.qt.tests/src/org/eclipse/cdt/qt/tests/QtIndexTests.java index 41a9576f63b..880f0bc7f99 100644 --- a/qt/org.eclipse.cdt.qt.tests/src/org/eclipse/cdt/qt/tests/QtIndexTests.java +++ b/qt/org.eclipse.cdt.qt.tests/src/org/eclipse/cdt/qt/tests/QtIndexTests.java @@ -7,8 +7,8 @@ */ package org.eclipse.cdt.qt.tests; -import org.eclipse.cdt.qt.core.index.IQObject; -import org.eclipse.cdt.qt.core.index.QtIndex; +import org.eclipse.cdt.internal.qt.core.index.IQObject; +import org.eclipse.cdt.internal.qt.core.index.QtIndex; public class QtIndexTests extends BaseQtTestCase { diff --git a/qt/org.eclipse.cdt.qt.tests/src/org/eclipse/cdt/qt/tests/QtRegressionTests.java b/qt/org.eclipse.cdt.qt.tests/src/org/eclipse/cdt/qt/tests/QtRegressionTests.java index cc8b2e619df..2f95a0cf49e 100644 --- a/qt/org.eclipse.cdt.qt.tests/src/org/eclipse/cdt/qt/tests/QtRegressionTests.java +++ b/qt/org.eclipse.cdt.qt.tests/src/org/eclipse/cdt/qt/tests/QtRegressionTests.java @@ -16,12 +16,12 @@ import java.util.Set; import org.eclipse.cdt.core.index.IIndex; import org.eclipse.cdt.internal.core.model.ext.SourceRange; +import org.eclipse.cdt.internal.qt.core.index.IQMethod; +import org.eclipse.cdt.internal.qt.core.index.IQObject; +import org.eclipse.cdt.internal.qt.core.index.QtIndex; import org.eclipse.cdt.internal.ui.editor.CEditor; import org.eclipse.cdt.internal.ui.search.CSearchResult; import org.eclipse.cdt.internal.ui.search.CSearchTextSelectionQuery; -import org.eclipse.cdt.qt.core.index.IQMethod; -import org.eclipse.cdt.qt.core.index.IQObject; -import org.eclipse.cdt.qt.core.index.QtIndex; import org.eclipse.cdt.ui.CUIPlugin; import org.eclipse.core.resources.IFile; import org.eclipse.core.runtime.IStatus; diff --git a/qt/org.eclipse.cdt.qt.ui/META-INF/MANIFEST.MF b/qt/org.eclipse.cdt.qt.ui/META-INF/MANIFEST.MF index 5cd245b6a0c..f2a8ef978f0 100644 --- a/qt/org.eclipse.cdt.qt.ui/META-INF/MANIFEST.MF +++ b/qt/org.eclipse.cdt.qt.ui/META-INF/MANIFEST.MF @@ -2,20 +2,22 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.cdt.qt.ui;singleton:=true -Bundle-Version: 1.1.0.qualifier -Bundle-Activator: org.eclipse.cdt.qt.ui.QtUIPlugin +Bundle-Version: 2.0.0.qualifier +Bundle-Activator: org.eclipse.cdt.internal.qt.ui.QtUIPlugin Bundle-Vendor: %providerName Bundle-Localization: plugin -Require-Bundle: org.eclipse.ui, - org.eclipse.core.runtime, +Require-Bundle: org.eclipse.core.runtime, + org.eclipse.core.resources, + org.eclipse.ui, + org.eclipse.ui.ide, + org.eclipse.ui.console;bundle-version="3.6.0", + org.eclipse.ui.editors, + org.eclipse.ui.workbench.texteditor, + org.eclipse.jface.text, org.eclipse.cdt.ui, org.eclipse.cdt.core, - org.eclipse.cdt.qt.core;bundle-version="[1.1.0,2.0.0)", - org.eclipse.jface.text, - org.eclipse.core.resources, - org.eclipse.ui.workbench.texteditor, - org.eclipse.ui.editors + org.eclipse.cdt.qt.core Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Bundle-ActivationPolicy: lazy -Export-Package: org.eclipse.cdt.internal.qt.ui.assist;x-friends:="org.eclipse.cdt.qt.tests", - org.eclipse.cdt.qt.ui +Export-Package: org.eclipse.cdt.internal.qt.ui.assist;x-friends:="org.eclipse.cdt.qt.tests" +Service-Component: OSGI-INF/consoleservice.xml diff --git a/qt/org.eclipse.cdt.qt.ui/OSGI-INF/consoleservice.xml b/qt/org.eclipse.cdt.qt.ui/OSGI-INF/consoleservice.xml new file mode 100644 index 00000000000..06dbdbbc437 --- /dev/null +++ b/qt/org.eclipse.cdt.qt.ui/OSGI-INF/consoleservice.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/qt/org.eclipse.cdt.qt.ui/icons/newcc_app.gif b/qt/org.eclipse.cdt.qt.ui/icons/newcc_app.gif new file mode 100644 index 00000000000..4b39411daf5 Binary files /dev/null and b/qt/org.eclipse.cdt.qt.ui/icons/newcc_app.gif differ diff --git a/qt/org.eclipse.cdt.qt.ui/plugin.properties b/qt/org.eclipse.cdt.qt.ui/plugin.properties index 5784ad40ca8..f27ceb8ace4 100644 --- a/qt/org.eclipse.cdt.qt.ui/plugin.properties +++ b/qt/org.eclipse.cdt.qt.ui/plugin.properties @@ -8,4 +8,6 @@ pluginName=C/C++ Qt Support UI providerName=Eclipse CDT qtHighlighting.extName=Qt Semantic Highlighting -qtHighlighting.displayName=Qt Keywords \ No newline at end of file +qtHighlighting.displayName=Qt Keywords + +newProject.name=Qt Project diff --git a/qt/org.eclipse.cdt.qt.ui/plugin.xml b/qt/org.eclipse.cdt.qt.ui/plugin.xml index 69dc0e2226c..8e9f4f0402c 100644 --- a/qt/org.eclipse.cdt.qt.ui/plugin.xml +++ b/qt/org.eclipse.cdt.qt.ui/plugin.xml @@ -35,4 +35,16 @@ + + + + diff --git a/qt/org.eclipse.cdt.qt.ui/pom.xml b/qt/org.eclipse.cdt.qt.ui/pom.xml index 0ced75cfb83..651ae337474 100644 --- a/qt/org.eclipse.cdt.qt.ui/pom.xml +++ b/qt/org.eclipse.cdt.qt.ui/pom.xml @@ -11,7 +11,7 @@ ../../pom.xml - 1.1.0-SNAPSHOT + 2.0.0-SNAPSHOT org.eclipse.cdt.qt.ui eclipse-plugin diff --git a/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/NewQtProjectWizard.java b/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/NewQtProjectWizard.java new file mode 100644 index 00000000000..414be826efe --- /dev/null +++ b/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/NewQtProjectWizard.java @@ -0,0 +1,35 @@ +package org.eclipse.cdt.internal.qt.ui; + +import org.eclipse.cdt.internal.qt.core.project.QtProjectGenerator; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.ui.wizards.newresource.BasicNewProjectResourceWizard; + +public class NewQtProjectWizard extends BasicNewProjectResourceWizard { + + @Override + public boolean performFinish() { + if (!super.performFinish()) { + return false; + } + + new Job("Creating Qt Project") { + @Override + protected IStatus run(IProgressMonitor monitor) { + try { + QtProjectGenerator generator = new QtProjectGenerator(getNewProject()); + generator.generate(monitor); + } catch (CoreException e) { + return e.getStatus(); + } + return Status.OK_STATUS; + } + }.schedule(); + + return true; + } + +} diff --git a/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/QObjectConnectCompletion.java b/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/QObjectConnectCompletion.java index bbd7219d44a..92eb7ee3fc3 100644 --- a/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/QObjectConnectCompletion.java +++ b/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/QObjectConnectCompletion.java @@ -26,13 +26,12 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFieldReference; import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType; import org.eclipse.cdt.internal.qt.core.ASTUtil; import org.eclipse.cdt.internal.qt.core.QtFunctionCallUtil; +import org.eclipse.cdt.internal.qt.core.QtKeywords; +import org.eclipse.cdt.internal.qt.core.index.IQMethod; +import org.eclipse.cdt.internal.qt.core.index.IQObject; +import org.eclipse.cdt.internal.qt.core.index.QtIndex; import org.eclipse.cdt.internal.ui.text.contentassist.CCompletionProposal; import org.eclipse.cdt.internal.ui.text.contentassist.RelevanceConstants; -import org.eclipse.cdt.qt.core.QtKeywords; -import org.eclipse.cdt.qt.core.index.IQMethod; -import org.eclipse.cdt.qt.core.index.IQObject; -import org.eclipse.cdt.qt.core.index.QtIndex; -import org.eclipse.cdt.qt.ui.QtUIPlugin; import org.eclipse.cdt.ui.text.contentassist.ICEditorContentAssistInvocationContext; import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.text.contentassist.ICompletionProposal; diff --git a/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/QObjectDeclarationCompletion.java b/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/QObjectDeclarationCompletion.java index 3fc354352b1..cefeab48fb0 100644 --- a/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/QObjectDeclarationCompletion.java +++ b/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/QObjectDeclarationCompletion.java @@ -15,7 +15,6 @@ import org.eclipse.cdt.internal.corext.template.c.CContextType; import org.eclipse.cdt.internal.corext.template.c.TranslationUnitContext; import org.eclipse.cdt.internal.corext.template.c.TranslationUnitContextType; import org.eclipse.cdt.internal.ui.text.template.TemplateEngine.CTemplateProposal; -import org.eclipse.cdt.qt.ui.QtUIPlugin; import org.eclipse.cdt.ui.text.contentassist.ICEditorContentAssistInvocationContext; import org.eclipse.jface.text.IRegion; import org.eclipse.jface.text.ITextSelection; diff --git a/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/QPropertyCompletion.java b/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/QPropertyCompletion.java index 31e1734b52e..37c7219d68d 100644 --- a/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/QPropertyCompletion.java +++ b/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/QPropertyCompletion.java @@ -14,11 +14,10 @@ import org.eclipse.cdt.core.dom.ast.IASTCompletionContext; import org.eclipse.cdt.core.dom.ast.IASTName; import org.eclipse.cdt.core.dom.ast.IASTNode; import org.eclipse.cdt.internal.corext.template.c.CContextType; +import org.eclipse.cdt.internal.qt.core.QtKeywords; import org.eclipse.cdt.internal.qt.ui.assist.QPropertyExpansion; import org.eclipse.cdt.internal.qt.ui.assist.QtProposalContext; import org.eclipse.cdt.internal.qt.ui.assist.QtTemplateProposal; -import org.eclipse.cdt.qt.core.QtKeywords; -import org.eclipse.cdt.qt.ui.QtUIPlugin; import org.eclipse.cdt.ui.text.contentassist.ICEditorContentAssistInvocationContext; import org.eclipse.jface.text.Region; import org.eclipse.jface.text.contentassist.ICompletionProposal; diff --git a/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/QtCompletionProposalComputer.java b/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/QtCompletionProposalComputer.java index baa0e1808c4..d3f00bf826f 100644 --- a/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/QtCompletionProposalComputer.java +++ b/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/QtCompletionProposalComputer.java @@ -18,10 +18,9 @@ import org.eclipse.cdt.core.dom.ast.IASTName; import org.eclipse.cdt.core.dom.ast.IASTNode; import org.eclipse.cdt.core.model.ICProject; import org.eclipse.cdt.core.model.ITranslationUnit; +import org.eclipse.cdt.internal.qt.core.QtNature; import org.eclipse.cdt.internal.ui.text.contentassist.CContentAssistInvocationContext; import org.eclipse.cdt.internal.ui.text.contentassist.ParsingBasedProposalComputer; -import org.eclipse.cdt.qt.core.QtNature; -import org.eclipse.cdt.qt.ui.QtUIPlugin; import org.eclipse.cdt.ui.text.contentassist.ContentAssistInvocationContext; import org.eclipse.cdt.ui.text.contentassist.ICEditorContentAssistInvocationContext; import org.eclipse.core.resources.IProject; diff --git a/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/QtConsoleService.java b/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/QtConsoleService.java new file mode 100644 index 00000000000..0a5756cccbc --- /dev/null +++ b/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/QtConsoleService.java @@ -0,0 +1,125 @@ +package org.eclipse.cdt.internal.qt.ui; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.concurrent.CountDownLatch; + +import org.eclipse.cdt.internal.qt.core.QtPlugin; +import org.eclipse.cdt.internal.qt.core.build.IConsoleService; +import org.eclipse.core.resources.IResourceChangeEvent; +import org.eclipse.core.resources.IResourceChangeListener; +import org.eclipse.core.resources.IncrementalProjectBuilder; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.swt.SWT; +import org.eclipse.swt.widgets.Display; +import org.eclipse.ui.console.ConsolePlugin; +import org.eclipse.ui.console.IConsole; +import org.eclipse.ui.console.MessageConsole; +import org.eclipse.ui.console.MessageConsoleStream; + +public class QtConsoleService implements IConsoleService, IResourceChangeListener { + + private MessageConsole console; + private MessageConsoleStream out; + private MessageConsoleStream err; + + private void initConsole() { + console = new MessageConsole("Qt Builds", null); + ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[] { console }); + out = console.newMessageStream(); + err = console.newMessageStream(); + + // set the colors + final Display display = Display.getDefault(); + display.syncExec(new Runnable() { + @Override + public void run() { + // TODO use preferences so user can change the colors + out.setColor(display.getSystemColor(SWT.COLOR_BLACK)); + err.setColor(display.getSystemColor(SWT.COLOR_RED)); + } + }); + ResourcesPlugin.getWorkspace().addResourceChangeListener(this, IResourceChangeEvent.PRE_BUILD); + } + + @Override + public void resourceChanged(IResourceChangeEvent event) { + switch (event.getType()) { + case IResourceChangeEvent.PRE_BUILD: + if (event.getBuildKind() != IncrementalProjectBuilder.AUTO_BUILD) { + // TODO this really should be done from the core and only when + // our projects are being built + console.clearConsole(); + } + break; + } + } + + @Override + public void monitor(final Process process) throws IOException { + if (console == null) { + initConsole(); + } + + console.activate(); + + final CountDownLatch latch = new CountDownLatch(2); + + // Output stream reader + new Thread("Qt Build Console Output") { + public void run() { + try (BufferedReader processOut = new BufferedReader(new InputStreamReader(process.getInputStream()))) { + for (String line = processOut.readLine(); line != null; line = processOut.readLine()) { + out.write(line); + out.write('\n'); + } + } catch (IOException e) { + e.printStackTrace(); + } finally { + latch.countDown(); + } + } + }.start(); + + // Error stream reader + new Thread("Qt Build Console Error") { + public void run() { + try (BufferedReader processErr = new BufferedReader(new InputStreamReader(process.getErrorStream()))) { + for (String line = processErr.readLine(); line != null; line = processErr.readLine()) { + err.write(line); + out.write('\n'); + } + } catch (IOException e) { + e.printStackTrace(); + } finally { + latch.countDown(); + } + } + }.start(); + + try { + latch.await(); + process.waitFor(); + } catch (InterruptedException e) { + QtPlugin.log(e); + } + } + + @Override + public void writeOutput(String msg) throws IOException { + if (out == null) { + initConsole(); + } + out.write(msg); + } + + @Override + public void writeError(String msg) throws IOException { + if (err == null) { + initConsole(); + } + err.write(msg); + } + +} diff --git a/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/QtHighlighting.java b/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/QtHighlighting.java index 3e53db1afc0..6d8e07ea33b 100644 --- a/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/QtHighlighting.java +++ b/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/QtHighlighting.java @@ -12,7 +12,7 @@ import org.eclipse.cdt.core.dom.ast.IASTName; import org.eclipse.cdt.core.dom.ast.IASTNode; import org.eclipse.cdt.core.dom.ast.IBinding; import org.eclipse.cdt.core.dom.ast.IMacroBinding; -import org.eclipse.cdt.qt.core.QtKeywords; +import org.eclipse.cdt.internal.qt.core.QtKeywords; import org.eclipse.cdt.ui.text.ISemanticHighlighter; import org.eclipse.cdt.ui.text.ISemanticToken; diff --git a/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/qt/ui/QtUIPlugin.java b/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/QtUIPlugin.java similarity index 80% rename from qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/qt/ui/QtUIPlugin.java rename to qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/QtUIPlugin.java index a88b877f2e9..62edffb37a8 100644 --- a/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/qt/ui/QtUIPlugin.java +++ b/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/QtUIPlugin.java @@ -5,7 +5,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.cdt.qt.ui; +package org.eclipse.cdt.internal.qt.ui; import org.eclipse.cdt.core.model.CModelException; import org.eclipse.core.runtime.CoreException; @@ -40,20 +40,15 @@ public class QtUIPlugin extends AbstractUIPlugin { return null; } - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ @Override public void start(BundleContext context) throws Exception { super.start(context); plugin = this; + + // context.registerService(IConsoleService.class, new + // QtConsoleService(), null); } - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ @Override public void stop(BundleContext context) throws Exception { plugin = null; @@ -69,9 +64,9 @@ public class QtUIPlugin extends AbstractUIPlugin { return plugin; } - public static CoreException coreException(String msg) { - return new CoreException(new Status(IStatus.INFO, PLUGIN_ID, msg)); - } + public static CoreException coreException(String msg) { + return new CoreException(new Status(IStatus.INFO, PLUGIN_ID, msg)); + } public static IStatus info(String msg) { return new Status(IStatus.INFO, PLUGIN_ID, msg); @@ -90,7 +85,7 @@ public class QtUIPlugin extends AbstractUIPlugin { } public static void log(Throwable e) { - String msg= e.getMessage(); + String msg = e.getMessage(); if (msg == null) { log("Error", e); //$NON-NLS-1$ } else { @@ -100,8 +95,7 @@ public class QtUIPlugin extends AbstractUIPlugin { public static void log(String message, Throwable e) { Throwable nestedException; - if (e instanceof CModelException - && (nestedException = ((CModelException)e).getException()) != null) { + if (e instanceof CModelException && (nestedException = ((CModelException) e).getException()) != null) { e = nestedException; } log(IStatus.ERROR, message, e); diff --git a/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/assist/QPropertyAttributeProposal.java b/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/assist/QPropertyAttributeProposal.java index 8b7ed4a7b6c..f2002829d2d 100644 --- a/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/assist/QPropertyAttributeProposal.java +++ b/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/assist/QPropertyAttributeProposal.java @@ -35,12 +35,12 @@ import org.eclipse.cdt.core.index.IIndex; import org.eclipse.cdt.core.model.ICProject; import org.eclipse.cdt.core.model.ITranslationUnit; import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPParameter; +import org.eclipse.cdt.internal.qt.core.index.IQMethod; +import org.eclipse.cdt.internal.qt.core.index.IQObject; +import org.eclipse.cdt.internal.qt.core.index.IQProperty; +import org.eclipse.cdt.internal.qt.core.index.QtIndex; +import org.eclipse.cdt.internal.qt.ui.QtUIPlugin; import org.eclipse.cdt.internal.ui.text.contentassist.CCompletionProposal; -import org.eclipse.cdt.qt.core.index.IQMethod; -import org.eclipse.cdt.qt.core.index.IQObject; -import org.eclipse.cdt.qt.core.index.IQProperty; -import org.eclipse.cdt.qt.core.index.QtIndex; -import org.eclipse.cdt.qt.ui.QtUIPlugin; import org.eclipse.cdt.ui.text.contentassist.ICEditorContentAssistInvocationContext; import org.eclipse.core.runtime.CoreException; import org.eclipse.jface.text.contentassist.ICompletionProposal; diff --git a/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/assist/QPropertyExpansion.java b/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/assist/QPropertyExpansion.java index 20ce678358f..dd739169999 100644 --- a/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/assist/QPropertyExpansion.java +++ b/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/assist/QPropertyExpansion.java @@ -19,13 +19,13 @@ import org.eclipse.cdt.core.dom.ast.IType; import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTypeId; import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor; import org.eclipse.cdt.internal.corext.template.c.CContextType; +import org.eclipse.cdt.internal.qt.core.QtKeywords; +import org.eclipse.cdt.internal.qt.core.index.IQProperty; import org.eclipse.cdt.internal.qt.core.parser.QtParser; +import org.eclipse.cdt.internal.qt.ui.QtUIPlugin; import org.eclipse.cdt.internal.ui.text.CHeuristicScanner; import org.eclipse.cdt.internal.ui.text.Symbols; import org.eclipse.cdt.internal.ui.text.contentassist.CCompletionProposal; -import org.eclipse.cdt.qt.core.QtKeywords; -import org.eclipse.cdt.qt.core.index.IQProperty; -import org.eclipse.cdt.qt.ui.QtUIPlugin; import org.eclipse.cdt.ui.text.contentassist.ICEditorContentAssistInvocationContext; import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.text.IDocument; diff --git a/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/assist/QtTemplateProposal.java b/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/assist/QtTemplateProposal.java index 4c7fd6cd96f..a3019f41365 100644 --- a/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/assist/QtTemplateProposal.java +++ b/qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/assist/QtTemplateProposal.java @@ -7,7 +7,7 @@ */ package org.eclipse.cdt.internal.qt.ui.assist; -import org.eclipse.cdt.qt.ui.QtUIPlugin; +import org.eclipse.cdt.internal.qt.ui.QtUIPlugin; import org.eclipse.cdt.ui.text.ICCompletionProposal; import org.eclipse.jface.text.IRegion; import org.eclipse.jface.text.templates.Template;