Skip to content

Commit 4ab71ef

Browse files
committed
cleanup
1 parent 66c6795 commit 4ab71ef

File tree

10 files changed

+49
-161
lines changed

10 files changed

+49
-161
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
}

ua/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/AbstractIntroPartImplementation.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public abstract class AbstractIntroPartImplementation {
6060
{
6161
setToolTipText(Messages.Browser_backwardButton_tooltip);
6262
setImageDescriptor(ImageUtil
63-
.createImageDescriptor("full/elcl16/backward_nav.svg")); //$NON-NLS-1$
63+
.createImageDescriptor("full/elcl16/backward_nav.svg")); //$NON-NLS-1$
6464
setDisabledImageDescriptor(ImageUtil
6565
.createImageDescriptor("full/dlcl16/backward_nav.png")); //$NON-NLS-1$
6666
}
@@ -76,7 +76,7 @@ public void run() {
7676
{
7777
setToolTipText(Messages.Browser_forwardButton_tooltip);
7878
setImageDescriptor(ImageUtil
79-
.createImageDescriptor("full/elcl16/forward_nav.svg")); //$NON-NLS-1$
79+
.createImageDescriptor("full/elcl16/forward_nav.svg")); //$NON-NLS-1$
8080
setDisabledImageDescriptor(ImageUtil
8181
.createImageDescriptor("full/dlcl16/forward_nav.png")); //$NON-NLS-1$
8282
}
@@ -92,7 +92,7 @@ public void run() {
9292
{
9393
setToolTipText(Messages.Browser_homeButton_tooltip);
9494
setImageDescriptor(ImageUtil
95-
.createImageDescriptor("full/elcl16/home_nav.svg")); //$NON-NLS-1$
95+
.createImageDescriptor("full/elcl16/home_nav.svg")); //$NON-NLS-1$
9696
setDisabledImageDescriptor(ImageUtil
9797
.createImageDescriptor("full/dlcl16/home_nav.png")); //$NON-NLS-1$
9898
}
@@ -108,7 +108,7 @@ public void run() {
108108
{
109109
setToolTipText(Messages.IntroPart_showContentButton_tooltip);
110110
setImageDescriptor(ImageUtil
111-
.createImageDescriptor("contents_view.svg")); //$NON-NLS-1$
111+
.createImageDescriptor("contents_view.svg")); //$NON-NLS-1$
112112
}
113113

114114
@Override

ua/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/viewer/IntroModelLabelProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public class IntroModelLabelProvider extends LabelProvider {
4040

4141
static {
4242
ImageUtil.registerImage(ImageUtil.INTRO_MODEL_CONTAINER,
43-
"container_obj.svg"); //$NON-NLS-1$
43+
"container_obj.svg"); //$NON-NLS-1$
4444
ImageUtil.registerImage(ImageUtil.INTRO_MODEL_LEAF, "topic.svg"); //$NON-NLS-1$
4545
}
4646

ua/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/presentations/BrowserIntroPartImplementation.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ private final class ReduceAction extends Action {
8686
{
8787
setToolTipText(Messages.Browser_reduce_tooltip);
8888
setImageDescriptor(ImageUtil
89-
.createImageDescriptor("full/elcl16/reduce_font.svg")); //$NON-NLS-1$
89+
.createImageDescriptor("full/elcl16/reduce_font.svg")); //$NON-NLS-1$
9090
setDisabledImageDescriptor(ImageUtil
9191
.createImageDescriptor("full/dlcl16/reduce_font.png")); //$NON-NLS-1$
9292
int scalePercent = FontSelection.getScalePercentage();
@@ -106,7 +106,7 @@ private final class MagnifyAction extends Action {
106106
{
107107
setToolTipText(Messages.Browser_magnify_tooltip);
108108
setImageDescriptor(ImageUtil
109-
.createImageDescriptor("full/elcl16/magnify_font.svg")); //$NON-NLS-1$
109+
.createImageDescriptor("full/elcl16/magnify_font.svg")); //$NON-NLS-1$
110110
setDisabledImageDescriptor(ImageUtil
111111
.createImageDescriptor("full/dlcl16/magnify_font.png")); //$NON-NLS-1$
112112
int scalePercent = FontSelection.getScalePercentage();
@@ -136,7 +136,7 @@ public void run() {
136136
{
137137
setToolTipText(Messages.IntroPart_openExternal_tooltip);
138138
setImageDescriptor(ImageUtil
139-
.createImageDescriptor("topic.svg")); //$NON-NLS-1$
139+
.createImageDescriptor("topic.svg")); //$NON-NLS-1$
140140
}
141141

142142
@Override
@@ -454,8 +454,8 @@ private Document resolveDynamicContent(AbstractIntroPage page,
454454

455455
// get the array version of the nodelist to work around DOM api design.
456456
Node[] nodes = ModelUtil.getArray(contentProviders);
457-
for (Node node : nodes) {
458-
Element contentProviderElement = (Element) node;
457+
for (int i = 0; i < nodes.length; i++) {
458+
Element contentProviderElement = (Element) nodes[i];
459459
IntroContentProvider provider = new IntroContentProvider(
460460
contentProviderElement, page.getBundle());
461461
provider.setParent(page);
@@ -494,10 +494,10 @@ private Document resolveDynamicContent(AbstractIntroPage page,
494494

495495
private void reinjectDynamicContent(Document dom,
496496
Node[] contentProviderElements) {
497-
for (Node contentProviderElement2 : contentProviderElements) {
497+
for (int i = 0; i < contentProviderElements.length; i++) {
498498
// for each cached contentProvider, find replacement div in DOM and
499499
// re-subsitute.
500-
Element contentProviderElement = (Element) contentProviderElement2;
500+
Element contentProviderElement = (Element) contentProviderElements[i];
501501
Element contentProviderDiv = ModelUtil.getElementById(dom,
502502
contentProviderElement
503503
.getAttribute(IIntroHTMLConstants.ATTRIBUTE_ID),

ua/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/presentations/FormIntroPartImplementation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public class FormIntroPartImplementation extends
7676
// registry.
7777
ImageUtil.registerImage(ImageUtil.DEFAULT_ROOT_LINK, "overview_48.svg"); //$NON-NLS-1$
7878
ImageUtil.registerImage(ImageUtil.DEFAULT_SMALL_ROOT_LINK,
79-
"overview_32.svg"); //$NON-NLS-1$
79+
"overview_32.svg"); //$NON-NLS-1$
8080
ImageUtil.registerImage(ImageUtil.DEFAULT_FORM_BG, "form_banner.svg"); //$NON-NLS-1$
8181
ImageUtil.registerImage(ImageUtil.DEFAULT_LINK, "welcome_item.gif"); //$NON-NLS-1$
8282
}

0 commit comments

Comments
 (0)