1 package net.sourceforge.phpeclipse.webbrowser.internal;
5 import net.sourceforge.phpeclipse.webbrowser.IInternalWebBrowser;
6 import net.sourceforge.phpeclipse.webbrowser.IInternalWebBrowserWorkingCopy;
7 import net.sourceforge.phpeclipse.webbrowser.WebBrowserEditorInput;
9 import org.eclipse.ui.IMemento;
14 public class InternalWebBrowser implements IInternalWebBrowser {
15 private static final String MEMENTO_NEW_PAGE = "new_page";
17 private static final String MEMENTO_CLEAR_HISTORY_ON_EXIT = "clear_history";
19 protected boolean useNewPage;
21 protected boolean clearHistory;
26 * @see net.sourceforge.phpeclipse.webbrowser.IWebBrowser#getName()
28 public String getName() {
29 return WebBrowserUIPlugin.getResource("%internalWebBrowserName");
32 public boolean getUseNewPage() {
36 public boolean getClearHistoryOnExit() {
40 public boolean isWorkingCopy() {
44 public IInternalWebBrowserWorkingCopy getWorkingCopy() {
45 return new InternalWebBrowserWorkingCopy(this);
48 protected void setInternal(IInternalWebBrowser browser) {
49 useNewPage = browser.getUseNewPage();
50 clearHistory = browser.getClearHistoryOnExit();
56 * @see net.sourceforge.phpeclipse.webbrowser.IWebBrowser#openURL(java.net.URL)
58 public void openURL(URL url) {
59 WebBrowserEditor.open(new WebBrowserEditorInput(url));
62 protected void save(IMemento memento) {
63 memento.putString(MEMENTO_NEW_PAGE, useNewPage ? "true" : "false");
64 memento.putString(MEMENTO_CLEAR_HISTORY_ON_EXIT, clearHistory ? "true"
68 protected void load(IMemento memento) {
69 String s = memento.getString(MEMENTO_NEW_PAGE);
75 s = memento.getString(MEMENTO_CLEAR_HISTORY_ON_EXIT);
82 public String toString() {
83 return "Internal Web browser";