<antcall target="gather.bin.parts">
<param name="destination.temp.folder" value="${temp.folder}/"/>
</antcall>
- <zip zipfile="${plugin.destination}/net.sourceforge.phpeclipse.webbrowser_1.1.0.jar" basedir="${temp.folder}/net.sourceforge.phpeclipse.webbrowser_1.1.0" filesonly="false" whenempty="skip" update="false"/>
+ <zip zipfile="${plugin.destination}/net.sourceforge.phpeclipse.webbrowser_1.1.1.jar" basedir="${temp.folder}/net.sourceforge.phpeclipse.webbrowser_1.1.1" filesonly="false" whenempty="skip" update="false"/>
<delete dir="${temp.folder}"/>
</target>
<javac destdir="${temp.folder}/webbrowser.jar.bin" failonerror="${javacFailOnError}" verbose="${javacVerbose}" debug="${javacDebugInfo}" includeAntRuntime="no" bootclasspath="${bootclasspath}" source="${javacSource}" target="${javacTarget}" >
<compilerarg line="${compilerArg}"/>
<classpath>
- <pathelement path="../../plugins/org.eclipse.core.resources_3.0.0/resources.jar"/>
- <pathelement path="../../plugins/org.eclipse.core.resources.win32_3.0.0/resources.jar"/>
- <pathelement path="../../plugins/org.eclipse.core.resources.win32_3.0.0/resources-win32.jar"/>
- <pathelement path="../../plugins/org.eclipse.core.runtime.compatibility_3.0.0/compatibility.jar"/>
- <pathelement path="../../plugins/org.eclipse.core.runtime_3.0.0/runtime.jar"/>
- <pathelement path="../../plugins/org.eclipse.osgi_3.0.0/core.jar"/>
- <pathelement path="../../plugins/org.eclipse.osgi_3.0.0/console.jar"/>
- <pathelement path="../../plugins/org.eclipse.osgi_3.0.0/osgi.jar"/>
- <pathelement path="../../plugins/org.eclipse.osgi_3.0.0/resolver.jar"/>
- <pathelement path="../../plugins/org.eclipse.osgi_3.0.0/defaultAdaptor.jar"/>
- <pathelement path="../../plugins/org.eclipse.osgi_3.0.0/eclipseAdaptor.jar"/>
- <pathelement path="../../plugins/org.eclipse.update.configurator_3.0.0/configurator.jar"/>
- <pathelement path="../../plugins/org.eclipse.ui_3.0.0/ui.jar"/>
- <pathelement path="../../plugins/org.eclipse.help_3.0.0/help.jar"/>
- <pathelement path="../../plugins/org.eclipse.swt_3.0.0/ws/${basews}/swt.jar"/>
- <pathelement path="../../plugins/org.eclipse.swt.win32_3.0.0/ws/${basews}/swt.jar"/>
- <pathelement path="../../plugins/org.eclipse.swt.win32_3.0.0"/>
- <pathelement path="../../plugins/org.eclipse.jface_3.0.0/jface.jar"/>
- <pathelement path="../../plugins/org.eclipse.ui.workbench_3.0.0/compatibility.jar"/>
- <pathelement path="../../plugins/org.eclipse.ui.workbench_3.0.0/workbench.jar"/>
- <pathelement path="../../plugins/org.eclipse.ui.workbench.compatibility_3.0.0/compatibility.jar"/>
- <pathelement path="../../plugins/org.eclipse.ui.workbench.compatibility_3.0.0/workbench.jar"/>
- <pathelement path="../../plugins/org.eclipse.core.expressions_3.0.0/expressions.jar"/>
- <pathelement path="../../plugins/org.eclipse.ui.ide_3.0.0/ide.jar"/>
- <pathelement path="../../plugins/org.eclipse.ui.win32_3.0.0/ide.jar"/>
- <pathelement path="../../plugins/org.eclipse.ui.win32_3.0.0/workbenchwin32.jar"/>
- <pathelement path="../../plugins/org.eclipse.ui.views_3.0.0/views.jar"/>
- <pathelement path="../../plugins/org.eclipse.update.core_3.0.0/updatecore.jar"/>
- <pathelement path="../../plugins/org.eclipse.update.core.win32_3.0.0/updatecore.jar"/>
- <pathelement path="../../plugins/org.eclipse.update.ui_3.0.0/updateui.jar"/>
- <pathelement path="../../plugins/org.eclipse.help.base_3.0.0/helpbase.jar"/>
- <pathelement path="../../plugins/org.apache.lucene_1.3.0/parser.jar"/>
- <pathelement path="../../plugins/org.apache.lucene_1.3.0/lucene-1.3-final.jar"/>
- <pathelement path="../../plugins/org.eclipse.help.appserver_3.0.0/appserver.jar"/>
- <pathelement path="../../plugins/org.eclipse.ui.forms_3.0.0/forms.jar"/>
- <pathelement path="../../plugins/org.eclipse.ui.editors_3.0.0/editors.jar"/>
- <pathelement path="../../plugins/org.eclipse.ui.workbench.texteditor_3.0.0/texteditor.jar"/>
- <pathelement path="../../plugins/org.eclipse.jface.text_3.0.0/jfacetext.jar"/>
- <pathelement path="../../plugins/org.eclipse.text_3.0.0/text.jar"/>
- <pathelement path="../../plugins/org.eclipse.core.filebuffers_3.0.0/filebuffers.jar"/>
+ <pathelement path="../../../eclipse301/plugins/org.eclipse.core.resources_3.0.1/resources.jar"/>
+ <pathelement path="../../../eclipse301/plugins/org.eclipse.core.resources.win32_3.0.0/resources.jar"/>
+ <pathelement path="../../../eclipse301/plugins/org.eclipse.core.resources.win32_3.0.0/resources-win32.jar"/>
+ <pathelement path="../../../eclipse301/plugins/org.eclipse.core.runtime.compatibility_3.0.0/compatibility.jar"/>
+ <pathelement path="../../../eclipse301/plugins/org.eclipse.core.runtime_3.0.1/runtime.jar"/>
+ <pathelement path="../../../eclipse301/plugins/org.eclipse.osgi_3.0.1/core.jar"/>
+ <pathelement path="../../../eclipse301/plugins/org.eclipse.osgi_3.0.1/console.jar"/>
+ <pathelement path="../../../eclipse301/plugins/org.eclipse.osgi_3.0.1/osgi.jar"/>
+ <pathelement path="../../../eclipse301/plugins/org.eclipse.osgi_3.0.1/resolver.jar"/>
+ <pathelement path="../../../eclipse301/plugins/org.eclipse.osgi_3.0.1/defaultAdaptor.jar"/>
+ <pathelement path="../../../eclipse301/plugins/org.eclipse.osgi_3.0.1/eclipseAdaptor.jar"/>
+ <pathelement path="../../../eclipse301/plugins/org.eclipse.update.configurator_3.0.0/configurator.jar"/>
+ <pathelement path="../../../eclipse301/plugins/org.eclipse.ui_3.0.1/ui.jar"/>
+ <pathelement path="../../../eclipse301/plugins/org.eclipse.help_3.0.0/help.jar"/>
+ <pathelement path="../../../eclipse301/plugins/org.eclipse.swt_3.0.1/ws/${basews}/swt.jar"/>
+ <pathelement path="../../../eclipse301/plugins/org.eclipse.swt.win32_3.0.1/ws/${basews}/swt.jar"/>
+ <pathelement path="../../../eclipse301/plugins/org.eclipse.swt.win32_3.0.1"/>
+ <pathelement path="../../../eclipse301/plugins/org.eclipse.jface_3.0.0/jface.jar"/>
+ <pathelement path="../../../eclipse301/plugins/org.eclipse.ui.workbench_3.0.1/compatibility.jar"/>
+ <pathelement path="../../../eclipse301/plugins/org.eclipse.ui.workbench_3.0.1/workbench.jar"/>
+ <pathelement path="../../../eclipse301/plugins/org.eclipse.ui.workbench.compatibility_3.0.0/compatibility.jar"/>
+ <pathelement path="../../../eclipse301/plugins/org.eclipse.ui.workbench.compatibility_3.0.0/workbench.jar"/>
+ <pathelement path="../../../eclipse301/plugins/org.eclipse.core.expressions_3.0.0/expressions.jar"/>
+ <pathelement path="../../../eclipse301/plugins/org.eclipse.ui.ide_3.0.1/ide.jar"/>
+ <pathelement path="../../../eclipse301/plugins/org.eclipse.ui.win32_3.0.1/ide.jar"/>
+ <pathelement path="../../../eclipse301/plugins/org.eclipse.ui.win32_3.0.1/workbenchwin32.jar"/>
+ <pathelement path="../../../eclipse301/plugins/org.eclipse.ui.views_3.0.0/views.jar"/>
+ <pathelement path="../../../eclipse301/plugins/org.eclipse.update.core_3.0.1/updatecore.jar"/>
+ <pathelement path="../../../eclipse301/plugins/org.eclipse.update.core.win32_3.0.0/updatecore.jar"/>
+ <pathelement path="../../../eclipse301/plugins/org.eclipse.update.ui_3.0.1/updateui.jar"/>
+ <pathelement path="../../../eclipse301/plugins/org.eclipse.help.base_3.0.1/helpbase.jar"/>
+ <pathelement path="../../../eclipse301/plugins/org.apache.lucene_1.3.1/parser.jar"/>
+ <pathelement path="../../../eclipse301/plugins/org.apache.lucene_1.3.1/lucene-1.3-final.jar"/>
+ <pathelement path="../../../eclipse301/plugins/org.eclipse.help.appserver_3.0.0/appserver.jar"/>
+ <pathelement path="../../../eclipse301/plugins/org.eclipse.ui.forms_3.0.0/forms.jar"/>
+ <pathelement path="../../../eclipse301/plugins/org.eclipse.ui.editors_3.0.1/editors.jar"/>
+ <pathelement path="../../../eclipse301/plugins/org.eclipse.ui.workbench.texteditor_3.0.1/texteditor.jar"/>
+ <pathelement path="../../../eclipse301/plugins/org.eclipse.jface.text_3.0.1/jfacetext.jar"/>
+ <pathelement path="../../../eclipse301/plugins/org.eclipse.text_3.0.1/text.jar"/>
+ <pathelement path="../../../eclipse301/plugins/org.eclipse.core.filebuffers_3.0.1/filebuffers.jar"/>
</classpath>
<src path="src/" />
</javac>
</target>
<target name="gather.bin.parts" depends="init" if="destination.temp.folder">
- <mkdir dir="${destination.temp.folder}/net.sourceforge.phpeclipse.webbrowser_1.1.0"/>
- <copy todir="${destination.temp.folder}/net.sourceforge.phpeclipse.webbrowser_1.1.0" failonerror="true">
+ <mkdir dir="${destination.temp.folder}/net.sourceforge.phpeclipse.webbrowser_1.1.1"/>
+ <copy todir="${destination.temp.folder}/net.sourceforge.phpeclipse.webbrowser_1.1.1" failonerror="true">
<fileset dir="${build.result.folder}" includes="webbrowser.jar" />
</copy>
- <copy todir="${destination.temp.folder}/net.sourceforge.phpeclipse.webbrowser_1.1.0" failonerror="true">
+ <copy todir="${destination.temp.folder}/net.sourceforge.phpeclipse.webbrowser_1.1.1" failonerror="true">
<fileset dir="${basedir}" includes="plugin.xml,*.jar,plugin.properties/,webbrowser.jar,icons/,home/,plugin.properties,defaultBrowsers.xml,.options" />
</copy>
</target>
</target>
<target name="gather.sources" depends="init" if="destination.temp.folder">
- <mkdir dir="${destination.temp.folder}/net.sourceforge.phpeclipse.webbrowser_1.1.0"/>
- <copy file="${build.result.folder}/webbrowsersrc.zip" todir="${destination.temp.folder}/net.sourceforge.phpeclipse.webbrowser_1.1.0" failonerror="false"/>
- <copy todir="${destination.temp.folder}/net.sourceforge.phpeclipse.webbrowser_1.1.0" failonerror="false">
+ <mkdir dir="${destination.temp.folder}/net.sourceforge.phpeclipse.webbrowser_1.1.1"/>
+ <copy file="${build.result.folder}/webbrowsersrc.zip" todir="${destination.temp.folder}/net.sourceforge.phpeclipse.webbrowser_1.1.1" failonerror="false"/>
+ <copy todir="${destination.temp.folder}/net.sourceforge.phpeclipse.webbrowser_1.1.1" failonerror="false">
<fileset dir="${basedir}" includes="plugin.properties/,schema/,build.properties,src/,.classpath,.cvsignore,.project" />
</copy>
</target>
<target name="gather.logs" depends="init" if="destination.temp.folder">
- <mkdir dir="${destination.temp.folder}/net.sourceforge.phpeclipse.webbrowser_1.1.0"/>
- <copy file="${temp.folder}/webbrowser.jar.bin.log" todir="${destination.temp.folder}/net.sourceforge.phpeclipse.webbrowser_1.1.0" failonerror="false"/>
+ <mkdir dir="${destination.temp.folder}/net.sourceforge.phpeclipse.webbrowser_1.1.1"/>
+ <copy file="${temp.folder}/webbrowser.jar.bin.log" todir="${destination.temp.folder}/net.sourceforge.phpeclipse.webbrowser_1.1.1" failonerror="false"/>
</target>
<target name="clean" depends="init" description="Clean the plug-in: net.sourceforge.phpeclipse.webbrowser of all the zips, jars and logs created.">
<delete file="${build.result.folder}/webbrowser.jar"/>
<delete file="${build.result.folder}/webbrowsersrc.zip"/>
- <delete file="${plugin.destination}/net.sourceforge.phpeclipse.webbrowser_1.1.0.jar"/>
- <delete file="${plugin.destination}/net.sourceforge.phpeclipse.webbrowser_1.1.0.zip"/>
+ <delete file="${plugin.destination}/net.sourceforge.phpeclipse.webbrowser_1.1.1.jar"/>
+ <delete file="${plugin.destination}/net.sourceforge.phpeclipse.webbrowser_1.1.1.zip"/>
<delete dir="${temp.folder}"/>
</target>
<delete>
<fileset dir="${temp.folder}" includes="**/*.bin.log" />
</delete>
- <zip zipfile="${plugin.destination}/net.sourceforge.phpeclipse.webbrowser_1.1.0.zip" basedir="${temp.folder}" filesonly="true" whenempty="skip" update="false"/>
+ <zip zipfile="${plugin.destination}/net.sourceforge.phpeclipse.webbrowser_1.1.1.zip" basedir="${temp.folder}" filesonly="true" whenempty="skip" update="false"/>
<delete dir="${temp.folder}"/>
</target>
# Name of the preference pages
preferenceInternetTitle=Internet
preferenceInternetDescription=General internet settings are available in the contained preference pages.
-preferenceWebBrowserTitle=Web Browser
+preferenceWebBrowserTitle=Browser Configurations
preferenceWebBrowserTitleLong=Installed Web Browsers
preferenceWebBrowserDescription=Add, remove, or edit installed Web browsers.\nThe selected Web browser will be used whenever Web pages are opened.
<page
id="net.sourceforge.phpeclipse.webbrowser.preferencePage"
name="%preferenceWebBrowserTitle"
- category="net.sourceforge.phpeclipse.preference.PHPEclipsePreferencePage"
+ category="net.sourceforge.phpeclipse.ui.preferencePage"
class="net.sourceforge.phpeclipse.webbrowser.internal.WebBrowserPreferencePage"/>
</extension>
*******************************************************************************/
package net.sourceforge.phpeclipse.webbrowser.views;
+import net.sourceforge.phpeclipse.webbrowser.internal.BrowserManager;
import net.sourceforge.phpeclipse.webbrowser.internal.WebBrowser;
import net.sourceforge.phpeclipse.webbrowser.internal.WebBrowserUtil;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.swt.browser.ProgressListener;
import org.eclipse.swt.browser.StatusTextListener;
import org.eclipse.swt.browser.TitleListener;
try {
if (WebBrowserUtil.canUseInternalWebBrowser()) {
instance = new WebBrowser(frame, true, true);
- }
+ }
} catch (Exception e) {
instance = null;
}
category="net.sourceforge.phpeclipse.ui.category.source"
id="net.sourceforge.phpeclipse.phpeditor.toggle.comment">
</command>
+
<keyBinding
string="Ctrl+Shift+C"
scope="net.sourceforge.phpdt.ui.phpEditorScope"
// public static final String LOCALHOST_PREF = "_localhost";
// public static final String DOCUMENTROOT_PREF = "_documentroot";
- public static final String USE_EXTERNAL_BROWSER_PREF = "_use_external_browser";
+// public static final String USE_EXTERNAL_BROWSER_PREF = "_use_external_browser";
// public static final String SHOW_EXTERNAL_PREVIEW_PREF = "_show_external_preview";
- public static final String EXTERNAL_BROWSER_PREF = "_external_browser";
+// public static final String EXTERNAL_BROWSER_PREF = "_external_browser";
public static final String MYSQL_RUN_PREF = "_mysql_run_pref";
public static final String MYSQL_START_BACKGROUND = "_mysql_start_background";
public static final String MYSQL_PREF = "__mysql_start";
public class PHPEclipseBasePreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
-// private SelectionListener SelectionListener;
-// private ModifyListener ModifyListener;
-// private ModifyListener TextModifyListener;
-//
-// private ArrayList CheckBoxes = new ArrayList();
-// private ArrayList ComboBoxes = new ArrayList();
-// private ArrayList TextBoxes = new ArrayList();
-// private ArrayList RadioButtons = new ArrayList();
-
-// StringFieldEditor localHostSFE;
-// DirectoryFieldEditor documentRootDFE;
-// BooleanFieldEditor showExternalPreviewBFE;
- BooleanFieldEditor externalBrowserBFE;
- StringFieldEditor externalBrowserSFE;
StringFieldEditor apacheStartSFE;
+
StringFieldEditor apacheStopSFE;
+
StringFieldEditor apacheRestartSFE;
+
StringFieldEditor mySQLCommandSFE;
+
FileFieldEditor apacheRunFFE;
+
FileFieldEditor mysqlRunFFE;
+
FileFieldEditor phpRunFFE;
-// RadioGroupFieldEditor chooseParser;
-// StringFieldEditor externalParserSFE;
-// BooleanFieldEditor parseOnSave;
+
BooleanFieldEditor apacheStartBFE;
+
BooleanFieldEditor apacheStopBFE;
+
BooleanFieldEditor apacheRestartBFE;
+
BooleanFieldEditor mysqlStartBFE;
public PHPEclipseBasePreferencePage() {
setPreferenceStore(PHPeclipsePlugin.getDefault().getPreferenceStore());
setDescription(PHPPreferencesMessages.getString("PHPBasePreferencePage.description")); //$NON-NLS-1$
}
+
public void init(IWorkbench workbench) {
}
+
protected void performDefaults() {
-// localHostSFE.loadDefault();
-// documentRootDFE.loadDefault();
-// showExternalPreviewBFE.loadDefault();
- externalBrowserBFE.loadDefault();
- externalBrowserSFE.loadDefault();
apacheStartSFE.loadDefault();
apacheStopSFE.loadDefault();
apacheRestartSFE.loadDefault();
phpRunFFE.loadDefault();
apacheRunFFE.loadDefault();
mysqlRunFFE.loadDefault();
-// chooseParser.loadDefault();
-// externalParserSFE.loadDefault();
-// parseOnSave.loadDefault();
apacheStartBFE.loadDefault();
apacheStopBFE.loadDefault();
apacheRestartBFE.loadDefault();
}
public boolean performOk() {
-// localHostSFE.store();
-// documentRootDFE.store();
-// showExternalPreviewBFE.store();
- externalBrowserBFE.store();
- externalBrowserSFE.store();
+
apacheStartSFE.store();
apacheStopSFE.store();
apacheRestartSFE.store();
phpRunFFE.store();
apacheRunFFE.store();
mysqlRunFFE.store();
-// chooseParser.store();
-// externalParserSFE.store();
-// parseOnSave.store();
+
apacheStartBFE.store();
apacheStopBFE.store();
apacheRestartBFE.store();
Composite composite = new Composite(parent, SWT.LEFT);
composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
composite.setLayout(new GridLayout());
- //Create Websettings
- // Composite webSettingsComposite = new Composite(composite, SWT.NONE);
- // webSettingsComposite.setLayout(new GridLayout());
- // webSettingsComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-// showExternalPreviewBFE =
-// new BooleanFieldEditor(
-// IPreferenceConstants.SHOW_EXTERNAL_PREVIEW_PREF,
-// PHPPreferencesMessages.getString("PHPBasePreferencePage.websettingsGroup.showexternalpreview"),
-// composite);
-// showExternalPreviewBFE.setPreferencePage(this);
-// showExternalPreviewBFE.setPreferenceStore(getPreferenceStore());
-// showExternalPreviewBFE.load();
-
- // Group webSettingsGroup = new Group(webSettingsComposite, SWT.NONE);
- // webSettingsGroup.setText(PHPPreferencesMessages.getString("PHPBasePreferencePage.websettingsGroup"));
- // GridLayout gridLayout = new GridLayout();
- // // gridLayout.numColumns = 3;
- // GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
- // webSettingsGroup.setLayoutData(gridData);
- // webSettingsGroup.setLayout(gridLayout);
-
- Composite webSettingsComposite = new Composite(composite, SWT.NULL);
- webSettingsComposite.setLayout(new GridLayout());
- webSettingsComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- Group webSettingsGroup = new Group(webSettingsComposite, SWT.NONE);
- webSettingsGroup.setText(PHPPreferencesMessages.getString("PHPBasePreferencePage.websettingsGroup"));
- webSettingsGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- webSettingsGroup.setLayout(new GridLayout());
-
- // new Label(webSettingsGroup, SWT.NONE);
- externalBrowserBFE =
- new BooleanFieldEditor(
- IPreferenceConstants.USE_EXTERNAL_BROWSER_PREF,
- PHPPreferencesMessages.getString("PHPBasePreferencePage.websettingsGroup.useexternal"),
- webSettingsGroup);
- externalBrowserBFE.setPreferencePage(this);
- externalBrowserBFE.setPreferenceStore(getPreferenceStore());
- externalBrowserBFE.load();
- new Label(webSettingsGroup, SWT.NONE);
- new Label(webSettingsGroup, SWT.NONE);
- // new Label(webSettingsGroup, SWT.NONE);
- externalBrowserSFE =
- new StringFieldEditor(
- IPreferenceConstants.EXTERNAL_BROWSER_PREF,
- PHPPreferencesMessages.getString("PHPBasePreferencePage.websettingsGroup.browser"),
- webSettingsGroup);
- externalBrowserSFE.setPreferencePage(this);
- externalBrowserSFE.setPreferenceStore(getPreferenceStore());
- externalBrowserSFE.load();
- new Label(webSettingsGroup, SWT.NONE);
-
-// localHostSFE =
-// new StringFieldEditor(
-// IPreferenceConstants.LOCALHOST_PREF,
-// PHPPreferencesMessages.getString("PHPBasePreferencePage.websettingsGroup.localhost"),
-// webSettingsGroup);
-// localHostSFE.setPreferencePage(this);
-// localHostSFE.setPreferenceStore(getPreferenceStore());
-// localHostSFE.load();
- new Label(webSettingsGroup, SWT.NONE);
-
-// documentRootDFE =
-// new DirectoryFieldEditor(
-// IPreferenceConstants.DOCUMENTROOT_PREF,
-// PHPPreferencesMessages.getString("PHPBasePreferencePage.websettingsGroup.docroot"),
-// webSettingsGroup);
-// documentRootDFE.setPreferencePage(this);
-// documentRootDFE.setPreferenceStore(getPreferenceStore());
-// documentRootDFE.load();
+
//Create apache
Composite apacheSettingsComposite = new Composite(composite, SWT.NULL);
apacheSettingsComposite.setLayout(new GridLayout());
apacheSettingsGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
apacheSettingsGroup.setLayout(new GridLayout());
- apacheStartBFE =
- new BooleanFieldEditor(
- PHPeclipsePlugin.APACHE_START_BACKGROUND,
- PHPPreferencesMessages.getString("PHPBasePreferencePage.apacheGroup.start_background"),
- apacheSettingsGroup);
- apacheStartBFE.setPreferencePage(this);
- apacheStartBFE.setPreferenceStore(getPreferenceStore());
- apacheStartBFE.load();
-
+ apacheStartBFE = new BooleanFieldEditor(PHPeclipsePlugin.APACHE_START_BACKGROUND, PHPPreferencesMessages
+ .getString("PHPBasePreferencePage.apacheGroup.start_background"), apacheSettingsGroup);
+ apacheStartBFE.setPreferencePage(this);
+ apacheStartBFE.setPreferenceStore(getPreferenceStore());
+ apacheStartBFE.load();
+
new Label(apacheSettingsGroup, SWT.NONE);
new Label(apacheSettingsGroup, SWT.NONE);
- apacheStartSFE =
- new StringFieldEditor(
- IPreferenceConstants.APACHE_START_PREF,
- PHPPreferencesMessages.getString("PHPBasePreferencePage.apacheGroup.start"),
- apacheSettingsGroup);
+ apacheStartSFE = new StringFieldEditor(IPreferenceConstants.APACHE_START_PREF, PHPPreferencesMessages
+ .getString("PHPBasePreferencePage.apacheGroup.start"), apacheSettingsGroup);
apacheStartSFE.setPreferencePage(this);
apacheStartSFE.setPreferenceStore(getPreferenceStore());
apacheStartSFE.load();
new Label(apacheSettingsGroup, SWT.NONE);
- apacheStopBFE =
- new BooleanFieldEditor(
- PHPeclipsePlugin.APACHE_STOP_BACKGROUND,
- PHPPreferencesMessages.getString("PHPBasePreferencePage.apacheGroup.stop_background"),
- apacheSettingsGroup);
- apacheStopBFE.setPreferencePage(this);
- apacheStopBFE.setPreferenceStore(getPreferenceStore());
- apacheStopBFE.load();
+ apacheStopBFE = new BooleanFieldEditor(PHPeclipsePlugin.APACHE_STOP_BACKGROUND, PHPPreferencesMessages
+ .getString("PHPBasePreferencePage.apacheGroup.stop_background"), apacheSettingsGroup);
+ apacheStopBFE.setPreferencePage(this);
+ apacheStopBFE.setPreferenceStore(getPreferenceStore());
+ apacheStopBFE.load();
new Label(apacheSettingsGroup, SWT.NONE);
new Label(apacheSettingsGroup, SWT.NONE);
- apacheStopSFE =
- new StringFieldEditor(
- IPreferenceConstants.APACHE_STOP_PREF,
- PHPPreferencesMessages.getString("PHPBasePreferencePage.apacheGroup.stop"),
- apacheSettingsGroup);
+ apacheStopSFE = new StringFieldEditor(IPreferenceConstants.APACHE_STOP_PREF, PHPPreferencesMessages
+ .getString("PHPBasePreferencePage.apacheGroup.stop"), apacheSettingsGroup);
apacheStopSFE.setPreferencePage(this);
apacheStopSFE.setPreferenceStore(getPreferenceStore());
apacheStopSFE.load();
new Label(apacheSettingsGroup, SWT.NONE);
- apacheRestartBFE =
- new BooleanFieldEditor(
- PHPeclipsePlugin.APACHE_RESTART_BACKGROUND,
- PHPPreferencesMessages.getString("PHPBasePreferencePage.apacheGroup.restart_background"),
- apacheSettingsGroup);
- apacheRestartBFE.setPreferencePage(this);
- apacheRestartBFE.setPreferenceStore(getPreferenceStore());
- apacheRestartBFE.load();
+ apacheRestartBFE = new BooleanFieldEditor(PHPeclipsePlugin.APACHE_RESTART_BACKGROUND, PHPPreferencesMessages
+ .getString("PHPBasePreferencePage.apacheGroup.restart_background"), apacheSettingsGroup);
+ apacheRestartBFE.setPreferencePage(this);
+ apacheRestartBFE.setPreferenceStore(getPreferenceStore());
+ apacheRestartBFE.load();
new Label(apacheSettingsGroup, SWT.NONE);
new Label(apacheSettingsGroup, SWT.NONE);
- apacheRestartSFE =
- new StringFieldEditor(
- IPreferenceConstants.APACHE_RESTART_PREF,
- PHPPreferencesMessages.getString("PHPBasePreferencePage.apacheGroup.restart"),
- apacheSettingsGroup);
+ apacheRestartSFE = new StringFieldEditor(IPreferenceConstants.APACHE_RESTART_PREF, PHPPreferencesMessages
+ .getString("PHPBasePreferencePage.apacheGroup.restart"), apacheSettingsGroup);
apacheRestartSFE.setPreferencePage(this);
apacheRestartSFE.setPreferenceStore(getPreferenceStore());
apacheRestartSFE.load();
new Label(apacheSettingsGroup, SWT.NONE);
- apacheRunFFE =
- new FileFieldEditor(
- IPreferenceConstants.APACHE_RUN_PREF,
- PHPPreferencesMessages.getString("PHPBasePreferencePage.apacheGroup.run"),
- apacheSettingsGroup);
+ apacheRunFFE = new FileFieldEditor(IPreferenceConstants.APACHE_RUN_PREF, PHPPreferencesMessages
+ .getString("PHPBasePreferencePage.apacheGroup.run"), apacheSettingsGroup);
apacheRunFFE.setPreferencePage(this);
apacheRunFFE.setPreferenceStore(getPreferenceStore());
apacheRunFFE.load();
- phpRunFFE =
- new FileFieldEditor(
- IPreferenceConstants.PHP_RUN_PREF,
- PHPPreferencesMessages.getString("PHPBasePreferencePage.console.php"),
- apacheSettingsGroup);
+ phpRunFFE = new FileFieldEditor(IPreferenceConstants.PHP_RUN_PREF, PHPPreferencesMessages
+ .getString("PHPBasePreferencePage.console.php"), apacheSettingsGroup);
phpRunFFE.setPreferencePage(this);
phpRunFFE.setPreferenceStore(getPreferenceStore());
phpRunFFE.load();
mySQLSettingsGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
mySQLSettingsGroup.setLayout(new GridLayout());
- mysqlStartBFE =
- new BooleanFieldEditor(
- PHPeclipsePlugin.MYSQL_START_BACKGROUND,
- PHPPreferencesMessages.getString("PHPBasePreferencePage.mySQLGroup.start_background"),
- mySQLSettingsGroup);
- mysqlStartBFE.setPreferencePage(this);
- mysqlStartBFE.setPreferenceStore(getPreferenceStore());
- mysqlStartBFE.load();
+ mysqlStartBFE = new BooleanFieldEditor(PHPeclipsePlugin.MYSQL_START_BACKGROUND, PHPPreferencesMessages
+ .getString("PHPBasePreferencePage.mySQLGroup.start_background"), mySQLSettingsGroup);
+ mysqlStartBFE.setPreferencePage(this);
+ mysqlStartBFE.setPreferenceStore(getPreferenceStore());
+ mysqlStartBFE.load();
new Label(mySQLSettingsGroup, SWT.NONE);
new Label(mySQLSettingsGroup, SWT.NONE);
- mySQLCommandSFE =
- new StringFieldEditor(
- IPreferenceConstants.MYSQL_PREF,
- PHPPreferencesMessages.getString("PHPBasePreferencePage.mySQLGroup.command"),
- mySQLSettingsGroup);
+ mySQLCommandSFE = new StringFieldEditor(IPreferenceConstants.MYSQL_PREF, PHPPreferencesMessages
+ .getString("PHPBasePreferencePage.mySQLGroup.command"), mySQLSettingsGroup);
mySQLCommandSFE.setPreferencePage(this);
mySQLCommandSFE.setPreferenceStore(getPreferenceStore());
mySQLCommandSFE.load();
new Label(mySQLSettingsGroup, SWT.NONE);
- mysqlRunFFE =
- new FileFieldEditor(
- IPreferenceConstants.MYSQL_RUN_PREF,
- PHPPreferencesMessages.getString("PHPBasePreferencePage.mySQLGroup.run"),
- mySQLSettingsGroup);
+ mysqlRunFFE = new FileFieldEditor(IPreferenceConstants.MYSQL_RUN_PREF, PHPPreferencesMessages
+ .getString("PHPBasePreferencePage.mySQLGroup.run"), mySQLSettingsGroup);
mysqlRunFFE.setPreferencePage(this);
mysqlRunFFE.setPreferenceStore(getPreferenceStore());
mysqlRunFFE.load();
-// //Create parser settings composite
-// Composite parserSettingsComposite = new Composite(composite, SWT.NONE);
-// parserSettingsComposite.setLayout(new GridLayout());
-// parserSettingsComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-// Group parserSettingsGroup = new Group(parserSettingsComposite, SWT.NONE);
-// parserSettingsGroup.setText(PHPPreferencesMessages.getString("PHPBasePreferencePage.parsers"));
-// parserSettingsGroup.setLayout(new GridLayout());
-// parserSettingsGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-// chooseParser =
-// new RadioGroupFieldEditor(
-// IPreferenceConstants.PHP_PARSER_DEFAULT,
-// PHPPreferencesMessages.getString("PHPBasePreferencePage.parsers.choose"),
-// 1,
-// new String[][] {
-// { PHPPreferencesMessages.getString("PHPBasePreferencePage.parsers.internal"), IPreferenceConstants.PHP_INTERNAL_PARSER },
-// {
-// PHPPreferencesMessages.getString("PHPBasePreferencePage.parsers.external"), IPreferenceConstants.PHP_EXTERNAL_PARSER }
-// }, parserSettingsGroup);
-// chooseParser.setPreferencePage(this);
-// chooseParser.setPreferenceStore(getPreferenceStore());
-// chooseParser.load();
-// //create a copmposte just for the StringEditor - makes layout simpler
-// Composite externalParserCompo = new Composite(parserSettingsGroup, SWT.NONE);
-// externalParserSFE =
-// new StringFieldEditor(
-// IPreferenceConstants.EXTERNAL_PARSER_PREF,
-// PHPPreferencesMessages.getString("PHPBasePreferencePage.parsers.extcommand"),
-// externalParserCompo
-// /*parserSettingsGroup*/
-// );
-// externalParserSFE.setPreferencePage(this);
-// externalParserSFE.setPreferenceStore(getPreferenceStore());
-// externalParserSFE.load();
-//
-// parseOnSave =
-// new BooleanFieldEditor(
-// PHPeclipsePlugin.PHP_PARSE_ON_SAVE,
-// PHPPreferencesMessages.getString("PHPBasePreferencePage.parsers.pos"),
-// parserSettingsGroup);
-// parseOnSave.setPreferencePage(this);
-// parseOnSave.setPreferenceStore(getPreferenceStore());
-// parseOnSave.load();
-
return composite;
}
-}
+}
\ No newline at end of file
// .getLocation().toString());
// store.setDefault(SHOW_EXTERNAL_PREVIEW_PREF, "true");
- store.setDefault(USE_EXTERNAL_BROWSER_PREF, "false");
+// store.setDefault(USE_EXTERNAL_BROWSER_PREF, "false");
store.setDefault(SHOW_OUTPUT_IN_CONSOLE, "true");
store.setDefault(PHP_OBFUSCATOR_DEFAULT, "c:\\temp");
// store.setDefault(PHP_BOOKMARK_DEFAULT, "");
String windowsSystem = Platform.getWS();
if (jvm == WINDOWS_9x) {
- store.setDefault(EXTERNAL_BROWSER_PREF, "command.com /c start iexplore {0}");
+// store.setDefault(EXTERNAL_BROWSER_PREF, "command.com /c start iexplore {0}");
} else if (windowsSystem.equals(Platform.WS_WIN32)) {
- store.setDefault(EXTERNAL_BROWSER_PREF, "rundll32 url.dll,FileProtocolHandler {0}");
+// store.setDefault(EXTERNAL_BROWSER_PREF, "rundll32 url.dll,FileProtocolHandler {0}");
} else if (windowsSystem.equals(Platform.WS_CARBON)) {
// TODO How do we start Safari on Mac OS X ?
- store.setDefault(EXTERNAL_BROWSER_PREF, "netscape {0}");
+// store.setDefault(EXTERNAL_BROWSER_PREF, "netscape {0}");
} else {
store.setDefault(PHP_OBFUSCATOR_DEFAULT, "/tmp");
- store.setDefault(EXTERNAL_BROWSER_PREF, "netscape {0}");
+// store.setDefault(EXTERNAL_BROWSER_PREF, "netscape {0}");
}
// if ((jvm == WINDOWS_9x) || (jvm == WINDOWS_NT)) {
//
-/**********************************************************************
- Copyright (c) 2000, 2002 IBM Corp. and others.
- All rights reserved. This program and the accompanying materials
- are made available under the terms of the Common Public License v1.0
- which accompanies this distribution, and is available at
- http://www.eclipse.org/legal/cpl-v10.html
-
- Contributors:
- IBM Corporation - Initial implementation
- Klaus Hartlage - www.eclipseproject.de
- **********************************************************************/
+/***********************************************************************************************************************************
+ * Copyright (c) 2000, 2002 IBM Corp. and others. All rights reserved. This program and the accompanying materials are made
+ * available under the terms of the Common Public License v1.0 which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors: IBM Corporation - Initial implementation Klaus Hartlage - www.eclipseproject.de
+ **********************************************************************************************************************************/
package net.sourceforge.phpeclipse.actions;
+
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Iterator;
import net.sourceforge.phpeclipse.PHPeclipsePlugin;
+import net.sourceforge.phpeclipse.ui.IPreferenceConstants;
import net.sourceforge.phpeclipse.ui.editor.ShowExternalPreviewAction;
-import net.sourceforge.phpeclipse.views.PHPConsole;
+import net.sourceforge.phpeclipse.ui.overlaypages.Util;
+import net.sourceforge.phpeclipse.webbrowser.IWebBrowser;
+import net.sourceforge.phpeclipse.webbrowser.internal.BrowserManager;
+import net.sourceforge.phpeclipse.webbrowser.internal.WebBrowserUtil;
import net.sourceforge.phpeclipse.webbrowser.views.BrowserView;
import org.eclipse.core.resources.IFile;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchPart;
-//import org.eclipse.update.internal.ui.UpdatePerspective;
-//import org.eclipse.update.internal.ui.views.IEmbeddedWebBrowser;
+
+
public class PHPEclipseShowAction implements IObjectActionDelegate {
private IWorkbenchPart workbenchPart;
+
/**
* Constructor for Action1.
*/
public PHPEclipseShowAction() {
super();
}
+
/**
* @see IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart)
*/
public void setActivePart(IAction action, IWorkbenchPart targetPart) {
workbenchPart = targetPart;
}
+
public void run(IAction action) {
ISelectionProvider selectionProvider = null;
selectionProvider = workbenchPart.getSite().getSelectionProvider();
StructuredSelection selection = null;
selection = (StructuredSelection) selectionProvider.getSelection();
- PHPConsole console = PHPConsole.getInstance();
+ // PHPConsole console = PHPConsole.getInstance();
IPreferenceStore store = PHPeclipsePlugin.getDefault().getPreferenceStore();
Shell shell = null;
Iterator iterator = null;
IResource resource = (IResource) obj;
// check if it's a file resource
switch (resource.getType()) {
- case IResource.FILE :
- // single file:
- IFile file = (IFile) resource;
- String localhostURL;
- if ((localhostURL = ShowExternalPreviewAction.getLocalhostURL(store, (IFile) resource)) == null) {
- MessageDialog.openInformation(shell,
- "Couldn't create localhost URL",
- "Please configure your localhost and documentRoot");
- return;
- }
- try {
- if (store.getBoolean(PHPeclipsePlugin.USE_EXTERNAL_BROWSER_PREF)) {
- String[] arguments = {localhostURL};
- MessageFormat form = new MessageFormat(store
- .getString(PHPeclipsePlugin.EXTERNAL_BROWSER_PREF));
- Runtime runtime = Runtime.getRuntime();
- String command = form.format(arguments);
- console.write("External Browser command: " + command + "\n");
- runtime.exec(command);
- // runtime.exec(store.getString(PHPeclipsePlugin.EXTERNAL_BROWSER_PREF)
- // + " " + fileName);
- // runtime.exec("command.com /c start iexplore " + fileName);
- } else {
- // MessageDialog.openInformation(shell, "localhostURL",
- // "localhostURL: " + localhostURL);
- // this doesn't work under win98 ?
- // Program.launch(localhostURL);
- console.write("Internal Browser URL: " + localhostURL + "\n");
- open(new URL(localhostURL), shell, localhostURL);
- }
- } catch (MalformedURLException e) {
- MessageDialog.openInformation(shell, "MalformedURLException: ", e
- .toString());
- } catch (IOException e) {
- MessageDialog.openInformation(shell, "IOException",
- "Cannot show: " + localhostURL);
- }
+ case IResource.FILE:
+ // single file:
+ IFile previewFile = (IFile) resource;
+ String extension = previewFile.getFileExtension().toLowerCase();
+ boolean bringToTopPreview = Util.getPreviewBooleanValue(previewFile, IPreferenceConstants.PHP_BRING_TO_TOP_PREVIEW_DEFAULT);
+ boolean showHTMLFilesLocal = Util.getPreviewBooleanValue(previewFile, IPreferenceConstants.PHP_SHOW_HTML_FILES_LOCAL);
+ boolean showXMLFilesLocal = Util.getPreviewBooleanValue(previewFile, IPreferenceConstants.PHP_SHOW_XML_FILES_LOCAL);
+ boolean isHTMLFileName = "html".equals(extension) || "htm".equals(extension) || "xhtml".equals(extension);
+ boolean isXMLFileName = "xml".equals(extension) || "xsd".equals(extension) || "dtd".equals(extension);
+
+ String localhostURL;
+ if (showHTMLFilesLocal && isHTMLFileName) {
+ localhostURL = "file://"+previewFile.getLocation().toString();
+ } else if (showXMLFilesLocal && isXMLFileName) {
+ localhostURL = "file://"+previewFile.getLocation().toString();
+ } else if ((localhostURL = ShowExternalPreviewAction.getLocalhostURL(store, previewFile)) == null) {
+ MessageDialog.openInformation(shell, "Couldn't create localhost URL",
+ "Please configure your localhost and documentRoot");
+ return;
+ }
+
+ try {
+// if (store.getBoolean(PHPeclipsePlugin.USE_EXTERNAL_BROWSER_PREF)) {
+// String[] arguments = { localhostURL };
+// MessageFormat form = new MessageFormat(store.getString(PHPeclipsePlugin.EXTERNAL_BROWSER_PREF));
+// Runtime runtime = Runtime.getRuntime();
+// String command = form.format(arguments);
+// // console.write("External Browser command: " + command + "\n");
+// runtime.exec(command);
+// } else {
+ open(new URL(localhostURL), shell, localhostURL);
+// }
+ } catch (MalformedURLException e) {
+ MessageDialog.openInformation(shell, "MalformedURLException: ", e.toString());
+ }
}
}
}
}
+
/**
* @see IActionDelegate#selectionChanged(IAction, ISelection)
*/
public void selectionChanged(IAction action, ISelection selection) {
}
-// public static String getLocalhostURL(IPreferenceStore store, IFile file) {
-// if (store == null) {
-// store = PHPeclipsePlugin.getDefault().getPreferenceStore();
-// }
-// // IPath path = file.getFullPath();
-// String localhostURL = file.getLocation().toString();
-// String lowerCaseFileName = localhostURL.toLowerCase();
-// // String documentRoot = store.getString(PHPeclipsePlugin.DOCUMENTROOT_PREF);
-// String documentRoot = Util.getMiscProjectsPreferenceValue(
-// file.getProject(), IPreferenceConstants.PHP_DOCUMENTROOT_PREF);
-//
-// documentRoot = documentRoot.replace('\\', '/');
-// documentRoot = documentRoot.toLowerCase();
-//
-// if (lowerCaseFileName.startsWith(documentRoot)) {
-// localhostURL = localhostURL.substring(documentRoot.length());
+
+ public static void open(final URL url, final Shell shell, final String dialogTitle) {
+// if (WebBrowserUtil.canUseInternalWebBrowser()) {
+// IWorkbenchPage page = PHPeclipsePlugin.getActivePage();
+// try {
+// IViewPart part = page.findView(BrowserView.ID_BROWSER);
+// if (part == null) {
+// part = page.showView(BrowserView.ID_BROWSER);
+// } else {
+// page.bringToTop(part);
+// }
+// ((BrowserView) part).setUrl(url.toExternalForm());
+// } catch (Exception e) {
+// }
// } else {
-// return null;
+ BrowserManager manager = BrowserManager.getInstance();
+ IWebBrowser browser = manager.getCurrentWebBrowser();
+ browser.openURL(url);
// }
-//// return store.getString(PHPeclipsePlugin.LOCALHOST_PREF) + localhostURL;
-// return Util.getMiscProjectsPreferenceValue(file.getProject(), IPreferenceConstants.PHP_LOCALHOST_PREF) + localhostURL;
-// }
-
- public static void open(final URL url, final Shell shell,
- final String dialogTitle) {
- IWorkbenchPage page = PHPeclipsePlugin.getActivePage();
- try {
- IViewPart part = page.findView(BrowserView.ID_BROWSER);
- if (part == null) {
- part = page.showView(BrowserView.ID_BROWSER);
- } else {
- page.bringToTop(part);
- }
- ((BrowserView) part).setUrl(url.toExternalForm());
- } catch (Exception e) {
- }
}
-}
+}
\ No newline at end of file