Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display problems in Eclipse Juno #24

Closed
donkirkby opened this issue Apr 20, 2013 · 1 comment
Closed

Display problems in Eclipse Juno #24

donkirkby opened this issue Apr 20, 2013 · 1 comment
Labels
Milestone

Comments

@donkirkby
Copy link
Owner

This problem was reported by a user via e-mail. Thanks for the bug report and suggested fix!

(screen is split in two: first half blank, second half contains the editor and live-display output)

After debugging a couple of hours (I have little Java experience and no experience writing Eclipse Plugins) I traced the problem down to the parent of the Splitter containing the editor and live-display widgets. When setting parent layout to Grid the code editor moves to the left and the big gray space on the left of it disappears.

Here's the changes I did (probably needs more work to keep compatibility with older versions of Eclipse):

$ git diff -p --no-ext-diff plugin/src/live_py/LiveCodingAnalyst.java
diff --git a/plugin/src/live_py/LiveCodingAnalyst.java b/plugin/src/live_py/LiveCodingAnalyst.java
index df44be4..2a8c026 100644
--- a/plugin/src/live_py/LiveCodingAnalyst.java
+++ b/plugin/src/live_py/LiveCodingAnalyst.java
@@ -31,6 +31,7 @@ import org.eclipse.swt.SWT;
 import org.eclipse.swt.graphics.Rectangle;
 import org.eclipse.swt.layout.FillLayout;
 import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Display;
 import org.osgi.framework.Bundle;
@@ -111,8 +112,14 @@ public class LiveCodingAnalyst {
         * @return The new control that the editor can be created in.
         */
        public Object createPartControl(Composite parent) {
-               splitter = new Splitter(parent, SWT.HORIZONTAL);

+               parent.setLayout(new GridLayout());
+               parent.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));             
+
+               splitter = new Splitter(parent,SWT.HORIZONTAL);
+               splitter.setLayout(new FillLayout());
+               splitter.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));           
+
                Composite editorContent = new Composite(splitter, SWT.NONE);
                editorContent.setLayout(new FillLayout());
                GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);

Tested on:

  • Eclipse Juno:
    Eclipse for Mobile Developers
    Version: Juno Service Release 2
    Build id: 20130225-0426
  • Aptana:
    Aptana Studio 3, build: 3.4.0.201304151603
@donkirkby
Copy link
Owner Author

Those changes continue to work for me in Eclipse Indigo (3.7), so I'm merging them. Thanks for the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant