summaryrefslogtreecommitdiffstats
path: root/bundles
diff options
context:
space:
mode:
authorSilenio Quarti <silenio>2008-08-07 13:52:32 +0000
committerSilenio Quarti <silenio>2008-08-07 13:52:32 +0000
commitdc19d25aa6cd979d0249c3e9ed5cf50640a357ac (patch)
treebf5937fb63fc82e9e9f521f16220731f9a7a5a3f /bundles
parentc0eab291930878b5b0686e9f1e20996a4f2d6348 (diff)
downloadeclipse.platform.swt-dc19d25aa6cd979d0249c3e9ed5cf50640a357ac.tar.gz
eclipse.platform.swt-dc19d25aa6cd979d0249c3e9ed5cf50640a357ac.tar.xz
eclipse.platform.swt-dc19d25aa6cd979d0249c3e9ed5cf50640a357ac.zip
*** empty log message ***
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.swt.tools/Mac Generation/org/eclipse/swt/tools/internal/MacGeneratorUI.java56
1 files changed, 27 insertions, 29 deletions
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 284f404d97..9ffcb9e847 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
@@ -108,10 +108,8 @@ public class MacGeneratorUI {
Document getDocument(String xmlPath) {
try {
InputStream is = null;
- if (xmlPath.indexOf(File.separatorChar) == -1) {
- is = getClass().getResourceAsStream(xmlPath);
- if (is == null) is = new BufferedInputStream(new FileInputStream(xmlPath));
- }
+ if (xmlPath.indexOf(File.separatorChar) == -1) is = getClass().getResourceAsStream(xmlPath);
+ if (is == null) is = new BufferedInputStream(new FileInputStream(xmlPath));
if (is != null) return DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new InputSource(is));
} catch (Exception e) {
// e.printStackTrace();
@@ -182,33 +180,33 @@ public class MacGeneratorUI {
void updateNodes() {
if (xmls == null) return;
- try {
- for (int x = 0; x < xmls.length; x++) {
- String xmlPath = xmls[x];
- TreeItem xmlItem = new TreeItem(nodesTree, SWT.NONE);
- String xmlText = xmlPath;
- int index = xmlText.lastIndexOf(File.separatorChar);
- if (index != -1) xmlText = xmlText.substring(index + 1);
- xmlItem.setText(xmlText);
-
- Hashtable extras = new Hashtable();
- Document extraDocument = getDocument(xmlText + ".extras");
- if (extraDocument != null) {
- buildLookup(extraDocument, extras);
- }
-
- Document document = getDocument(xmlPath);
- NodeList list = document.getDocumentElement().getChildNodes();
- for (int i = 0; i < list.getLength(); i++) {
- addChild(list.item(i), xmlItem, extras);
- }
+ for (int x = 0; x < xmls.length; x++) {
+ String xmlPath = xmls[x];
+ String xmlSimplePath = xmlPath;
+ int index = xmlSimplePath.lastIndexOf(File.separatorChar);
+ if (index != -1) xmlSimplePath = xmlSimplePath.substring(index + 1);
+
+ Document document = getDocument(xmlPath);
+ if (document == null) {
+ System.out.println("Could not find: " + xmlPath);
+ continue;
+ }
+ Hashtable extras = new Hashtable();
+ Document extraDocument = getDocument(xmlSimplePath + ".extras");
+ if (extraDocument != null) {
+ buildLookup(extraDocument, extras);
}
- TreeColumn[] columns = nodesTree.getColumns();
- for (int i = 0; i < columns.length; i++) {
- columns[i].pack();
+
+ TreeItem xmlItem = new TreeItem(nodesTree, SWT.NONE);
+ xmlItem.setText(xmlSimplePath);
+ NodeList list = document.getDocumentElement().getChildNodes();
+ for (int i = 0; i < list.getLength(); i++) {
+ addChild(list.item(i), xmlItem, extras);
}
- } catch (Throwable e) {
- e.printStackTrace();
+ }
+ TreeColumn[] columns = nodesTree.getColumns();
+ for (int i = 0; i < columns.length; i++) {
+ columns[i].pack();
}
}