1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Bug 461545 Add support of attribute isDisplayable to the Build Property

of a tool and implement the new interface method.

Change-Id: Iee645519c1bf9fbe144021bc81bd6cf7434c3e4b
Signed-off-by: Guy Bonneau <guy.bonneau@videotron.ca>
This commit is contained in:
Guy Bonneau 2015-03-05 20:14:49 -05:00 committed by Gerrit Code Review @ Eclipse.org
parent ebf041caef
commit 8cfa1448ac
7 changed files with 98 additions and 14 deletions

View file

@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.managedbuilder.core; singleton:=true
Bundle-Version: 8.3.0.qualifier
Bundle-Version: 8.4.0.qualifier
Bundle-Activator: org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin

View file

@ -11,7 +11,7 @@
<relativePath>../../pom.xml</relativePath>
</parent>
<version>8.3.0-SNAPSHOT</version>
<version>8.4.0-SNAPSHOT</version>
<artifactId>org.eclipse.cdt.managedbuilder.core</artifactId>
<packaging>eclipse-plugin</packaging>
</project>

View file

@ -810,6 +810,13 @@ The pathConverter of a toolchain applies for all tools of the toolchain except i
</documentation>
</annotation>
</attribute>
<attribute name="isHidden" type="boolean">
<annotation>
<documentation>
Specifies whether or not the tool is hidden within the setting tab of the user interface. This attribute should be set to true when a tool is internal to the toolchain and options cannot be changed by the user. Default value is false.
</documentation>
</annotation>
</attribute>
</complexType>
</element>
@ -1618,12 +1625,14 @@ If no order is defined a default order is assumed, see &quot;org.eclipse.cdt.man
<attribute name="id" type="string" use="required">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="name" type="string" use="required">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
@ -2574,15 +2583,6 @@ The only difference between this element and the resourceConfiguration is that r
</complexType>
</element>
<annotation>
<appInfo>
<meta.section type="apiInfo"/>
</appInfo>
<documentation>
[Enter API information here.]
</documentation>
</annotation>
<annotation>
<appInfo>
<meta.section type="since"/>
@ -2601,6 +2601,15 @@ The only difference between this element and the resourceConfiguration is that r
</documentation>
</annotation>
<annotation>
<appInfo>
<meta.section type="apiInfo"/>
</appInfo>
<documentation>
[Enter API information here.]
</documentation>
</annotation>
<annotation>
<appInfo>
<meta.section type="implementation"/>

View file

@ -47,6 +47,10 @@ public interface ITool extends IHoldsOptions {
public static final String WHITE_SPACE = " "; //$NON-NLS-1$
public static final String EMPTY_STRING = ""; //$NON-NLS-1$
public static final String IS_SYSTEM = "isSystem"; //$NON-NLS-1$
/**
* @since 8.4
*/
public static final String IS_HIDDEN = "isHidden"; //$NON-NLS-1$
public static final String VERSIONS_SUPPORTED = "versionsSupported"; //$NON-NLS-1$
public static final String CONVERT_TO_ID = "convertToId"; //$NON-NLS-1$
@ -697,5 +701,15 @@ public interface ITool extends IHoldsOptions {
boolean isSystemObject();
/**
* @since 8.4
*/
boolean isHidden();
/**
* @since 8.4
*/
void setHidden(boolean hidden);
String getUniqueRealName();
}

View file

@ -155,6 +155,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
private IOptionPathConverter optionPathConverter = null ;
private SupportedProperties supportedProperties;
private Boolean supportsManagedBuild;
private Boolean isHidden;
private boolean isTest;
// Miscellaneous
private boolean isExtensionTool = false;
@ -442,6 +443,9 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
if (tool.announcement != null) {
announcement = new String(tool.announcement);
}
if (tool.isHidden != null) {
isHidden = tool.isHidden;
}
supportsManagedBuild = tool.supportsManagedBuild;
@ -579,6 +583,9 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
if (announcement == null) {
announcement = tool.announcement;
}
if (isHidden == null) {
isHidden = tool.isHidden;
}
if(supportsManagedBuild == null)
supportsManagedBuild = tool.supportsManagedBuild;
@ -791,6 +798,12 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
if(tmp != null)
supportsManagedBuild = Boolean.valueOf(tmp);
// isHidden
String hidden = element.getAttribute(ITool.IS_HIDDEN);
if (hidden != null) {
isHidden = Boolean.valueOf(hidden);
}
scannerConfigDiscoveryProfileId = SafeStringInterner.safeIntern(element.getAttribute(IToolChain.SCANNER_CONFIG_PROFILE_ID));
tmp = element.getAttribute(IS_SYSTEM);
@ -931,6 +944,14 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
if (element.getAttribute(ITool.ANNOUNCEMENT) != null) {
announcement = SafeStringInterner.safeIntern(element.getAttribute(ITool.ANNOUNCEMENT));
}
// Get the tool hidden setting
if (element.getAttribute(ITool.IS_HIDDEN) != null) {
String hidden = element.getAttribute(ITool.IS_HIDDEN);
if(hidden != null) {
isHidden = Boolean.valueOf(hidden);
}
}
// icon - was saved as URL in string form
if (element.getAttribute(IOptionCategory.ICON) != null) {
@ -1084,6 +1105,11 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
if (announcement != null) {
element.setAttribute(ITool.ANNOUNCEMENT, announcement);
}
// hidden tool
if (isHidden != null) {
element.setAttribute(ITool.IS_HIDDEN, isHidden.toString());
}
// Serialize elements from my super class
super.serialize(element);
@ -2528,6 +2554,15 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
setDirty(true);
}
}
@Override
public void setHidden(boolean hidden) {
if (isHidden == null || !(hidden == isHidden.booleanValue())) {
isHidden = hidden;
setDirty(true);
}
}
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.ITool#getCommandFlags()
@ -3890,6 +3925,17 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
return ((IToolChain)bo).isSystemObject();
return false;
}
@Override
public boolean isHidden() {
if (isHidden == null) {
if (getSuperClass() != null) {
return getSuperClass().isHidden();
}
return false; // default is false
}
return isHidden.booleanValue();
}
@Override
public String getUniqueRealName() {
@ -4032,6 +4078,9 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
if(announcement != null && !announcement.equals(superTool.getAnnouncement()))
return true;
if(isHidden != null && isHidden.booleanValue() != superTool.isHidden())
return true;
if(discoveredInfoMap != null && discoveredInfoMap.size() != 0)
return true;

View file

@ -1222,6 +1222,16 @@ public class ToolReference implements IToolReference {
@Override
public void addOptionCategory(IOptionCategory category) {
}
@Override
public void setHidden(boolean hidden) {
}
@Override
public boolean isHidden() {
return false;
}
/*
* The following methods are added to allow the converter from ToolReference -> Tool

View file

@ -67,9 +67,11 @@ public class ToolListContentProvider implements ITreeContentProvider{
filteredTools = config.getFilteredTools();
// Create an element for each one
for (int i=0; i<filteredTools.length; i++) {
ToolListElement e = new ToolListElement(filteredTools[i]);
elementList.add(e);
createChildElements(e,config);
if(!filteredTools[i].isHidden()) {
ToolListElement e = new ToolListElement(filteredTools[i]);
elementList.add(e);
createChildElements(e,config);
}
}
}
return elementList.toArray(new ToolListElement[elementList.size()]);