Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarsten Thoms2017-11-14 17:05:18 +0000
committerAlexander Kurtakov2017-11-21 16:42:15 +0000
commit9119eed8ef0e4f698df4f540967197074d49a785 (patch)
tree681998b0aa5694b785d0b2ef0222e36b5ae770b7
parentfd699c1f9f4fb7524aa0b18db3ca45b8ad223494 (diff)
downloadeclipse.platform.ua-I20171126-2000.tar.gz
eclipse.platform.ua-I20171126-2000.tar.xz
eclipse.platform.ua-I20171126-2000.zip
Change-Id: Icb01b5aea72cc6423324ffbeb5a829e5903c5d33 Signed-off-by: Karsten Thoms <karsten.thoms@itemis.de>
-rw-r--r--org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroModelRoot.java89
1 files changed, 46 insertions, 43 deletions
diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroModelRoot.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroModelRoot.java
index 34e6d875d..272713f6c 100644
--- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroModelRoot.java
+++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroModelRoot.java
@@ -278,21 +278,24 @@ public class IntroModelRoot extends AbstractIntroContainer {
}
private void determineHomePage() {
- String pid = Platform.getProduct().getId();
- startPageId = getProcessPreference("INTRO_START_PAGE", pid); //$NON-NLS-1$
- String homePagePreference = getProcessPreference("INTRO_HOME_PAGE", pid); //$NON-NLS-1$
- homePage = rootPage; // Default, may be overridden
- if (homePagePreference.length() != 0) {
- AbstractIntroPage page = (AbstractIntroPage) findChild(homePagePreference,
- ABSTRACT_PAGE);
- if (page != null) {
- homePage = page;
- if(startPageId.length() == 0) {
- startPageId = homePagePreference;
- }
- }
- }
- String standbyPagePreference = getProcessPreference("INTRO_STANDBY_PAGE", pid); //$NON-NLS-1$
+ homePage = rootPage; // Default, may be overridden
+ if (Platform.getProduct() == null) {
+ return;
+ }
+ String pid = Platform.getProduct().getId();
+ startPageId = getProcessPreference("INTRO_START_PAGE", pid); //$NON-NLS-1$
+ String homePagePreference = getProcessPreference("INTRO_HOME_PAGE", pid); //$NON-NLS-1$
+ if (homePagePreference.length() != 0) {
+ AbstractIntroPage page = (AbstractIntroPage) findChild(homePagePreference,
+ ABSTRACT_PAGE);
+ if (page != null) {
+ homePage = page;
+ if(startPageId.length() == 0) {
+ startPageId = homePagePreference;
+ }
+ }
+ }
+ String standbyPagePreference = getProcessPreference("INTRO_STANDBY_PAGE", pid); //$NON-NLS-1$
modelStandbyPageId = getPresentation().getStandbyPageId();
if (standbyPagePreference.length() != 0) {
@@ -309,34 +312,34 @@ public class IntroModelRoot extends AbstractIntroContainer {
}
private void loadTheme() {
- String pid = Platform.getProduct().getId();
- String themeId = getProcessPreference("INTRO_THEME", pid); //$NON-NLS-1$
-
- IConfigurationElement [] elements = Platform.getExtensionRegistry().getConfigurationElementsFor("org.eclipse.ui.intro.configExtension"); //$NON-NLS-1$
- IConfigurationElement themeElement=null;
- for (int i=0; i<elements.length; i++) {
- if (elements[i].getName().equals("theme")) { //$NON-NLS-1$
- String id = elements[i].getAttribute("id"); //$NON-NLS-1$
- if (themeId!=null) {
- if (id!=null && themeId.equals(id)) {
- // use this one
- themeElement = elements[i];
- break;
- }
- }
- else {
- // see if this one is the default
- String value = elements[i].getAttribute("default"); //$NON-NLS-1$
- if (value!=null && value.equalsIgnoreCase("true")) { //$NON-NLS-1$
- themeElement = elements[i];
- break;
- }
- }
- }
- }
- if (themeElement!=null) {
- theme = new IntroTheme(themeElement);
- }
+ String pid = Platform.getProduct() != null ? Platform.getProduct().getId() : null;
+ String themeId = pid != null ? getProcessPreference("INTRO_THEME", pid) : null; //$NON-NLS-1$
+
+ IConfigurationElement [] elements = Platform.getExtensionRegistry().getConfigurationElementsFor("org.eclipse.ui.intro.configExtension"); //$NON-NLS-1$
+ IConfigurationElement themeElement=null;
+ for (int i=0; i<elements.length; i++) {
+ if (elements[i].getName().equals("theme")) { //$NON-NLS-1$
+ String id = elements[i].getAttribute("id"); //$NON-NLS-1$
+ if (themeId!=null) {
+ if (id!=null && themeId.equals(id)) {
+ // use this one
+ themeElement = elements[i];
+ break;
+ }
+ }
+ else {
+ // see if this one is the default
+ String value = elements[i].getAttribute("default"); //$NON-NLS-1$
+ if (value!=null && value.equalsIgnoreCase("true")) { //$NON-NLS-1$
+ themeElement = elements[i];
+ break;
+ }
+ }
+ }
+ }
+ if (themeElement!=null) {
+ theme = new IntroTheme(themeElement);
+ }
}
/**

Back to the top