/** Search. */ public void search() { ToolsSettings settings = ToolsSettings.getInstance(); SearchEngine searchEngine = settings.getSelectedSearchEngine(); if (searchEngine != null) { try { this.navigate(searchEngine.getURL(this.getAddressBarText())); } catch (MalformedURLException mfu) { window.getTopFrame().alert("Malformed search URL."); } } }
/** Show source. */ public void showSource() { String sourceCode = window.getTopFrame().getSourceCode(); if (sourceCode == null) { sourceCode = ""; } TextViewerWindow textViewer = new TextViewerWindow(window); textViewer.setText(sourceCode); textViewer.setSize(new Dimension(600, 400)); textViewer.setLocationByPlatform(true); textViewer.setVisible(true); }
/* * (non-Javadoc) * @see org.lobobrowser.primary.action.EnableableAction#updateEnabling() */ @Override public void updateEnabling() { action.setEnabled(window.hasSource()); }
/* * (non-Javadoc) * * @see * java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) */ @Override public void actionPerformed(ActionEvent e) { window.reload(); }
/* * (non-Javadoc) * * @see * org.lobobrowser.primary.ext.ActionPool.EnableableAction#updateEnabling() */ @Override public void updateEnabling() { action.setEnabled(window.canReload()); }