Commits

Anonymous committed 80dfef8

Fixed displaying of repl console.

Comments (0)

Files changed (2)

src/org/lispdev/replview/LocalLispLaunchDelegate.java

           final IWorkbenchWindow w = wk.getActiveWorkbenchWindow();
           wk.showPerspective(LispPerspectiveFactory.ID,w);
           cm.showConsoleView(c);
+          c.setFocus();
         }
         catch(WorkbenchException e)
         {

src/org/lispdev/replview/ReplConsolePage.java

 import org.eclipse.jface.util.PropertyChangeEvent;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.VerifyEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
 import org.eclipse.ui.IActionBars;
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.part.IPageBookViewPage;
 {
   private IPageSite fSite;
 
-  private LispConsole replConsole;
+  private LispConsole replConsole; //viewer
   private Repl repl;
-  private Label info;
   private final LispProcess process;
   private ConsoleEnterTrigger enterTrigger;
 
+  private void setStatusMessage(String msg)
+  {
+    fSite.getActionBars().getStatusLineManager().setMessage(msg);
+  }
+
   /**
    * Constructs a repl console page corresponding to given process
    */
     @Override
     public void disconnected()
     {
-      if( info != null )
-      {
-        info.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
-        info.setText("Not connected");
-      }
+      setStatusMessage("Not connected");
     }
 
     @Override
     public void connected()
     {
-      if( info != null )
-      {
-        info.setText(swank.getLispVersion());
-      }
+      setStatusMessage(swank.getLispVersion());
     }
 
     @Override
     public void connecting()
     {
-      if( info != null )
-      {
-        info.setForeground(
-            Display.getCurrent().getSystemColor(SWT.COLOR_INFO_FOREGROUND));
-        info.setText("Connecting to Lisp ...");
-      }
+      setStatusMessage("Connecting to Lisp ...");
     }
 
     @Override
   @Override
   public void createControl(Composite parent)
   {
-    GridLayout layout = new GridLayout(1, false);
-    layout.marginLeft = 1;
-    layout.marginTop = 1;
-    layout.marginRight = 1;
-    layout.marginBottom = 1;
-    parent.setLayout(layout);
-
-    GridData gd;
-
-    info = new Label(parent, SWT.BORDER);
-    gd = new GridData();
-    gd.horizontalAlignment = GridData.FILL;
-    gd.grabExcessHorizontalSpace = true;
-    gd.grabExcessVerticalSpace = false;
-    info.setLayoutData(gd);
-
-    // Put a border around our text viewer
-    Composite comp = new Composite(parent, SWT.BORDER);
-    layout = new GridLayout(1, false);
-    layout.marginLeft = 0;
-    layout.marginTop = 0;
-    layout.marginRight = 0;
-    layout.marginBottom = 0;
-    layout.horizontalSpacing = 0;
-    layout.marginHeight = 0;
-    layout.marginWidth = 0;
-    comp.setLayout(layout);
-    gd = new GridData();
-    gd.horizontalAlignment = GridData.FILL;
-    gd.verticalAlignment = GridData.FILL;
-    gd.grabExcessHorizontalSpace = true;
-    gd.grabExcessVerticalSpace = true;
-    comp.setLayoutData(gd);
-
-    replConsole = new LispConsole(comp, new VerticalRuler(10),
+    replConsole = new LispConsole(parent/*comp*/, new VerticalRuler(10),
         SWT.V_SCROLL | SWT.H_SCROLL | SWT.MULTI | SWT.LEFT | SWT.BORDER);
-    replConsole.getControl().setLayoutData(gd);
     replConsole.getTextWidget().setFont(JFaceResources.getTextFont());
     JFaceResources.getFontRegistry().addListener(fontListener);
 
         new Prompt("CL-USER>","prompt","0",null,null,SWT.BOLD,false));
     replConsole.startEdit();
     repl.disconnected();
-
   }
 
   @Override