mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Fixed API tooling errors.
This commit is contained in:
parent
2559c118ec
commit
cec50f2b6e
34 changed files with 632 additions and 516 deletions
|
@ -40,6 +40,8 @@ import org.eclipse.core.runtime.jobs.Job;
|
|||
*
|
||||
* Note: IErrorParser interface is used here to work around {@link ConsoleOutputSniffer} having
|
||||
* no access from CDT core to build packages. TODO - elaborate?
|
||||
*
|
||||
* @since 7.2
|
||||
*/
|
||||
public abstract class AbstractBuildCommandParser extends AbstractLanguageSettingsOutputScanner
|
||||
implements ICConsoleParser, IErrorParser {
|
||||
|
|
|
@ -67,6 +67,9 @@ import org.eclipse.core.runtime.jobs.ISchedulingRule;
|
|||
import org.eclipse.core.runtime.jobs.Job;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
/**
|
||||
* @since 7.2
|
||||
*/
|
||||
public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSettingsOutputScanner implements ICListenerAgent {
|
||||
public static final Object JOB_FAMILY_BUILTIN_SPECS_DETECTOR = "org.eclipse.cdt.make.core.scannerconfig.AbstractBuiltinSpecsDetector";
|
||||
|
||||
|
|
|
@ -54,6 +54,9 @@ import org.eclipse.core.runtime.content.IContentType;
|
|||
import org.eclipse.core.runtime.content.IContentTypeManager;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
/**
|
||||
* @since 7.2
|
||||
*/
|
||||
public abstract class AbstractLanguageSettingsOutputScanner extends LanguageSettingsSerializableProvider {
|
||||
|
||||
protected static final String ATTR_EXPAND_RELATIVE_PATHS = "expand-relative-paths"; //$NON-NLS-1$
|
||||
|
|
|
@ -24,14 +24,14 @@ import org.eclipse.core.runtime.IPath;
|
|||
|
||||
/**
|
||||
* A tool-integrator defines default configurations as children of the project type.
|
||||
* These provide a template for the configurations added to the user's project,
|
||||
* which are stored in the project's .cproject file.
|
||||
* These provide a template for the configurations added to the user's project,
|
||||
* which are stored in the project's .cproject file.
|
||||
* <p>
|
||||
* The configuration contains one child of type tool-chain. This describes how the
|
||||
* The configuration contains one child of type tool-chain. This describes how the
|
||||
* project's resources are transformed into the build artifact. The configuration can
|
||||
* contain one or more children of type resourceConfiguration. These describe build
|
||||
* settings of individual resources that are different from the configuration as a whole.
|
||||
*
|
||||
*
|
||||
* @since 2.1
|
||||
* @noextend This class is not intended to be subclassed by clients.
|
||||
* @noimplement This interface is not intended to be implemented by clients.
|
||||
|
@ -39,34 +39,35 @@ import org.eclipse.core.runtime.IPath;
|
|||
public interface IConfiguration extends IBuildObject, IBuildObjectPropertiesContainer {
|
||||
public static final String ARTIFACT_NAME = "artifactName"; //$NON-NLS-1$
|
||||
public static final String CLEAN_COMMAND = "cleanCommand"; //$NON-NLS-1$
|
||||
public static final String PREBUILD_STEP = "prebuildStep"; //$NON-NLS-1$
|
||||
public static final String POSTBUILD_STEP = "postbuildStep"; //$NON-NLS-1$
|
||||
public static final String PREANNOUNCEBUILD_STEP = "preannouncebuildStep"; //$NON-NLS-1$
|
||||
public static final String POSTANNOUNCEBUILD_STEP = "postannouncebuildStep"; //$NON-NLS-1$
|
||||
public static final String PREBUILD_STEP = "prebuildStep"; //$NON-NLS-1$
|
||||
public static final String POSTBUILD_STEP = "postbuildStep"; //$NON-NLS-1$
|
||||
public static final String PREANNOUNCEBUILD_STEP = "preannouncebuildStep"; //$NON-NLS-1$
|
||||
public static final String POSTANNOUNCEBUILD_STEP = "postannouncebuildStep"; //$NON-NLS-1$
|
||||
// Schema element names
|
||||
public static final String CONFIGURATION_ELEMENT_NAME = "configuration"; //$NON-NLS-1$
|
||||
public static final String ERROR_PARSERS = "errorParsers"; //$NON-NLS-1$
|
||||
/** @since 8.1 */
|
||||
public static final String LANGUAGE_SETTINGS_PROVIDERS = "languageSettingsProviders";
|
||||
public static final String EXTENSION = "artifactExtension"; //$NON-NLS-1$
|
||||
public static final String PARENT = "parent"; //$NON-NLS-1$
|
||||
|
||||
|
||||
public static final String DESCRIPTION = "description"; //$NON-NLS-1$
|
||||
|
||||
|
||||
public static final String BUILD_PROPERTIES = "buildProperties"; //$NON-NLS-1$
|
||||
public static final String BUILD_ARTEFACT_TYPE = "buildArtefactType"; //$NON-NLS-1$
|
||||
public static final String IS_SYSTEM = "isSystem"; //$NON-NLS-1$
|
||||
|
||||
public static final String SOURCE_ENTRIES = "sourceEntries"; //$NON-NLS-1$
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Returns the description of the configuration.
|
||||
*
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public String getDescription();
|
||||
|
||||
|
||||
/**
|
||||
* Sets the description of the receiver to the value specified in the argument
|
||||
*/
|
||||
|
@ -85,206 +86,207 @@ public interface IConfiguration extends IBuildObject, IBuildObjectPropertiesCont
|
|||
* @param name - The name for the new tool chain
|
||||
* @param isExtensionElement - set {@code true} if the toolchain being created
|
||||
* represents extension point toolchain
|
||||
*
|
||||
*
|
||||
* @return IToolChain
|
||||
*/
|
||||
public IToolChain createToolChain(IToolChain superClass, String Id, String name, boolean isExtensionElement);
|
||||
|
||||
|
||||
/**
|
||||
* Returns the extension that should be applied to build artifacts created by
|
||||
* Returns the extension that should be applied to build artifacts created by
|
||||
* this configuration.
|
||||
*
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public String getArtifactExtension();
|
||||
public String getArtifactExtension();
|
||||
|
||||
/**
|
||||
* Returns the name of the final build artifact.
|
||||
*
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public String getArtifactName();
|
||||
|
||||
/**
|
||||
* Returns the build arguments from this configuration's builder
|
||||
*
|
||||
* Returns the build arguments from this configuration's builder
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public String getBuildArguments();
|
||||
|
||||
/**
|
||||
* Returns the build command from this configuration's builder
|
||||
*
|
||||
* Returns the build command from this configuration's builder
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public String getBuildCommand();
|
||||
|
||||
|
||||
/**
|
||||
* Returns the prebuild step command
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public String getPrebuildStep();
|
||||
|
||||
/**
|
||||
* Returns the postbuild step command
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public String getPostbuildStep();
|
||||
|
||||
/**
|
||||
* Returns the display string associated with the prebuild step
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public String getPreannouncebuildStep();
|
||||
|
||||
/**
|
||||
* Returns the display string associated with the postbuild step
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public String getPostannouncebuildStep();
|
||||
|
||||
/**
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public String getPrebuildStep();
|
||||
|
||||
/**
|
||||
* Returns the postbuild step command
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public String getPostbuildStep();
|
||||
|
||||
/**
|
||||
* Returns the display string associated with the prebuild step
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public String getPreannouncebuildStep();
|
||||
|
||||
/**
|
||||
* Returns the display string associated with the postbuild step
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public String getPostannouncebuildStep();
|
||||
|
||||
/**
|
||||
* Answers the OS-specific command to remove files created by the build
|
||||
* of this configuration.
|
||||
*
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public String getCleanCommand();
|
||||
|
||||
/**
|
||||
* Answers the semicolon separated list of unique IDs of the error parsers associated
|
||||
* Answers the semicolon separated list of unique IDs of the error parsers associated
|
||||
* with this configuration.
|
||||
*
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public String getErrorParserIds();
|
||||
|
||||
/**
|
||||
* Answers the ordered list of unique IDs of the error parsers associated
|
||||
* Answers the ordered list of unique IDs of the error parsers associated
|
||||
* with this configuration.
|
||||
*
|
||||
*
|
||||
* @return String[]
|
||||
*/
|
||||
public String[] getErrorParserList();
|
||||
|
||||
|
||||
/** @since 8.1 */
|
||||
public String getDefaultLanguageSettingsProvidersIds();
|
||||
|
||||
/**
|
||||
* Projects have C or CC natures. Tools can specify a filter so they are not
|
||||
* misapplied to a project. This method allows the caller to retrieve a list
|
||||
* of tools from a project that are correct for a project's nature.
|
||||
*
|
||||
* @return an array of <code>ITools</code> that have compatible filters
|
||||
* Projects have C or CC natures. Tools can specify a filter so they are not
|
||||
* misapplied to a project. This method allows the caller to retrieve a list
|
||||
* of tools from a project that are correct for a project's nature.
|
||||
*
|
||||
* @return an array of <code>ITools</code> that have compatible filters
|
||||
* for this configuration.
|
||||
*/
|
||||
ITool[] getFilteredTools();
|
||||
|
||||
|
||||
/**
|
||||
* Returns the managed-project parent of this configuration, if this is a
|
||||
* project configuration. Otherwise, returns <code>null</code>.
|
||||
*
|
||||
*
|
||||
* @return IManagedProject
|
||||
*/
|
||||
public IManagedProject getManagedProject();
|
||||
|
||||
|
||||
/**
|
||||
* Returns the Eclipse project that owns the configuration.
|
||||
*
|
||||
*
|
||||
* @return IResource
|
||||
*/
|
||||
public IResource getOwner();
|
||||
|
||||
|
||||
/**
|
||||
* Returns the configuration that this configuration is based on.
|
||||
*
|
||||
* Returns the configuration that this configuration is based on.
|
||||
*
|
||||
* @return IConfiguration
|
||||
*/
|
||||
public IConfiguration getParent();
|
||||
|
||||
|
||||
/**
|
||||
* Returns the project-type parent of this configuration, if this is an
|
||||
* extension configuration. Otherwise, returns <code>null</code>.
|
||||
*
|
||||
*
|
||||
* @return IProjectType
|
||||
*/
|
||||
public IProjectType getProjectType();
|
||||
|
||||
|
||||
/**
|
||||
* @param path - path of the resource
|
||||
*
|
||||
*
|
||||
* @return the resource configuration child of this configuration
|
||||
* that is associated with the project resource, or <code>null</code> if none.
|
||||
*/
|
||||
public IResourceConfiguration getResourceConfiguration(String path);
|
||||
|
||||
|
||||
/**
|
||||
* Returns the resource configuration children of this configuration.
|
||||
*
|
||||
*
|
||||
* @return IResourceConfigurations[]
|
||||
*/
|
||||
public IResourceConfiguration[] getResourceConfigurations();
|
||||
|
||||
|
||||
/**
|
||||
* Returns the <code>ITool</code> in this configuration's tool-chain with
|
||||
* the same id as the argument, or <code>null</code>.
|
||||
*
|
||||
* the same id as the argument, or <code>null</code>.
|
||||
*
|
||||
* @param id unique identifier to search for
|
||||
* @return ITool
|
||||
*/
|
||||
public ITool getTool(String id);
|
||||
|
||||
/**
|
||||
* Returns the <code>ITool</code> in this configuration's tool-chain with
|
||||
* the specified ID, or the tool(s) with a superclass with this id.
|
||||
*
|
||||
* <p>If the tool-chain does not have a tool with that ID, the method
|
||||
* returns an empty array. It is the responsibility of the caller to
|
||||
* verify the return value.
|
||||
*
|
||||
* Returns the <code>ITool</code> in this configuration's tool-chain with
|
||||
* the specified ID, or the tool(s) with a superclass with this id.
|
||||
*
|
||||
* <p>If the tool-chain does not have a tool with that ID, the method
|
||||
* returns an empty array. It is the responsibility of the caller to
|
||||
* verify the return value.
|
||||
*
|
||||
* @param id unique identifier of the tool to search for
|
||||
* @return <code>ITool[]</code>
|
||||
* @since 3.0.2
|
||||
*/
|
||||
public ITool[] getToolsBySuperClassId(String id);
|
||||
|
||||
|
||||
/**
|
||||
* Returns the <code>IToolChain</code> child of this configuration.
|
||||
*
|
||||
*
|
||||
* @return IToolChain
|
||||
*/
|
||||
public IToolChain getToolChain();
|
||||
|
||||
|
||||
/**
|
||||
* Returns the command-line invocation command for the specified tool.
|
||||
*
|
||||
*
|
||||
* @param tool The tool that will have its command retrieved.
|
||||
* @return String The command
|
||||
*/
|
||||
public String getToolCommand(ITool tool);
|
||||
|
||||
|
||||
/**
|
||||
* Returns the tools that are used in this configuration's tool-chain.
|
||||
*
|
||||
*
|
||||
* @return ITool[]
|
||||
*/
|
||||
public ITool[] getTools();
|
||||
|
||||
/**
|
||||
* Returns the tool in this configuration specified with
|
||||
* Returns the tool in this configuration specified with
|
||||
* the toolChain#targetTool attribute that creates the build artifact
|
||||
*
|
||||
* NOTE: This method returns null in case the toolChain definition
|
||||
*
|
||||
* NOTE: This method returns null in case the toolChain definition
|
||||
* does not have the targetTool attribute or if the attribute does not
|
||||
* refer to the appropriate tool.
|
||||
* For the target tool calculation the IConfiguration#calculateTargetTool()
|
||||
* method should be used
|
||||
*
|
||||
*
|
||||
* @see IConfiguration#calculateTargetTool()
|
||||
*
|
||||
*
|
||||
* @return ITool
|
||||
*/
|
||||
public ITool getTargetTool();
|
||||
|
@ -292,42 +294,42 @@ public interface IConfiguration extends IBuildObject, IBuildObjectPropertiesCont
|
|||
/**
|
||||
* Returns <code>true</code> if this configuration has overridden the default build
|
||||
* build command in this configuration, otherwise <code>false</code>.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean hasOverriddenBuildCommand();
|
||||
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if the extension matches one of the special
|
||||
* file extensions the tools for the configuration consider to be a header file.
|
||||
*
|
||||
* Returns <code>true</code> if the extension matches one of the special
|
||||
* file extensions the tools for the configuration consider to be a header file.
|
||||
*
|
||||
* @param ext the file extension of the resource
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean isHeaderFile(String ext);
|
||||
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if this configuration has changes that need to
|
||||
* be saved in the project file, else <code>false</code>.
|
||||
* Returns <code>true</code> if this configuration has changes that need to
|
||||
* be saved in the project file, else <code>false</code>.
|
||||
* Should not be called for an extension configuration.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean isDirty();
|
||||
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if this configuration was loaded from a manifest file,
|
||||
* and <code>false</code> if it was loaded from a project (.cdtbuild) file.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean isExtensionElement();
|
||||
|
||||
/**
|
||||
* Returns whether this configuration has been changed and requires the
|
||||
* Returns whether this configuration has been changed and requires the
|
||||
* project to be rebuilt.
|
||||
*
|
||||
* @return <code>true</code> if the configuration contains a change
|
||||
*
|
||||
* @return <code>true</code> if the configuration contains a change
|
||||
* that needs the project to be rebuilt.
|
||||
* Should not be called for an extension configuration.
|
||||
*/
|
||||
|
@ -335,13 +337,13 @@ public interface IConfiguration extends IBuildObject, IBuildObjectPropertiesCont
|
|||
|
||||
/**
|
||||
* Removes a resource configuration from the configuration's list.
|
||||
*
|
||||
*
|
||||
* @param resConfig - resource configuration to remove
|
||||
*/
|
||||
public void removeResourceConfiguration(IResourceInfo resConfig);
|
||||
|
||||
|
||||
public void removeResourceInfo(IPath path);
|
||||
|
||||
|
||||
/**
|
||||
* Set (override) the extension that should be appended to the build artifact
|
||||
* for the receiver.
|
||||
|
@ -355,7 +357,7 @@ public interface IConfiguration extends IBuildObject, IBuildObjectPropertiesCont
|
|||
public void setArtifactName(String name);
|
||||
|
||||
/**
|
||||
* Sets the arguments to be passed to the build utility used by the
|
||||
* Sets the arguments to be passed to the build utility used by the
|
||||
* receiver to produce a build goal.
|
||||
*/
|
||||
public void setBuildArguments(String makeArgs);
|
||||
|
@ -366,26 +368,26 @@ public interface IConfiguration extends IBuildObject, IBuildObjectPropertiesCont
|
|||
public void setBuildCommand(String command);
|
||||
|
||||
/**
|
||||
* Sets the prebuild step for the receiver to the value in the argument.
|
||||
*/
|
||||
public void setPrebuildStep(String step);
|
||||
|
||||
/**
|
||||
* Sets the postbuild step for the receiver to the value in the argument.
|
||||
*/
|
||||
public void setPostbuildStep(String step);
|
||||
|
||||
/**
|
||||
* Sets the prebuild step display string for the receiver to the value in the argument.
|
||||
*/
|
||||
public void setPreannouncebuildStep(String announceStep);
|
||||
|
||||
/**
|
||||
* Sets the postbuild step display string for the receiver to the value in the argument.
|
||||
*/
|
||||
public void setPostannouncebuildStep(String announceStep);
|
||||
|
||||
/**
|
||||
* Sets the prebuild step for the receiver to the value in the argument.
|
||||
*/
|
||||
public void setPrebuildStep(String step);
|
||||
|
||||
/**
|
||||
* Sets the postbuild step for the receiver to the value in the argument.
|
||||
*/
|
||||
public void setPostbuildStep(String step);
|
||||
|
||||
/**
|
||||
* Sets the prebuild step display string for the receiver to the value in the argument.
|
||||
*/
|
||||
public void setPreannouncebuildStep(String announceStep);
|
||||
|
||||
/**
|
||||
* Sets the postbuild step display string for the receiver to the value in the argument.
|
||||
*/
|
||||
public void setPostannouncebuildStep(String announceStep);
|
||||
|
||||
/**
|
||||
* Sets the command used to clean the outputs of this configuration.
|
||||
* @param command - the command to clean outputs
|
||||
*/
|
||||
|
@ -407,46 +409,46 @@ public interface IConfiguration extends IBuildObject, IBuildObjectPropertiesCont
|
|||
* Sets the name of the receiver to the value specified in the argument
|
||||
*/
|
||||
public void setName(String name);
|
||||
|
||||
|
||||
/**
|
||||
* Sets the value of a boolean option for this configuration.
|
||||
*
|
||||
*
|
||||
* @param parent The holder/parent of the option.
|
||||
* @param option The option to change.
|
||||
* @param value The value to apply to the option.
|
||||
*
|
||||
*
|
||||
* @return IOption The modified option. This can be the same option or a newly created option.
|
||||
*
|
||||
*
|
||||
* @since 3.0 - The type of parent has changed from ITool to IHoldsOptions.
|
||||
* Code assuming ITool as type, will continue to work unchanged.
|
||||
*/
|
||||
public IOption setOption(IHoldsOptions parent, IOption option, boolean value)
|
||||
throws BuildException;
|
||||
public IOption setOption(IHoldsOptions parent, IOption option, boolean value)
|
||||
throws BuildException;
|
||||
|
||||
/**
|
||||
* Sets the value of a string option for this configuration.
|
||||
*
|
||||
*
|
||||
* @param parent The holder/parent of the option.
|
||||
* @param option The option that will be effected by change.
|
||||
* @param value The value to apply to the option.
|
||||
*
|
||||
*
|
||||
* @return IOption The modified option. This can be the same option or a newly created option.
|
||||
*
|
||||
*
|
||||
* @since 3.0 - The type of parent has changed from ITool to IHoldsOptions.
|
||||
* Code assuming ITool as type, will continue to work unchanged.
|
||||
*/
|
||||
public IOption setOption(IHoldsOptions parent, IOption option, String value)
|
||||
throws BuildException;
|
||||
|
||||
|
||||
/**
|
||||
* Sets the value of a list option for this configuration.
|
||||
*
|
||||
*
|
||||
* @param parent The holder/parent of the option.
|
||||
* @param option The option to change.
|
||||
* @param value The values to apply to the option.
|
||||
*
|
||||
*
|
||||
* @return IOption The modified option. This can be the same option or a newly created option.
|
||||
*
|
||||
*
|
||||
* @since 3.0 - The type of parent has changed from ITool to IHoldsOptions.
|
||||
* Code assuming ITool as type, will continue to work unchanged.
|
||||
*/
|
||||
|
@ -455,7 +457,7 @@ public interface IConfiguration extends IBuildObject, IBuildObjectPropertiesCont
|
|||
|
||||
/**
|
||||
* Sets the rebuild state in this configuration.
|
||||
*
|
||||
*
|
||||
* @param rebuild <code>true</code> will force a rebuild the next time the project builds
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo#setRebuildState(boolean)
|
||||
*/
|
||||
|
@ -463,93 +465,93 @@ public interface IConfiguration extends IBuildObject, IBuildObjectPropertiesCont
|
|||
|
||||
/**
|
||||
* Overrides the tool command for a tool defined in this configuration's tool-chain.
|
||||
*
|
||||
*
|
||||
* @param tool The tool that will have its command modified.
|
||||
* @param command The command
|
||||
*/
|
||||
public void setToolCommand(ITool tool, String command);
|
||||
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if the configuration's tool-chain is supported on the system
|
||||
* otherwise returns <code>false</code>
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean isSupported();
|
||||
|
||||
|
||||
/**
|
||||
* Returns the implementation of the IConfigurationEnvironmentVariableSupplier provided
|
||||
* by the tool-integrator or <code>null</code> if none.
|
||||
*
|
||||
* @return IConfigurationEnvironmentVariableSupplier
|
||||
*/
|
||||
*
|
||||
* @return IConfigurationEnvironmentVariableSupplier
|
||||
*/
|
||||
public IConfigurationEnvironmentVariableSupplier getEnvironmentVariableSupplier();
|
||||
|
||||
|
||||
/**
|
||||
* Returns the tool-integrator provided implementation of the configuration build macro supplier
|
||||
* or <code>null</code> if none.
|
||||
*
|
||||
* or <code>null</code> if none.
|
||||
*
|
||||
* @return IConfigurationBuildMacroSupplier
|
||||
*/
|
||||
public IConfigurationBuildMacroSupplier getBuildMacroSupplier();
|
||||
|
||||
|
||||
/**
|
||||
* answers true if the configuration is temporary, otherwise - false
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean isTemporary();
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Returns whether this configuration requires a full rebuild
|
||||
*
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean needsFullRebuild();
|
||||
|
||||
/**
|
||||
* Calculates the configuration target tool.
|
||||
*
|
||||
*
|
||||
* @return ITool or null if not found
|
||||
*
|
||||
*
|
||||
* @since 3.1
|
||||
*/
|
||||
public ITool calculateTargetTool();
|
||||
|
||||
|
||||
/**
|
||||
* Returns a <code>ITool</code> for the tool associated with the
|
||||
* Returns a <code>ITool</code> for the tool associated with the
|
||||
* output extension.
|
||||
*
|
||||
*
|
||||
* @param extension the file extension of the output file
|
||||
* @return ITool
|
||||
*
|
||||
*
|
||||
* @since 3.1
|
||||
*/
|
||||
public ITool getToolFromOutputExtension(String extension);
|
||||
|
||||
|
||||
/**
|
||||
* Returns a <code>ITool</code> for the tool associated with the
|
||||
* Returns a <code>ITool</code> for the tool associated with the
|
||||
* input extension.
|
||||
*
|
||||
*
|
||||
* @param sourceExtension the file extension of the input file
|
||||
* @return ITool
|
||||
*
|
||||
*
|
||||
* @since 3.1
|
||||
*/
|
||||
public ITool getToolFromInputExtension(String sourceExtension);
|
||||
|
||||
|
||||
IResourceInfo getResourceInfo(IPath path, boolean exactPath);
|
||||
|
||||
|
||||
IResourceInfo[] getResourceInfos();
|
||||
|
||||
|
||||
IResourceInfo getResourceInfoById(String id);
|
||||
|
||||
IFolderInfo getRootFolderInfo();
|
||||
|
||||
|
||||
IFolderInfo getRootFolderInfo();
|
||||
|
||||
IFileInfo createFileInfo(IPath path);
|
||||
|
||||
IFileInfo createFileInfo(IPath path, String id, String name);
|
||||
|
||||
|
||||
IFileInfo createFileInfo(IPath path, IFolderInfo base, ITool baseTool, String id, String name);
|
||||
|
||||
IFileInfo createFileInfo(IPath path, IFileInfo base, String id, String name);
|
||||
|
@ -557,49 +559,49 @@ public interface IConfiguration extends IBuildObject, IBuildObjectPropertiesCont
|
|||
IFolderInfo createFolderInfo(IPath path);
|
||||
|
||||
IFolderInfo createFolderInfo(IPath path, String id, String name);
|
||||
|
||||
|
||||
IFolderInfo createFolderInfo(IPath path, IFolderInfo base, String id, String name);
|
||||
|
||||
|
||||
CConfigurationData getConfigurationData();
|
||||
|
||||
|
||||
ICSourceEntry[] getSourceEntries();
|
||||
|
||||
void setSourceEntries(ICSourceEntry[] entries);
|
||||
|
||||
|
||||
CBuildData getBuildData();
|
||||
|
||||
|
||||
IBuilder getBuilder();
|
||||
|
||||
|
||||
IBuilder getEditableBuilder();
|
||||
|
||||
|
||||
String getOutputPrefix(String outputExtension);
|
||||
|
||||
|
||||
boolean isSystemObject();
|
||||
|
||||
|
||||
String getOutputExtension(String resourceExtension);
|
||||
|
||||
|
||||
String getOutputFlag(String outputExt);
|
||||
|
||||
IManagedCommandLineInfo generateToolCommandLineInfo( String sourceExtension, String[] flags,
|
||||
|
||||
IManagedCommandLineInfo generateToolCommandLineInfo( String sourceExtension, String[] flags,
|
||||
String outputFlag, String outputPrefix, String outputName, String[] inputResources, IPath inputLocation, IPath outputLocation );
|
||||
|
||||
|
||||
String[] getUserObjects(String extension);
|
||||
|
||||
|
||||
String[] getLibs(String extension);
|
||||
|
||||
|
||||
boolean buildsFileType(String srcExt);
|
||||
|
||||
|
||||
boolean supportsBuild(boolean managed);
|
||||
|
||||
|
||||
boolean isManagedBuildOn();
|
||||
|
||||
void setManagedBuildOn(boolean on) throws BuildException;
|
||||
|
||||
|
||||
boolean isBuilderCompatible(IBuilder builder);
|
||||
|
||||
|
||||
void changeBuilder(IBuilder newBuilder, String id, String name);
|
||||
|
||||
|
||||
IBuildPropertyValue getBuildArtefactType();
|
||||
|
||||
|
||||
void setBuildArtefactType(String id) throws BuildException;
|
||||
}
|
||||
|
|
|
@ -16,19 +16,19 @@ import org.eclipse.cdt.managedbuilder.macros.IConfigurationBuildMacroSupplier;
|
|||
|
||||
|
||||
/**
|
||||
* This interface represents a tool-integrator-defined, ordered set of tools
|
||||
* that transform the project's input into the project's outputs. A
|
||||
* tool-chain can be defined as part of a configuration, or as an
|
||||
* This interface represents a tool-integrator-defined, ordered set of tools
|
||||
* that transform the project's input into the project's outputs. A
|
||||
* tool-chain can be defined as part of a configuration, or as an
|
||||
* independent specification that is referenced in a separate configuration
|
||||
* via the toolChain superclass attribute.
|
||||
* <p>
|
||||
* The toolChain contains one or more children of type tool. These define
|
||||
* the tools used in the tool-chain. The toolChain contains one child of
|
||||
* the tools used in the tool-chain. The toolChain contains one child of
|
||||
* type targetPlatform. This defines the architecture/os combination where
|
||||
* the outputs of the project can be deployed. The toolChain contains one
|
||||
* the outputs of the project can be deployed. The toolChain contains one
|
||||
* child of type builder. This defines the "build" or "make" utility that
|
||||
* is used to drive the transformation of the inputs into outputs.
|
||||
*
|
||||
*
|
||||
* @since 2.1
|
||||
* @noextend This class is not intended to be subclassed by clients.
|
||||
* @noimplement This interface is not intended to be implemented by clients.
|
||||
|
@ -49,15 +49,16 @@ public interface IToolChain extends IBuildObject, IHoldsOptions {
|
|||
public static final String IS_SYSTEM= "isSystem"; //$NON-NLS-1$
|
||||
public static final String NON_INTERNAL_BUILDER_ID = "nonInternalBuilderId"; //$NON-NLS-1$
|
||||
public static final String RESOURCE_TYPE_BASED_DISCOVERY = "resourceTypeBasedDiscovery"; //$NON-NLS-1$
|
||||
|
||||
|
||||
// The attribute name for the scanner info collector
|
||||
public static final String SCANNER_CONFIG_PROFILE_ID = "scannerConfigDiscoveryProfileId"; //$NON-NLS-1$
|
||||
|
||||
/** @since 8.1 */
|
||||
public static final String LANGUAGE_SETTINGS_PROVIDERS = "languageSettingsProviders";
|
||||
|
||||
/**
|
||||
* Returns the configuration that is the parent of this tool-chain.
|
||||
*
|
||||
*
|
||||
* @return IConfiguration
|
||||
*/
|
||||
public IConfiguration getParent();
|
||||
|
@ -69,14 +70,14 @@ public interface IToolChain extends IBuildObject, IHoldsOptions {
|
|||
* @param Id The id for the new tool chain
|
||||
* @param name The name for the new tool chain
|
||||
* @param isExtensionElement Indicates whether this is an extension element or a managed project element
|
||||
*
|
||||
*
|
||||
* @return ITargetPlatform
|
||||
*/
|
||||
public ITargetPlatform createTargetPlatform(ITargetPlatform superClass, String Id, String name, boolean isExtensionElement);
|
||||
|
||||
/**
|
||||
* Returns the target-platform child of this tool-chain
|
||||
*
|
||||
*
|
||||
* @return ITargetPlatform
|
||||
*/
|
||||
public ITargetPlatform getTargetPlatform();
|
||||
|
@ -89,30 +90,30 @@ public interface IToolChain extends IBuildObject, IHoldsOptions {
|
|||
|
||||
/**
|
||||
* Returns the 'versionsSupported' of this tool-chain
|
||||
*
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
|
||||
public String getVersionsSupported();
|
||||
/**
|
||||
* Returns the 'convertToId' of this tool-chain
|
||||
*
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
|
||||
public String getConvertToId();
|
||||
|
||||
|
||||
/**
|
||||
* Sets the 'versionsSupported' attribute of the tool-chain.
|
||||
* Sets the 'versionsSupported' attribute of the tool-chain.
|
||||
*/
|
||||
|
||||
|
||||
public void setVersionsSupported(String versionsSupported);
|
||||
|
||||
|
||||
/**
|
||||
* Sets the 'convertToId' attribute of the tool-chain.
|
||||
* Sets the 'convertToId' attribute of the tool-chain.
|
||||
*/
|
||||
public void setConvertToId(String convertToId);
|
||||
|
||||
|
||||
/**
|
||||
* Creates the <code>Builder</code> child of this tool-chain.
|
||||
*
|
||||
|
@ -120,7 +121,7 @@ public interface IToolChain extends IBuildObject, IHoldsOptions {
|
|||
* @param Id The id for the new tool chain
|
||||
* @param name The name for the new tool chain
|
||||
* @param isExtensionElement Indicates whether this is an extension element or a managed project element
|
||||
*
|
||||
*
|
||||
* @return IBuilder
|
||||
*/
|
||||
public IBuilder createBuilder(IBuilder superClass, String Id, String name, boolean isExtensionElement);
|
||||
|
@ -133,7 +134,7 @@ public interface IToolChain extends IBuildObject, IHoldsOptions {
|
|||
|
||||
/**
|
||||
* Returns the builder child of this tool-chain.
|
||||
*
|
||||
*
|
||||
* @return IBuilder
|
||||
*/
|
||||
public IBuilder getBuilder();
|
||||
|
@ -145,35 +146,35 @@ public interface IToolChain extends IBuildObject, IHoldsOptions {
|
|||
* @param Id The id for the new tool chain
|
||||
* @param name The name for the new tool chain
|
||||
* @param isExtensionElement Indicates whether this is an extension element or a managed project element
|
||||
*
|
||||
*
|
||||
* @return ITool
|
||||
*/
|
||||
public ITool createTool(ITool superClass, String Id, String name, boolean isExtensionElement);
|
||||
|
||||
/**
|
||||
* Returns an array of tool children of this tool-chain
|
||||
*
|
||||
*
|
||||
* @return ITool[]
|
||||
*/
|
||||
public ITool[] getTools();
|
||||
|
||||
/**
|
||||
* Returns the tool in this tool-chain with the ID specified in the argument,
|
||||
* or <code>null</code>
|
||||
*
|
||||
* Returns the tool in this tool-chain with the ID specified in the argument,
|
||||
* or <code>null</code>
|
||||
*
|
||||
* @param id The ID of the requested tool
|
||||
* @return ITool
|
||||
*/
|
||||
public ITool getTool(String id);
|
||||
|
||||
/**
|
||||
* Returns the <code>ITool</code> in the tool-chain with the specified
|
||||
* ID, or the tool(s) with a superclass with this id.
|
||||
*
|
||||
* <p>If the tool-chain does not have a tool with that ID, the method
|
||||
* returns an empty array. It is the responsibility of the caller to
|
||||
* verify the return value.
|
||||
*
|
||||
* Returns the <code>ITool</code> in the tool-chain with the specified
|
||||
* ID, or the tool(s) with a superclass with this id.
|
||||
*
|
||||
* <p>If the tool-chain does not have a tool with that ID, the method
|
||||
* returns an empty array. It is the responsibility of the caller to
|
||||
* verify the return value.
|
||||
*
|
||||
* @param id unique identifier of the tool to search for
|
||||
* @return <code>ITool[]</code>
|
||||
* @since 3.0.2
|
||||
|
@ -183,55 +184,55 @@ public interface IToolChain extends IBuildObject, IHoldsOptions {
|
|||
/**
|
||||
* Returns the <code>IToolChain</code> that is the superclass of this
|
||||
* tool-chain, or <code>null</code> if the attribute was not specified.
|
||||
*
|
||||
*
|
||||
* @return IToolChain
|
||||
*/
|
||||
public IToolChain getSuperClass();
|
||||
|
||||
|
||||
/**
|
||||
* Returns whether this element is abstract. Returns <code>false</code>
|
||||
* if the attribute was not specified.
|
||||
* @return boolean
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean isAbstract();
|
||||
|
||||
/**
|
||||
* Sets the isAbstract attribute of the tool-chain.
|
||||
* Sets the isAbstract attribute of the tool-chain.
|
||||
*/
|
||||
public void setIsAbstract(boolean b);
|
||||
|
||||
|
||||
/**
|
||||
* Returns a semi-colon delimited list of child Ids of the superclass'
|
||||
* children that should not be automatically inherited by this element.
|
||||
* Returns an empty string if the attribute was not specified.
|
||||
* @return String
|
||||
* Returns an empty string if the attribute was not specified.
|
||||
* @return String
|
||||
*/
|
||||
public String getUnusedChildren();
|
||||
|
||||
|
||||
/**
|
||||
* Returns an array of operating systems the tool-chain outputs can run on.
|
||||
*
|
||||
*
|
||||
* @return String[]
|
||||
*/
|
||||
public String[] getOSList();
|
||||
|
||||
/**
|
||||
* Sets the OS list.
|
||||
*
|
||||
*
|
||||
* @param OSs The list of OS names
|
||||
*/
|
||||
public void setOSList(String[] OSs);
|
||||
|
||||
|
||||
/**
|
||||
* Returns an array of architectures the tool-chain outputs can run on.
|
||||
*
|
||||
*
|
||||
* @return String[]
|
||||
*/
|
||||
public String[] getArchList();
|
||||
|
||||
|
||||
/**
|
||||
* Sets the architecture list.
|
||||
*
|
||||
*
|
||||
* @param archs The list of architecture names
|
||||
*/
|
||||
public void setArchList(String[] archs);
|
||||
|
@ -239,7 +240,7 @@ public interface IToolChain extends IBuildObject, IHoldsOptions {
|
|||
/**
|
||||
* Returns the semicolon separated list of unique IDs of the error parsers associated
|
||||
* with the tool-chain.
|
||||
*
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public String getErrorParserIds();
|
||||
|
@ -251,9 +252,9 @@ public interface IToolChain extends IBuildObject, IHoldsOptions {
|
|||
public String getErrorParserIds(IConfiguration config);
|
||||
|
||||
/**
|
||||
* Returns the ordered list of unique IDs of the error parsers associated with the
|
||||
* Returns the ordered list of unique IDs of the error parsers associated with the
|
||||
* tool-chain.
|
||||
*
|
||||
*
|
||||
* @return String[]
|
||||
*/
|
||||
public String[] getErrorParserList();
|
||||
|
@ -267,12 +268,14 @@ public interface IToolChain extends IBuildObject, IHoldsOptions {
|
|||
* Returns the default language settings providers IDs.
|
||||
*
|
||||
* @return the default language settings providers IDs separated by semicolon or {@code null} if none.
|
||||
*
|
||||
* @since 8.1
|
||||
*/
|
||||
public String getDefaultLanguageSettingsProvidersIds();
|
||||
|
||||
/**
|
||||
* Returns the scanner config discovery profile id or <code>null</code> if none.
|
||||
*
|
||||
* Returns the scanner config discovery profile id or <code>null</code> if none.
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public String getScannerConfigDiscoveryProfileId();
|
||||
|
@ -283,93 +286,93 @@ public interface IToolChain extends IBuildObject, IHoldsOptions {
|
|||
public void setScannerConfigDiscoveryProfileId(String profileId);
|
||||
|
||||
/**
|
||||
* Returns the sem-colon separated list of Tool ids containing each
|
||||
* tool that can create the final build artifact (the end target of
|
||||
* the build). MBS will use the first ID in the list that matches
|
||||
* a Tool in the ToolChain. One reason for specifying a list, is
|
||||
* that different versions of a tool can be selected based upon the
|
||||
* Returns the sem-colon separated list of Tool ids containing each
|
||||
* tool that can create the final build artifact (the end target of
|
||||
* the build). MBS will use the first ID in the list that matches
|
||||
* a Tool in the ToolChain. One reason for specifying a list, is
|
||||
* that different versions of a tool can be selected based upon the
|
||||
* project nature (e.g. different tool definitions for a linker for C vs. C++).
|
||||
*
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public String getTargetToolIds();
|
||||
|
||||
/**
|
||||
* Sets the sem-colon separated list of Tool ids containing each
|
||||
* tool that can create the final build artifact (the end target of
|
||||
* the build).
|
||||
* Sets the sem-colon separated list of Tool ids containing each
|
||||
* tool that can create the final build artifact (the end target of
|
||||
* the build).
|
||||
*/
|
||||
public void setTargetToolIds(String targetToolIds);
|
||||
|
||||
/**
|
||||
* Returns the list of Tool ids containing each
|
||||
* tool that can create the final build artifact (the end target of
|
||||
* the build). MBS will use the first ID in the list that matches
|
||||
* a Tool in the ToolChain. One reason for specifying a list, is
|
||||
* that different versions of a tool can be selected based upon the
|
||||
* Returns the list of Tool ids containing each
|
||||
* tool that can create the final build artifact (the end target of
|
||||
* the build). MBS will use the first ID in the list that matches
|
||||
* a Tool in the ToolChain. One reason for specifying a list, is
|
||||
* that different versions of a tool can be selected based upon the
|
||||
* project nature (e.g. different tool definitions for a linker for C vs. C++).
|
||||
*
|
||||
*
|
||||
* @return String[]
|
||||
*/
|
||||
public String[] getTargetToolList();
|
||||
|
||||
|
||||
/**
|
||||
* Returns the OutputTypes in this tool-chain, besides the primary
|
||||
* output of the targetTool, that are also considered to be build
|
||||
* artifacts.
|
||||
*
|
||||
* Returns the OutputTypes in this tool-chain, besides the primary
|
||||
* output of the targetTool, that are also considered to be build
|
||||
* artifacts.
|
||||
*
|
||||
* @return IOutputType[]
|
||||
*/
|
||||
public IOutputType[] getSecondaryOutputs();
|
||||
|
||||
|
||||
/**
|
||||
* Sets the semicolon separated list of OutputType identifiers in
|
||||
* Sets the semicolon separated list of OutputType identifiers in
|
||||
* this tool-chain, besides the primary output of the targetTool,
|
||||
* that are also considered to be build artifacts.
|
||||
* that are also considered to be build artifacts.
|
||||
*/
|
||||
public void setSecondaryOutputs(String ids);
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if this tool-chain has changes that need to
|
||||
* Returns <code>true</code> if this tool-chain has changes that need to
|
||||
* be saved in the project file, else <code>false</code>.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean isDirty();
|
||||
|
||||
|
||||
/**
|
||||
* Sets the element's "dirty" (have I been modified?) flag.
|
||||
*/
|
||||
public void setDirty(boolean isDirty);
|
||||
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if this tool-chain was loaded from a manifest file,
|
||||
* and <code>false</code> if it was loaded from a project (.cdtbuild) file.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean isExtensionElement();
|
||||
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if the tool-chain support is installed on the system
|
||||
* otherwise returns <code>false</code>
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean isSupported();
|
||||
|
||||
|
||||
/**
|
||||
* Returns the tool-integrator provided implementation of the configuration environment variable supplier
|
||||
* or <code>null</code> if none.
|
||||
*
|
||||
* or <code>null</code> if none.
|
||||
*
|
||||
* @return IConfigurationEnvironmentVariableSupplier
|
||||
*/
|
||||
public IConfigurationEnvironmentVariableSupplier getEnvironmentVariableSupplier();
|
||||
|
||||
|
||||
/**
|
||||
* Returns the tool-integrator provided implementation of the configuration build macro supplier
|
||||
* or <code>null</code> if none.
|
||||
*
|
||||
* or <code>null</code> if none.
|
||||
*
|
||||
* @return IConfigurationBuildMacroSupplier
|
||||
*/
|
||||
public IConfigurationBuildMacroSupplier getBuildMacroSupplier();
|
||||
|
@ -379,16 +382,16 @@ public interface IToolChain extends IBuildObject, IHoldsOptions {
|
|||
* or null, if no conversion is required
|
||||
*/
|
||||
public IOptionPathConverter getOptionPathConverter() ;
|
||||
|
||||
|
||||
IFolderInfo getParentFolderInfo();
|
||||
|
||||
|
||||
CTargetPlatformData getTargetPlatformData();
|
||||
|
||||
|
||||
boolean supportsBuild(boolean managed);
|
||||
|
||||
|
||||
boolean isSystemObject();
|
||||
|
||||
|
||||
boolean matches(IToolChain tc);
|
||||
|
||||
|
||||
String getUniqueRealName();
|
||||
}
|
||||
|
|
|
@ -21,6 +21,9 @@ import org.eclipse.cdt.managedbuilder.core.IToolChain;
|
|||
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
|
||||
import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
|
||||
|
||||
/**
|
||||
* @since 8.1
|
||||
*/
|
||||
public abstract class ToolchainBuiltinSpecsDetector extends AbstractBuiltinSpecsDetector {
|
||||
private Map<String, ITool> toolMap = new HashMap<String, ITool>();
|
||||
/**
|
||||
|
@ -33,7 +36,7 @@ public abstract class ToolchainBuiltinSpecsDetector extends AbstractBuiltinSpecs
|
|||
if (langTool != null) {
|
||||
return langTool;
|
||||
}
|
||||
|
||||
|
||||
String toolchainId = getToolchainId();
|
||||
IToolChain toolchain = ManagedBuildManager.getExtensionToolChain(toolchainId);
|
||||
if (toolchain != null) {
|
||||
|
|
|
@ -94,6 +94,7 @@ public class MBSWizardHandler extends CWizardHandler {
|
|||
private static final String PROP_VAL = PROPERTY + ".debug"; //$NON-NLS-1$
|
||||
|
||||
private static final String UI_USER_LANGUAGE_SETTINGS_PROVIDER = "org.eclipse.cdt.ui.user.LanguageSettingsProvider";
|
||||
/** @since 8.1 */
|
||||
public static final String MBS_LANGUAGE_SETTINGS_PROVIDER = "org.eclipse.cdt.managedbuilder.core.LanguageSettingsProvider";
|
||||
private static final String LANGUAGE_SETTINGS_PROVIDER_DELIMITER = ";";
|
||||
|
||||
|
@ -885,6 +886,9 @@ public class MBSWizardHandler extends CWizardHandler {
|
|||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 8.1
|
||||
*/
|
||||
public static List<ILanguageSettingsProvider> getLanguageSettingsProviders(IConfiguration cfg) {
|
||||
List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ public class NewMakeProjFromExistingPage extends WizardPage {
|
|||
IWorkspaceRoot root;
|
||||
List tcList;
|
||||
Map<String, IToolChain> tcMap = new HashMap<String, IToolChain>();
|
||||
|
||||
|
||||
private Button checkBoxTryNewSD;
|
||||
|
||||
|
||||
|
@ -233,6 +233,10 @@ public class NewMakeProjFromExistingPage extends WizardPage {
|
|||
return selection.length != 0 ? tcMap.get(selection[0]) : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* AG FIXME temporary method to be removed before CDT Juno release.
|
||||
* @since 8.1
|
||||
*/
|
||||
public boolean isTryingNewSD() {
|
||||
return checkBoxTryNewSD.getSelection();
|
||||
}
|
||||
|
|
17
core/org.eclipse.cdt.core/.settings/.api_filters
Normal file
17
core/org.eclipse.cdt.core/.settings/.api_filters
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<component id="org.eclipse.cdt.core" version="2">
|
||||
<resource path="model/org/eclipse/cdt/core/settings/model/ICDescriptionDelta.java" type="org.eclipse.cdt.core.settings.model.ICDescriptionDelta">
|
||||
<filter comment="Temporary filter to ignore added API restictions for interfaces that should be internal to begin with" id="403853384">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.cdt.core.settings.model.ICDescriptionDelta"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="model/org/eclipse/cdt/core/settings/model/ICSettingEntry.java" type="org.eclipse.cdt.core.settings.model.ICSettingEntry">
|
||||
<filter comment="Temporary filter to ignore added API restictions for interfaces that should be internal to begin with" id="403853384">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.cdt.core.settings.model.ICSettingEntry"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
</component>
|
|
@ -25,6 +25,8 @@ import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
|
|||
* Implementers are to create a specific listener and register it to
|
||||
* appropriate event manager in {@link #registerListener(ICConfigurationDescription)}
|
||||
* then unregister and dispose in {@link #unregisterListener()}.
|
||||
*
|
||||
* @since 5.4
|
||||
*/
|
||||
public interface ICListenerAgent {
|
||||
/**
|
||||
|
|
|
@ -19,6 +19,8 @@ import org.eclipse.core.resources.IResource;
|
|||
/**
|
||||
* This interface is to be implemented by providers which want to broadcast the changes in their setting entries
|
||||
* with {@link ILanguageSettingsChangeEvent}.
|
||||
*
|
||||
* @since 5.4
|
||||
*/
|
||||
public interface ILanguageSettingsBroadcastingProvider extends ILanguageSettingsProvider {
|
||||
@Override
|
||||
|
|
|
@ -28,6 +28,8 @@ import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
|
|||
*
|
||||
* @noextend This interface is not intended to be extended by clients.
|
||||
* @noimplement This interface is not intended to be implemented by clients.
|
||||
*
|
||||
* @since 5.4
|
||||
*/
|
||||
public interface ILanguageSettingsChangeEvent {
|
||||
/**
|
||||
|
|
|
@ -17,6 +17,8 @@ import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
|
|||
*
|
||||
* @see LanguageSettingsManager#registerLanguageSettingsChangeListener(ILanguageSettingsChangeListener)
|
||||
* @see LanguageSettingsManager#unregisterLanguageSettingsChangeListener(ILanguageSettingsChangeListener)
|
||||
*
|
||||
* @since 5.4
|
||||
*/
|
||||
public interface ILanguageSettingsChangeListener {
|
||||
/**
|
||||
|
|
|
@ -22,6 +22,8 @@ import org.eclipse.core.resources.IResource;
|
|||
* contrary to some subclasses of {@link LanguageSettingsSerializableProvider} managing
|
||||
* their settings themselves and not providing such option to the user.
|
||||
*
|
||||
* @since 5.4
|
||||
*
|
||||
*/
|
||||
public interface ILanguageSettingsEditableProvider extends ILanguageSettingsBroadcastingProvider, Cloneable {
|
||||
@Override
|
||||
|
|
|
@ -39,6 +39,8 @@ import org.eclipse.core.resources.IResource;
|
|||
* plugins {@code AbstractBuildCommandParser} and {@code AbstractBuiltinSpecsDetector} which
|
||||
* serve as a base for output parsers and built-in compiler language settings detectors.
|
||||
* See also extension point schema description LanguageSettingsProvider.exsd.
|
||||
*
|
||||
* @since 5.4
|
||||
*/
|
||||
public interface ILanguageSettingsProvider {
|
||||
/**
|
||||
|
|
|
@ -18,6 +18,8 @@ import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
|
|||
* Providers.
|
||||
* @see ILanguageSettingsProvider
|
||||
*
|
||||
* @since 5.4
|
||||
*
|
||||
*/
|
||||
public interface ILanguageSettingsProvidersKeeper {
|
||||
/**
|
||||
|
|
|
@ -29,6 +29,8 @@ import org.eclipse.core.resources.IResource;
|
|||
*
|
||||
* This implementation supports "static" list of entries for languages specified in
|
||||
* the extension point.
|
||||
*
|
||||
* @since 5.4
|
||||
*/
|
||||
public class LanguageSettingsBaseProvider extends AbstractExecutableExtensionBase implements ILanguageSettingsProvider {
|
||||
/** Language scope, i.e. list of languages the entries will be provided for. */
|
||||
|
|
|
@ -16,6 +16,8 @@ package org.eclipse.cdt.core.language.settings.providers;
|
|||
* The instances of this class can be used in plugin.xml to create a new provider
|
||||
* but this class is not intended to be extended. For more details how to create a
|
||||
* language settings provider see the description of {@link ILanguageSettingsProvider}.
|
||||
*
|
||||
* @since 5.4
|
||||
*/
|
||||
final public class LanguageSettingsGenericProvider extends LanguageSettingsSerializableProvider
|
||||
implements ILanguageSettingsEditableProvider {
|
||||
|
|
|
@ -34,6 +34,8 @@ import org.eclipse.core.runtime.IPath;
|
|||
/**
|
||||
* A collection of utility methods to manage language settings providers.
|
||||
* See {@link ILanguageSettingsProvider}.
|
||||
*
|
||||
* @since 5.4
|
||||
*/
|
||||
public class LanguageSettingsManager {
|
||||
/**
|
||||
|
|
|
@ -38,6 +38,8 @@ import org.w3c.dom.NodeList;
|
|||
* design. Implement {@link ILanguageSettingsEditableProvider} interface for that.
|
||||
* For more on the suggested way of extending this class see the description of
|
||||
* {@link ILanguageSettingsProvider}.
|
||||
*
|
||||
* @since 5.4
|
||||
*/
|
||||
public class LanguageSettingsSerializableProvider extends LanguageSettingsBaseProvider implements ILanguageSettingsBroadcastingProvider {
|
||||
protected static final String ATTR_ID = LanguageSettingsProvidersSerializer.ATTR_ID;
|
||||
|
|
|
@ -25,6 +25,8 @@ import org.eclipse.cdt.internal.core.parser.util.WeakHashSet;
|
|||
|
||||
/**
|
||||
* The class representing the (in-memory) storage for language settings entries {@link ICLanguageSettingEntry}.
|
||||
*
|
||||
* @since 5.4
|
||||
*/
|
||||
public class LanguageSettingsStorage implements Cloneable {
|
||||
/** Storage to keep settings entries. */
|
||||
|
|
|
@ -29,6 +29,8 @@ import org.osgi.service.prefs.Preferences;
|
|||
*
|
||||
* @noextend This class is not intended to be subclassed by clients.
|
||||
* @noinstantiate This class is not intended to be instantiated by clients.
|
||||
*
|
||||
* @since 5.4
|
||||
*/
|
||||
public class ScannerDiscoveryLegacySupport {
|
||||
/** Name of MBS language settings provider (from org.eclipse.cdt.managedbuilder.core) */
|
||||
|
|
|
@ -36,7 +36,9 @@ public abstract class ACExclusionFilterEntry extends ACPathEntry implements ICEx
|
|||
this.exclusionPatterns = exclusionPatterns != null ? (IPath[])exclusionPatterns.clone() : new IPath[0];
|
||||
}
|
||||
|
||||
/** @since 5.3 */
|
||||
/**
|
||||
* @since 5.4
|
||||
*/
|
||||
@Override
|
||||
public final boolean isFile() {
|
||||
return false;
|
||||
|
|
|
@ -66,9 +66,9 @@ public abstract class ACPathEntry extends ACSettingEntry implements ICPathEntry
|
|||
return rcs[0].getFullPath();
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @since 5.3
|
||||
* @since 5.4
|
||||
*/
|
||||
public abstract boolean isFile();
|
||||
|
||||
|
|
|
@ -10,7 +10,10 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.core.settings.model;
|
||||
|
||||
|
||||
/**
|
||||
* @noextend This interface is not intended to be extended by clients.
|
||||
* @noimplement This interface is not intended to be implemented by clients.
|
||||
*/
|
||||
public interface ICDescriptionDelta {
|
||||
/*
|
||||
* delta kinds
|
||||
|
@ -18,8 +21,8 @@ public interface ICDescriptionDelta {
|
|||
/**
|
||||
* kind specifying that the setting object returned by
|
||||
* the {@link #getSetting()} was removed
|
||||
* the {@link #getNewSetting()} returns null
|
||||
* the {@link #getOldSetting()} returns the same object as {@link #getSetting()}
|
||||
* the {@link #getNewSetting()} returns null
|
||||
* the {@link #getOldSetting()} returns the same object as {@link #getSetting()}
|
||||
*/
|
||||
int REMOVED = 1;
|
||||
|
||||
|
@ -27,28 +30,29 @@ public interface ICDescriptionDelta {
|
|||
* kind specifying that the setting object returned by
|
||||
* the {@link #getSetting()} was added
|
||||
* the {@link #getNewSetting()} returns the same object as {@link #getSetting()}
|
||||
* the {@link #getOldSetting()} returns null
|
||||
* the {@link #getOldSetting()} returns null
|
||||
*/
|
||||
int ADDED = 2;
|
||||
|
||||
/**
|
||||
* kind specifying that the setting object was changed
|
||||
* the {@link #getNewSetting()} returns new object
|
||||
* the {@link #getOldSetting()} returns old object
|
||||
* the {@link #getNewSetting()} returns new object
|
||||
* the {@link #getOldSetting()} returns old object
|
||||
* the {@link #getSetting()} returns the same object as {@link #getNewSetting()}
|
||||
*/
|
||||
int CHANGED = 3;
|
||||
|
||||
|
||||
/*
|
||||
* delta change flags
|
||||
*/
|
||||
|
||||
|
||||
int ACTIVE_CFG = 1;
|
||||
int NAME = 1 << 1;
|
||||
int DESCRIPTION = 1 << 2;
|
||||
// int PATH = 1 << 3;
|
||||
int LANGUAGE_ID = 1 << 4;
|
||||
int SOURCE_CONTENT_TYPE = 1 << 5;
|
||||
/** @since 5.4 */
|
||||
int SOURCE_EXTENSIONS = 1 << 6;
|
||||
/** @deprecated Use ICDescriptionDelta.SOURCE_EXTENSIONS */
|
||||
@Deprecated
|
||||
|
@ -69,18 +73,19 @@ public interface ICDescriptionDelta {
|
|||
int OWNER = 1 << 20;
|
||||
int INDEX_CFG = 1 << 21;
|
||||
int SETTING_CFG = INDEX_CFG;
|
||||
/** @since 5.4 */
|
||||
int LANGUAGE_SETTINGS_PROVIDERS = 1 << 22;
|
||||
|
||||
|
||||
/**
|
||||
* specifies that the project "isCdtProjectCreating" state was set to false
|
||||
* the PROJECT_CREAION_COMPLETED delta gets notified ONLY in case
|
||||
* the project previously contained the project description with
|
||||
* the project previously contained the project description with
|
||||
* the true "isCdtProjectCreating" state
|
||||
*
|
||||
*
|
||||
* in case the initial project description does NOT contain the true "isCdtProjectCreating"
|
||||
* the project is considered as initialized from the very beginning
|
||||
* the project is considered as initialized from the very beginning
|
||||
* and the PROJECT_CREAION_COMPLETED delta is NOT notified
|
||||
*
|
||||
*
|
||||
* @see ICProjectDescription#isCdtProjectCreating()
|
||||
* @see ICProjectDescription#setCdtProjectCreated()
|
||||
* @see ICProjectDescriptionManager#createProjectDescription(org.eclipse.core.resources.IProject, boolean, boolean)
|
||||
|
@ -89,19 +94,19 @@ public interface ICDescriptionDelta {
|
|||
|
||||
/**
|
||||
* returns the kind
|
||||
* @see #ADDED
|
||||
* @see #REMOVED
|
||||
* @see #ADDED
|
||||
* @see #REMOVED
|
||||
* @see #CHANGED
|
||||
*
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
int getDeltaKind();
|
||||
|
||||
|
||||
/**
|
||||
* @return ored delta flags
|
||||
*/
|
||||
int getChangeFlags();
|
||||
|
||||
|
||||
int getSettingType();
|
||||
|
||||
int getAddedEntriesKinds();
|
||||
|
@ -115,8 +120,8 @@ public interface ICDescriptionDelta {
|
|||
ICSettingObject getNewSetting();
|
||||
|
||||
ICSettingObject getSetting();
|
||||
|
||||
|
||||
ICSettingObject getOldSetting();
|
||||
|
||||
|
||||
ICDescriptionDelta getParent();
|
||||
}
|
||||
|
|
|
@ -12,6 +12,10 @@ package org.eclipse.cdt.core.settings.model;
|
|||
|
||||
import org.eclipse.cdt.core.model.IIncludeEntry;
|
||||
|
||||
/**
|
||||
* @noextend This interface is not intended to be extended by clients.
|
||||
* @noimplement This interface is not intended to be implemented by clients.
|
||||
*/
|
||||
public interface ICSettingEntry {
|
||||
/**
|
||||
* Flag {@code BUILTIN} indicates settings built in a tool (compiler) itself.
|
||||
|
@ -49,15 +53,16 @@ public interface ICSettingEntry {
|
|||
/**
|
||||
* Flag {@code UNDEFINED} indicates that the entry should not be defined.
|
||||
* It's main purpose to provide the means to negate entries defined elsewhere.
|
||||
*
|
||||
* @since 6.0
|
||||
*
|
||||
* @since 5.4
|
||||
*/
|
||||
int UNDEFINED = 1 << 5;
|
||||
|
||||
/**
|
||||
* Flag {@code FRAMEWORKS_MAC} applies for path entries. Such a path entry will be treated
|
||||
* in a special way to imitate resolving paths by Apple's version of gcc, see bug 69529.
|
||||
* .
|
||||
*
|
||||
* @since 5.4
|
||||
*/
|
||||
int FRAMEWORKS_MAC = 1 << 6;
|
||||
|
||||
|
|
|
@ -40,10 +40,10 @@ public class LanguageSettingEntriesSerializer {
|
|||
public static final String ATTRIBUTE_SOURCE_ATTACHMENT_PATH = "srcPath"; //$NON-NLS-1$
|
||||
public static final String ATTRIBUTE_SOURCE_ATTACHMENT_ROOT_PATH = "srcRootPath"; //$NON-NLS-1$
|
||||
public static final String ATTRIBUTE_SOURCE_ATTACHMENT_PREFIX_MAPPING = "srcPrefixMapping"; //$NON-NLS-1$
|
||||
|
||||
|
||||
// public static final String ATTRIBUTE_FULL_PATH = "fullPath"; //$NON-NLS-1$
|
||||
// public static final String ATTRIBUTE_LOCATION = "location"; //$NON-NLS-1$
|
||||
|
||||
|
||||
|
||||
public static final String INCLUDE_PATH = "includePath"; //$NON-NLS-1$
|
||||
public static final String INCLUDE_FILE = "includeFile"; //$NON-NLS-1$
|
||||
|
@ -61,7 +61,7 @@ public class LanguageSettingEntriesSerializer {
|
|||
public static final String RESOLVED = "RESOLVED"; //$NON-NLS-1$
|
||||
private static final String UNDEFINED = "UNDEFINED"; //$NON-NLS-1$
|
||||
private static final String FRAMEWORK = "FRAMEWORK"; //$NON-NLS-1$
|
||||
|
||||
|
||||
public static final String FLAGS_SEPARATOR = "|"; //$NON-NLS-1$
|
||||
|
||||
public static ICSettingEntry[] loadEntries(ICStorageElement el){
|
||||
|
@ -86,7 +86,7 @@ public class LanguageSettingEntriesSerializer {
|
|||
child = children[i];
|
||||
if(ELEMENT_ENTRY.equals(child.getName())){
|
||||
entry = loadEntry(child);
|
||||
if(entry != null
|
||||
if(entry != null
|
||||
&& (kindFilter == 0
|
||||
|| (kindFilter & entry.getKind()) != 0))
|
||||
list.add(entry);
|
||||
|
@ -99,11 +99,11 @@ public class LanguageSettingEntriesSerializer {
|
|||
int kind = stringToKind(el.getAttribute(ATTRIBUTE_KIND));
|
||||
if(kind == 0)
|
||||
return null;
|
||||
|
||||
|
||||
int flags = composeFlags(el.getAttribute(ATTRIBUTE_FLAGS));
|
||||
String name = el.getAttribute(ATTRIBUTE_NAME);
|
||||
|
||||
|
||||
|
||||
switch(kind){
|
||||
case ICLanguageSettingEntry.INCLUDE_PATH:
|
||||
return new CIncludePathEntry(name, flags);
|
||||
|
@ -128,7 +128,7 @@ public class LanguageSettingEntriesSerializer {
|
|||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
private static IPath loadPath(ICStorageElement el, String attr){
|
||||
String value = el.getAttribute(attr);
|
||||
if(value != null)
|
||||
|
@ -151,18 +151,18 @@ public class LanguageSettingEntriesSerializer {
|
|||
}
|
||||
return paths;
|
||||
}
|
||||
return null;
|
||||
return null;
|
||||
}
|
||||
|
||||
private static void storeExclusions(ICStorageElement el, IPath[] paths){
|
||||
if(paths == null || paths.length == 0)
|
||||
return;
|
||||
|
||||
|
||||
String[] strs = new String[paths.length];
|
||||
for(int i = 0; i < strs.length; i++){
|
||||
strs[i] = paths[i].toString();
|
||||
}
|
||||
|
||||
|
||||
String attr = CDataUtil.arrayToString(strs, FLAGS_SEPARATOR);
|
||||
el.setAttribute(ATTRIBUTE_EXCLUDING, attr);
|
||||
}
|
||||
|
@ -176,7 +176,7 @@ public class LanguageSettingEntriesSerializer {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static void serializeEntry(ICSettingEntry entry, ICStorageElement element){
|
||||
String kind = kindToString(entry.getKind());
|
||||
String flags = composeFlagsString(entry.getFlags());
|
||||
|
@ -199,7 +199,7 @@ public class LanguageSettingEntriesSerializer {
|
|||
IPath path = libFile.getSourceAttachmentPath();
|
||||
if(path != null)
|
||||
element.setAttribute(ATTRIBUTE_SOURCE_ATTACHMENT_PATH, path.toString());
|
||||
|
||||
|
||||
path = libFile.getSourceAttachmentRootPath();
|
||||
if(path != null)
|
||||
element.setAttribute(ATTRIBUTE_SOURCE_ATTACHMENT_ROOT_PATH, path.toString());
|
||||
|
@ -209,7 +209,7 @@ public class LanguageSettingEntriesSerializer {
|
|||
element.setAttribute(ATTRIBUTE_SOURCE_ATTACHMENT_PREFIX_MAPPING, path.toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static String kindToString(int kind){
|
||||
switch(kind){
|
||||
case ICLanguageSettingEntry.INCLUDE_PATH:
|
||||
|
@ -261,25 +261,25 @@ public class LanguageSettingEntriesSerializer {
|
|||
if((flags & ICLanguageSettingEntry.READONLY) != 0){
|
||||
if(buf.length() != 0)
|
||||
buf.append(FLAGS_SEPARATOR);
|
||||
|
||||
|
||||
buf.append(READONLY);
|
||||
}
|
||||
if((flags & ICLanguageSettingEntry.LOCAL) != 0){
|
||||
if(buf.length() != 0)
|
||||
buf.append(FLAGS_SEPARATOR);
|
||||
|
||||
|
||||
buf.append(LOCAL);
|
||||
}
|
||||
if((flags & ICLanguageSettingEntry.VALUE_WORKSPACE_PATH) != 0){
|
||||
if(buf.length() != 0)
|
||||
buf.append(FLAGS_SEPARATOR);
|
||||
|
||||
|
||||
buf.append(VALUE_WORKSPACE_PATH);
|
||||
}
|
||||
if((flags & ICLanguageSettingEntry.RESOLVED) != 0){
|
||||
if(buf.length() != 0)
|
||||
buf.append(FLAGS_SEPARATOR);
|
||||
|
||||
|
||||
buf.append(RESOLVED);
|
||||
}
|
||||
if((flags & ICLanguageSettingEntry.UNDEFINED) != 0){
|
||||
|
@ -291,37 +291,40 @@ public class LanguageSettingEntriesSerializer {
|
|||
if((flags & ICLanguageSettingEntry.FRAMEWORKS_MAC) != 0){
|
||||
if(buf.length() != 0)
|
||||
buf.append(FLAGS_SEPARATOR);
|
||||
|
||||
|
||||
buf.append(FRAMEWORK);
|
||||
}
|
||||
return buf.toString();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @since 5.4
|
||||
*/
|
||||
public static int composeFlags(String flagsString){
|
||||
if(flagsString == null || flagsString.length() == 0)
|
||||
return 0;
|
||||
|
||||
|
||||
StringTokenizer tokenizer = new StringTokenizer(flagsString, FLAGS_SEPARATOR);
|
||||
int flags = 0;
|
||||
String f;
|
||||
while(tokenizer.hasMoreElements()){
|
||||
f = tokenizer.nextToken();
|
||||
if(BUILTIN.equals(f))
|
||||
flags |= ICLanguageSettingEntry.BUILTIN;
|
||||
flags |= ICLanguageSettingEntry.BUILTIN;
|
||||
if(READONLY.equals(f))
|
||||
flags |= ICLanguageSettingEntry.READONLY;
|
||||
flags |= ICLanguageSettingEntry.READONLY;
|
||||
if(LOCAL.equals(f))
|
||||
flags |= ICLanguageSettingEntry.LOCAL;
|
||||
flags |= ICLanguageSettingEntry.LOCAL;
|
||||
if(VALUE_WORKSPACE_PATH.equals(f))
|
||||
flags |= ICLanguageSettingEntry.VALUE_WORKSPACE_PATH;
|
||||
flags |= ICLanguageSettingEntry.VALUE_WORKSPACE_PATH;
|
||||
if(RESOLVED.equals(f))
|
||||
flags |= ICLanguageSettingEntry.RESOLVED;
|
||||
flags |= ICLanguageSettingEntry.RESOLVED;
|
||||
if(UNDEFINED.equals(f))
|
||||
flags |= ICLanguageSettingEntry.UNDEFINED;
|
||||
if(FRAMEWORK.equals(f))
|
||||
flags |= ICLanguageSettingEntry.FRAMEWORKS_MAC;
|
||||
}
|
||||
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
|
|
|
@ -15,6 +15,8 @@ package org.eclipse.cdt.core;
|
|||
* Helper abstract class serving as a base for creating a frame of executable class
|
||||
* defined as an extension in plugin.xml.
|
||||
*
|
||||
* @since 5.4
|
||||
*
|
||||
*/
|
||||
public abstract class AbstractExecutableExtensionBase {
|
||||
private String fId;
|
||||
|
|
|
@ -529,6 +529,8 @@ public class CCorePlugin extends Plugin {
|
|||
* </code>
|
||||
*
|
||||
* @return CDT console adapter.
|
||||
*
|
||||
* @since 5.4
|
||||
*/
|
||||
public IConsole getConsole(String extConsoleId, String contextId, String name, URL iconUrl) {
|
||||
try {
|
||||
|
|
|
@ -19,6 +19,8 @@ import org.eclipse.core.runtime.CoreException;
|
|||
* can be without configurations, in that case IProject should be passed
|
||||
* to startup somehow. Perhaps another interface "IPConsoleParser" could
|
||||
* be created when needed?
|
||||
*
|
||||
* @since 5.4
|
||||
*/
|
||||
public interface ICConsoleParser extends IConsoleParser {
|
||||
public void startup(ICConfigurationDescription cfgDescription) throws CoreException;
|
||||
|
|
|
@ -47,7 +47,7 @@ import org.eclipse.swt.graphics.Image;
|
|||
*
|
||||
* @noextend This class is not intended to be subclassed by clients.
|
||||
* @noinstantiate This class is not intended to be instantiated by clients.
|
||||
*
|
||||
*
|
||||
* @since 5.3
|
||||
*/
|
||||
public class CDTSharedImages {
|
||||
|
@ -116,6 +116,7 @@ public class CDTSharedImages {
|
|||
public static final String IMG_OBJS_INCLUDES_FOLDER_WORKSPACE = "icons/obj16/wsp_includefolder.gif"; //$NON-NLS-1$
|
||||
public static final String IMG_OBJS_QUOTE_INCLUDES_FOLDER = "icons/obj16/hfolder_quote_obj.gif"; //$NON-NLS-1$
|
||||
public static final String IMG_OBJS_INCLUDES_FOLDER_SYSTEM = "icons/obj16/fldr_sys_obj.gif"; //$NON-NLS-1$
|
||||
/** @since 5.4 */
|
||||
public static final String IMG_OBJS_FRAMEWORKS_FOLDER = "icons/obj16/frameworks.gif"; //$NON-NLS-1$
|
||||
public static final String IMG_OBJS_MACROS_FILE= "icons/obj16/macros_file.gif"; //$NON-NLS-1$
|
||||
public static final String IMG_OBJS_LIBRARY_FOLDER= "icons/obj16/fldr_lib_obj.gif"; // $NON-NLS-1$ //$NON-NLS-1$
|
||||
|
@ -185,21 +186,21 @@ public class CDTSharedImages {
|
|||
public static final String IMG_OVR_ERROR = "icons/ovr16/error_co.gif"; //$NON-NLS-1$
|
||||
public static final String IMG_OVR_SETTING = "icons/ovr16/setting_nav.gif"; //$NON-NLS-1$
|
||||
public static final String IMG_OVR_INACTIVE = "icons/ovr16/inactive_co.gif"; //$NON-NLS-1$
|
||||
|
||||
|
||||
// Pin & Clone
|
||||
public static final String IMG_THREAD_SUSPENDED_R_PINNED = "icons/obj16/threads_obj_r.gif"; //$NON-NLS-1$
|
||||
public static final String IMG_THREAD_SUSPENDED_G_PINNED = "icons/obj16/threads_obj_g.gif"; //$NON-NLS-1$
|
||||
public static final String IMG_THREAD_SUSPENDED_B_PINNED = "icons/obj16/threads_obj_b.gif"; //$NON-NLS-1$
|
||||
|
||||
|
||||
public static final String IMG_THREAD_RUNNING_R_PINNED = "icons/obj16/thread_obj_r.gif"; //$NON-NLS-1$
|
||||
public static final String IMG_THREAD_RUNNING_G_PINNED = "icons/obj16/thread_obj_g.gif"; //$NON-NLS-1$
|
||||
public static final String IMG_THREAD_RUNNING_B_PINNED = "icons/obj16/thread_obj_b.gif"; //$NON-NLS-1$
|
||||
|
||||
public static final String IMG_THREAD_RUNNING_B_PINNED = "icons/obj16/thread_obj_b.gif"; //$NON-NLS-1$
|
||||
|
||||
public static final String IMG_CONTAINER_SUSPENDED_R_PINNED = "icons/obj16/debugts_obj_r.gif"; //$NON-NLS-1$
|
||||
public static final String IMG_CONTAINER_SUSPENDED_G_PINNED = "icons/obj16/debugts_obj_g.gif"; //$NON-NLS-1$
|
||||
public static final String IMG_CONTAINER_SUSPENDED_B_PINNED = "icons/obj16/debugts_obj_b.gif"; //$NON-NLS-1$
|
||||
|
||||
public static final String IMG_CONTAINER_RUNNING_R_PINNED = "icons/obj16/debugt_obj_r.gif"; //$NON-NLS-1$
|
||||
|
||||
public static final String IMG_CONTAINER_RUNNING_R_PINNED = "icons/obj16/debugt_obj_r.gif"; //$NON-NLS-1$
|
||||
public static final String IMG_CONTAINER_RUNNING_G_PINNED = "icons/obj16/debugt_obj_g.gif"; //$NON-NLS-1$
|
||||
public static final String IMG_CONTAINER_RUNNING_B_PINNED = "icons/obj16/debugt_obj_b.gif"; //$NON-NLS-1$
|
||||
|
||||
|
@ -210,20 +211,34 @@ public class CDTSharedImages {
|
|||
public static final String IMG_VIEW_PIN_ACTION_MULTI = "icons/obj16/toolbar_pinned_multi.gif"; //$NON-NLS-1$
|
||||
|
||||
// Language Settings Images
|
||||
/** @since 5.4 */
|
||||
public static final String IMG_OBJS_LANG_SETTINGS_PROVIDER = "icons/obj16/ls_entries_provider.gif"; //$NON-NLS-1$
|
||||
/** @since 5.4 */
|
||||
public static final String IMG_ETOOL_PROJECT = "icons/etool16/prj_obj.gif"; //$NON-NLS-1$
|
||||
|
||||
/** @since 5.4 */
|
||||
public static final String IMG_OVR_GLOBAL = "icons/ovr16/global_ovr.gif"; //$NON-NLS-1$
|
||||
/** @since 5.4 */
|
||||
public static final String IMG_OVR_IMPORT = "icons/ovr16/import_co.gif"; //$NON-NLS-1$
|
||||
/** @since 5.4 */
|
||||
public static final String IMG_OVR_LINK = "icons/ovr16/link_ovr.gif"; //$NON-NLS-1$
|
||||
/** @since 5.4 */
|
||||
public static final String IMG_OVR_CONFIGURATION = "icons/ovr16/cfg_ovr.gif"; //$NON-NLS-1$
|
||||
/** @since 5.4 */
|
||||
public static final String IMG_OVR_PARENT = "icons/ovr16/path_inherit_co.gif"; //$NON-NLS-1$
|
||||
/** @since 5.4 */
|
||||
public static final String IMG_OVR_INDEXED = "icons/ovr16/indexedFile.gif"; //$NON-NLS-1$
|
||||
/** @since 5.4 */
|
||||
public static final String IMG_OVR_REFERENCE = "icons/ovr16/referencedby_co.gif"; //$NON-NLS-1$
|
||||
/** @since 5.4 */
|
||||
public static final String IMG_OVR_PROJECT = "icons/ovr16/project_co.gif"; //$NON-NLS-1$
|
||||
/** @since 5.4 */
|
||||
public static final String IMG_OVR_CONTEXT = "icons/ovr16/overlay-has-context.gif"; //$NON-NLS-1$
|
||||
/** @since 5.4 */
|
||||
public static final String IMG_OVR_LOCK = "icons/ovr16/lock_ovr.gif"; //$NON-NLS-1$
|
||||
/** @since 5.4 */
|
||||
public static final String IMG_OVR_EDITED = "icons/ovr16/edited_ov.gif"; //$NON-NLS-1$
|
||||
/** @since 5.4 */
|
||||
public static final String IMG_OVR_EMPTY = "icons/ovr16/empty_ovr.png"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
|
|
|
@ -64,71 +64,72 @@ import org.eclipse.cdt.internal.ui.dialogs.StatusInfo;
|
|||
import org.eclipse.cdt.internal.ui.newui.Messages;
|
||||
|
||||
/**
|
||||
* It is a parent for all standard property tabs
|
||||
* It is a parent for all standard property tabs
|
||||
* in new CDT model.
|
||||
*
|
||||
*
|
||||
* Although it's enough for new tabs to implement
|
||||
* ICPropertyTab interface only, it would be better
|
||||
* ICPropertyTab interface only, it would be better
|
||||
* to extend them from this class.
|
||||
*
|
||||
* In this case, we'll able to use:
|
||||
* - a lot of utility methods via "provider" link.
|
||||
* In particular, it allows to get current project,
|
||||
* configuration etc. See ICPropertyProvider interface.
|
||||
* configuration etc. See ICPropertyProvider interface.
|
||||
* - a standard way to create buttons (ins/edit/del etc)
|
||||
* and to handle their events (see buttonPressed(int))
|
||||
* - several utility methods to create widgets in the
|
||||
* uniform manner (setupLabel(), setupText() etc).
|
||||
* uniform manner (setupLabel(), setupText() etc).
|
||||
* - means to handle control messages which are the main
|
||||
* communication way for new CDT model pages and tabs.
|
||||
* communication way for new CDT model pages and tabs.
|
||||
*/
|
||||
public abstract class AbstractCPropertyTab implements ICPropertyTab {
|
||||
|
||||
|
||||
public static final Method GRAY_METHOD = getGrayEnabled();
|
||||
public static final int BUTTON_WIDTH = 120; // used as hint for all push buttons
|
||||
|
||||
// commonly used button names
|
||||
public static final String EMPTY_STR = ""; //$NON-NLS-1$
|
||||
public static final String ADD_STR = Messages.FileListControl_add;
|
||||
public static final String DEL_STR = Messages.FileListControl_delete;
|
||||
public static final String EDIT_STR = Messages.FileListControl_edit;
|
||||
public static final String MOVEUP_STR = Messages.FileListControl_moveup;
|
||||
public static final String MOVEDOWN_STR = Messages.FileListControl_movedown;
|
||||
public static final String PROJECTBUTTON_NAME = "Project...";
|
||||
public static final String WORKSPACEBUTTON_NAME = Messages.FileListControl_button_workspace;
|
||||
public static final String FILESYSTEMBUTTON_NAME = Messages.FileListControl_button_fs;
|
||||
public static final String VARIABLESBUTTON_NAME = Messages.AbstractCPropertyTab_1;
|
||||
public static final String FILESYSTEM_DIR_DIALOG_MSG = Messages.BrowseEntryDialog_fs_dir_dlg_msg;
|
||||
public static final String FILESYSTEM_FILE_DIALOG_TITLE = EMPTY_STR;
|
||||
public static final String WORKSPACE_DIR_DIALOG_TITLE = Messages.BrowseEntryDialog_wsp_dir_dlg_title;
|
||||
public static final String WORKSPACE_FILE_DIALOG_TITLE = Messages.BrowseEntryDialog_wsp_file_dlg_title;
|
||||
public static final String WORKSPACE_DIR_DIALOG_MSG = Messages.BrowseEntryDialog_wsp_dir_dlg_msg;
|
||||
public static final String WORKSPACE_FILE_DIALOG_MSG = Messages.BrowseEntryDialog_wsp_file_dlg_msg;
|
||||
public static final String WORKSPACE_FILE_DIALOG_ERR = Messages.BrowseEntryDialog_wsp_file_dlg_err;
|
||||
public static final String WORKSPACE_DIR_DIALOG_ERR = Messages.BrowseEntryDialog_wsp_dir_dlg_err;
|
||||
public static final String BACKGROUND_TEXT_DEFAULT = Messages.AbstractCPropertyTab_2;
|
||||
public static final String ADD_STR = Messages.FileListControl_add;
|
||||
public static final String DEL_STR = Messages.FileListControl_delete;
|
||||
public static final String EDIT_STR = Messages.FileListControl_edit;
|
||||
public static final String MOVEUP_STR = Messages.FileListControl_moveup;
|
||||
public static final String MOVEDOWN_STR = Messages.FileListControl_movedown;
|
||||
/** @since 5.4 */
|
||||
public static final String PROJECTBUTTON_NAME = "Project...";
|
||||
public static final String WORKSPACEBUTTON_NAME = Messages.FileListControl_button_workspace;
|
||||
public static final String FILESYSTEMBUTTON_NAME = Messages.FileListControl_button_fs;
|
||||
public static final String VARIABLESBUTTON_NAME = Messages.AbstractCPropertyTab_1;
|
||||
public static final String FILESYSTEM_DIR_DIALOG_MSG = Messages.BrowseEntryDialog_fs_dir_dlg_msg;
|
||||
public static final String FILESYSTEM_FILE_DIALOG_TITLE = EMPTY_STR;
|
||||
public static final String WORKSPACE_DIR_DIALOG_TITLE = Messages.BrowseEntryDialog_wsp_dir_dlg_title;
|
||||
public static final String WORKSPACE_FILE_DIALOG_TITLE = Messages.BrowseEntryDialog_wsp_file_dlg_title;
|
||||
public static final String WORKSPACE_DIR_DIALOG_MSG = Messages.BrowseEntryDialog_wsp_dir_dlg_msg;
|
||||
public static final String WORKSPACE_FILE_DIALOG_MSG = Messages.BrowseEntryDialog_wsp_file_dlg_msg;
|
||||
public static final String WORKSPACE_FILE_DIALOG_ERR = Messages.BrowseEntryDialog_wsp_file_dlg_err;
|
||||
public static final String WORKSPACE_DIR_DIALOG_ERR = Messages.BrowseEntryDialog_wsp_dir_dlg_err;
|
||||
public static final String BACKGROUND_TEXT_DEFAULT = Messages.AbstractCPropertyTab_2;
|
||||
public static final Color BACKGROUND_FOR_USER_VAR = new Color(Display.getDefault(), 255, 255, 200); // light yellow
|
||||
|
||||
private static final String PREFIX = "org.eclipse.cdt.ui."; //$NON-NLS-1$
|
||||
|
||||
|
||||
public static final int TRI_UNKNOWN = 2;
|
||||
public static final int TRI_YES = 1;
|
||||
public static final int TRI_NO = 0;
|
||||
|
||||
protected static final String ENUM = "enum"; //$NON-NLS-1$
|
||||
protected static final String SSET = "set"; //$NON-NLS-1$
|
||||
|
||||
|
||||
private PageBook pageBook; // to select between background and usercomp.
|
||||
private CLabel background;
|
||||
private Composite userdata;
|
||||
|
||||
protected Composite usercomp; // space where user can create widgets
|
||||
|
||||
protected Composite usercomp; // space where user can create widgets
|
||||
protected Composite buttoncomp; // space for buttons on the right
|
||||
private Button[] buttons; // buttons in buttoncomp
|
||||
public ICPropertyProvider page;
|
||||
protected Image icon = null;
|
||||
private String helpId = EMPTY_STR;
|
||||
|
||||
protected Image icon = null;
|
||||
private String helpId = EMPTY_STR;
|
||||
|
||||
protected boolean visible;
|
||||
|
||||
@Override
|
||||
|
@ -140,8 +141,8 @@ public abstract class AbstractCPropertyTab implements ICPropertyTab {
|
|||
/**
|
||||
* Creates basic widgets for property tab.
|
||||
* Descendants should, normally, override
|
||||
* this method but call super.createControls().
|
||||
*
|
||||
* this method but call super.createControls().
|
||||
*
|
||||
* @param parent
|
||||
*/
|
||||
protected void createControls(Composite parent) {
|
||||
|
@ -154,27 +155,27 @@ public abstract class AbstractCPropertyTab implements ICPropertyTab {
|
|||
GridData gd;
|
||||
userdata= new Composite(pageBook, SWT.NONE);
|
||||
userdata.setLayout(new GridLayout(2, false));
|
||||
|
||||
|
||||
usercomp = new Composite(userdata, SWT.NONE);
|
||||
usercomp.setLayoutData(gd= new GridData(GridData.FILL_BOTH));
|
||||
gd.widthHint= 150;
|
||||
|
||||
|
||||
buttoncomp = new Composite(userdata, SWT.NONE);
|
||||
buttoncomp.setLayoutData(gd= new GridData(GridData.END));
|
||||
// width hint must be set to one, otherwise subclasses that do not have buttons
|
||||
// don't look pretty, bug 242408
|
||||
gd.widthHint= 1;
|
||||
|
||||
|
||||
pageBook.showPage(userdata);
|
||||
|
||||
|
||||
PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, helpId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The common way to create buttons cluster
|
||||
* on the right of tab workspace.
|
||||
* @param names : array of button names
|
||||
* null instead of name means "skip place"
|
||||
* null instead of name means "skip place"
|
||||
*/
|
||||
protected void initButtons(String[] names) {
|
||||
initButtons(buttoncomp, names, 80);
|
||||
|
@ -182,7 +183,7 @@ public abstract class AbstractCPropertyTab implements ICPropertyTab {
|
|||
protected void initButtons(String[] names, int width) {
|
||||
initButtons(buttoncomp, names, width);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Ability to create standard button on any composite.
|
||||
* @param c
|
||||
|
@ -202,15 +203,15 @@ public abstract class AbstractCPropertyTab implements ICPropertyTab {
|
|||
gdb.grabExcessHorizontalSpace = false;
|
||||
gdb.horizontalAlignment = SWT.FILL;
|
||||
gdb.minimumWidth = width;
|
||||
|
||||
|
||||
if (names[i] != null)
|
||||
buttons[i].setText(names[i]);
|
||||
else { // no button, but placeholder !
|
||||
else { // no button, but placeholder !
|
||||
buttons[i].setVisible(false);
|
||||
buttons[i].setEnabled(false);
|
||||
gdb.heightHint = 10;
|
||||
}
|
||||
|
||||
|
||||
buttons[i].setLayoutData(gdb);
|
||||
buttons[i].addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
|
@ -220,15 +221,15 @@ public abstract class AbstractCPropertyTab implements ICPropertyTab {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Called when user changes
|
||||
* Called when user changes
|
||||
* @param cfg - selected configuration
|
||||
*/
|
||||
private void configChanged(ICResourceDescription cfg) {
|
||||
if (visible) updateData(cfg);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Disposes the SWT resources allocated by this dialog page.
|
||||
*/
|
||||
|
@ -245,13 +246,13 @@ public abstract class AbstractCPropertyTab implements ICPropertyTab {
|
|||
visible = _visible;
|
||||
if (visible) updateData(page.getResDesc());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Descendant tabs should implement this method so
|
||||
* that it copies it's data from one description
|
||||
* Descendant tabs should implement this method so
|
||||
* that it copies it's data from one description
|
||||
* to another. Only data affected by given tab
|
||||
* should be copied.
|
||||
*
|
||||
*
|
||||
* @param src
|
||||
* @param dst
|
||||
*/
|
||||
|
@ -273,32 +274,32 @@ public abstract class AbstractCPropertyTab implements ICPropertyTab {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Method should be rewritten to handle button presses
|
||||
* Method should be rewritten to handle button presses
|
||||
* @param i : number of button pressed
|
||||
*
|
||||
* Does nothing by default.
|
||||
*
|
||||
* Does nothing by default.
|
||||
* May (but not must) be overridden.
|
||||
*/
|
||||
protected void buttonPressed(int i) {}
|
||||
|
||||
|
||||
/**
|
||||
* Checks state of existing button.
|
||||
*
|
||||
*
|
||||
* @param i - button index
|
||||
* @return - true if button exists and enabled
|
||||
* @return - true if button exists and enabled
|
||||
*/
|
||||
protected boolean buttonIsEnabled(int i) {
|
||||
if (buttons == null || buttons.length <= i )
|
||||
if (buttons == null || buttons.length <= i )
|
||||
return false;
|
||||
return buttons[i].isEnabled();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Changes state of existing button.
|
||||
* Does nothing if index is invalid
|
||||
*
|
||||
*
|
||||
* @param i - button index
|
||||
* @param state - required state
|
||||
*/
|
||||
|
@ -306,11 +307,11 @@ public abstract class AbstractCPropertyTab implements ICPropertyTab {
|
|||
if (buttons == null || buttons.length <= i ) return;
|
||||
buttons[i].setEnabled(state);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Changes text of existing button
|
||||
* Does nothing if index is invalid
|
||||
*
|
||||
*
|
||||
* @param i - button index
|
||||
* @param text - text to display
|
||||
*/
|
||||
|
@ -346,13 +347,13 @@ public abstract class AbstractCPropertyTab implements ICPropertyTab {
|
|||
b.setLayoutData(g);
|
||||
return b;
|
||||
}
|
||||
|
||||
|
||||
protected Text setupText(Composite c, int span, int mode) {
|
||||
Text t = new Text(c, SWT.SINGLE | SWT.BORDER);
|
||||
setupControl(t, span, mode);
|
||||
return t;
|
||||
}
|
||||
|
||||
|
||||
protected Group setupGroup(Composite c, String name, int cols, int mode) {
|
||||
Group g = new Group(c, SWT.NONE);
|
||||
g.setText(name);
|
||||
|
@ -360,7 +361,7 @@ public abstract class AbstractCPropertyTab implements ICPropertyTab {
|
|||
setupControl(g, 1, mode);
|
||||
return g;
|
||||
}
|
||||
|
||||
|
||||
protected Button setupCheck(Composite c, String name, int span, int mode) {
|
||||
Button b = new Button(c, SWT.CHECK);
|
||||
b.setText(name);
|
||||
|
@ -376,23 +377,23 @@ public abstract class AbstractCPropertyTab implements ICPropertyTab {
|
|||
}
|
||||
|
||||
/**
|
||||
* Selection handler for checkbox created
|
||||
* by methods "setupCheck()" or "setupTri()"
|
||||
* Descendants should override this method
|
||||
* if they use "setupCheck".
|
||||
* Selection handler for checkbox created
|
||||
* by methods "setupCheck()" or "setupTri()"
|
||||
* Descendants should override this method
|
||||
* if they use "setupCheck".
|
||||
* Usually the method body will look like:
|
||||
* {
|
||||
* {
|
||||
* Control b = (Control)e.widget;
|
||||
* if (b.equals(myFirstCheckbox) { ... }
|
||||
* if (b.equals(myFirstCheckbox) { ... }
|
||||
* else if (b.equals(mySecondCheckbox) { ... }
|
||||
* ... }
|
||||
* ... }
|
||||
*/
|
||||
protected void checkPressed(SelectionEvent e) {
|
||||
}
|
||||
|
||||
protected void setupControl(Control c, int span, int mode) {
|
||||
// although we use GridLayout usually,
|
||||
// exceptions can occur: do nothing.
|
||||
// exceptions can occur: do nothing.
|
||||
if (c != null) {
|
||||
if (span != 0) {
|
||||
GridData gd = new GridData(mode);
|
||||
|
@ -403,11 +404,11 @@ public abstract class AbstractCPropertyTab implements ICPropertyTab {
|
|||
c.setFont(p.getFont());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* A set of methods providing selection dialogs for files or dirs.
|
||||
* A set of methods providing selection dialogs for files or dirs.
|
||||
*/
|
||||
|
||||
|
||||
public static String getFileSystemDirDialog(Shell shell, String text) {
|
||||
DirectoryDialog dialog = new DirectoryDialog(shell, SWT.OPEN|SWT.APPLICATION_MODAL);
|
||||
if(text != null && text.trim().length() != 0) dialog.setFilterPath(text);
|
||||
|
@ -432,12 +433,12 @@ public abstract class AbstractCPropertyTab implements ICPropertyTab {
|
|||
dialog.setText(FILESYSTEM_FILE_DIALOG_TITLE);
|
||||
return dialog.open();
|
||||
}
|
||||
|
||||
|
||||
public static String getVariableDialog(Shell shell, ICConfigurationDescription cfgd) {
|
||||
|
||||
|
||||
ICdtVariableManager vm = CCorePlugin.getDefault().getCdtVariableManager();
|
||||
BuildVarListDialog dialog = new BuildVarListDialog(shell, vm.getVariables(cfgd));
|
||||
dialog.setTitle(Messages.AbstractCPropertyTab_0);
|
||||
dialog.setTitle(Messages.AbstractCPropertyTab_0);
|
||||
if (dialog.open() == Window.OK) {
|
||||
Object[] selected = dialog.getResult();
|
||||
if (selected.length > 0) {
|
||||
|
@ -454,13 +455,19 @@ public abstract class AbstractCPropertyTab implements ICPropertyTab {
|
|||
public static String getWorkspaceFileDialog(Shell shell, String text) {
|
||||
return getWorkspaceDialog(shell, text, false, null);
|
||||
}
|
||||
/**
|
||||
* @since 5.4
|
||||
*/
|
||||
public static String getProjectDirDialog(Shell shell, String text, IProject prj) {
|
||||
return getWorkspaceDialog(shell, text, true, prj);
|
||||
}
|
||||
/**
|
||||
* @since 5.4
|
||||
*/
|
||||
public static String getProjectFileDialog(Shell shell, String text, IProject prj) {
|
||||
return getWorkspaceDialog(shell, text, false, prj);
|
||||
}
|
||||
|
||||
|
||||
private static String getWorkspaceDialog(Shell shell, String text, boolean dir, IProject prj) {
|
||||
String currentPathText;
|
||||
IPath path;
|
||||
|
@ -468,7 +475,7 @@ public abstract class AbstractCPropertyTab implements ICPropertyTab {
|
|||
/* Remove double quotes */
|
||||
currentPathText = currentPathText.replaceAll("\"", ""); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
path = new Path(currentPathText);
|
||||
|
||||
|
||||
ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(shell,
|
||||
new WorkbenchLabelProvider(), new WorkbenchContentProvider());
|
||||
|
||||
|
@ -477,7 +484,7 @@ public abstract class AbstractCPropertyTab implements ICPropertyTab {
|
|||
else
|
||||
dialog.setInput(prj);
|
||||
dialog.setComparator(new ResourceComparator(ResourceComparator.NAME));
|
||||
|
||||
|
||||
if (dir) {
|
||||
IResource container = null;
|
||||
if(path.isAbsolute()){
|
||||
|
@ -519,14 +526,14 @@ public abstract class AbstractCPropertyTab implements ICPropertyTab {
|
|||
}
|
||||
if (dialog.open() == Window.OK) {
|
||||
IResource resource = (IResource) dialog.getFirstResult();
|
||||
if (resource != null) {
|
||||
if (resource != null) {
|
||||
StringBuffer buf = new StringBuffer();
|
||||
return buf.append("${").append("workspace_loc:").append(resource.getFullPath()).append("}").toString(); //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
// shortcut to frequently-used method
|
||||
public ICResourceDescription getResDesc() {
|
||||
return page.getResDesc();
|
||||
|
@ -560,19 +567,19 @@ public abstract class AbstractCPropertyTab implements ICPropertyTab {
|
|||
dispose();
|
||||
break;
|
||||
case ICPropertyTab.VISIBLE:
|
||||
if (canBeVisible())
|
||||
if (canBeVisible())
|
||||
setVisible(data != null);
|
||||
else
|
||||
else
|
||||
setVisible(false);
|
||||
break;
|
||||
case ICPropertyTab.SET_ICON:
|
||||
icon = (Image)data;
|
||||
icon = (Image)data;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// By default, returns true (no visibility restriction)
|
||||
// But several pages should rewrite this functionality.
|
||||
@Override
|
||||
|
@ -594,20 +601,20 @@ public abstract class AbstractCPropertyTab implements ICPropertyTab {
|
|||
}
|
||||
|
||||
/**
|
||||
* Sets checkbox to appropriate state:
|
||||
* Sets checkbox to appropriate state:
|
||||
* unchecked or checked
|
||||
* @param b - checkbox to set
|
||||
* @param state
|
||||
* @param state
|
||||
*/
|
||||
public static void setTriSelection(Button b, boolean state) {
|
||||
setTriSelection(b, state ? TRI_YES : TRI_NO);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets checkbox to appropriate state:
|
||||
* Sets checkbox to appropriate state:
|
||||
* unchecked, checked or unknown (grayed)
|
||||
* @param b - checkbox to set
|
||||
* @param state
|
||||
* @param state
|
||||
*/
|
||||
public static void setTriSelection(Button b, int state) {
|
||||
switch (state) {
|
||||
|
@ -630,7 +637,7 @@ public abstract class AbstractCPropertyTab implements ICPropertyTab {
|
|||
* This method will be simplified after M5 release,
|
||||
* when Button.setGrayed() method will be accessible.
|
||||
* In this case, reflection will not be required.
|
||||
*
|
||||
*
|
||||
* @param b
|
||||
* @param value
|
||||
* @deprecated call {@link Button#setGrayed(boolean)} instead
|
||||
|
@ -643,7 +650,7 @@ public abstract class AbstractCPropertyTab implements ICPropertyTab {
|
|||
/**
|
||||
* This method will be removed after M5 release,
|
||||
* when Button.setGrayed() will be officially accessible.
|
||||
*
|
||||
*
|
||||
* @return reference to Button.setGrayed() method
|
||||
*/
|
||||
private static Method getGrayEnabled() {
|
||||
|
@ -659,8 +666,8 @@ public abstract class AbstractCPropertyTab implements ICPropertyTab {
|
|||
|
||||
/**
|
||||
* Utility method to show/hide working panes
|
||||
* When panes are hidden, message becomes visible
|
||||
*
|
||||
* When panes are hidden, message becomes visible
|
||||
*
|
||||
* @param visible - true or false
|
||||
* @param msg - text to be shown instead of panes
|
||||
*/
|
||||
|
@ -680,21 +687,21 @@ public abstract class AbstractCPropertyTab implements ICPropertyTab {
|
|||
b.setVisible(visible);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Allows changing message on background pane,
|
||||
* which becomes visible after usercomp hidden
|
||||
*
|
||||
* @param s - text to display or null for default
|
||||
*
|
||||
* @param s - text to display or null for default
|
||||
*/
|
||||
protected void setBackgroundText(String s) {
|
||||
background.setText(s == null ? BACKGROUND_TEXT_DEFAULT : s);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Used to display double-clickable buttons for multiple configurations
|
||||
* string list mode (see Multiple Configurations Edit Preference page).
|
||||
*
|
||||
*
|
||||
* @deprecated as of CDT 8.0. This functionality is presented as links
|
||||
* to the preference page, see {@link AbstractLangsListTab#updateStringListModeControl()}
|
||||
*/
|
||||
|
@ -721,7 +728,7 @@ public abstract class AbstractCPropertyTab implements ICPropertyTab {
|
|||
* The writing mode for multiple configurations edits (configuration drop-down list
|
||||
* in project properties). This mode applies to lists of entries.
|
||||
* See preference Multiple Configurations Edit, String List Write Mode.
|
||||
*
|
||||
*
|
||||
* @return
|
||||
* {@code true} if each list should be replaced as a whole with the
|
||||
* list user is currently working with in UI<br/>
|
||||
|
@ -736,12 +743,12 @@ public abstract class AbstractCPropertyTab implements ICPropertyTab {
|
|||
public String getHelpContextId() {
|
||||
return helpId;
|
||||
}
|
||||
|
||||
|
||||
public void setHelpContextId(String id) {
|
||||
helpId = PREFIX + id;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Allows subclasses to inform the container about changes relevant to the indexer.
|
||||
* The tab will be asked before the apply is performed. As a consequence of returning
|
||||
* <code>true</code> the user will be asked whether she wants to rebuild the index.
|
||||
|
|
|
@ -33,12 +33,14 @@ import org.eclipse.cdt.internal.ui.workingsets.WorkingSetConfigurationManager;
|
|||
public class CDTPrefUtil {
|
||||
// boolean keys (KEY_NO-s are to be inverted !)
|
||||
public static final String KEY_NOSUPP = "wizard.show.unsupported.disable"; //$NON-NLS-1$
|
||||
/** @since 5.4 */ // AG FIXME - remove before CDT Juno release
|
||||
public static final String KEY_NEWSD = "wizard.try.new.sd.enable"; //$NON-NLS-1$
|
||||
public static final String KEY_OTHERS = "wizard.group.others.enable"; //$NON-NLS-1$
|
||||
public static final String KEY_NOMNG = "properties.manage.config.disable"; //$NON-NLS-1$
|
||||
public static final String KEY_DTREE = "properties.data.hierarchy.enable"; //$NON-NLS-1$
|
||||
public static final String KEY_NOTOOLM = "properties.toolchain.modification.disable"; //$NON-NLS-1$
|
||||
public static final String KEY_EXPORT = "properties.export.page.enable"; //$NON-NLS-1$
|
||||
/** @since 5.4 */
|
||||
public static final String KEY_NO_SHOW_PROVIDERS = "properties.providers.tab.disable"; //$NON-NLS-1$
|
||||
/** @since 5.2 Show the "Include Files" settings entry tab */
|
||||
public static final String KEY_SHOW_INC_FILES = "properties.includefiles.page.enable"; //$NON-NLS-1$
|
||||
|
@ -52,34 +54,34 @@ public class CDTPrefUtil {
|
|||
public static final int POSITION_SAVE_SIZE = 0;
|
||||
public static final int POSITION_SAVE_NONE = 2;
|
||||
public static final int POSITION_SAVE_BOTH = 3;
|
||||
|
||||
|
||||
public static final String KEY_DISC_NAMES = "properties.discovery.naming"; //$NON-NLS-1$
|
||||
public static final int DISC_NAMING_UNIQUE_OR_BOTH = 0;
|
||||
public static final int DISC_NAMING_UNIQUE_OR_IDS = 1;
|
||||
public static final int DISC_NAMING_ALWAYS_BOTH = 2;
|
||||
public static final int DISC_NAMING_ALWAYS_IDS = 3;
|
||||
public static final int DISC_NAMING_DEFAULT = DISC_NAMING_UNIQUE_OR_BOTH;
|
||||
|
||||
|
||||
/** Property key used for string list display mode for multi-configuration edits (conjunction/disjunction) */
|
||||
public static final String KEY_DMODE = "properties.multi.displ.mode"; //$NON-NLS-1$
|
||||
/** Conjunction implies showing only common elements (intersection) */
|
||||
public static final int DMODE_CONJUNCTION = 1;
|
||||
/** Disjunction implies showing all elements (union) */
|
||||
public static final int DMODE_DISJUNCTION = 2;
|
||||
|
||||
|
||||
/** Property key used for string list write mode for multi-configuration edits (modify/replace) */
|
||||
public static final String KEY_WMODE = "properties.multi.write.mode"; //$NON-NLS-1$
|
||||
/** Modify implies changing only given elements and not changing any others */
|
||||
public static final int WMODE_MODIFY = 4;
|
||||
/** Replace implies replacing the whole list with the given one, overwriting old entries */
|
||||
public static final int WMODE_REPLACE = 8;
|
||||
|
||||
|
||||
public static final String NULL = "NULL"; //$NON-NLS-1$
|
||||
private static final IPreferenceStore pref = CUIPlugin.getDefault().getPreferenceStore();
|
||||
private static final String DELIMITER = " "; //$NON-NLS-1$
|
||||
public static final String CONFSETDEL = "\f"; //$NON-NLS-1$
|
||||
private static LinkedList<String> preferredTCs = null;
|
||||
|
||||
|
||||
public static final Object[] EMPTY_ARRAY = new Object[0];
|
||||
|
||||
// low-level methods
|
||||
|
@ -95,40 +97,40 @@ public class CDTPrefUtil {
|
|||
preferredTCs = new LinkedList<String>(Arrays.asList(getStr(KEY_PREFTC).split(DELIMITER)));
|
||||
}
|
||||
public static List<String> getPreferredTCs() {
|
||||
if (preferredTCs == null) readPreferredTCs();
|
||||
return preferredTCs;
|
||||
if (preferredTCs == null) readPreferredTCs();
|
||||
return preferredTCs;
|
||||
}
|
||||
public static void delPreferredTC(String s) {
|
||||
if (preferredTCs == null) readPreferredTCs();
|
||||
preferredTCs.remove(s);
|
||||
public static void delPreferredTC(String s) {
|
||||
if (preferredTCs == null) readPreferredTCs();
|
||||
preferredTCs.remove(s);
|
||||
}
|
||||
public static void addPreferredTC(String s) {
|
||||
if (preferredTCs == null) readPreferredTCs();
|
||||
if (!preferredTCs.contains(s)) preferredTCs.add(s);
|
||||
if (preferredTCs == null) readPreferredTCs();
|
||||
if (!preferredTCs.contains(s)) preferredTCs.add(s);
|
||||
}
|
||||
public static void cleanPreferredTCs() {
|
||||
setStr(KEY_PREFTC, IPreferenceStore.STRING_DEFAULT_DEFAULT);
|
||||
readPreferredTCs();
|
||||
readPreferredTCs();
|
||||
}
|
||||
public static void savePreferredTCs() {
|
||||
if (preferredTCs == null) return;
|
||||
if (preferredTCs == null) return;
|
||||
Iterator<String> it = preferredTCs.iterator();
|
||||
StringBuilder b = new StringBuilder();
|
||||
StringBuilder b = new StringBuilder();
|
||||
while (it.hasNext()) {
|
||||
String s = it.next();
|
||||
if (s == null) continue;
|
||||
if (s == null) continue;
|
||||
b.append(s);
|
||||
b.append(DELIMITER);
|
||||
}
|
||||
setStr(KEY_PREFTC, b.toString().trim());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns string list display mode for multi-configuration edits (conjunction/disjunction).
|
||||
*
|
||||
*
|
||||
* @return the mode which can be either {@link CDTPrefUtil#DMODE_CONJUNCTION} (default value)
|
||||
* or else {@link CDTPrefUtil#DMODE_DISJUNCTION}.
|
||||
*
|
||||
*
|
||||
* @since 5.3
|
||||
*/
|
||||
public static int getMultiCfgStringListDisplayMode() {
|
||||
|
@ -138,25 +140,25 @@ public class CDTPrefUtil {
|
|||
}
|
||||
return mode;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets string list display mode for multi-configuration edits (conjunction/disjunction).
|
||||
*
|
||||
*
|
||||
* @param mode must be either {@link CDTPrefUtil#DMODE_CONJUNCTION}
|
||||
* or {@link CDTPrefUtil#DMODE_DISJUNCTION}.
|
||||
*
|
||||
*
|
||||
* @since 5.3
|
||||
*/
|
||||
public static void setMultiCfgStringListDisplayMode(int mode) {
|
||||
setInt(KEY_DMODE, mode);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns string list write mode for multi-configuration edits (modify/replace).
|
||||
*
|
||||
*
|
||||
* @return the mode which can be either {@link CDTPrefUtil#WMODE_MODIFY} (default value)
|
||||
* or else {@link CDTPrefUtil#WMODE_REPLACE}.
|
||||
*
|
||||
*
|
||||
* @since 5.3
|
||||
*/
|
||||
public static int getMultiCfgStringListWriteMode() {
|
||||
|
@ -166,19 +168,19 @@ public class CDTPrefUtil {
|
|||
}
|
||||
return mode;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets string list write mode for multi-configuration edits (modify/replace).
|
||||
*
|
||||
*
|
||||
* @param mode must be either {@link CDTPrefUtil#WMODE_MODIFY}
|
||||
* or {@link CDTPrefUtil#WMODE_REPLACE}.
|
||||
*
|
||||
*
|
||||
* @since 5.3
|
||||
*/
|
||||
public static void setMultiCfgStringListWriteMode(int mode) {
|
||||
setInt(KEY_WMODE, mode);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @deprecated as of CDT 8.0. Use {@link StringListModeControl} to display string list modes.
|
||||
*/
|
||||
|
@ -187,15 +189,15 @@ public class CDTPrefUtil {
|
|||
String s = null;
|
||||
switch(getMultiCfgStringListDisplayMode()) {
|
||||
case DMODE_CONJUNCTION:
|
||||
s = Messages.EnvironmentTab_17;
|
||||
s = Messages.EnvironmentTab_17;
|
||||
break;
|
||||
case DMODE_DISJUNCTION:
|
||||
s = Messages.EnvironmentTab_18;
|
||||
s = Messages.EnvironmentTab_18;
|
||||
break;
|
||||
}
|
||||
return Messages.EnvironmentTab_19 + s;
|
||||
return Messages.EnvironmentTab_19 + s;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @deprecated as of CDT 8.0. Use {@link StringListModeControl} to display string list modes.
|
||||
*/
|
||||
|
@ -204,15 +206,15 @@ public class CDTPrefUtil {
|
|||
String s = null;
|
||||
switch(getMultiCfgStringListWriteMode()) {
|
||||
case WMODE_MODIFY:
|
||||
s = Messages.EnvironmentTab_24;
|
||||
s = Messages.EnvironmentTab_24;
|
||||
break;
|
||||
case WMODE_REPLACE:
|
||||
s = Messages.EnvironmentTab_21;
|
||||
s = Messages.EnvironmentTab_21;
|
||||
break;
|
||||
}
|
||||
return Messages.EnvironmentTab_22 + s;
|
||||
return Messages.EnvironmentTab_22 + s;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Toggle string list display mode: conjunction <-> disjunction.
|
||||
*/
|
||||
|
@ -242,21 +244,21 @@ public class CDTPrefUtil {
|
|||
public static final String[] getStrListForDisplay(String[][] input) {
|
||||
return getStrListForDisplay(input, getMultiCfgStringListDisplayMode());
|
||||
}
|
||||
|
||||
|
||||
private static final String[] getStrListForDisplay(String[][] input, int mode) {
|
||||
Object[] ob = getListForDisplay(input, getMultiCfgStringListDisplayMode(), null);
|
||||
String[] ss = new String[ob.length];
|
||||
System.arraycopy(ob, 0, ss, 0, ob.length);
|
||||
return ss;
|
||||
}
|
||||
|
||||
|
||||
public static final Object[] getListForDisplay(Object[][] input, Comparator<Object> cmp) {
|
||||
return getListForDisplay(input, getMultiCfgStringListDisplayMode(), cmp);
|
||||
}
|
||||
/**
|
||||
* Utility method forms string list
|
||||
* according to current list display mode
|
||||
*
|
||||
*
|
||||
* @param input - array of string arrays
|
||||
* @return
|
||||
*/
|
||||
|
@ -270,11 +272,11 @@ public class CDTPrefUtil {
|
|||
}
|
||||
|
||||
Object[] s1 = input[0];
|
||||
if (s1 == null ||
|
||||
if (s1 == null ||
|
||||
s1.length == 0)
|
||||
return EMPTY_ARRAY;
|
||||
if (getMultiCfgStringListDisplayMode() == DMODE_CONJUNCTION)
|
||||
{
|
||||
if (getMultiCfgStringListDisplayMode() == DMODE_CONJUNCTION)
|
||||
{
|
||||
ArrayList<Object> lst = new ArrayList<Object>();
|
||||
for (int i=0; i<s1.length; i++) {
|
||||
if (s1[i] == null)
|
||||
|
@ -309,7 +311,7 @@ public class CDTPrefUtil {
|
|||
Arrays.sort(s1, cmp);
|
||||
return s1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @deprecated Use the {@link WorkingSetConfigurationManager} class, instead.
|
||||
*/
|
||||
|
@ -317,15 +319,15 @@ public class CDTPrefUtil {
|
|||
public static List<String> readConfigSets() {
|
||||
return new LinkedList<String>(Arrays.asList(getStr(KEY_CONFSET).split(CONFSETDEL)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @deprecated Use the {@link WorkingSetConfigurationManager} class, instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public static void saveConfigSets(List<String> out) {
|
||||
StringBuilder b = new StringBuilder();
|
||||
StringBuilder b = new StringBuilder();
|
||||
for (String s : out) {
|
||||
if (s == null) continue;
|
||||
if (s == null) continue;
|
||||
b.append(s);
|
||||
b.append(CONFSETDEL);
|
||||
}
|
||||
|
|
|
@ -497,6 +497,10 @@ import org.eclipse.cdt.internal.ui.newui.Messages;
|
|||
return items;
|
||||
}
|
||||
|
||||
/**
|
||||
* AG FIXME - remove before CDT Juno release.
|
||||
* @since 5.4
|
||||
*/
|
||||
public boolean isTryingNewSD() {
|
||||
return checkBoxTryNewSD.getSelection();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue