am b8a74f45: ADT: Fix some potential NPE in the configuration composite.
Merge commit 'b8a74f45519830f2695b74f39fc9097659e28969' * commit 'b8a74f45519830f2695b74f39fc9097659e28969': ADT: Fix some potential NPE in the configuration composite.
This commit is contained in:
@@ -57,6 +57,9 @@ import java.util.Map;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.SortedSet;
|
import java.util.SortedSet;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A composite that displays the current configuration displayed in a Graphical Layout Editor.
|
||||||
|
*/
|
||||||
public class ConfigurationComposite extends Composite {
|
public class ConfigurationComposite extends Composite {
|
||||||
|
|
||||||
private final static String THEME_SEPARATOR = "----------"; //$NON-NLS-1$
|
private final static String THEME_SEPARATOR = "----------"; //$NON-NLS-1$
|
||||||
@@ -90,6 +93,12 @@ public class ConfigurationComposite extends Composite {
|
|||||||
|
|
||||||
private final IConfigListener mListener;
|
private final IConfigListener mListener;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Interface implemented by the part which owns a {@link ConfigurationComposite}.
|
||||||
|
* This notifies the owners when the configuration change.
|
||||||
|
* The owner must also provide methods to provide the configuration that will
|
||||||
|
* be displayed.
|
||||||
|
*/
|
||||||
public interface IConfigListener {
|
public interface IConfigListener {
|
||||||
void onConfigurationChange();
|
void onConfigurationChange();
|
||||||
void onThemeChange();
|
void onThemeChange();
|
||||||
@@ -386,7 +395,7 @@ public class ConfigurationComposite extends Composite {
|
|||||||
mLocale.add("Default");
|
mLocale.add("Default");
|
||||||
mLocaleList.add(new ResourceQualifier[] { null, null });
|
mLocaleList.add(new ResourceQualifier[] { null, null });
|
||||||
|
|
||||||
if (languages != null && languages.size() > 0) {
|
if (project != null && languages != null && languages.size() > 0) {
|
||||||
for (String language : languages) {
|
for (String language : languages) {
|
||||||
// first the language alone
|
// first the language alone
|
||||||
mLocale.add(language);
|
mLocale.add(language);
|
||||||
@@ -402,7 +411,6 @@ public class ConfigurationComposite extends Composite {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mDisableUpdates = false;
|
mDisableUpdates = false;
|
||||||
@@ -701,6 +709,7 @@ public class ConfigurationComposite extends Composite {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (parentStyle != null) {
|
||||||
if (frameworkStyle) {
|
if (frameworkStyle) {
|
||||||
// if the parent is a framework style, it has to be 'Theme' or 'Theme.*'
|
// if the parent is a framework style, it has to be 'Theme' or 'Theme.*'
|
||||||
return parentStyle.equals("Theme") || parentStyle.startsWith("Theme.");
|
return parentStyle.equals("Theme") || parentStyle.startsWith("Theme.");
|
||||||
@@ -712,6 +721,7 @@ public class ConfigurationComposite extends Composite {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user