Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Wilson2001-09-28 20:27:02 +0000
committerMike Wilson2001-09-28 20:27:02 +0000
commit29123b5f0e735e30e600161f0bc0d2b0d6ac29e9 (patch)
treeeb835b4157db2fbe77f7258076b81f1244789a40
parentea98401c38a92737337a27f0e234598003de6843 (diff)
downloadeclipse.platform.swt-29123b5f0e735e30e600161f0bc0d2b0d6ac29e9.tar.gz
eclipse.platform.swt-29123b5f0e735e30e600161f0bc0d2b0d6ac29e9.tar.xz
eclipse.platform.swt-29123b5f0e735e30e600161f0bc0d2b0d6ac29e9.zip
*** empty log message ***CLDC_001
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Program/motif/placeholder.txt0
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Program/motif_j2me/org/eclipse/swt/program/Program.java25
-rw-r--r--[-rwxr-xr-x]bundles/org.eclipse.swt/Eclipse SWT Program/motif_j2se/org/eclipse/swt/program/Program.java (renamed from bundles/org.eclipse.swt/Eclipse SWT Program/motif/org/eclipse/swt/program/Program.java)0
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWT.java21
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/widgets/Synchronizer.java5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common_j2me/org/eclipse/swt/internal/Compatability.java60
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/Compatability.java10
7 files changed, 81 insertions, 40 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Program/motif/placeholder.txt b/bundles/org.eclipse.swt/Eclipse SWT Program/motif/placeholder.txt
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Program/motif/placeholder.txt
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Program/motif_j2me/org/eclipse/swt/program/Program.java b/bundles/org.eclipse.swt/Eclipse SWT Program/motif_j2me/org/eclipse/swt/program/Program.java
new file mode 100644
index 0000000000..5bdf548e0d
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Program/motif_j2me/org/eclipse/swt/program/Program.java
@@ -0,0 +1,25 @@
+package org.eclipse.swt.program;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved
+ */
+
+import org.eclipse.swt.internal.*;
+import org.eclipse.swt.internal.motif.*;
+import org.eclipse.swt.*;
+import org.eclipse.swt.graphics.*;
+
+import org.eclipse.swt.widgets.Display;
+
+import java.io.*;
+import java.util.Iterator;
+import java.util.Hashtable;
+import java.util.Vector;
+
+/**
+ * Instances of this class represent programs and
+ * their assoicated file extensions in the operating
+ * system.
+ */
+public final class Program {}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Program/motif/org/eclipse/swt/program/Program.java b/bundles/org.eclipse.swt/Eclipse SWT Program/motif_j2se/org/eclipse/swt/program/Program.java
index f91333a713..f91333a713 100755..100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Program/motif/org/eclipse/swt/program/Program.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Program/motif_j2se/org/eclipse/swt/program/Program.java
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWT.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWT.java
index a8d3eb635c..c30929521f 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWT.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWT.java
@@ -1687,8 +1687,6 @@ static String findErrorText (int code) {
return "Unknown error";
}
-private static ResourceBundle msgs = null;
-
/**
* Returns the NLS'ed message for the given argument.
*
@@ -1700,24 +1698,7 @@ private static ResourceBundle msgs = null;
* </ul>
*/
public static String getMessage(String key) {
- String answer = key;
-
- if (key == null) {
- error (ERROR_NULL_ARGUMENT);
- }
- if (msgs == null) {
- try {
- msgs = ResourceBundle.getBundle("org.eclipse.swt.SWTMessages");
- } catch (MissingResourceException ex) {
- answer = key + " (no resource bundle)";
- }
- }
- if (msgs != null) {
- try {
- answer = msgs.getString(key);
- } catch (MissingResourceException ex2) {}
- }
- return answer;
+ return Compatability.getMessage(key);
}
/**
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/widgets/Synchronizer.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/widgets/Synchronizer.java
index fd2426f6b2..db259c417f 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/widgets/Synchronizer.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/widgets/Synchronizer.java
@@ -6,7 +6,8 @@ package org.eclipse.swt.widgets;
*/
import org.eclipse.swt.*;
-
+import org.eclipse.swt.internal.*;
+
/**
* Instances of this class provide synchronization support
* for displays. A default instance is created automatically
@@ -141,7 +142,7 @@ protected void syncExec (Runnable runnable) {
}
}
if (interrupted) {
- Thread.currentThread ().interrupt ();
+ Compatability.interrupt ();
}
if (lock.throwable != null) {
SWT.error (SWT.ERROR_FAILED_EXEC, lock.throwable);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common_j2me/org/eclipse/swt/internal/Compatability.java b/bundles/org.eclipse.swt/Eclipse SWT/common_j2me/org/eclipse/swt/internal/Compatability.java
index 7de8d03ba8..722e03b0a4 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/common_j2me/org/eclipse/swt/internal/Compatability.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/common_j2me/org/eclipse/swt/internal/Compatability.java
@@ -1,5 +1,6 @@
package org.eclipse.swt.internal;
+
import java.io.*;
import org.eclipse.swt.*;
@@ -90,24 +91,47 @@ public static OutputStream newFileOutputStream (String filename) throws IOExcept
* </ul>
*/
public static String getMessage(String key) {
- String answer = key;
-
- if (key == null) {
- error (ERROR_NULL_ARGUMENT);
- }
- if (msgs == null) {
- try {
- msgs = ResourceBundle.getBundle("org.eclipse.swt.SWTMessages");
- } catch (MissingResourceException ex) {
- answer = key + " (no resource bundle)";
- }
- }
- if (msgs != null) {
- try {
- answer = msgs.getString(key);
- } catch (MissingResourceException ex2) {}
- }
- return answer;
+ if (key.equals( "SWT_Yes"))
+ return "Yes";
+ if (key.equals("SWT_No"))
+ return "No";
+ if (key.equals("SWT_OK"))
+ return "OK";
+ if (key.equals("SWT_Cancel"))
+ return "Cancel";
+ if (key.equals("SWT_Abort"))
+ return "Abort";
+ if (key.equals("SWT_Retry"))
+ return "Retry";
+ if (key.equals("SWT_Ignore"))
+ return "Ignore";
+ if (key.equals("SWT_Sample"))
+ return "Sample";
+ if (key.equals("SWT_A_Sample_Text"))
+ return "A Sample Text";
+ if (key.equals("SWT_Selection"))
+ return "Selection";
+ if (key.equals("SWT_Current_Selection"))
+ return "Current Selection";
+ if (key.equals("SWT_Character_set"))
+ return "Character set";
+ if (key.equals("SWT_Font"))
+ return "Font";
+ if (key.equals("SWT_Extended_style"))
+ return "Extended style";
+ if (key.equals("SWT_Size"))
+ return "Size";
+ if (key.equals("SWT_Style"))
+ return "Style";
+
+ return key;
+}
+
+/**
+ * Interrupt the current thread. Note that this is not
+ * available on CLDC.
+ */
+public static void interrupt() {
}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/Compatability.java b/bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/Compatability.java
index 206ddce48a..09097d6155 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/Compatability.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/Compatability.java
@@ -78,6 +78,8 @@ public static OutputStream newFileOutputStream (String filename) throws IOError
return new FileOutputStream(filename);
}
+private static ResourceBundle msgs = null;
+
/**
* Returns the NLS'ed message for the given argument.
*
@@ -108,6 +110,14 @@ public static String getMessage(String key) {
}
return answer;
}
+
+/**
+ * Interrupt the current thread. Note that this is not
+ * available on CLDC.
+ */
+public static void interrupt() {
+ Thread.currentThread ().interrupt ();
+}
}

Back to the top