|
Lines 600-622
Link Here
|
| 600 |
* <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li> |
600 |
* <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li> |
| 601 |
* </ul> |
601 |
* </ul> |
| 602 |
* |
602 |
* |
|
|
603 |
* @see Browser#evaluate(String,boolean) |
| 603 |
* @see ProgressListener#completed(ProgressEvent) |
604 |
* @see ProgressListener#completed(ProgressEvent) |
| 604 |
* |
605 |
* |
| 605 |
* @since 3.5 |
606 |
* @since 3.5 |
| 606 |
*/ |
607 |
*/ |
| 607 |
public Object evaluate (String script) throws SWTException { |
608 |
public Object evaluate (String script) throws SWTException { |
| 608 |
checkWidget(); |
609 |
checkWidget(); |
| 609 |
return evaluate (script, true); |
610 |
return evaluate (script, false); |
| 610 |
} |
611 |
} |
| 611 |
|
612 |
|
| 612 |
/** |
613 |
/** |
| 613 |
* Returns the result, if any, of executing the specified script. |
614 |
* Returns the result, if any, of executing the specified script. |
| 614 |
* <p> |
615 |
* <p> |
| 615 |
* Evaluates a script containing javascript commands in the context of |
616 |
* Evaluates a script containing javascript commands. |
| 616 |
* the current document. If document-defined functions or properties |
617 |
* When <code>trusted</code> is <code>true</code> script is executed in the context of Chrome |
| 617 |
* are accessed by the script then this method should not be invoked |
618 |
* with Chrome security privileges. |
| 618 |
* until the document has finished loading (<code>ProgressListener.completed()</code> |
619 |
* When <code>trusted</code> is <code>false</code> script is executed in the context of the |
| 619 |
* gives notification of this). |
620 |
* current document with normal privileges. |
|
|
621 |
* </p><p> |
| 622 |
* If document-defined functions or properties are accessed by the script then |
| 623 |
* this method should not be invoked until the document has finished loading |
| 624 |
* (<code>ProgressListener.completed()</code> gives notification of this). |
| 620 |
* </p><p> |
625 |
* </p><p> |
| 621 |
* If the script returns a value with a supported type then a java |
626 |
* If the script returns a value with a supported type then a java |
| 622 |
* representation of the value is returned. The supported |
627 |
* representation of the value is returned. The supported |
|
Lines 628-643
Link Here
|
| 628 |
* <li>javascript boolean -> <code>java.lang.Boolean</code></li> |
633 |
* <li>javascript boolean -> <code>java.lang.Boolean</code></li> |
| 629 |
* <li>javascript array whose elements are all of supported types -> <code>java.lang.Object[]</code></li> |
634 |
* <li>javascript array whose elements are all of supported types -> <code>java.lang.Object[]</code></li> |
| 630 |
* </ul> |
635 |
* </ul> |
| 631 |
* The <code>trusted</code> parameter affects the security context the script will be executed in. |
|
|
| 632 |
* Specifying <code>true</code> for trusted executes the script in Chrome security context <code>false</code> for trusted |
| 633 |
* executes script in normal security context. |
| 634 |
* |
| 635 |
* Note: Chrome security context is applicable only to Browsers with style <code>SWT.Mozilla</code> |
| 636 |
* |
| 637 |
* An <code>SWTException</code> is thrown if the return value has an |
636 |
* An <code>SWTException</code> is thrown if the return value has an |
| 638 |
* unsupported type, or if evaluating the script causes a javascript |
637 |
* unsupported type, or if evaluating the script causes a javascript |
| 639 |
* error to be thrown. |
638 |
* error to be thrown. |
| 640 |
* |
639 |
* </p><p> |
|
|
640 |
* Note: Chrome security context is applicable only to Browsers with style <code>SWT.Mozilla</code>. |
| 641 |
* </p> |
| 641 |
* @param script the script with javascript commands |
642 |
* @param script the script with javascript commands |
| 642 |
* @param trusted <code>true> or <code>false</code> depending on the security context to be used |
643 |
* @param trusted <code>true> or <code>false</code> depending on the security context to be used |
| 643 |
* |
644 |
* |