use of org.eclipse.swt.browser.LocationEvent in project netxms by netxms.
the class BrowserView method createPartControl.
/* (non-Javadoc)
* @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
*/
@Override
public void createPartControl(Composite parent) {
browser = new Browser(parent, SWT.NONE);
browser.addLocationListener(new LocationListener() {
@Override
public void changing(LocationEvent event) {
setPartName(String.format(Messages.get().BrowserView_PartName_Changing, event.location));
actionStop.setEnabled(true);
}
@Override
public void changed(LocationEvent event) {
setPartName(String.format(Messages.get().BrowserView_PartName_Changed, getTitle(browser.getText(), event.location)));
actionStop.setEnabled(false);
}
});
createActions();
contributeToActionBars();
}
use of org.eclipse.swt.browser.LocationEvent in project core by jcryptool.
the class BrowserView method createPartControl.
@Override
public void createPartControl(Composite parent) {
GridLayout gridLayout = new GridLayout();
gridLayout.verticalSpacing = 2;
parent.setLayout(gridLayout);
controls = new Controls(parent, SWT.NONE, this);
GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, false);
gridData.heightHint = 28;
controls.setLayoutData(gridData);
browser = new Browser(parent, SWT.NONE);
browser.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
browser.setUrl(BROWSER_HOME);
browser.addLocationListener(new LocationListener() {
public void changed(LocationEvent event) {
history.put(browser.getUrl(), browser.getUrl());
controls.getUrlField().setItems(history.values().toArray(new String[0]));
controls.getUrlField().setText(browser.getUrl());
controls.getBackButton().setEnabled(browser.isBackEnabled());
controls.getForwardButton().setEnabled(browser.isForwardEnabled());
controls.animateReloadButton(false);
}
public void changing(LocationEvent event) {
controls.animateReloadButton(true);
}
});
browser.addStatusTextListener(new StatusTextListener() {
public void changed(StatusTextEvent event) {
status.setText(event.text);
}
});
status = new Text(parent, SWT.BORDER | SWT.READ_ONLY | SWT.SINGLE);
status.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, // $NON-NLS-1$
"org.jcryptool.webbrowser.webBrowserView");
}
Aggregations