/* Location Field */
createLocationInput(container);
}
private void createInfobar(final Composite parent) {
final IPreferenceScope preferences = Owl.getPreferenceService().getGlobalScope();
if (Application.IS_WINDOWS && !preferences.getBoolean(DefaultPreferences.JS_INFOBAR_CLOSED) && preferences.getBoolean(DefaultPreferences.DISABLE_JAVASCRIPT)) {
/* Separator */
fJSInfoSeparator = new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL);
fJSInfoSeparator.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false));
/* Info Bar */
fJSInfoBar = new Composite(parent, SWT.None);
fJSInfoBar.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
fJSInfoBar.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false));
fJSInfoBar.setLayout(LayoutUtils.createGridLayout(3, 3, 3));
Label imgLabel = new Label(fJSInfoBar, SWT.None);
imgLabel.setImage(OwlUI.getImage(imgLabel, "icons/obj16/warning.gif")); //$NON-NLS-1$
imgLabel.setBackground(fJSInfoBar.getBackground());
imgLabel.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, true));
Link textLink = new Link(fJSInfoBar, SWT.NONE);
textLink.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true));
textLink.setBackground(fJSInfoBar.getBackground());
textLink.setText(Messages.WebBrowserView_JS_DISABLED_INFO);
textLink.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
PreferencesUtil.createPreferenceDialogOn(fBrowser.getControl().getShell(), BrowserPreferencePage.ID, null, Boolean.TRUE).open();
}
});
ToolBar bar = new ToolBar(fJSInfoBar, SWT.FLAT);
bar.setLayoutData(new GridData(SWT.END, SWT.CENTER, false, true));
bar.setBackground(fJSInfoBar.getBackground());
ToolItem closeItem = new ToolItem(bar, SWT.PUSH);
closeItem.setToolTipText(Messages.WebBrowserView_CLOSE);
closeItem.setImage(OwlUI.getImage(bar, "icons/etool16/close_normal.png")); //$NON-NLS-1$
closeItem.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
closeJSInfoBar();
preferences.putBoolean(DefaultPreferences.JS_INFOBAR_CLOSED, true);
}
});
}
}