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;
13 public class InternalWebBrowser implements IInternalWebBrowser {
14 private static final String MEMENTO_NEW_PAGE = "new_page";
15 private static final String MEMENTO_CLEAR_HISTORY_ON_EXIT = "clear_history";
17 protected boolean useNewPage;
18 protected boolean clearHistory;
21 * @see net.sourceforge.phpeclipse.webbrowser.IWebBrowser#getName()
23 public String getName() {
24 return WebBrowserUIPlugin.getResource("%internalWebBrowserName");
27 public boolean getUseNewPage() {
31 public boolean getClearHistoryOnExit() {
35 public boolean isWorkingCopy() {
39 public IInternalWebBrowserWorkingCopy getWorkingCopy() {
40 return new InternalWebBrowserWorkingCopy(this);
43 protected void setInternal(IInternalWebBrowser browser) {
44 useNewPage = browser.getUseNewPage();
45 clearHistory = browser.getClearHistoryOnExit();
49 * @see net.sourceforge.phpeclipse.webbrowser.IWebBrowser#openURL(java.net.URL)
51 public void openURL(URL url) {
52 WebBrowserEditor.open(new WebBrowserEditorInput(url));
55 protected void save(IMemento memento) {
56 memento.putString(MEMENTO_NEW_PAGE, useNewPage ? "true" : "false");
57 memento.putString(MEMENTO_CLEAR_HISTORY_ON_EXIT, clearHistory ? "true" : "false");
60 protected void load(IMemento memento) {
61 String s = memento.getString(MEMENTO_NEW_PAGE);
67 s = memento.getString(MEMENTO_CLEAR_HISTORY_ON_EXIT);
74 public String toString() {
75 return "Internal Web browser";