use of org.eclipse.swt.browser.ProgressEvent in project cubrid-manager by CUBRID.
the class BrowserEditorPart method initBrowser.
private void initBrowser(Composite parent) {
browser = new Browser(parent, SWT.None);
browser.setLayoutData(createGridData(FILL_BOTH, 3, 1, -1, -1));
// Add location change listener
browser.addLocationListener(new LocationListener() {
public void changing(LocationEvent e) {
location.setText(e.location);
}
public void changed(LocationEvent e) {
noOp();
}
});
// Add loading listener
browser.addProgressListener(new ProgressListener() {
// Set stopItem and progress bar status
public void changed(ProgressEvent e) {
if (!stopItem.isEnabled() && e.total != e.current) {
stopItem.setEnabled(true);
}
}
// Set stopItem,backItem,forwardItem and progress bar status
public void completed(ProgressEvent e) {
stopItem.setEnabled(false);
backItem.setEnabled(browser.isBackEnabled());
forwardItem.setEnabled(browser.isForwardEnabled());
}
});
}
Aggregations