Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Loskutov2016-01-07 21:13:38 +0000
committerAndrey Loskutov2016-01-07 21:13:38 +0000
commit5ac9a285370904f70d1bfedebeb9324141831c8d (patch)
tree637a04022166c17d3e9d315ac4bdeee77624290e /bundles/org.eclipse.swt/Eclipse SWT AWT
parent99e351989b664361d67301543e836c2f84860038 (diff)
downloadeclipse.platform.swt-5ac9a285370904f70d1bfedebeb9324141831c8d.tar.gz
eclipse.platform.swt-5ac9a285370904f70d1bfedebeb9324141831c8d.tar.xz
eclipse.platform.swt-5ac9a285370904f70d1bfedebeb9324141831c8d.zip
Bug 485367 - cleaned trailing spaces in swt (cocoa)
Change-Id: I47e7c08d8fdd9beea2ace6603c5de79755925f48 Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT AWT')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT AWT/cocoa/org/eclipse/swt/awt/SWT_AWT.java86
1 files changed, 43 insertions, 43 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT AWT/cocoa/org/eclipse/swt/awt/SWT_AWT.java b/bundles/org.eclipse.swt/Eclipse SWT AWT/cocoa/org/eclipse/swt/awt/SWT_AWT.java
index d75ca4eaba..cdc70ed472 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT AWT/cocoa/org/eclipse/swt/awt/SWT_AWT.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT AWT/cocoa/org/eclipse/swt/awt/SWT_AWT.java
@@ -29,39 +29,39 @@ import org.eclipse.swt.widgets.Event;
*
* @see <a href="http://www.eclipse.org/swt/snippets/#awt">Swing/AWT snippets</a>
* @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
- *
+ *
* @since 3.0
*/
public class SWT_AWT {
-
+
/**
* The name of the embedded Frame class. The default class name
- * for the platform will be used if <code>null</code>.
+ * for the platform will be used if <code>null</code>.
*/
public static String embeddedFrameClass;
-
+
/**
* Key for looking up the embedded frame for a Composite using
- * getData().
+ * getData().
*/
static String EMBEDDED_FRAME_KEY = "org.eclipse.swt.awt.SWT_AWT.embeddedFrame";
-
+
/**
- * Key for running pending AWT invokeLater() events.
+ * Key for running pending AWT invokeLater() events.
*/
static final String RUN_AWT_INVOKE_LATER_KEY = "org.eclipse.swt.internal.runAWTInvokeLater"; //$NON-NLS-1$
-
+
static {
System.setProperty("apple.awt.usingSWT", "true");
}
static final String JDK16_FRAME = "apple.awt.CEmbeddedFrame";
static final String JDK17_FRAME = "sun.lwawt.macosx.CViewEmbeddedFrame";
-
+
static boolean loaded, swingInitialized;
-
+
static native final long /*int*/ getAWTHandle (Canvas canvas);
-
+
static synchronized void loadLibrary () {
if (loaded) return;
loaded = true;
@@ -77,7 +77,7 @@ public class SWT_AWT {
} catch (Throwable e) {}
Library.loadLibrary("swt-awt");
}
-
+
static synchronized void initializeSwing() {
if (swingInitialized) return;
swingInitialized = true;
@@ -88,18 +88,18 @@ public class SWT_AWT {
if (method != null) method.invoke(clazz);
} catch (Throwable e) {}
}
-
+
/**
* Returns a <code>java.awt.Frame</code> which is the embedded frame
* associated with the specified composite.
- *
+ *
* @param parent the parent <code>Composite</code> of the <code>java.awt.Frame</code>
* @return a <code>java.awt.Frame</code> the embedded frame or <code>null</code>.
- *
+ *
* @exception IllegalArgumentException <ul>
* <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
* </ul>
- *
+ *
* @since 3.2
*/
public static Frame getFrame(Composite parent) {
@@ -107,7 +107,7 @@ public static Frame getFrame(Composite parent) {
if ((parent.getStyle() & SWT.EMBEDDED) == 0) return null;
return (Frame) parent.getData(EMBEDDED_FRAME_KEY);
}
-
+
/**
* Creates a new <code>java.awt.Frame</code>. This frame is the root for
* the AWT components that will be embedded within the composite. In order
@@ -120,15 +120,15 @@ public static Frame getFrame(Composite parent) {
* strongly recommended that a heavyweight component such as <code>java.awt.Panel</code>
* be added to the frame as the root of all components.
* </p>
- *
+ *
* @param parent the parent <code>Composite</code> of the new <code>java.awt.Frame</code>
* @return a <code>java.awt.Frame</code> to be the parent of the embedded AWT components
- *
+ *
* @exception IllegalArgumentException <ul>
* <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
- * <li>ERROR_INVALID_ARGUMENT - if the parent Composite does not have the SWT.EMBEDDED style</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the parent Composite does not have the SWT.EMBEDDED style</li>
* </ul>
- *
+ *
* @since 3.0
*/
public static Frame new_Frame(final Composite parent) {
@@ -136,7 +136,7 @@ public static Frame new_Frame(final Composite parent) {
if ((parent.getStyle() & SWT.EMBEDDED) == 0) {
SWT.error(SWT.ERROR_INVALID_ARGUMENT);
}
-
+
final long /*int*/ handle = parent.view.id;
final Class<?> [] clazz = new Class [1];
@@ -154,9 +154,9 @@ public static Frame new_Frame(final Composite parent) {
SWT.error (SWT.ERROR_NOT_IMPLEMENTED, cne1);
}
} catch (Throwable e) {
- SWT.error (SWT.ERROR_UNSPECIFIED , e, " [Error while starting AWT]");
+ SWT.error (SWT.ERROR_UNSPECIFIED , e, " [Error while starting AWT]");
}
-
+
/* NOTE: Swing must not be initialize in an invokeLater() or it hangs */
initializeSwing();
@@ -196,12 +196,12 @@ public static Frame new_Frame(final Composite parent) {
}
final Frame frame = result[0];
final boolean isJDK17 = JDK17_FRAME.equals(frame.getClass().getName());
-
+
/* NOTE: addNotify() should not be called in the UI thread or we could hang */
//frame.addNotify();
-
+
parent.setData(EMBEDDED_FRAME_KEY, frame);
-
+
/* Forward the iconify and deiconify events */
final Listener shellListener = new Listener () {
public void handleEvent (Event e) {
@@ -226,7 +226,7 @@ public static Frame new_Frame(final Composite parent) {
Shell shell = parent.getShell ();
shell.addListener (SWT.Deiconify, shellListener);
shell.addListener (SWT.Iconify, shellListener);
-
+
/* When display is disposed the frame is disposed in AWT EventQueue.
* Force main event loop to run to let the frame finish dispose.
*/
@@ -244,7 +244,7 @@ public static Frame new_Frame(final Composite parent) {
}
}
});
-
+
/*
* Generate the appropriate events to activate and deactivate
* the embedded frame. This is needed in order to make keyboard
@@ -300,18 +300,18 @@ public static Frame new_Frame(final Composite parent) {
}
}
};
-
+
parent.addListener (SWT.FocusIn, listener);
if (isJDK17) {
parent.addListener(SWT.FocusOut, listener);
//To allow cross-app activation/deactivation
- shell.addListener (SWT.Activate, listener);
- shell.addListener (SWT.Deactivate, listener);
+ shell.addListener (SWT.Activate, listener);
+ shell.addListener (SWT.Deactivate, listener);
} else {
- parent.addListener (SWT.Deactivate, listener);
+ parent.addListener (SWT.Deactivate, listener);
}
parent.addListener (SWT.Dispose, listener);
-
+
display.asyncExec(new Runnable() {
public void run () {
if (parent.isDisposed()) return;
@@ -326,7 +326,7 @@ public static Frame new_Frame(final Composite parent) {
public void run () {
frame.setSize(clientArea.width, clientArea.height);
frame.validate();
-
+
// Bug in Cocoa AWT? For some reason the frame isn't showing up on first draw.
// Toggling visibility seems to be the only thing that works.
frame.setVisible(false);
@@ -336,31 +336,31 @@ public static Frame new_Frame(final Composite parent) {
}
}
});
-
+
return frame;
}
-
+
/**
* Creates a new <code>Shell</code>. This Shell is the root for
- * the SWT widgets that will be embedded within the AWT canvas.
- *
+ * the SWT widgets that will be embedded within the AWT canvas.
+ *
* @param display the display for the new Shell
* @param parent the parent <code>java.awt.Canvas</code> of the new Shell
* @return a <code>Shell</code> to be the parent of the embedded SWT widgets
- *
+ *
* @exception IllegalArgumentException <ul>
* <li>ERROR_NULL_ARGUMENT - if the display is null</li>
* <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
* <li>ERROR_INVALID_ARGUMENT - if the parent's peer is not created</li>
* </ul>
- *
+ *
* @since 3.0
*/
public static Shell new_Shell(final Display display, final Canvas parent) {
if (display == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
if (parent == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
long /*int*/ handle = 0;
-
+
try {
loadLibrary ();
handle = getAWTHandle (parent);
@@ -368,7 +368,7 @@ public static Shell new_Shell(final Display display, final Canvas parent) {
SWT.error (SWT.ERROR_NOT_IMPLEMENTED, e);
}
if (handle == 0) SWT.error (SWT.ERROR_INVALID_ARGUMENT, null, " [peer not created]");
-
+
final Shell shell = Shell.cocoa_new (display, handle);
final ComponentListener listener = new ComponentAdapter () {
@Override

Back to the top