Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

rename inspect to display

  • Loading branch information...
commit 9783ae22a0abfbb2e289699239195cae4366e143 1 parent aadf735
@JPMoresmau authored
View
1  ...ipsefp.haskell.debug.core/src/net/sf/eclipsefp/haskell/debug/core/internal/debug/HaskellDebugTarget.java
@@ -105,7 +105,6 @@ public HaskellDebugTarget(final ILaunch launch, final IProcess process){
this.fProcess.getStreamsProxy().getOutputStreamMonitor().addListener( this );
DebugPlugin.getDefault().getBreakpointManager().addBreakpointListener(this);
- instances(1);
}
@Override
View
4 net.sf.eclipsefp.haskell.ui/plugin.properties
@@ -122,8 +122,8 @@ openDefinitionCommand_desc = Opens an editor on the declaration of the selected
watchExpressionCommand_name=Watch
watchExpressionCommand_desc=Add the selected code to the watched expressions
-inspectExpressionCommand_name=Inspect
-inspectExpressionCommand_desc=See the current value of the expression
+displayExpressionCommand_name=Display
+displayExpressionCommand_desc=See the current value of the expression
searchHoogleAction_label = Search in &Hoogle
searchHoogleAction_tooltip = Search for the select element in Hoogle
View
14 net.sf.eclipsefp.haskell.ui/plugin.xml
@@ -481,10 +481,10 @@
name="%watchExpressionCommand_name"
id="net.sf.eclipsefp.ui.commands.run.watchExpression"/>
<command
- description="%inspectExpressionCommand_desc"
+ description="%displayExpressionCommand_desc"
categoryId="org.eclipse.debug.ui.category.run"
- name="%inspectExpressionCommand_name"
- id="net.sf.eclipsefp.ui.commands.run.inspectExpression"/>
+ name="%displayExpressionCommand_name"
+ id="net.sf.eclipsefp.ui.commands.run.displayExpression"/>
<command
description="%HaddockDocumentFollowing.description"
categoryId="net.sf.eclipsefp.haskell.ui.category.source"
@@ -531,7 +531,7 @@
<menuContribution
locationURI="menu:org.eclipse.ui.run?after=emptyBreakpointGroup">
<command
- commandId="net.sf.eclipsefp.ui.commands.run.inspectExpression"
+ commandId="net.sf.eclipsefp.ui.commands.run.displayExpression"
icon="icons/etool16/insp_exp.gif">
<visibleWhen checkEnabled="true"/>
</command>
@@ -561,7 +561,7 @@
<menuContribution
locationURI="popup:#HaskellEditorContext?after=additions">
<command
- commandId="net.sf.eclipsefp.ui.commands.run.inspectExpression"
+ commandId="net.sf.eclipsefp.ui.commands.run.displayExpression"
icon="icons/etool16/insp_exp.gif">
<visibleWhen checkEnabled="true"/>
</command>
@@ -728,8 +728,8 @@
</handler>
<!-- handler for the Inspect expression action when invoked from the HaskellEditor -->
<handler
- class="net.sf.eclipsefp.haskell.ui.handlers.InspectExpressionHandler"
- commandId="net.sf.eclipsefp.ui.commands.run.inspectExpression">
+ class="net.sf.eclipsefp.haskell.ui.handlers.DisplayExpressionHandler"
+ commandId="net.sf.eclipsefp.ui.commands.run.displayExpression">
<activeWhen>
<and>
<reference
View
90 net.sf.eclipsefp.haskell.ui/src/net/sf/eclipsefp/haskell/ui/handlers/DisplayExpressionHandler.java
@@ -0,0 +1,90 @@
+/**
+ * Copyright (c) 2012 by JP Moresmau
+ * This code is made available under the terms of the Eclipse Public License,
+ * version 1.0 (EPL). See http://www.eclipse.org/legal/epl-v10.html
+ */
+package net.sf.eclipsefp.haskell.ui.handlers;
+
+import net.sf.eclipsefp.haskell.debug.core.internal.debug.HaskellDebugElement;
+import net.sf.eclipsefp.haskell.debug.core.internal.debug.HaskellValue;
+import net.sf.eclipsefp.haskell.ui.HaskellUIPlugin;
+import net.sf.eclipsefp.haskell.ui.internal.editors.haskell.HaskellEditor;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.model.ISuspendResume;
+import org.eclipse.debug.ui.DebugPopup;
+import org.eclipse.debug.ui.DebugUITools;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Point;
+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.Label;
+
+
+/**
+ * Inspect the current value of the selected expression
+ * @author JP Moresmau
+ *
+ */
+public class DisplayExpressionHandler extends WatchExpressionHandler {
+
+ /* (non-Javadoc)
+ * @see net.sf.eclipsefp.haskell.ui.handlers.WatchExpressionHandler#addExpression(java.lang.String)
+ */
+ @Override
+ protected void addExpression(final HaskellEditor hEditor, final String s ) {
+ IAdaptable context = DebugUITools.getDebugContext();
+ if (context instanceof HaskellDebugElement){
+ final HaskellDebugElement hde=(HaskellDebugElement)context;
+ if ((hde instanceof ISuspendResume && ((ISuspendResume)hde).isSuspended()) || hde.getDebugTarget().isSuspended()){
+ try {
+ final HaskellValue val=hde.getDebugTarget().evaluate( s );
+ hEditor.getEditorSite().getShell().getDisplay().asyncExec( new Runnable(){
+ @Override
+ public void run() {
+ Point p=hEditor.getSelectedPoint();
+ new InspectDialog(hEditor, new Point( p.x, p.y+20 ),s,val.getValueString()).open();
+ //new InspectPopupDialog( hEditor.getEditorSite().getShell(), new Point( p.x, p.y+20 ), null, new HaskellExpression( hde.getDebugTarget(), s, val ) ).open();
+ }
+ });
+
+ } catch (DebugException de){
+ HaskellUIPlugin.log( de );
+ }
+
+ }
+ }
+
+ }
+
+ private static class InspectDialog extends DebugPopup{
+ private final String val;
+ /**
+ *
+ */
+ public InspectDialog(final HaskellEditor hEditor,final Point location,final String exp,final String val) {
+ super(hEditor.getEditorSite().getShell(),location,null);
+ setTitleText( exp );
+ this.val=val;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.PopupDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ protected Control createDialogArea( final Composite parent ) {
+ Composite composite=new Composite(parent,SWT.NONE);
+ composite.setLayout( new GridLayout(1,true) );
+ composite.setLayoutData( new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.FILL_BOTH) );
+ //Composite)super.createDialogArea( parent );
+ Label l=new Label(composite,SWT.NONE);
+ l.setLayoutData( new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL) );
+ l.setText( val );
+ l.setLayoutData( new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.FILL_BOTH) );
+ composite.layout( true );
+ return composite;
+ }
+ }
+}
View
80 net.sf.eclipsefp.haskell.ui/src/net/sf/eclipsefp/haskell/ui/handlers/InspectExpressionHandler.java
@@ -1,80 +0,0 @@
-/**
- * Copyright (c) 2012 by JP Moresmau
- * This code is made available under the terms of the Eclipse Public License,
- * version 1.0 (EPL). See http://www.eclipse.org/legal/epl-v10.html
- */
-package net.sf.eclipsefp.haskell.ui.handlers;
-
-import net.sf.eclipsefp.haskell.debug.core.internal.debug.HaskellDebugElement;
-import net.sf.eclipsefp.haskell.debug.core.internal.debug.HaskellExpression;
-import net.sf.eclipsefp.haskell.debug.core.internal.debug.HaskellValue;
-import net.sf.eclipsefp.haskell.ui.HaskellUIPlugin;
-import net.sf.eclipsefp.haskell.ui.internal.editors.haskell.HaskellEditor;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.ISuspendResume;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.InspectPopupDialog;
-import org.eclipse.swt.graphics.Point;
-
-
-/**
- * Inspect the current value of the selected expression
- * @author JP Moresmau
- *
- */
-public class InspectExpressionHandler extends WatchExpressionHandler {
-
- /* (non-Javadoc)
- * @see net.sf.eclipsefp.haskell.ui.handlers.WatchExpressionHandler#addExpression(java.lang.String)
- */
- @Override
- protected void addExpression(final HaskellEditor hEditor, final String s ) {
- IAdaptable context = DebugUITools.getDebugContext();
- if (context instanceof HaskellDebugElement){
- final HaskellDebugElement hde=(HaskellDebugElement)context;
- if ((hde instanceof ISuspendResume && ((ISuspendResume)hde).isSuspended()) || hde.getDebugTarget().isSuspended()){
- try {
- final HaskellValue val=hde.getDebugTarget().evaluate( s );
- hEditor.getEditorSite().getShell().getDisplay().asyncExec( new Runnable(){
- @Override
- public void run() {
- Point p=hEditor.getSelectedPoint();
- //new InspectDialog(hEditor,s,res).open();
- new InspectPopupDialog( hEditor.getEditorSite().getShell(), new Point( p.x, p.y+20 ), null, new HaskellExpression( hde.getDebugTarget(), s, val ) ).open();
- }
- });
-
- } catch (DebugException de){
- HaskellUIPlugin.log( de );
- }
-
- }
- }
-
- }
-
-// private static class InspectDialog extends PopupDialog{
-// private final String val;
-// /**
-// *
-// */
-// public InspectDialog(final HaskellEditor hEditor,final String exp,final String val) {
-// super(hEditor.getEditorSite().getShell(),PopupDialog.INFOPOPUPRESIZE_SHELLSTYLE,false,false,false,false,false,exp,"");
-// this.val=val;
-// }
-//
-// /* (non-Javadoc)
-// * @see org.eclipse.jface.dialogs.PopupDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
-// */
-// @Override
-// protected Control createDialogArea( final Composite parent ) {
-// Composite composite=(Composite)super.createDialogArea( parent );
-// Label l=new Label(composite,SWT.NONE);
-// l.setLayoutData( new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL) );
-// l.setText( val );
-// composite.layout( true );
-// return composite;
-// }
-// }
-}
Please sign in to comment.
Something went wrong with that request. Please try again.