This commit was generated by cvs2svn to compensate for changes in r55,
authorkhartlage <khartlage>
Fri, 27 Dec 2002 23:16:07 +0000 (23:16 +0000)
committerkhartlage <khartlage>
Fri, 27 Dec 2002 23:16:07 +0000 (23:16 +0000)
which included commits to RCS files with non-trunk default branches.

net.sourceforge.phpeclipse.phphelp/.classpath [new file with mode: 0644]
net.sourceforge.phpeclipse.phphelp/.project [new file with mode: 0644]
net.sourceforge.phpeclipse.phphelp/.template [new file with mode: 0644]
net.sourceforge.phpeclipse.phphelp/build.properties [new file with mode: 0644]
net.sourceforge.phpeclipse.phphelp/build.xml [new file with mode: 0644]
net.sourceforge.phpeclipse.phphelp/phphelp.xml [new file with mode: 0644]
net.sourceforge.phpeclipse.phphelp/plugin.properties [new file with mode: 0644]
net.sourceforge.phpeclipse.phphelp/plugin.xml [new file with mode: 0644]
net.sourceforge.phpeclipse.phphelp/src/net/sourceforge/phpdt/phphelp/actions/PHPEclipseShowContextHelp.java [new file with mode: 0644]
net.sourceforge.phpeclipse.phphelp/src/net/sourceforge/phpdt/phphelp/actions/PHPFunctionHelpResource.java [new file with mode: 0644]

