mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-22 06:02:11 +02:00
Cosmetics.
This commit is contained in:
parent
9f79b897c1
commit
e901d4a7d4
1 changed files with 14 additions and 15 deletions
|
@ -21,11 +21,11 @@ import java.util.Iterator;
|
||||||
*
|
*
|
||||||
* @noextend This class is not intended to be extended by clients.
|
* @noextend This class is not intended to be extended by clients.
|
||||||
*/
|
*/
|
||||||
public class ListProblemPreference extends AbstractProblemPreference implements IProblemPreferenceCompositeValue,
|
public class ListProblemPreference extends AbstractProblemPreference
|
||||||
IProblemPreferenceCompositeDescriptor {
|
implements IProblemPreferenceCompositeValue, IProblemPreferenceCompositeDescriptor {
|
||||||
/**
|
/**
|
||||||
* Constant that represent a key for "shared" child preference (descriptor)
|
* Constant that represent a key for "shared" child preference (descriptor)
|
||||||
* of all elements
|
* of all elements.
|
||||||
*/
|
*/
|
||||||
public static final String COMMON_DESCRIPTOR_KEY = "#"; //$NON-NLS-1$
|
public static final String COMMON_DESCRIPTOR_KEY = "#"; //$NON-NLS-1$
|
||||||
protected ArrayList<Object> list = new ArrayList<Object>();
|
protected ArrayList<Object> list = new ArrayList<Object>();
|
||||||
|
@ -48,7 +48,7 @@ public class ListProblemPreference extends AbstractProblemPreference implements
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set child descriptor (all elements have the same). Value and key
|
* Sets child descriptor (all elements have the same). Value and key
|
||||||
* of it would be ignored and reset.
|
* of it would be ignored and reset.
|
||||||
*
|
*
|
||||||
* @param desc
|
* @param desc
|
||||||
|
@ -80,7 +80,6 @@ public class ListProblemPreference extends AbstractProblemPreference implements
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @return descriptor of the child elements
|
* @return descriptor of the child elements
|
||||||
*/
|
*/
|
||||||
public IProblemPreference getChildDescriptor() {
|
public IProblemPreference getChildDescriptor() {
|
||||||
|
@ -106,8 +105,7 @@ public class ListProblemPreference extends AbstractProblemPreference implements
|
||||||
* Get read only problem preference for element equal to key's int value.
|
* Get read only problem preference for element equal to key's int value.
|
||||||
* If key is null or # return generic descriptor with null value.
|
* If key is null or # return generic descriptor with null value.
|
||||||
*
|
*
|
||||||
* @throws NumberFormatException
|
* @throws NumberFormatException if key is not number
|
||||||
* if key is not number
|
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public IProblemPreference getChildDescriptor(String key) throws NumberFormatException {
|
public IProblemPreference getChildDescriptor(String key) throws NumberFormatException {
|
||||||
|
@ -126,7 +124,7 @@ public class ListProblemPreference extends AbstractProblemPreference implements
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return array of clones values of child preferences.
|
* Returns array of clones values of child preferences.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public IProblemPreference[] getChildDescriptors() {
|
public IProblemPreference[] getChildDescriptors() {
|
||||||
|
@ -219,7 +217,7 @@ public class ListProblemPreference extends AbstractProblemPreference implements
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void importValue(String str) {
|
public void importValue(String str) {
|
||||||
if (str.length()==0) return;
|
if (str.isEmpty()) return;
|
||||||
StreamTokenizer tokenizer = getImportTokenizer(str);
|
StreamTokenizer tokenizer = getImportTokenizer(str);
|
||||||
try {
|
try {
|
||||||
importValue(tokenizer);
|
importValue(tokenizer);
|
||||||
|
@ -239,10 +237,11 @@ public class ListProblemPreference extends AbstractProblemPreference implements
|
||||||
if (token != '(')
|
if (token != '(')
|
||||||
throw new IllegalArgumentException(chara);
|
throw new IllegalArgumentException(chara);
|
||||||
token = tokenizer.nextToken();
|
token = tokenizer.nextToken();
|
||||||
if (token != ')')
|
if (token != ')') {
|
||||||
tokenizer.pushBack();
|
tokenizer.pushBack();
|
||||||
else
|
} else {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
while (true) {
|
while (true) {
|
||||||
String ik = String.valueOf(index);
|
String ik = String.valueOf(index);
|
||||||
IProblemPreference desc = getChildDescriptor(ik);
|
IProblemPreference desc = getChildDescriptor(ik);
|
||||||
|
@ -263,16 +262,16 @@ public class ListProblemPreference extends AbstractProblemPreference implements
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If info key is '#' resets common descriptor to null, otherwise removes
|
* If info key is '#' resets common descriptor to null, otherwise removes value.
|
||||||
* value
|
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void removeChildDescriptor(IProblemPreference info) {
|
public void removeChildDescriptor(IProblemPreference info) {
|
||||||
if (info.getKey().equals(COMMON_DESCRIPTOR_KEY))
|
if (info.getKey().equals(COMMON_DESCRIPTOR_KEY)) {
|
||||||
setChildDescriptor(null);
|
setChildDescriptor(null);
|
||||||
else
|
} else {
|
||||||
removeChildValue(info.getKey());
|
removeChildValue(info.getKey());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return children size
|
* @return children size
|
||||||
|
|
Loading…
Add table
Reference in a new issue