diff options
author | Arun Thondapu <arunkumar.thondapu@in.ibm.com> | 2012-09-11 19:16:12 +0530 |
---|---|---|
committer | Arun Thondapu <arunkumar.thondapu@in.ibm.com> | 2012-09-11 20:32:23 +0530 |
commit | e146916783f37aa41636cc83669e5f610cf7343a (patch) | |
tree | 60d6fd4261724b8c74de1f48b6f5d0a29793bcbe | |
parent | 1ff5dc76daca83722cbc3a22652379df0452b7e8 (diff) | |
download | eclipse.platform.swt-e146916783f37aa41636cc83669e5f610cf7343a.tar.gz eclipse.platform.swt-e146916783f37aa41636cc83669e5f610cf7343a.tar.xz eclipse.platform.swt-e146916783f37aa41636cc83669e5f610cf7343a.zip |
Bug 388265 fix formatting and remove redundant else check in Widget
10 files changed, 17 insertions, 21 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/gtk/org/eclipse/swt/browser/MozillaDelegate.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/gtk/org/eclipse/swt/browser/MozillaDelegate.java index 761768d0bf..07a2a65866 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/gtk/org/eclipse/swt/browser/MozillaDelegate.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/gtk/org/eclipse/swt/browser/MozillaDelegate.java @@ -178,9 +178,9 @@ int /*long*/ getHandle () { * causing the child of the GtkFixed handle to be resized to 1. * The workaround is to embed Mozilla into a GtkHBox handle. */ - if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)){ - embedHandle = OS.gtk_box_new(OS.GTK_ORIENTATION_HORIZONTAL, 0); - OS.gtk_box_set_homogeneous(embedHandle, false); + if (OS.GTK_VERSION >= OS.VERSION (3, 0, 0)) { + embedHandle = OS.gtk_box_new (OS.GTK_ORIENTATION_HORIZONTAL, 0); + OS.gtk_box_set_homogeneous (embedHandle, false); } else { embedHandle = OS.gtk_hbox_new (false, 0); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c index 885435bae6..e2b6d7546d 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c @@ -7507,12 +7507,12 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1box_1set_1homogeneous) { OS_NATIVE_ENTER(env, that, _1gtk_1box_1set_1homogeneous_FUNC); /* - gtk_box_set_homogeneous(arg0, arg1); + gtk_box_set_homogeneous((GtkBox *)arg0, arg1); */ { OS_LOAD_FUNCTION(fp, gtk_box_set_homogeneous) if (fp) { - ((void (CALLING_CONVENTION*)(jintLong, jboolean))fp)(arg0, arg1); + ((void (CALLING_CONVENTION*)(GtkBox *, jboolean))fp)((GtkBox *)arg0, arg1); } } OS_NATIVE_EXIT(env, that, _1gtk_1box_1set_1homogeneous_FUNC); diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java index 72695dadbb..4630423a17 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java @@ -7145,6 +7145,7 @@ public static final int /*long*/ gtk_box_new(int orientation, int spacing) { } /** * @method flags=dynamic + * @param box cast=(GtkBox *) */ public static final native void _gtk_box_set_homogeneous(int /*long*/ box, boolean homogeneous); public static final void gtk_box_set_homogeneous(int /*long*/ box, boolean homogeneous) { diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DirectoryDialog.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DirectoryDialog.java index 1a28ecebdb..d10d2b8bf1 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DirectoryDialog.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DirectoryDialog.java @@ -160,9 +160,9 @@ String openChooserDialog () { if (message.length () > 0) { byte [] buffer = Converter.wcsToMbcs (null, message, true); int /*long*/ box = 0; - if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)){ - box = OS.gtk_box_new(OS.GTK_ORIENTATION_HORIZONTAL, 0); - OS.gtk_box_set_homogeneous(box, false); + if (OS.GTK_VERSION >= OS.VERSION (3, 0, 0)) { + box = OS.gtk_box_new (OS.GTK_ORIENTATION_HORIZONTAL, 0); + OS.gtk_box_set_homogeneous (box, false); } else { box = OS.gtk_hbox_new (false, 0); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandBar.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandBar.java index cf156cb5c9..c515ebaf77 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandBar.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandBar.java @@ -130,12 +130,7 @@ void createHandle (int index) { fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0); if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES); gtk_widget_set_has_window (fixedHandle, true); - if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)){ - handle = OS.gtk_box_new(OS.GTK_ORIENTATION_VERTICAL, 0); - OS.gtk_box_set_homogeneous(handle, false); - } else { - handle = OS.gtk_vbox_new (false, 0); - } + handle = gtk_box_new (OS.GTK_ORIENTATION_VERTICAL, false, 0); if (handle == 0) error (SWT.ERROR_NO_HANDLES); if ((style & SWT.V_SCROLL) != 0) { scrolledHandle = OS.gtk_scrolled_window_new (0, 0); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java index 232b05af5a..e8ff75e44b 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java @@ -217,7 +217,7 @@ void createItem (TabItem item, int index) { System.arraycopy (items, 0, newItems, 0, items.length); items = newItems; } - int /*long*/ boxHandle = gtk_box_new ( OS.GTK_ORIENTATION_HORIZONTAL, false, 0); + int /*long*/ boxHandle = gtk_box_new (OS.GTK_ORIENTATION_HORIZONTAL, false, 0); if (boxHandle == 0) error (SWT.ERROR_NO_HANDLES); int /*long*/ labelHandle = OS.gtk_label_new_with_mnemonic (null); if (labelHandle == 0) error (SWT.ERROR_NO_HANDLES); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java index d859a2f916..70621ce8c7 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java @@ -658,7 +658,7 @@ void createItem (TableColumn column, int index) { } else { createColumn (column, index); } - int /*long*/ boxHandle = gtk_box_new ( OS.GTK_ORIENTATION_HORIZONTAL, false, 3); + int /*long*/ boxHandle = gtk_box_new (OS.GTK_ORIENTATION_HORIZONTAL, false, 3); if (boxHandle == 0) error (SWT.ERROR_NO_HANDLES); int /*long*/ labelHandle = OS.gtk_label_new_with_mnemonic (null); if (labelHandle == 0) error (SWT.ERROR_NO_HANDLES); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java index 6145bc6524..742d742ead 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java @@ -215,7 +215,7 @@ void createHandle (int index) { */ handle = OS.gtk_tool_button_new (0, null); if (handle == 0) error (SWT.ERROR_NO_HANDLES); - arrowBoxHandle = gtk_box_new ( OS.GTK_ORIENTATION_HORIZONTAL, false, 0);; + arrowBoxHandle = gtk_box_new (OS.GTK_ORIENTATION_HORIZONTAL, false, 0); if (arrowBoxHandle == 0) error(SWT.ERROR_NO_HANDLES); arrowHandle = OS.gtk_arrow_new (OS.GTK_ARROW_DOWN, OS.GTK_SHADOW_NONE); if (arrowHandle == 0) error (SWT.ERROR_NO_HANDLES); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java index a105fefe3c..f3a061833a 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java @@ -769,7 +769,7 @@ void createItem (TreeColumn column, int index) { } else { createColumn (column, index); } - int /*long*/ boxHandle = gtk_box_new ( OS.GTK_ORIENTATION_HORIZONTAL, false, 3); + int /*long*/ boxHandle = gtk_box_new (OS.GTK_ORIENTATION_HORIZONTAL, false, 3); if (boxHandle == 0) error (SWT.ERROR_NO_HANDLES); int /*long*/ labelHandle = OS.gtk_label_new_with_mnemonic (null); if (labelHandle == 0) error (SWT.ERROR_NO_HANDLES); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java index e9db87b1ae..5161141007 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java @@ -1826,7 +1826,7 @@ void gdk_pixmap_get_size (int /*long*/ pixmap, int[] width, int[] height) { } void gdk_window_get_size (int /*long*/ drawable, int[] width, int[] height) { - if (OS.GTK_VERSION >= OS.VERSION(2, 24, 0)) { + if (OS.GTK_VERSION >= OS.VERSION (2, 24, 0)) { width[0] = OS.gdk_window_get_width (drawable); height[0] = OS.gdk_window_get_height (drawable); } else { @@ -1836,13 +1836,13 @@ void gdk_window_get_size (int /*long*/ drawable, int[] width, int[] height) { int /*long*/ gtk_box_new (int orientation, boolean homogeneous, int spacing) { int /*long*/ box = 0; - if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) { + if (OS.GTK_VERSION >= OS.VERSION (3, 0, 0)) { box = OS.gtk_box_new (orientation, spacing); OS.gtk_box_set_homogeneous (box, homogeneous); } else { if (orientation == OS.GTK_ORIENTATION_HORIZONTAL) { box = OS.gtk_hbox_new (homogeneous, spacing); - } else if (orientation == OS.GTK_ORIENTATION_VERTICAL) { + } else { box = OS.gtk_vbox_new (homogeneous, spacing); } } |