コード例 #1
0
ファイル: PHPWatchAction.java プロジェクト: N3X15/studio3-php
 /**
  * Creates an expression, adds it to the expression manager and set the debug context.<br>
  * This default behavior can be subclassed to be changed.
  *
  * @param expressionManager
  * @param expression
  */
 @SuppressWarnings("restriction")
 protected void createExpression(IExpressionManager expressionManager, String expression) {
   IWatchExpression watchExpression = expressionManager.newWatchExpression(expression.trim());
   expressionManager.addExpression(watchExpression);
   // refresh and re-evaluate
   watchExpression.setExpressionContext(getContext());
 }
コード例 #2
0
 /**
  * Creates a new watch expression from a string using the default expression manager.
  *
  * @param exp the string to use to create the expression
  */
 private IExpression createExpression(String exp) {
   IWatchExpression expression =
       DebugPlugin.getDefault().getExpressionManager().newWatchExpression(exp);
   IAdaptable object = DebugUITools.getPartDebugContext(fSite);
   IDebugElement context = null;
   if (object instanceof IDebugElement) {
     context = (IDebugElement) object;
   } else if (object instanceof ILaunch) {
     context = ((ILaunch) object).getDebugTarget();
   }
   expression.setExpressionContext(context);
   return expression;
 }
コード例 #3
0
 private String getWatchExpressionText(IWatchExpression exp) throws CoreException {
   StringBuilder sb = new StringBuilder();
   sb.append("\"");
   sb.append(exp.getExpressionText());
   sb.append("\"");
   if (exp.getValue() != null
       && exp.getValue().getValueString() != null
       && exp.getValue().getValueString().length() > 0) {
     sb.append(" = ");
     sb.append(exp.getValue().getValueString());
   }
   return sb.toString();
 }