Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Goldthorpe2009-02-03 18:21:01 +0000
committerChris Goldthorpe2009-02-03 18:21:01 +0000
commit1746b8167c52abdfe28f18872a4f44b123155c30 (patch)
treebe0b3c5f35bd89c2be1b7ead02c7e61681895068 /org.eclipse.ui.intro
parent3e7601e7a8242281f3268b96d8a7bf944420fe5e (diff)
downloadeclipse.platform.ua-1746b8167c52abdfe28f18872a4f44b123155c30.tar.gz
eclipse.platform.ua-1746b8167c52abdfe28f18872a4f44b123155c30.tar.xz
eclipse.platform.ua-1746b8167c52abdfe28f18872a4f44b123155c30.zip
Update to show paths to anchors
Diffstat (limited to 'org.eclipse.ui.intro')
-rw-r--r--org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/viewer/IntroModelLabelProvider.java30
1 files changed, 27 insertions, 3 deletions
diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/viewer/IntroModelLabelProvider.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/viewer/IntroModelLabelProvider.java
index 1adc3f9a2..77216a5f6 100644
--- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/viewer/IntroModelLabelProvider.java
+++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/viewer/IntroModelLabelProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -14,7 +14,9 @@ package org.eclipse.ui.internal.intro.impl.model.viewer;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.internal.intro.impl.model.AbstractIntroElement;
+import org.eclipse.ui.internal.intro.impl.model.AbstractIntroIdElement;
import org.eclipse.ui.internal.intro.impl.model.AbstractIntroPage;
+import org.eclipse.ui.internal.intro.impl.model.IntroAnchor;
import org.eclipse.ui.internal.intro.impl.model.IntroContentProvider;
import org.eclipse.ui.internal.intro.impl.model.IntroExtensionContent;
import org.eclipse.ui.internal.intro.impl.model.IntroGroup;
@@ -22,6 +24,8 @@ import org.eclipse.ui.internal.intro.impl.model.IntroHTML;
import org.eclipse.ui.internal.intro.impl.model.IntroImage;
import org.eclipse.ui.internal.intro.impl.model.IntroInclude;
import org.eclipse.ui.internal.intro.impl.model.IntroLink;
+import org.eclipse.ui.internal.intro.impl.model.IntroModelRoot;
+import org.eclipse.ui.internal.intro.impl.model.IntroPageTitle;
import org.eclipse.ui.internal.intro.impl.model.IntroPartPresentation;
import org.eclipse.ui.internal.intro.impl.model.IntroSeparator;
import org.eclipse.ui.internal.intro.impl.model.IntroText;
@@ -77,7 +81,7 @@ public class IntroModelLabelProvider extends LabelProvider {
int elementType = introElement.getType();
switch (elementType) {
case AbstractIntroElement.GROUP:
- label = "GROUP: " + ((IntroGroup) introElement).getLabel(); //$NON-NLS-1$
+ label = "GROUP: " + ((IntroGroup) introElement).getId(); //$NON-NLS-1$
break;
case AbstractIntroElement.LINK:
label = "LINK: " + ((IntroLink) introElement).getLabel(); //$NON-NLS-1$
@@ -103,7 +107,7 @@ public class IntroModelLabelProvider extends LabelProvider {
break;
case AbstractIntroElement.HOME_PAGE:
label = "HOME PAGE: " //$NON-NLS-1$
- + ((AbstractIntroPage) introElement).getTitle();
+ + ((AbstractIntroPage) introElement).getId();
break;
case AbstractIntroElement.PRESENTATION:
label = "PRESENTATION: " //$NON-NLS-1$
@@ -117,6 +121,14 @@ public class IntroModelLabelProvider extends LabelProvider {
case AbstractIntroElement.CONTAINER_EXTENSION:
label = "Unresolved ConfigExtension: " //$NON-NLS-1$
+ ((IntroExtensionContent) introElement).getPath();
+ break;
+ case AbstractIntroElement.ANCHOR:
+ label = "ANCHOR: " //$NON-NLS-1$
+ + getPath(introElement.getParent(), ((IntroAnchor) introElement).getId());
+ break;
+ case AbstractIntroElement.PAGE_TITLE:
+ label = "Title: " //$NON-NLS-1$
+ + ((IntroPageTitle) introElement).getTitle();
break;
default:
label = super.getText(element);
@@ -125,4 +137,16 @@ public class IntroModelLabelProvider extends LabelProvider {
return label;
}
+ private String getPath(AbstractIntroElement introElement, String suffix) {
+ if (introElement == null || introElement instanceof IntroModelRoot) {
+ return suffix;
+ }
+ String newSuffix = suffix;
+ if (introElement instanceof AbstractIntroIdElement) {
+ newSuffix = ((AbstractIntroIdElement)introElement).getId() + '/' + suffix;
+ }
+ return getPath(introElement.getParent(), newSuffix);
+
+ }
+
}

Back to the top