diff --git a/net.sourceforge.phpeclipse.phphelp/.classpath b/net.sourceforge.phpeclipse.phphelp/.classpath
new file mode 100644 (file)
index 0000000..8a77a77
--- /dev/null
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+    <classpathentry kind="src" path="src/"/>
+    <classpathentry kind="var"
+        path="ECLIPSE_HOME/plugins/org.eclipse.core.resources_2.0.0/resources.jar" sourcepath="_ORG_ECLIPSE_PLATFORM_SOURCE/org.eclipse.core.resources_2.0.0/resourcessrc.zip"/>
+    <classpathentry kind="var"
+        path="ECLIPSE_HOME/plugins/org.eclipse.ui_2.0.0/workbench.jar" sourcepath="_ORG_ECLIPSE_PLATFORM_SOURCE/org.eclipse.ui_2.0.0/workbenchsrc.zip"/>
+    <classpathentry kind="var"
+        path="ECLIPSE_HOME/plugins/org.eclipse.ui.win32_2.0.0/workbenchwin32.jar" sourcepath="_ORG_ECLIPSE_PLATFORM_WIN32_SOURCE/org.eclipse.ui.win32_2.0.0/workbenchwin32src.zip"/>
+    <classpathentry kind="var"
+        path="ECLIPSE_HOME/plugins/org.eclipse.swt.win32_2.0.0/ws/win32/swt.jar" sourcepath="_ORG_ECLIPSE_PLATFORM_WIN32_SOURCE/org.eclipse.swt.win32_2.0.0/ws/win32/swtsrc.zip"/>
+    <classpathentry kind="var"
+        path="ECLIPSE_HOME/plugins/org.eclipse.help_2.0.0/help.jar" sourcepath="_ORG_ECLIPSE_PLATFORM_SOURCE/org.eclipse.help_2.0.0/helpsrc.zip"/>
+    <classpathentry kind="var"
+        path="ECLIPSE_HOME/plugins/org.eclipse.core.runtime_2.0.0/runtime.jar" sourcepath="_ORG_ECLIPSE_PLATFORM_SOURCE/org.eclipse.core.runtime_2.0.0/runtimesrc.zip"/>
+    <classpathentry kind="var"
+        path="ECLIPSE_HOME/plugins/org.eclipse.core.boot_2.0.0/boot.jar" sourcepath="_ORG_ECLIPSE_PLATFORM_SOURCE/org.eclipse.core.boot_2.0.0/bootsrc.zip"/>
+    <classpathentry kind="var" path="JRE_LIB" rootpath="JRE_SRCROOT" sourcepath="JRE_SRC"/>
+    <classpathentry kind="lib" path="C:/eclipse/plugins/org.junit_3.7.0/junit.jar"/>
+    <classpathentry kind="src" path="/net.sourceforge.phpeclipse"/>
+    <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/net.sourceforge.phpeclipse.phphelp/.project b/net.sourceforge.phpeclipse.phphelp/.project
new file mode 100644 (file)
index 0000000..39448c4
--- /dev/null
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>net.sourceforge.phpeclipse.phphelp</name>
+       <comment></comment>
+       <projects>
+               <project>net.sourceforge.phpeclipse</project>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.jdt.core.javabuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.ManifestBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.SchemaBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.jdt.core.javanature</nature>
+               <nature>org.eclipse.pde.PluginNature</nature>
+       </natures>
+</projectDescription>
diff --git a/net.sourceforge.phpeclipse.phphelp/.template b/net.sourceforge.phpeclipse.phphelp/.template
new file mode 100644 (file)
index 0000000..d65e0f4
--- /dev/null
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<form>
+   <p/><p><b>Tips on working with this plug-in project</b></p><li>For the view of the new plug-in at a glance, go to the <img href="pageImage"/><a href="OverviewPage">Overview</a>.</li><li>You can test the contributions of this plug-in by launching another instance of the workbench. On the <b>Run</b> menu, click <b>Run As</b> and choose <img href="runTimeWorkbenchImage"/><a href="action.run">Run-time Workbench</a> from the available choices.</li><li>You can add more functionality to this plug-in by adding extensions using the <a href="action.newExtension">New Extension Wizard</a>.</li><li>The plug-in project contains Java code that you can debug. Place breakpoints in Java classes. On the <b>Run</b> menu, select <b>Debug As</b> and choose <img href="runTimeWorkbenchImage"/><a href="action.debug">Run-time Workbench</a> from the available choices.</li>
+</form>
diff --git a/net.sourceforge.phpeclipse.phphelp/build.properties b/net.sourceforge.phpeclipse.phphelp/build.properties
new file mode 100644 (file)
index 0000000..ec21977
--- /dev/null
@@ -0,0 +1 @@
+source.phphelp.jar = src/
diff --git a/net.sourceforge.phpeclipse.phphelp/build.xml b/net.sourceforge.phpeclipse.phphelp/build.xml
new file mode 100644 (file)
index 0000000..ee787e4
--- /dev/null
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="net.sourceforge.phpeclipse.phphelp" default="build.jars" basedir=".">
+
+       <property name="bootclasspath" value=""/>
+       <property name="ws" value="win32"/>
+       <property name="os" value="win32"/>
+       <property name="arch" value="x86"/>
+
+       <target name="init" depends="properties">
+               <property name="plugin" value="net.sourceforge.phpeclipse.phphelp"/>
+               <property name="version.suffix" value="_1.0.3"/>
+               <property name="full.name" value="${plugin}${version.suffix}"/>
+               <property name="temp.folder" value="${basedir}/temp.folder"/>
+               <property name="plugin.destination" value="${basedir}"/>
+               <property name="build.result.folder" value="${basedir}"/>
+       </target>
+
+       <target name="properties" if="eclipse.running">
+               <property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
+       </target>
+
+       <target name="build.update.jar" depends="init">
+               <delete dir="${temp.folder}"/>
+               <mkdir dir="${temp.folder}"/>
+               <antcall target="build.jars"/>
+               <antcall target="gather.bin.parts">
+                       <param name="destination.temp.folder" value="${temp.folder}/"/>
+               </antcall>
+               <zip zipfile="${plugin.destination}/${full.name}.jar" basedir="${temp.folder}/${full.name}" filesonly="false"/>
+               <delete dir="${temp.folder}"/>
+       </target>
+
+       <target name="gather.bin.parts" depends="init" if="destination.temp.folder">
+               <mkdir dir="${destination.temp.folder}/${full.name}"/>
+               <copy file="${build.result.folder}/phphelp.jar" todir="${destination.temp.folder}/${full.name}"/>
+       </target>
+
+       <target name="phphelp.jar" depends="init" unless="phphelp.jar">
+               <property name="destdir" value="${temp.folder}/phphelp.jar.bin"/>
+               <delete dir="${temp.folder}/phphelp.jar.bin"/>
+               <mkdir dir="${temp.folder}/phphelp.jar.bin"/>
+               <!-- compile the source code -->
+               <javac destdir="${temp.folder}/phphelp.jar.bin" failonerror="false" verbose="true" debug="on" includeAntRuntime="no" bootclasspath="${bootclasspath}" classpath="../../plugins/org.eclipse.core.resources.win32_2.0.0/resources.jar;../net.sourceforge.phpeclipse/phpeclipse.jar;../../plugins/org.eclipse.swt_2.0.0/ws/${ws}/swt.jar;../../plugins/org.eclipse.core.boot_2.0.0/bin;../../plugins/org.eclipse.core.runtime_2.0.0/runtime.jar;../../plugins/org.eclipse.core.boot_2.0.0/boot.jar;../../plugins/org.eclipse.ui.win32_2.0.0/workbench.jar;../net.sourceforge.phpeclipse/bin;../../plugins/org.eclipse.swt_2.0.0/bin;../../plugins/org.eclipse.core.resources_2.0.0/bin;../../plugins/org.eclipse.core.resources_2.0.0/resources.jar;../../plugins/org.eclipse.swt.win32_2.0.0/ws/${ws}/swt.jar;../../plugins/org.eclipse.help_2.0.0/bin;../../plugins/org.eclipse.ui_2.0.0/workbench.jar;../../plugins/org.eclipse.core.runtime_2.0.0/bin;../../plugins/org.eclipse.help_2.0.0/help.jar;../../plugins/org.eclipse.ui_2.0.0/bin;../../plugins/org.eclipse.ui.win32_2.0.0/workbenchwin32.jar">
+                       <src path="src/"/>
+               </javac>
+               <!-- copy necessary resources -->
+               <copy todir="${temp.folder}/phphelp.jar.bin">
+                       <fileset dir="src/" excludes="**/*.java"/>
+               </copy>
+               <mkdir dir="${build.result.folder}"/>
+               <jar jarfile="${build.result.folder}/phphelp.jar" basedir="${temp.folder}/phphelp.jar.bin"/>
+               <delete dir="${temp.folder}/phphelp.jar.bin"/>
+       </target>
+
+       <target name="phphelpsrc.zip" depends="init" unless="phphelpsrc.zip">
+               <mkdir dir="${build.result.folder}"/>
+               <zip zipfile="${build.result.folder}/phphelpsrc.zip" filesonly="false">
+                       <fileset dir="src/" includes="**/*.java"/>
+               </zip>
+       </target>
+
+       <target name="build.jars" depends="init">
+               <available property="phphelp.jar" file="${build.result.folder}/phphelp.jar"/>
+               <antcall target="phphelp.jar"/>
+       </target>
+
+       <target name="build.sources" depends="init">
+               <available property="phphelpsrc.zip" file="${build.result.folder}/phphelpsrc.zip"/>
+               <antcall target="phphelpsrc.zip"/>
+       </target>
+
+       <target name="build.zips" depends="init">
+       </target>
+
+       <target name="gather.sources" depends="init" if="destination.temp.folder">
+               <mkdir dir="${destination.temp.folder}/${full.name}"/>
+               <copy file="${build.result.folder}/phphelpsrc.zip" todir="${destination.temp.folder}/${full.name}"/>
+       </target>
+
+       <target name="gather.logs" depends="init" if="destination.temp.folder">
+               <mkdir dir="${destination.temp.folder}/${full.name}"/>
+               <copy file="${temp.folder}/phphelp.jar.bin.log" todir="${destination.temp.folder}/${full.name}"/>
+       </target>
+
+       <target name="clean" depends="init">
+               <delete file="${build.result.folder}/phphelp.jar"/>
+               <delete file="${build.result.folder}/phphelpsrc.zip"/>
+               <delete file="${plugin.destination}/${full.name}.jar"/>
+               <delete file="${plugin.destination}/${full.name}.zip"/>
+               <delete dir="${temp.folder}"/>
+       </target>
+
+       <target name="refresh" depends="init" if="eclipse.running">
+               <eclipse.refreshLocal resource="${plugin}" depth="infinite"/>
+       </target>
+
+       <target name="zip.plugin" depends="init">
+               <delete dir="${temp.folder}"/>
+               <mkdir dir="${temp.folder}"/>
+               <antcall target="build.jars"/>
+               <antcall target="build.sources"/>
+               <antcall target="gather.bin.parts">
+                       <param name="destination.temp.folder" value="${temp.folder}/"/>
+               </antcall>
+               <antcall target="gather.sources">
+                       <param name="destination.temp.folder" value="${temp.folder}/"/>
+               </antcall>
+               <delete>
+                       <fileset dir="${temp.folder}" includes="**/*.bin.log"/>
+               </delete>
+               <zip zipfile="${plugin.destination}/${full.name}.zip" basedir="${temp.folder}" filesonly="true"/>
+               <delete dir="${temp.folder}"/>
+       </target>
+
+</project>
diff --git a/net.sourceforge.phpeclipse.phphelp/phphelp.xml b/net.sourceforge.phpeclipse.phphelp/phphelp.xml
new file mode 100644 (file)
index 0000000..8e19278
--- /dev/null
@@ -0,0 +1,10 @@
+<toc label="PHPEclipse Help" topic="doc/phpeclipse/index.html">
+  <topic label="PHP Help Table of Contents" href="doc/index.html"/>
+  <topic label="I. Getting Started" href="doc/getting-started.html"/>
+  <topic label="II. Language Reference" href="doc/langref.html"/>
+  <topic label="III. Features" href="doc/features.html"/>
+  <topic label="IV. Function Reference" href="doc/funcref.html"/>
+  <topic label="V. Extending PHP 4.0" href="doc/zend.html"/>
+  <topic label="VI. FAQ: Frequently Asked Questions" href="doc/faq.html"/>
+  <topic label="VII. Appendixes" href="doc/appendixes.html"/>
+</toc>
\ No newline at end of file
diff --git a/net.sourceforge.phpeclipse.phphelp/plugin.properties b/net.sourceforge.phpeclipse.phphelp/plugin.properties
new file mode 100644 (file)
index 0000000..0a31e89
--- /dev/null
@@ -0,0 +1,5 @@
+#########################################
+#
+#########################################
+pluginName=PHP Plugin Help 
+providerName=EclipseProject.de
diff --git a/net.sourceforge.phpeclipse.phphelp/plugin.xml b/net.sourceforge.phpeclipse.phphelp/plugin.xml
new file mode 100644 (file)
index 0000000..6af417e
--- /dev/null
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<plugin
+   id="net.sourceforge.phpeclipse.phphelp"
+   name="%pluginName"
+   version="1.0.3"
+   provider-name="%providerName">
+
+   <runtime>
+      <library name="phphelp.jar"/>
+   </runtime>
+   <requires>
+      <import plugin="org.eclipse.core.resources"/>
+      <import plugin="org.eclipse.ui"/>
+      <import plugin="org.eclipse.help"/>
+      <import plugin="org.eclipse.swt"/>
+      <import plugin="net.sourceforge.phpeclipse"/>
+   </requires>
+  
+   <extension
+         point="org.eclipse.ui.popupMenus">   
+      <viewerContribution
+            targetID="#PHPEditorContext"
+            id="net.sourceforge.phpdt.phphelp.actions.popup.editor">
+         <action
+               label="PHP Help"
+               class="net.sourceforge.phpdt.phphelp.actions.PHPEclipseShowContextHelp"
+               menubarPath="additions"
+               id="net.sourceforge.phpdt.phphelp.actions.contexthelp">
+         </action>
+      </viewerContribution>
+   </extension>
+   <extension
+         point="org.eclipse.help.toc">
+      <toc
+            file="phphelp.xml"
+            primary="true">
+      </toc>
+   </extension>
+</plugin>
diff --git a/net.sourceforge.phpeclipse.phphelp/src/net/sourceforge/phpdt/phphelp/actions/PHPEclipseShowContextHelp.java b/net.sourceforge.phpeclipse.phphelp/src/net/sourceforge/phpdt/phphelp/actions/PHPEclipseShowContextHelp.java
new file mode 100644 (file)
index 0000000..834d108
--- /dev/null
@@ -0,0 +1,96 @@
+/**********************************************************************
+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.phpdt.phphelp.actions;
+
+import net.sourceforge.phpeclipse.phpeditor.PHPEditor;
+import net.sourceforge.phpeclipse.phpeditor.php.PHPWordExtractor;
+import org.eclipse.help.IHelp;
+import org.eclipse.help.IHelpResource;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITextSelection;
+import org.eclipse.jface.text.TextSelection;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.ui.IEditorActionDelegate;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.actions.ActionDelegate;
+import org.eclipse.ui.help.WorkbenchHelp;
+
+public class PHPEclipseShowContextHelp extends ActionDelegate implements IEditorActionDelegate {
+
+  private IWorkbenchWindow window;
+  private PHPEditor editor;
+
+  public void dispose() {
+  }
+
+  public void init(IWorkbenchWindow window) {
+    this.window = window;
+  }
+
+  public void selectionChanged(IAction action, ISelection selection) {
+    if (!selection.isEmpty()) {
+      if (selection instanceof TextSelection) {
+        action.setEnabled(true);
+      } else if (window.getActivePage() != null && window.getActivePage().getActivePart() != null) {
+        //
+      }
+    }
+  }
+
+  public void run(IAction action) {
+    if (editor == null) {
+      IEditorPart targetEditor = window.getActivePage().getActiveEditor();
+      if (targetEditor != null && (targetEditor instanceof PHPEditor)) {
+        editor = (PHPEditor) targetEditor;
+      }
+    }
+    if (editor != null) {
+      ITextSelection selection = (ITextSelection) editor.getSelectionProvider().getSelection();
+      IDocument doc = editor.getDocumentProvider().getDocument(editor.getEditorInput());
+      int pos = selection.getOffset();
+      String word = getFunctionName(doc, pos);
+      openContextHelp(word);
+
+    }
+  }
+
+  public void setActiveEditor(IAction action, IEditorPart targetEditor) {
+    if (targetEditor != null && (targetEditor instanceof PHPEditor)) {
+      editor = (PHPEditor) targetEditor;
+    }
+  }
+
+  public static void openContextHelp(String word) {
+    IHelp help = WorkbenchHelp.getHelpSupport();
+    if (help != null) {
+      IHelpResource helpResource = new PHPFunctionHelpResource(word);
+      WorkbenchHelp.getHelpSupport().displayHelpResource(helpResource);
+    } else {
+      //   showMessage(shell, dialogTitle, ActionMessages.getString("Open help not available"), false); //$NON-NLS-1$
+    }
+  }
+
+  private String getFunctionName(IDocument doc, int pos) {
+    Point word = PHPWordExtractor.findWord(doc, pos);
+    if (word != null) {
+      try {
+        return doc.get(word.x, word.y).replace('_', '-');
+      } catch (BadLocationException e) {
+      }
+    }
+    return "";
+  }
+}
diff --git a/net.sourceforge.phpeclipse.phphelp/src/net/sourceforge/phpdt/phphelp/actions/PHPFunctionHelpResource.java b/net.sourceforge.phpeclipse.phphelp/src/net/sourceforge/phpdt/phphelp/actions/PHPFunctionHelpResource.java
new file mode 100644 (file)
index 0000000..7f0249f
--- /dev/null
@@ -0,0 +1,35 @@
+/**********************************************************************
+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.phpdt.phphelp.actions;
+
+import org.eclipse.help.IHelpResource;
+
+/**
+ * 
+ */
+public class PHPFunctionHelpResource implements IHelpResource {
+
+  private String word;
+
+  public PHPFunctionHelpResource(String word) {
+    this.word = word;
+  }
+
+  public String getHref() {
+    return "/net.sourceforge.phpeclipse.phphelp/doc/function." + word + ".html";
+  }
+
+  public String getLabel() {
+    return "PHP Context Help";
+  }
+
+}
\ No newline at end of file