本文整理汇总了Java中org.eclipse.swt.browser.Browser.setJavascriptEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java Browser.setJavascriptEnabled方法的具体用法?Java Browser.setJavascriptEnabled怎么用?Java Browser.setJavascriptEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.browser.Browser
的用法示例。
在下文中一共展示了Browser.setJavascriptEnabled方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createContent
import org.eclipse.swt.browser.Browser; //导入方法依赖的package包/类
@Override
protected void createContent(Composite parent) {
assertAvailable();
browser = new Browser(parent, SWT.FILL);
browser.setJavascriptEnabled(false);
/* disable browser menues */
browser.setMenu(new Menu(getShell(), SWT.NONE));
}
示例2: createPartControl
import org.eclipse.swt.browser.Browser; //导入方法依赖的package包/类
/** Callback to create and initialize the browser. */
@Override
public void createPartControl(Composite parent) {
browser = new Browser(parent, SWT.NONE);
browser.setRedraw(true);
browser.setJavascriptEnabled(true);
viewjob = new ViewJob(viewpart);
getPreferenceStore().addPropertyChangeListener(this);
getActivePage().addPartListener(this);
}
示例3: createPartControl
import org.eclipse.swt.browser.Browser; //导入方法依赖的package包/类
@Override
public void createPartControl(Composite parent) {
feedbackHandlerUrl = FeedbackPreferences.getString(FeedbackPreferences.FEEDBACK_HANDLER__URL);
browser = new Browser(parent, SWT.NONE);
browser.setJavascriptEnabled(true);
browser.setUrl(feedbackHandlerUrl);
}
示例4: createPartControl
import org.eclipse.swt.browser.Browser; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void createPartControl(final Composite parent) {
browser = new Browser(parent, SWT.NONE);
browser.setJavascriptEnabled(true);
}
示例5: internalCreatePartControl
import org.eclipse.swt.browser.Browser; //导入方法依赖的package包/类
@Override
protected void internalCreatePartControl(Composite parent) {
try {
fBrowser= new Browser(parent, SWT.NONE);
fBrowser.setJavascriptEnabled(false);
fIsUsingBrowserWidget= true;
addLinkListener(fBrowser);
fBrowser.addOpenWindowListener(new OpenWindowListener() {
public void open(WindowEvent event) {
event.required= true; // Cancel opening of new windows
}
});
} catch (SWTError er) {
/* The Browser widget throws an SWTError if it fails to
* instantiate properly. Application code should catch
* this SWTError and disable any feature requiring the
* Browser widget.
* Platform requirements for the SWT Browser widget are available
* from the SWT FAQ web site.
*/
IPreferenceStore store= JavaPlugin.getDefault().getPreferenceStore();
boolean doNotWarn= store.getBoolean(DO_NOT_WARN_PREFERENCE_KEY);
if (WARNING_DIALOG_ENABLED) {
if (!doNotWarn) {
String title= InfoViewMessages.JavadocView_error_noBrowser_title;
String message= InfoViewMessages.JavadocView_error_noBrowser_message;
String toggleMessage= InfoViewMessages.JavadocView_error_noBrowser_doNotWarn;
MessageDialogWithToggle dialog= MessageDialogWithToggle.openError(parent.getShell(), title, message, toggleMessage, false, null, null);
if (dialog.getReturnCode() == Window.OK)
store.setValue(DO_NOT_WARN_PREFERENCE_KEY, dialog.getToggleState());
}
}
fIsUsingBrowserWidget= false;
}
if (!fIsUsingBrowserWidget) {
fText= new StyledText(parent, SWT.V_SCROLL | SWT.H_SCROLL);
fText.setEditable(false);
fPresenter= new HTMLTextPresenter(false);
fText.addControlListener(new ControlAdapter() {
/*
* @see org.eclipse.swt.events.ControlAdapter#controlResized(org.eclipse.swt.events.ControlEvent)
*/
@Override
public void controlResized(ControlEvent e) {
doSetInput(fOriginalInput);
}
});
}
initStyleSheet();
listenForFontChanges();
getViewSite().setSelectionProvider(new SelectionProvider(getControl()));
}