diff options
author | Mazen Faraj | 2004-06-19 18:01:50 +0000 |
---|---|---|
committer | Mazen Faraj | 2004-06-19 18:01:50 +0000 |
commit | 53d4e16ec8d823c808c048a87166fdf294aedffa (patch) | |
tree | 88885d87906bf6e822508111cd890573f9c601cf | |
parent | ef84e7176634f48aa24dafe7bb83a6b79c40750c (diff) | |
download | eclipse.platform.ua-53d4e16ec8d823c808c048a87166fdf294aedffa.tar.gz eclipse.platform.ua-53d4e16ec8d823c808c048a87166fdf294aedffa.tar.xz eclipse.platform.ua-53d4e16ec8d823c808c048a87166fdf294aedffa.zip |
3 files changed, 52 insertions, 15 deletions
diff --git a/org.eclipse.ui.intro/empty_swt.properties b/org.eclipse.ui.intro/empty_swt.properties index 92022d94a..43de2ac13 100644 --- a/org.eclipse.ui.intro/empty_swt.properties +++ b/org.eclipse.ui.intro/empty_swt.properties @@ -14,17 +14,13 @@ ! ---------------------------------------- title.image = <file name> title.image.repeat = true/false - - ! Flag to display Root page navigation links. Default is true. - ! Note: this flag can be specified at the page level too. - ! --------------------------------------- - show-home-page-navigation = true/false ! Flag to display the Home Page using custom layout. Default is true. ! ---------------------------------------- home-page-custom-layout = true/false - + + ! Home Page settings ! ------------------ @@ -52,13 +48,22 @@ <homePageId>.<linkId>.small-hover-icon = <relative file name> + + ! Page settings ! ------------- +! Note: in any of the page settings, if the <pageId> is ommitted and the +! property starts with a ".", then this property applies to this whole page, +! and to any page that inherits the properties of this page. So in effect, +! this property becomes like a shared property. + ! Flag to display link description in a given page. Default is true. <pageId>.show-link-description = true/false + .show-link-description = true/false ! Flag to display Root page navigation links in a given page. Default is true. <pageId>.show-home-page-navigation = true/false + .show-home-page-navigation = true/false ! Layout: ! ------- @@ -77,11 +82,13 @@ ! Icons: ! ------ - ! default icon used for all links in the page. + ! default icon/hover icon used for all links in the page. <pageId>.link-icon = <relative file name> - ! icon for specific link. - <pageId>.<path_to_link>.link-icon = <relative file name> + <pageId>.hover-icon = <relative file name> + ! icon/hover icon for specific link/Image link. + <pageId>.<path_to_link>.link-icon = <relative file name> + <pageId>.<path_to_link>.hover-icon = <relative file name> ! Sub Title: diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/swt/PageStyleManager.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/swt/PageStyleManager.java index 57284f115..b84bb532f 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/swt/PageStyleManager.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/swt/PageStyleManager.java @@ -58,16 +58,34 @@ public class PageStyleManager extends SharedStyleManager { root = (IntroModelRoot) page.getParentPage().getParent(); } - // Override parent method to include alt styles. + + // Override parent method to include alt-styles. Use implicit keys as well. public String getProperty(String key) { + return getProperty(key, true); + } + + // Override parent method to include alt-styles. If useImplicit is true, we + // try to resolve a key without its pageId. + private String getProperty(String key, boolean useImplicitKey) { Properties aProperties = findPropertyOwner(key); - return super.doGetProperty(aProperties, key); + String value = super.doGetProperty(aProperties, key); + if (useImplicitKey) { + if (value == null && page.getId() != null + && key.startsWith(page.getId())) { + // did not find the key as-is. Trim pageId and try again. + String relativeKey = key.substring(page.getId().length()); + return getProperty(relativeKey); + } + } + return value; } /** * Finds a Properties that represents an inherited shared style, or this - * current pages style. + * current pages style. If the given key is not found, the pageId is trimmed + * from the begining of the key, and the key is looked up again. If key does + * not start with a pageId, lookup only the key as is. * * @param key * @return @@ -309,7 +327,7 @@ public class PageStyleManager extends SharedStyleManager { String key = page.getId() + ".show-link-description"; //$NON-NLS-1$ String value = getProperty(key); if (value == null) { - key = "show-link-description"; + key = ".show-link-description"; value = getProperty(key); } if (value == null) @@ -321,7 +339,7 @@ public class PageStyleManager extends SharedStyleManager { String key = page.getId() + ".show-home-page-navigation"; //$NON-NLS-1$ String value = getProperty(key); if (value == null) { - key = "show-home-page-navigation"; + key = ".show-home-page-navigation"; value = getProperty(key); } if (value == null) @@ -375,7 +393,17 @@ public class PageStyleManager extends SharedStyleManager { */ public Image getImage(IntroLink link, String qualifier, String defaultKey) { String key = createImageKey(page, link, qualifier); + // special case where we have to handle this because extended code does + // not go through getProperty() in this method. + String value = getProperty(key, false); + if (value == null && page.getId() != null + && key.startsWith(page.getId())) + // did not use the key as-is. Trim pageId and try again. + key = key.substring(page.getId().length()); + + // pageKey can not become an implicit key. String pageKey = createImageKey(page, null, qualifier); + return getImage(key, pageKey, defaultKey); } diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/swt/PageWidgetFactory.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/swt/PageWidgetFactory.java index f49ffcb92..eeb1b746e 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/swt/PageWidgetFactory.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/swt/PageWidgetFactory.java @@ -194,6 +194,7 @@ public class PageWidgetFactory { boolean showLinkDescription = styleManager.getShowLinkDescription(); Image linkImage = styleManager.getImage(link, "link-icon", //$NON-NLS-1$ ImageUtil.DEFAULT_LINK); + if (showLinkDescription && link.getText() != null) { Composite container = toolkit.createComposite(parent); TableWrapLayout layout = new TableWrapLayout(); @@ -227,6 +228,8 @@ public class PageWidgetFactory { ImageHyperlink imageLink = toolkit.createImageHyperlink(parent, SWT.WRAP | SWT.CENTER); imageLink.setImage(linkImage); + imageLink.setHoverImage(styleManager.getImage(link, "hover-icon", + null)); TableWrapData td = new TableWrapData(); td.grabHorizontal = true; imageLink.setLayoutData(td); @@ -262,7 +265,6 @@ public class PageWidgetFactory { fg); else return createText(parent, text.getText(), fg); - } private Control createFormText(Composite parent, String text, Color fg) { |