Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeo Ufimtsev2018-05-16 20:37:47 +0000
committerLeo Ufimtsev2018-05-16 21:10:26 +0000
commitd451e52002aeb6e27e59809d60ef18043a768b70 (patch)
tree6746f189b6761a6312feda5305ba2524924f45b9 /bundles/org.eclipse.swt.tools/Mac Generation
parent9d334185fde44514da763f3766f9c872d149ab51 (diff)
downloadeclipse.platform.swt-d451e52002aeb6e27e59809d60ef18043a768b70.tar.gz
eclipse.platform.swt-d451e52002aeb6e27e59809d60ef18043a768b70.tar.xz
eclipse.platform.swt-d451e52002aeb6e27e59809d60ef18043a768b70.zip
Bug 534783 – SWT tools isn't rebuilding natives after foreach patch
Revert "For each conversion in swt.tools." This reverts commit 9a92da14a27e579409c00ff3eefd197eac4209da. https://bugs.eclipse.org/bugs/show_bug.cgi?id=534783 Change-Id: I464b41bdc9bdd125b1f56b501e226fb89ceca310 Signed-off-by: Leo Ufimtsev <lufimtse@redhat.com>
Diffstat (limited to 'bundles/org.eclipse.swt.tools/Mac Generation')
-rw-r--r--bundles/org.eclipse.swt.tools/Mac Generation/org/eclipse/swt/tools/internal/MacGenerator.java8
-rw-r--r--bundles/org.eclipse.swt.tools/Mac Generation/org/eclipse/swt/tools/internal/MacGeneratorUI.java66
2 files changed, 40 insertions, 34 deletions
diff --git a/bundles/org.eclipse.swt.tools/Mac Generation/org/eclipse/swt/tools/internal/MacGenerator.java b/bundles/org.eclipse.swt.tools/Mac Generation/org/eclipse/swt/tools/internal/MacGenerator.java
index 58adc94850..2c9e7c2211 100644
--- a/bundles/org.eclipse.swt.tools/Mac Generation/org/eclipse/swt/tools/internal/MacGenerator.java
+++ b/bundles/org.eclipse.swt.tools/Mac Generation/org/eclipse/swt/tools/internal/MacGenerator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2018 IBM Corporation and others.
+ * Copyright (c) 2008, 2017 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
@@ -50,7 +50,8 @@ static void list(File path, ArrayList<String> list) {
if (path == null) return;
File[] frameworks = path.listFiles();
if (frameworks == null) return;
- for (File file : frameworks) {
+ for (int i = 0; i < frameworks.length; i++) {
+ File file = frameworks[i];
String name = file.getName();
int index = name.lastIndexOf(".");
if (index != -1) {
@@ -673,7 +674,8 @@ void copyClassMethodsDown(final Map<String, Object[]> classes) {
ArrayList<Node> methods = (ArrayList<Node>)clazz[1];
Object[] superclass = classes.get(getSuperclassName(node));
if (superclass != null) {
- for (Node method : ((ArrayList<Node>) superclass[1])) {
+ for (Iterator<Node> iterator2 = ((ArrayList<Node>)superclass[1]).iterator(); iterator2.hasNext();) {
+ Node method = iterator2.next();
if (isStatic(method)) {
methods.add(method);
}
diff --git a/bundles/org.eclipse.swt.tools/Mac Generation/org/eclipse/swt/tools/internal/MacGeneratorUI.java b/bundles/org.eclipse.swt.tools/Mac Generation/org/eclipse/swt/tools/internal/MacGeneratorUI.java
index 862156248a..d5a31068e0 100644
--- a/bundles/org.eclipse.swt.tools/Mac Generation/org/eclipse/swt/tools/internal/MacGeneratorUI.java
+++ b/bundles/org.eclipse.swt.tools/Mac Generation/org/eclipse/swt/tools/internal/MacGeneratorUI.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2018 IBM Corporation and others.
+ * Copyright (c) 2008, 2016 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
@@ -41,9 +41,9 @@ public class MacGeneratorUI {
parentItem = lastParent;
} else {
TreeItem[] items = superItem.getItems();
- for (TreeItem item : items) {
- if (name.equals(item.getData())) {
- parentItem = item;
+ for (int i = 0; i < items.length; i++) {
+ if (name.equals(items[i].getData())) {
+ parentItem = items[i];
break;
}
}
@@ -122,15 +122,15 @@ public class MacGeneratorUI {
}
/* Figure out categories state */
TreeItem[] items = item.getItems();
- for (TreeItem item2 : items) {
- TreeItem[] children = item2.getItems();
+ for (int i = 0; i < items.length; i++) {
+ TreeItem[] children = items[i].getItems();
int checkedCount = 0;
for (int j = 0; j < children.length; j++) {
if (children[j].getChecked()) checkedCount++;
if (children[j].getGrayed()) break;
}
- item2.setChecked(checkedCount != 0);
- item2.setGrayed(checkedCount != children.length);
+ items[i].setChecked(checkedCount != 0);
+ items[i].setGrayed(checkedCount != children.length);
}
}
}
@@ -275,27 +275,30 @@ public class MacGeneratorUI {
// editorTx.addListener(SWT.FocusOut, textListener);
editorTx.addListener(SWT.KeyDown, textListener);
editorTx.addListener(SWT.Traverse, textListener);
- attribTable.addListener(SWT.MouseDown, e -> e.display.asyncExec (() -> {
- if (attribTable.isDisposed ()) return;
- if (e.button != 1) return;
- Point pt = new Point(e.x, e.y);
- TableItem item = attribTable.getItem(pt);
- if (item == null) return;
- int column = -1;
- for (int i = 0; i < attribTable.getColumnCount(); i++) {
- if (item.getBounds(i).contains(pt)) {
- column = i;
- break;
- }
+ attribTable.addListener(SWT.MouseDown, e -> e.display.asyncExec (new Runnable () {
+ @Override
+ public void run () {
+ if (attribTable.isDisposed ()) return;
+ if (e.button != 1) return;
+ Point pt = new Point(e.x, e.y);
+ TableItem item = attribTable.getItem(pt);
+ if (item == null) return;
+ int column = -1;
+ for (int i = 0; i < attribTable.getColumnCount(); i++) {
+ if (item.getBounds(i).contains(pt)) {
+ column = i;
+ break;
+ }
+ }
+ if (column == -1) return;
+ if (!getEditable(item, column)) return;
+ editor.setColumn(column);
+ editor.setItem(item);
+ editorTx.setText(item.getText(column));
+ editorTx.selectAll();
+ editorTx.setVisible(true);
+ editorTx.setFocus();
}
- if (column == -1) return;
- if (!getEditable(item, column)) return;
- editor.setColumn(column);
- editor.setItem(item);
- editorTx.setText(item.getText(column));
- editorTx.selectAll();
- editorTx.setVisible(true);
- editorTx.setFocus();
}));
return comp;
@@ -453,12 +456,13 @@ public class MacGeneratorUI {
}
TreeItem findItem(TreeItem[] items, Node node) {
- for (TreeItem item : items) {
+ for (int i = 0; i < items.length; i++) {
+ TreeItem item = items[i];
checkChildren(item);
if (item.getData() == node) return item;
}
- for (TreeItem item : items) {
- TreeItem child = findItem(item.getItems(), node);
+ for (int i = 0; i < items.length; i++) {
+ TreeItem child = findItem(items[i].getItems(), node);
if (child != null) return child;
}
return null;

Back to the top