Skip to content

Commit ecd45ef

Browse files
committed
cleanup
1 parent 66c6795 commit ecd45ef

File tree

5 files changed

+32
-144
lines changed

5 files changed

+32
-144
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ protected void cancelPressed() {
6868
protected void configureShell(Shell newShell) {
6969
super.configureShell(newShell);
7070
newShell.setText(Messages.WelcomeCustomizationPreferencePage_Customize);
71-
newShell.setImage(ImageUtil.createImage("full/elcl16/configure.svg")); //$NON-NLS-1$ );
71+
newShell.setImage(ImageUtil.createImage("full/elcl16/configure.svg")); //$NON-NLS-1$);
7272
}
7373

7474
}

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

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ public String getMixinStyle(String pageId, String extensionId) {
110110
}
111111
// else, find the most referenced importance style from other products
112112
int[] importanceRefs = new int[ExtensionData.IMPORTANCE_TABLE.length];
113-
for (IntroData data : secondaryIntroData) {
113+
for (int i=0;i<secondaryIntroData.length;++i) {
114+
IntroData data = secondaryIntroData[i];
114115
int importance = getImportance(data, pageId, extensionId);
115116
if (importance >= 0) {
116117
++importanceRefs[importance];
@@ -515,14 +516,14 @@ private void loadData() {
515516
// load all other installed (but not running) products' intro data
516517
List<IntroData> result = new ArrayList<>();
517518
Properties[] prefs = ProductPreferences.getProductPreferences(false);
518-
for (Properties pref : prefs) {
519+
for (int i=0;i<prefs.length;++i) {
519520
String key = UniversalIntroPlugin.PLUGIN_ID + '/' + VAR_INTRO_DATA;
520-
String dataFile = pref.getProperty(key);
521+
String dataFile = prefs[i].getProperty(key);
521522
if (dataFile != null) {
522-
String pluginId = ProductPreferences.getPluginId(pref);
523+
String pluginId = ProductPreferences.getPluginId(prefs[i]);
523524
Bundle bundle = Platform.getBundle(pluginId);
524525
if (bundle != null) {
525-
String pid = ProductPreferences.getProductId(pref);
526+
String pid = ProductPreferences.getProductId(prefs[i]);
526527
dataFile = resolveVariable(bundle, dataFile);
527528
result.add(new IntroData(pid, dataFile, false));
528529
}
@@ -559,7 +560,8 @@ private List<IntroElement> getAnchors(String pageId, String groupId) {
559560
primaryAnchors = Collections.emptyList();
560561
}
561562
List<List<IntroElement>> secondaryAnchors = new ArrayList<>();
562-
for (IntroData idata : secondaryIntroData) {
563+
for (int i=0;i<secondaryIntroData.length;++i) {
564+
IntroData idata = secondaryIntroData[i];
563565
List<IntroElement> anchors = getAnchors(idata, pageId, groupId);
564566
if (anchors != null) {
565567
secondaryAnchors.add(anchors);
@@ -625,7 +627,8 @@ private String resolveExtensionPath(String extensionId, String pageId) {
625627
}
626628
// if not, do the others have preferences?
627629
PreferenceArbiter arbiter = new PreferenceArbiter();
628-
for (IntroData idata : secondaryIntroData) {
630+
for (int i=0;i<secondaryIntroData.length;++i) {
631+
IntroData idata = secondaryIntroData[i];
629632
PageData pdata = idata.getPage(pageId);
630633
if (pdata != null) {
631634
arbiter.consider(pdata.resolvePath(extensionId));
@@ -656,7 +659,8 @@ private String resolveDefaultPath(String pageId, String extensionId) {
656659
}
657660
// if not, do the others have preferences?
658661
PreferenceArbiter arbiter = new PreferenceArbiter();
659-
for (IntroData idata : secondaryIntroData) {
662+
for (int i=0;i<secondaryIntroData.length;++i) {
663+
IntroData idata = secondaryIntroData[i];
660664
PageData pdata = idata.getPage(pageId);
661665
if (pdata != null) {
662666
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 & 15 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,18 +1018,18 @@ 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-
// IE does not support alpha blanding well.
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.
10221025
// We will set the alpha image loader and load the real image
10231026
// that way. The 'src' attribute in the image itself will
10241027
// get the blank image.
10251028
String blankImageURL = BundleUtil.getResolvedResourceLocation(
10261029
IIntroHTMLConstants.IMAGE_SRC_BLANK, IIntroConstants.PLUGIN_ID);
10271030
if (blankImageURL != null) {
10281031
image.addAttribute(IIntroHTMLConstants.ATTRIBUTE_SRC, blankImageURL);
1029-
if (svgOnWin32) {
1032+
if (pngOnWin32) {
10301033
String style = "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + imageSrc + "', sizingMethod='image')"; //$NON-NLS-1$//$NON-NLS-2$
10311034
image.addAttribute(IIntroHTMLConstants.ATTRIBUTE_STYLE, style);
10321035
}

0 commit comments

Comments
 (0)