Skip to content

Commit cbbe4c6

Browse files
committed
cleanup
1 parent 66c6795 commit cbbe4c6

File tree

4 files changed

+29
-141
lines changed

4 files changed

+29
-141
lines changed

ua/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/UniversalIntroConfigurer.java

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -515,14 +515,14 @@ private void loadData() {
515515
// load all other installed (but not running) products' intro data
516516
List<IntroData> result = new ArrayList<>();
517517
Properties[] prefs = ProductPreferences.getProductPreferences(false);
518-
for (Properties pref : prefs) {
518+
for (int i=0;i<prefs.length;++i) {
519519
String key = UniversalIntroPlugin.PLUGIN_ID + '/' + VAR_INTRO_DATA;
520-
String dataFile = pref.getProperty(key);
520+
String dataFile = prefs[i].getProperty(key);
521521
if (dataFile != null) {
522-
String pluginId = ProductPreferences.getPluginId(pref);
522+
String pluginId = ProductPreferences.getPluginId(prefs[i]);
523523
Bundle bundle = Platform.getBundle(pluginId);
524524
if (bundle != null) {
525-
String pid = ProductPreferences.getProductId(pref);
525+
String pid = ProductPreferences.getProductId(prefs[i]);
526526
dataFile = resolveVariable(bundle, dataFile);
527527
result.add(new IntroData(pid, dataFile, false));
528528
}
@@ -559,7 +559,8 @@ private List<IntroElement> getAnchors(String pageId, String groupId) {
559559
primaryAnchors = Collections.emptyList();
560560
}
561561
List<List<IntroElement>> secondaryAnchors = new ArrayList<>();
562-
for (IntroData idata : secondaryIntroData) {
562+
for (int i=0;i<secondaryIntroData.length;++i) {
563+
IntroData idata = secondaryIntroData[i];
563564
List<IntroElement> anchors = getAnchors(idata, pageId, groupId);
564565
if (anchors != null) {
565566
secondaryAnchors.add(anchors);
@@ -625,7 +626,8 @@ private String resolveExtensionPath(String extensionId, String pageId) {
625626
}
626627
// if not, do the others have preferences?
627628
PreferenceArbiter arbiter = new PreferenceArbiter();
628-
for (IntroData idata : secondaryIntroData) {
629+
for (int i=0;i<secondaryIntroData.length;++i) {
630+
IntroData idata = secondaryIntroData[i];
629631
PageData pdata = idata.getPage(pageId);
630632
if (pdata != null) {
631633
arbiter.consider(pdata.resolvePath(extensionId));
@@ -656,7 +658,8 @@ private String resolveDefaultPath(String pageId, String extensionId) {
656658
}
657659
// if not, do the others have preferences?
658660
PreferenceArbiter arbiter = new PreferenceArbiter();
659-
for (IntroData idata : secondaryIntroData) {
661+
for (int i=0;i<secondaryIntroData.length;++i) {
662+
IntroData idata = secondaryIntroData[i];
660663
PageData pdata = idata.getPage(pageId);
661664
if (pdata != null) {
662665
arbiter.consider(pdata.resolveDefaultPath());

ua/org.eclipse.ui.intro/invalidPage/invalidPage.xhtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<body style="padding: 0">
1515

1616
<p>
17-
<img border="0" src="showerr_tsk.svg" width="16" height="16" align="left" style="float: left; padding-right:2px" alt="Error image" /></p>
17+
<img border="0" src="showerr_tsk.gif" width="16" height="16" align="left" style="float: left; padding-right:2px" alt="Error image" /></p>
1818
<address>
1919
<span style="font-style: normal">
2020
<b>Error loading Welcome page</b></span></address>

ua/org.eclipse.ui.intro/invalidPage/showerr_tsk.svg

Lines changed: 0 additions & 119 deletions
This file was deleted.

ua/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/html/IntroHTMLGenerator.java

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@ private HTMLElement generateHeadElement(int indentLevel) {
184184
String[] presentationStyles = IntroPlugin.getDefault().getIntroModelRoot().getPresentation()
185185
.getImplementationStyles();
186186
if (presentationStyles != null && introPage.injectSharedStyle()) {
187-
for (String presentationStyle : presentationStyles)
188-
head.addContent(generateLinkElement(presentationStyle, indentLevel + 1));
187+
for (int i=0; i<presentationStyles.length; i++)
188+
head.addContent(generateLinkElement(presentationStyles[i], indentLevel + 1));
189189
}
190190
String pageStyle = introPage.getStyle();
191191
if (pageStyle != null)
@@ -195,8 +195,8 @@ private HTMLElement generateHeadElement(int indentLevel) {
195195

196196
// add the page's inherited style(s)
197197
String[] pageStyles = introPage.getStyles();
198-
for (String pageStyle2 : pageStyles) {
199-
pageStyle = pageStyle2;
198+
for (int i = 0; i < pageStyles.length; i++) {
199+
pageStyle = pageStyles[i];
200200
if (pageStyle != null)
201201
head.addContent(generateLinkElement(pageStyle, indentLevel + 1));
202202
}
@@ -216,8 +216,8 @@ private HTMLElement generateHeadElement(int indentLevel) {
216216
// TODO: there should only be one of these at the page level, not a
217217
// collection..
218218
IntroHead[] htmlHeads = introPage.getHTMLHeads();
219-
for (IntroHead htmlHead : htmlHeads) {
220-
introHead = htmlHead;
219+
for (int i = 0; i < htmlHeads.length; i++) {
220+
introHead = htmlHeads[i];
221221
if (introHead != null) {
222222
content = readFromFile(introHead.getSrc(), introHead.getInlineEncoding());
223223
if (content != null)
@@ -300,7 +300,8 @@ private HTMLElement generateBodyElement(int indentLevel, HTMLElement head) {
300300

301301
// Add any children of the page, in the order they are defined
302302
AbstractIntroElement[] children = introPage.getChildren();
303-
for (AbstractIntroElement child : children) {
303+
for (int i = 0; i < children.length; i++) {
304+
AbstractIntroElement child = children[i];
304305
// use indentLevel + 2 here, since this element is contained within
305306
// the pageContentDiv
306307
HTMLElement childElement = generateIntroElement(child, indentLevel + 2);
@@ -443,8 +444,9 @@ private HTMLElement generateIntroDiv(IntroGroup element, int indentLevel) {
443444
imageUrl = BundleUtil.getResolvedResourceLocation(element.getBase(), imageUrl, element
444445
.getBundle());
445446
String style;
446-
if (Platform.getWS().equals(Platform.WS_WIN32) && !backgroundSizeWorks
447-
&& imageUrl.toLowerCase().endsWith(".svg")) { //$NON-NLS-1$
447+
if (Platform.getWS().equals(Platform.WS_WIN32) && !backgroundSizeWorks && imageUrl.toLowerCase().endsWith(".png")) { //$NON-NLS-1$
448+
// IE 5.5+ does not handle alphas in PNGs without
449+
// this hack. Remove when IE7 becomes widespread
448450
style = "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + imageUrl + "', sizingMethod='crop');"; //$NON-NLS-1$ //$NON-NLS-2$
449451
} else {
450452
style = "background-image : url(" + imageUrl + ")"; //$NON-NLS-1$ //$NON-NLS-2$
@@ -453,7 +455,8 @@ private HTMLElement generateIntroDiv(IntroGroup element, int indentLevel) {
453455
}
454456
// Add any children of the div, in the order they are defined
455457
AbstractIntroElement[] children = element.getChildren();
456-
for (AbstractIntroElement child : children) {
458+
for (int i = 0; i < children.length; i++) {
459+
AbstractIntroElement child = children[i];
457460
HTMLElement childElement = generateIntroElement(child, indentLevel + 1);
458461
if (childElement != null) {
459462
addMixinStyle(childElement, child.getMixinStyle());
@@ -1015,9 +1018,10 @@ private HTMLElement generateImageElement(String imageSrc, String altText, String
10151018
int indentLevel) {
10161019
HTMLElement image = new FormattedHTMLElement(IIntroHTMLConstants.ELEMENT_IMG, indentLevel, true,
10171020
false);
1018-
boolean svgOnWin32 = imageSrc != null && Platform.getWS().equals(Platform.WS_WIN32)
1019-
&& !backgroundSizeWorks && imageSrc.toLowerCase().endsWith(".svg"); //$NON-NLS-1$
1020-
if (imageSrc == null || svgOnWin32) {
1021+
boolean pngOnWin32 = imageSrc != null && Platform.getWS().equals(Platform.WS_WIN32)
1022+
&& !backgroundSizeWorks && imageSrc.toLowerCase().endsWith(".png"); //$NON-NLS-1$
1023+
if (imageSrc == null || pngOnWin32) {
1024+
// we must handle PNGs here - IE does not support alpha blanding well.
10211025
// IE does not support alpha blanding well.
10221026
// We will set the alpha image loader and load the real image
10231027
// that way. The 'src' attribute in the image itself will
@@ -1026,7 +1030,7 @@ private HTMLElement generateImageElement(String imageSrc, String altText, String
10261030
IIntroHTMLConstants.IMAGE_SRC_BLANK, IIntroConstants.PLUGIN_ID);
10271031
if (blankImageURL != null) {
10281032
image.addAttribute(IIntroHTMLConstants.ATTRIBUTE_SRC, blankImageURL);
1029-
if (svgOnWin32) {
1033+
if (pngOnWin32) {
10301034
String style = "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + imageSrc + "', sizingMethod='image')"; //$NON-NLS-1$//$NON-NLS-2$
10311035
image.addAttribute(IIntroHTMLConstants.ATTRIBUTE_STYLE, style);
10321036
}

0 commit comments

Comments
 (0)