/** * Creates the source viewer that allows the user to enter * an evaluation expression. */ protected void createSourceViewer() { Composite parent= fInputArea; String name= ActionMessages.ExpressionInputDialog_3; try { name= fVariable.getName(); } catch (DebugException e) { JDIDebugUIPlugin.log(e); } fEvaluateLabel= new Label(parent, SWT.WRAP); fEvaluateLabel.setText(MessageFormat.format(ActionMessages.ExpressionInputDialog_0, new String[] {name})); GridData data = new GridData(GridData.FILL_HORIZONTAL); data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH); fEvaluateLabel.setLayoutData(data); fEvaluateLabel.setFont(parent.getFont()); fSourceViewer= new JDISourceViewer(parent, null, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL); fSourceViewer.setInput(parent); configureSourceViewer(); fSourceViewer.doOperation(ITextOperationTarget.SELECT_ALL); }
protected String getVariableText(IJavaVariable var) { String varLabel= DebugUIMessages.JDIModelPresentation_unknown_name__1; try { varLabel= var.getName(); } catch (DebugException exception) {
public void run() { Object selectedObject= getSelectedObject(); if (selectedObject instanceof IStructuredSelection) { IStructuredSelection selection = (IStructuredSelection)selectedObject; Iterator elements = selection.iterator(); while (elements.hasNext()) { try { createWatchExpression(((IJavaVariable)elements.next()).getName()); } catch (DebugException e) { JDIDebugUIPlugin.log(e); return; } } showExpressionView(); } else if (selectedObject instanceof String) { createWatchExpression((String) selectedObject); showExpressionView(); } }
IJavaWatchpoint wp = (IJavaWatchpoint)jbp; IJavaFieldVariable fv = (IJavaFieldVariable)variable; if (variable.getName().equals(wp.getFieldName()) && fv.getDeclaringType().getName().equals(wp.getTypeName())) { valid = wp;
public String[][] getLocalVariables() throws CoreException { IJavaStackFrame frame = getStackFrame(); if (frame != null) { IVariable[] variables = frame.getVariables(); int index = 0; if (!frame.isStatic()) { index = 1; } String[][] locals = new String[2][variables.length - index]; for (int i = 0; i < locals[0].length; i++) { IJavaVariable var = (IJavaVariable) variables[index]; locals[0][i] = var.getName(); locals[1][i] = var.getJavaType().getName(); index++; } return locals; } return super.getLocalVariables(); }
}; final IDebugModelPresentation modelPresentation= DebugUITools.newDebugModelPresentation(); ListSelectionDialog dialog = new InstanceFilterDialog(JDIDebugUIPlugin.getActiveWorkbenchShell(), breakpoints, content, modelPresentation, MessageFormat.format(ActionMessages.InstanceFiltersAction_1, new String[] {var.getName()})){ public void okPressed() {
protected void run() { IWorkbenchPart part= getTargetPart(); if (part instanceof JavaSnippetEditor) { ((JavaSnippetEditor)part).evalSelection(JavaSnippetEditor.RESULT_INSPECT); return; } Object selection= getSelectedObject(); if (!(selection instanceof IStructuredSelection)) { super.run(); return; } //inspecting from the context of the variables view Iterator variables = ((IStructuredSelection)selection).iterator(); while (variables.hasNext()) { IJavaVariable var = (IJavaVariable)variables.next(); try { JavaInspectExpression expr = new JavaInspectExpression(var.getName(), (IJavaValue)var.getValue()); DebugPlugin.getDefault().getExpressionManager().addExpression(expr); } catch (DebugException e) { JDIDebugUIPlugin.statusDialog(e.getStatus()); } } showExpressionView(); }
if (!var.getName().equals("this")) { //$NON-NLS-1$ IValue value= var.getValue(); if (value instanceof IJavaObject) {
null, MessageFormat.format(ActionMessages.InstanceFiltersAction_3, new String[] { modelPresentation.getText(breakpoint), var.getName()}), MessageDialog.QUESTION, new String[] { ActionMessages.InstanceFiltersAction_Yes_2, ActionMessages.InstanceFiltersAction_Cancel_3}, // 0);
public void run(IAction action) { IStructuredSelection currentSelection = getCurrentSelection(); if (currentSelection != null && (currentSelection.getFirstElement() instanceof IJavaVariable)){ IJavaVariable var = (IJavaVariable) currentSelection.getFirstElement(); try { JDIReferenceListValue referenceList = new JDIReferenceListValue((IJavaObject) var.getValue()); InspectPopupDialog ipd = new InspectPopupDialog(getShell(), getAnchor((IDebugView) getPart().getAdapter(IDebugView.class)), PopupInspectAction.ACTION_DEFININITION_ID, new JavaInspectExpression(MessageFormat.format(Messages.AllReferencesActionDelegate_1,new String[]{var.getName()}),referenceList)); ipd.open(); } catch (DebugException e) { JDIDebugUIPlugin.statusDialog(e.getStatus()); } } else { JDIDebugUIPlugin.statusDialog(new Status(IStatus.WARNING,JDIDebugUIPlugin.getUniqueIdentifier(),Messages.AllReferencesActionDelegate_0)); } }