From: jsurfer Date: Fri, 3 Sep 2004 17:33:50 +0000 (+0000) Subject: misc changes X-Git-Url: http://secure.phpeclipse.com misc changes --- diff --git a/archive/net.sourceforge.phpeclipse.html.ui/cpl-v10.html b/archive/net.sourceforge.phpeclipse.html.ui/cpl-v10.html new file mode 100644 index 0000000..36aa208 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.html.ui/cpl-v10.html @@ -0,0 +1,125 @@ + + + +Common Public License - v 1.0 + + + + + + +

Common Public License - v 1.0 +

+

THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. +

+

1. DEFINITIONS +

"Contribution" means: + +

+ + + + + + + + + + +

+

"Contributor" means any person or entity that distributes the Program. +

+

"Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. +

+

"Program" means the Contributions distributed in accordance with this Agreement. +

+

"Recipient" means anyone who receives the Program under this Agreement, including all Contributors. +

+

2. GRANT OF RIGHTS + +

+ + + + + + + + + + + + + + + + + + + + + + +

3. REQUIREMENTS +

A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that: + +

+ + + + + + + + + + + + + + + + + + + +

When the Program is made available in source code form: + +

+ + + + +

+

Contributors may not remove or alter any copyright notices contained within the Program. +

+

Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution. +

+

4. COMMERCIAL DISTRIBUTION +

Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense. +

+

For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages. +

+

5. NO WARRANTY +

EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. +

+

6. DISCLAIMER OF LIABILITY +

EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. +

+

7. GENERAL +

If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. +

+

If Recipient institutes patent litigation against a Contributor with respect to a patent applicable to software (including a cross-claim or counterclaim in a lawsuit), then any patent licenses granted by that Contributor to such Recipient under this Agreement shall terminate as of the date such litigation is filed. In addition, if Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. +

+

All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. +

+

Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. IBM is the initial Agreement Steward. IBM may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. +

+

This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation. +

+

+ + + + \ No newline at end of file diff --git a/archive/net.sourceforge.phpeclipse.html.ui/plugin.xml b/archive/net.sourceforge.phpeclipse.html.ui/plugin.xml index 277ae4f..2553033 100644 --- a/archive/net.sourceforge.phpeclipse.html.ui/plugin.xml +++ b/archive/net.sourceforge.phpeclipse.html.ui/plugin.xml @@ -34,6 +34,7 @@ name="HTML Editor" icon="icons/full/obj16/html.png" extensions="html, htm, xhtml" + contributorClass="net.sourceforge.phpeclipse.html.ui.internal.editor.HTMLEditorActionContributor" class="net.sourceforge.phpeclipse.html.ui.internal.editor.HTMLEditor" id="net.sourceforge.phpeclipse.html.ui.editor"> diff --git a/archive/net.sourceforge.phpeclipse.html.ui/src/net/sourceforge/phpeclipse/html/ui/internal/editor/HTMLEditor.java b/archive/net.sourceforge.phpeclipse.html.ui/src/net/sourceforge/phpeclipse/html/ui/internal/editor/HTMLEditor.java index 4ccff01..2edc99e 100644 --- a/archive/net.sourceforge.phpeclipse.html.ui/src/net/sourceforge/phpeclipse/html/ui/internal/editor/HTMLEditor.java +++ b/archive/net.sourceforge.phpeclipse.html.ui/src/net/sourceforge/phpeclipse/html/ui/internal/editor/HTMLEditor.java @@ -8,26 +8,19 @@ * Contributors: * Christopher Lenz - initial implementation * - * $Id: HTMLEditor.java,v 1.1 2004-09-02 18:13:32 jsurfer Exp $ + * $Id: HTMLEditor.java,v 1.2 2004-09-03 17:32:25 jsurfer Exp $ */ package net.sourceforge.phpeclipse.html.ui.internal.editor; -import java.net.MalformedURLException; -import java.net.URL; - -import net.sourceforge.phpeclipse.html.ui.internal.preview.HTMLPreviewPage; import net.sourceforge.phpeclipse.html.ui.internal.text.HTMLConfiguration; -import net.sourceforge.phpeclipse.ui.views.preview.IBrowserPreviewPage; +import net.sourceforge.phpeclipse.ui.editor.ShowExternalPreviewAction; import net.sourceforge.phpeclipse.xml.ui.XMLPlugin; import net.sourceforge.phpeclipse.xml.ui.internal.editor.XMLDocumentProvider; import net.sourceforge.phpeclipse.xml.ui.internal.editor.XMLEditor; import net.sourceforge.phpeclipse.xml.ui.text.XMLTextTools; -import org.eclipse.core.resources.IFile; import org.eclipse.jface.action.IAction; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IFileEditorInput; import org.eclipse.ui.texteditor.ContentAssistAction; import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds; @@ -38,31 +31,33 @@ import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds; public class HTMLEditor extends XMLEditor { // Instance Variables ------------------------------------------------------ - + public HTMLEditor() { + super(ShowExternalPreviewAction.HTML_TYPE); + } /** The associated preview page. */ - private HTMLPreviewPage previewPage; +// private HTMLPreviewPage previewPage; // XMLEditor Implementation ------------------------------------------------ /* * @see org.eclipse.ui.texteditor.AbstractTextEditor#editorSaved() */ - protected void editorSaved() { - if (previewPage != null) { - previewPage.update(); - } - } +// protected void editorSaved() { +// if (previewPage != null) { +// previewPage.update(); +// } +// } /* * @see org.eclipse.core.runtime.IAdaptable#getAdapter(Class) */ public Object getAdapter(Class adapter) { - if (adapter == IBrowserPreviewPage.class) { - if (previewPage == null) { - previewPage = createPreviewPage(); - } - return previewPage; - } +// if (adapter == IBrowserPreviewPage.class) { +// if (previewPage == null) { +// previewPage = createPreviewPage(); +// } +// return previewPage; +// } return super.getAdapter(adapter); } @@ -71,17 +66,17 @@ public class HTMLEditor extends XMLEditor { /** * Creates the HTML preview page. */ - private HTMLPreviewPage createPreviewPage() { - IEditorInput input = getEditorInput(); - if (input instanceof IFileEditorInput) { - IFile file = ((IFileEditorInput) input).getFile(); - try { - URL location = file.getLocation().toFile().toURL(); - return new HTMLPreviewPage(location); - } catch (MalformedURLException e) { } - } - return null; - } +// private HTMLPreviewPage createPreviewPage() { +// IEditorInput input = getEditorInput(); +// if (input instanceof IFileEditorInput) { +// IFile file = ((IFileEditorInput) input).getFile(); +// try { +// URL location = file.getLocation().toFile().toURL(); +// return new HTMLPreviewPage(location); +// } catch (MalformedURLException e) { } +// } +// return null; +// } protected void createActions() { super.createActions(); diff --git a/archive/net.sourceforge.phpeclipse.html.ui/src/net/sourceforge/phpeclipse/html/ui/internal/editor/HTMLEditorActionContributor.java b/archive/net.sourceforge.phpeclipse.html.ui/src/net/sourceforge/phpeclipse/html/ui/internal/editor/HTMLEditorActionContributor.java new file mode 100644 index 0000000..fb71253 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.html.ui/src/net/sourceforge/phpeclipse/html/ui/internal/editor/HTMLEditorActionContributor.java @@ -0,0 +1,51 @@ +/******************************************************************************* + * Copyright (c) 2000, 2003 IBM Corporation 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 API and implementation + *******************************************************************************/ +package net.sourceforge.phpeclipse.html.ui.internal.editor; + +import net.sourceforge.phpeclipse.ui.editor.ShowExternalPreviewAction; + +import org.eclipse.core.resources.IFile; +import org.eclipse.ui.IEditorInput; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IFileEditorInput; +import org.eclipse.ui.texteditor.BasicTextEditorActionContributor; +import org.eclipse.ui.texteditor.ITextEditor; + +/** + * Common base class for action contributors for Java editors. + */ +public class HTMLEditorActionContributor extends BasicTextEditorActionContributor { + + /* (non-Javadoc) + * @see org.eclipse.ui.IEditorActionBarContributor#setActiveEditor(org.eclipse.ui.IEditorPart) + */ + public void setActiveEditor(IEditorPart part) { + super.setActiveEditor(part); + ITextEditor textEditor = null; + if (part instanceof ITextEditor) + textEditor = (ITextEditor) part; + + if (textEditor != null) { + IFile file = null; + IEditorInput editorInput = textEditor.getEditorInput(); + + if (editorInput instanceof IFileEditorInput) { + file = ((IFileEditorInput) editorInput).getFile(); + } + + ShowExternalPreviewAction fShowExternalPreviewAction = ShowExternalPreviewAction.getInstance(); + fShowExternalPreviewAction.setEditor(textEditor); + fShowExternalPreviewAction.update(); + if (fShowExternalPreviewAction != null) + fShowExternalPreviewAction.doRun(ShowExternalPreviewAction.HTML_TYPE); + } + } +} diff --git a/archive/net.sourceforge.phpeclipse.html.ui/src/net/sourceforge/phpeclipse/html/ui/internal/preview/HTMLPreviewPage.java b/archive/net.sourceforge.phpeclipse.html.ui/src/net/sourceforge/phpeclipse/html/ui/internal/preview/HTMLPreviewPage.java deleted file mode 100644 index 3608a09..0000000 --- a/archive/net.sourceforge.phpeclipse.html.ui/src/net/sourceforge/phpeclipse/html/ui/internal/preview/HTMLPreviewPage.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (c) 2004 Christopher Lenz 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: - * Christopher Lenz - initial implementation - * - * $Id: HTMLPreviewPage.java,v 1.1 2004-09-02 18:13:31 jsurfer Exp $ - */ - -package net.sourceforge.phpeclipse.html.ui.internal.preview; - -import java.net.URL; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.browser.Browser; -import org.eclipse.swt.browser.LocationAdapter; -import org.eclipse.swt.browser.LocationEvent; -import org.eclipse.swt.layout.FillLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.ui.part.Page; -import org.eclipse.ui.texteditor.IUpdate; - -import net.sourceforge.phpeclipse.ui.views.preview.IBrowserPreviewPage; - -/** - * Provides a HTML preview page based on the SWT browser control. - */ -public class HTMLPreviewPage extends Page - implements IBrowserPreviewPage, IUpdate { - - // Instance Variables ------------------------------------------------------ - - /** The browser widget. */ - private Browser browser; - - /** The URL of the resource to preview. */ - private URL location; - - // Constructors ------------------------------------------------------------ - - /** - * Constructor. - * - * @param location the URL of the resource to preview - */ - public HTMLPreviewPage(URL location) { - this.location = location; - } - - // IPage Implementation ---------------------------------------------------- - - /* - * @see org.eclipse.ui.part.IPage#createControl(Composite) - */ - public void createControl(Composite parent) { - browser = new Browser(parent, SWT.NONE); - browser.setLayout(new FillLayout()); - browser.setUrl(location.toString()); - browser.addLocationListener(new LocationAdapter() { - public void changing(LocationEvent event) { - if (event.location != null) { - event.doit = false; - } - } - }); - } - - /* - * @see org.eclipse.ui.part.IPage#getControl() - */ - public Control getControl() { - return browser; - } - - /* - * @see org.eclipse.ui.part.IPage#setFocus() - */ - public void setFocus() { - browser.setFocus(); - } - - // IUpdate Implementation -------------------------------------------------- - - /* - * @see IUpdate#update() - */ - public void update() { - browser.refresh(); - } - -} diff --git a/archive/net.sourceforge.phpeclipse.js.core/cpl-v10.html b/archive/net.sourceforge.phpeclipse.js.core/cpl-v10.html new file mode 100644 index 0000000..36aa208 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.js.core/cpl-v10.html @@ -0,0 +1,125 @@ + + + +Common Public License - v 1.0 + + + + + + +

Common Public License - v 1.0 +

+

THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. +

+

1. DEFINITIONS +

"Contribution" means: + +

+ + + + + + + + + + +

+

"Contributor" means any person or entity that distributes the Program. +

+

"Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. +

+

"Program" means the Contributions distributed in accordance with this Agreement. +

+

"Recipient" means anyone who receives the Program under this Agreement, including all Contributors. +

+

2. GRANT OF RIGHTS + +

+ + + + + + + + + + + + + + + + + + + + + + +

3. REQUIREMENTS +

A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that: + +

+ + + + + + + + + + + + + + + + + + + +

When the Program is made available in source code form: + +

+ + + + +

+

Contributors may not remove or alter any copyright notices contained within the Program. +

+

Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution. +

+

4. COMMERCIAL DISTRIBUTION +

Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense. +

+

For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages. +

+

5. NO WARRANTY +

EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. +

+

6. DISCLAIMER OF LIABILITY +

EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. +

+

7. GENERAL +

If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. +

+

If Recipient institutes patent litigation against a Contributor with respect to a patent applicable to software (including a cross-claim or counterclaim in a lawsuit), then any patent licenses granted by that Contributor to such Recipient under this Agreement shall terminate as of the date such litigation is filed. In addition, if Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. +

+

All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. +

+

Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. IBM is the initial Agreement Steward. IBM may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. +

+

This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation. +

+

+ + + + \ No newline at end of file diff --git a/archive/net.sourceforge.phpeclipse.js.ui/cpl-v10.html b/archive/net.sourceforge.phpeclipse.js.ui/cpl-v10.html new file mode 100644 index 0000000..36aa208 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.js.ui/cpl-v10.html @@ -0,0 +1,125 @@ + + + +Common Public License - v 1.0 + + + + + + +

Common Public License - v 1.0 +

+

THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. +

+

1. DEFINITIONS +

"Contribution" means: + +

+ + + + + + + + + + +

+

"Contributor" means any person or entity that distributes the Program. +

+

"Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. +

+

"Program" means the Contributions distributed in accordance with this Agreement. +

+

"Recipient" means anyone who receives the Program under this Agreement, including all Contributors. +

+

2. GRANT OF RIGHTS + +

+ + + + + + + + + + + + + + + + + + + + + + +

3. REQUIREMENTS +

A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that: + +

+ + + + + + + + + + + + + + + + + + + +

When the Program is made available in source code form: + +

+ + + + +

+

Contributors may not remove or alter any copyright notices contained within the Program. +

+

Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution. +

+

4. COMMERCIAL DISTRIBUTION +

Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense. +

+

For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages. +

+

5. NO WARRANTY +

EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. +

+

6. DISCLAIMER OF LIABILITY +

EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. +

+

7. GENERAL +

If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. +

+

If Recipient institutes patent litigation against a Contributor with respect to a patent applicable to software (including a cross-claim or counterclaim in a lawsuit), then any patent licenses granted by that Contributor to such Recipient under this Agreement shall terminate as of the date such litigation is filed. In addition, if Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. +

+

All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. +

+

Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. IBM is the initial Agreement Steward. IBM may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. +

+

This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation. +

+

+ + + + \ No newline at end of file diff --git a/archive/net.sourceforge.phpeclipse.js.ui/plugin.xml b/archive/net.sourceforge.phpeclipse.js.ui/plugin.xml index 37f2d13..723d66d 100644 --- a/archive/net.sourceforge.phpeclipse.js.ui/plugin.xml +++ b/archive/net.sourceforge.phpeclipse.js.ui/plugin.xml @@ -31,7 +31,7 @@ diff --git a/net.sourceforge.phpeclipse.smarty.ui/cpl-v10.html b/net.sourceforge.phpeclipse.smarty.ui/cpl-v10.html new file mode 100644 index 0000000..36aa208 --- /dev/null +++ b/net.sourceforge.phpeclipse.smarty.ui/cpl-v10.html @@ -0,0 +1,125 @@ + + + +Common Public License - v 1.0 + + + + + + +

Common Public License - v 1.0 +

+

THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. +

+

1. DEFINITIONS +

"Contribution" means: + +

+ + + + + + + + + + +

+

"Contributor" means any person or entity that distributes the Program. +

+

"Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. +

+

"Program" means the Contributions distributed in accordance with this Agreement. +

+

"Recipient" means anyone who receives the Program under this Agreement, including all Contributors. +

+

2. GRANT OF RIGHTS + +

+ + + + + + + + + + + + + + + + + + + + + + +

3. REQUIREMENTS +

A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that: + +

+ + + + + + + + + + + + + + + + + + + +

When the Program is made available in source code form: + +

+ + + + +

+

Contributors may not remove or alter any copyright notices contained within the Program. +

+

Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution. +

+

4. COMMERCIAL DISTRIBUTION +

Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense. +

+

For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages. +

+

5. NO WARRANTY +

EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. +

+

6. DISCLAIMER OF LIABILITY +

EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. +

+

7. GENERAL +

If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. +

+

If Recipient institutes patent litigation against a Contributor with respect to a patent applicable to software (including a cross-claim or counterclaim in a lawsuit), then any patent licenses granted by that Contributor to such Recipient under this Agreement shall terminate as of the date such litigation is filed. In addition, if Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. +

+

All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. +

+

Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. IBM is the initial Agreement Steward. IBM may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. +

+

This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation. +

+

+ + + + \ No newline at end of file diff --git a/net.sourceforge.phpeclipse.smarty.ui/plugin.xml b/net.sourceforge.phpeclipse.smarty.ui/plugin.xml index 342f9ff..622e75b 100644 --- a/net.sourceforge.phpeclipse.smarty.ui/plugin.xml +++ b/net.sourceforge.phpeclipse.smarty.ui/plugin.xml @@ -2,10 +2,10 @@ + name="PHPeclipse Smarty UI" + version="1.1.0" + provider-name="PHPeclipse.de" + class="net.sourceforge.phpdt.smarty.ui.SmartyUI"> @@ -34,7 +34,8 @@ name="HTML Editor" icon="icons/full/obj16/html.png" extensions="tpl" - class="net.sourceforge.phpdt.smarty.ui.internal.editor.HTMLEditor" + contributorClass="net.sourceforge.phpdt.smarty.ui.internal.editor.SmartyEditorActionContributor" + class="net.sourceforge.phpdt.smarty.ui.internal.editor.SmartyEditor" id="net.sourceforge.phpdt.smarty.ui.editor"> @@ -42,14 +43,14 @@ point="org.eclipse.core.filebuffers.documentSetup"> + class="net.sourceforge.phpdt.smarty.ui.internal.editor.SmartyDocumentSetupParticipant"> diff --git a/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/HTMLUI.java b/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/SmartyUI.java similarity index 81% rename from net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/HTMLUI.java rename to net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/SmartyUI.java index ec255d5..695c929 100644 --- a/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/HTMLUI.java +++ b/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/SmartyUI.java @@ -8,7 +8,7 @@ * Contributors: * Christopher Lenz - initial API and implementation * - * $Id: HTMLUI.java,v 1.1 2004-09-02 18:25:04 jsurfer Exp $ + * $Id: SmartyUI.java,v 1.1 2004-09-03 17:31:18 jsurfer Exp $ */ package net.sourceforge.phpdt.smarty.ui; @@ -18,19 +18,19 @@ import org.eclipse.ui.plugin.AbstractUIPlugin; /** * The main plugin class to be used in the desktop. */ -public class HTMLUI extends AbstractUIPlugin { +public class SmartyUI extends AbstractUIPlugin { // Class Variables --------------------------------------------------------- /** The shared instance. */ - private static HTMLUI plugin; + private static SmartyUI plugin; // Constructors ------------------------------------------------------------ /** * The constructor. */ - public HTMLUI() { + public SmartyUI() { plugin = this; } @@ -39,7 +39,7 @@ public class HTMLUI extends AbstractUIPlugin { /** * Returns the shared instance. */ - public static HTMLUI getDefault() { + public static SmartyUI getDefault() { return plugin; } } diff --git a/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/HTMLUIMessages.java b/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/SmartyUIMessages.java similarity index 92% rename from net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/HTMLUIMessages.java rename to net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/SmartyUIMessages.java index c7536ed..3549dab 100644 --- a/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/HTMLUIMessages.java +++ b/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/SmartyUIMessages.java @@ -8,7 +8,7 @@ * Contributors: * Christopher Lenz - initial API and implementation * - * $Id: HTMLUIMessages.java,v 1.1 2004-09-02 18:25:05 jsurfer Exp $ + * $Id: SmartyUIMessages.java,v 1.1 2004-09-03 17:31:19 jsurfer Exp $ */ package net.sourceforge.phpdt.smarty.ui.internal; @@ -20,7 +20,7 @@ import java.util.ResourceBundle; /** * Utility class that provides easy access to externalized strings. */ -public final class HTMLUIMessages { +public final class SmartyUIMessages { // Constants --------------------------------------------------------------- @@ -28,7 +28,7 @@ public final class HTMLUIMessages { * Qualified name of the resource bundle containing the localized messages. */ private static final String RESOURCE_BUNDLE = - "net.sourceforge.phpdt.smarty.ui.internal.HTMLUIMessages"; //$NON-NLS-1$ + "net.sourceforge.phpdt.smarty.ui.internal.SmartyUIMessages"; //$NON-NLS-1$ // Class Variables --------------------------------------------------------- @@ -43,7 +43,7 @@ public final class HTMLUIMessages { /** * Hidden constructor. */ - private HTMLUIMessages() { + private SmartyUIMessages() { // Hidden } diff --git a/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/HTMLUIMessages.properties b/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/SmartyUIMessages.properties similarity index 83% rename from net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/HTMLUIMessages.properties rename to net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/SmartyUIMessages.properties index 2bca3aa..337df8e 100644 --- a/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/HTMLUIMessages.properties +++ b/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/SmartyUIMessages.properties @@ -8,5 +8,5 @@ # Contributors: # Christopher Lenz - initial english resources # -# $Id: HTMLUIMessages.properties,v 1.1 2004-09-02 18:25:05 jsurfer Exp $ +# $Id: SmartyUIMessages.properties,v 1.1 2004-09-03 17:31:19 jsurfer Exp $ # diff --git a/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/HTMLDocumentProvider.java b/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/SmartyDocumentProvider.java similarity index 80% rename from net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/HTMLDocumentProvider.java rename to net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/SmartyDocumentProvider.java index 8213ad2..c6a5b6e 100644 --- a/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/HTMLDocumentProvider.java +++ b/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/SmartyDocumentProvider.java @@ -8,7 +8,7 @@ * Contributors: * Christopher Lenz - initial API and implementation * - * $Id: HTMLDocumentProvider.java,v 1.1 2004-09-02 18:25:05 jsurfer Exp $ + * $Id: SmartyDocumentProvider.java,v 1.1 2004-09-03 17:31:18 jsurfer Exp $ */ package net.sourceforge.phpdt.smarty.ui.internal.editor; @@ -19,6 +19,6 @@ import net.sourceforge.phpeclipse.xml.ui.internal.editor.XMLDocumentProvider; /** * Document provider for HTML files. */ -public class HTMLDocumentProvider extends XMLDocumentProvider { +public class SmartyDocumentProvider extends XMLDocumentProvider { } diff --git a/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/HTMLDocumentSetupParticipant.java b/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/SmartyDocumentSetupParticipant.java similarity index 78% rename from net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/HTMLDocumentSetupParticipant.java rename to net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/SmartyDocumentSetupParticipant.java index f76eb1b..b8fac8b 100644 --- a/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/HTMLDocumentSetupParticipant.java +++ b/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/SmartyDocumentSetupParticipant.java @@ -8,7 +8,7 @@ * Contributors: * Christopher Lenz - initial implementation * - * $Id: HTMLDocumentSetupParticipant.java,v 1.1 2004-09-02 18:25:05 jsurfer Exp $ + * $Id: SmartyDocumentSetupParticipant.java,v 1.1 2004-09-03 17:31:18 jsurfer Exp $ */ package net.sourceforge.phpdt.smarty.ui.internal.editor; @@ -19,6 +19,6 @@ import net.sourceforge.phpeclipse.xml.ui.internal.editor.XMLDocumentSetupPartici /** * Document setup participant that sets up the HTML specific partitioning. */ -public class HTMLDocumentSetupParticipant extends XMLDocumentSetupParticipant { +public class SmartyDocumentSetupParticipant extends XMLDocumentSetupParticipant { } diff --git a/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/HTMLEditor.java b/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/SmartyEditor.java similarity index 63% rename from net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/HTMLEditor.java rename to net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/SmartyEditor.java index dc96755..77aa1b4 100644 --- a/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/HTMLEditor.java +++ b/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/SmartyEditor.java @@ -8,26 +8,19 @@ * Contributors: * Christopher Lenz - initial implementation * - * $Id: HTMLEditor.java,v 1.1 2004-09-02 18:25:05 jsurfer Exp $ + * $Id: SmartyEditor.java,v 1.1 2004-09-03 17:31:18 jsurfer Exp $ */ package net.sourceforge.phpdt.smarty.ui.internal.editor; -import java.net.MalformedURLException; -import java.net.URL; - -import net.sourceforge.phpdt.smarty.ui.internal.preview.HTMLPreviewPage; -import net.sourceforge.phpdt.smarty.ui.internal.text.HTMLConfiguration; -import net.sourceforge.phpeclipse.ui.views.preview.IBrowserPreviewPage; +import net.sourceforge.phpdt.smarty.ui.internal.text.SmartyConfiguration; +import net.sourceforge.phpeclipse.ui.editor.ShowExternalPreviewAction; import net.sourceforge.phpeclipse.xml.ui.XMLPlugin; import net.sourceforge.phpeclipse.xml.ui.internal.editor.XMLDocumentProvider; import net.sourceforge.phpeclipse.xml.ui.internal.editor.XMLEditor; import net.sourceforge.phpeclipse.xml.ui.text.XMLTextTools; -import org.eclipse.core.resources.IFile; import org.eclipse.jface.action.IAction; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IFileEditorInput; import org.eclipse.ui.texteditor.ContentAssistAction; import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds; @@ -35,34 +28,29 @@ import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds; /** * HTML editor implementation. */ -public class HTMLEditor extends XMLEditor { +public class SmartyEditor extends XMLEditor { + public SmartyEditor() { + super(ShowExternalPreviewAction.SMARTY_TYPE); + } // Instance Variables ------------------------------------------------------ /** The associated preview page. */ - private HTMLPreviewPage previewPage; +// private HTMLPreviewPage previewPage; // XMLEditor Implementation ------------------------------------------------ - /* - * @see org.eclipse.ui.texteditor.AbstractTextEditor#editorSaved() - */ - protected void editorSaved() { - if (previewPage != null) { - previewPage.update(); - } - } /* * @see org.eclipse.core.runtime.IAdaptable#getAdapter(Class) */ public Object getAdapter(Class adapter) { - if (adapter == IBrowserPreviewPage.class) { - if (previewPage == null) { - previewPage = createPreviewPage(); - } - return previewPage; - } +// if (adapter == IBrowserPreviewPage.class) { +// if (previewPage == null) { +// previewPage = createPreviewPage(); +// } +// return previewPage; +// } return super.getAdapter(adapter); } @@ -71,21 +59,21 @@ public class HTMLEditor extends XMLEditor { /** * Creates the HTML preview page. */ - private HTMLPreviewPage createPreviewPage() { - IEditorInput input = getEditorInput(); - if (input instanceof IFileEditorInput) { - IFile file = ((IFileEditorInput) input).getFile(); - try { - URL location = file.getLocation().toFile().toURL(); - return new HTMLPreviewPage(location); - } catch (MalformedURLException e) { } - } - return null; - } +// private HTMLPreviewPage createPreviewPage() { +// IEditorInput input = getEditorInput(); +// if (input instanceof IFileEditorInput) { +// IFile file = ((IFileEditorInput) input).getFile(); +// try { +// URL location = file.getLocation().toFile().toURL(); +// return new HTMLPreviewPage(location); +// } catch (MalformedURLException e) { } +// } +// return null; +// } protected void createActions() { super.createActions(); - IAction action = new ContentAssistAction(HTMLEditorMessages.getResourceBundle(), + IAction action = new ContentAssistAction(SmartyEditorMessages.getResourceBundle(), "ContentAssistProposal.", this); //$NON-NLS-1$ action .setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS); @@ -108,7 +96,7 @@ public class HTMLEditor extends XMLEditor { super.initializeEditor(); XMLTextTools xmlTextTools = XMLPlugin.getDefault().getXMLTextTools(); - setSourceViewerConfiguration(new HTMLConfiguration(xmlTextTools, this)); + setSourceViewerConfiguration(new SmartyConfiguration(xmlTextTools, this)); setDocumentProvider(new XMLDocumentProvider()); } } diff --git a/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/SmartyEditorActionContributor.java b/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/SmartyEditorActionContributor.java new file mode 100644 index 0000000..5b565d5 --- /dev/null +++ b/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/SmartyEditorActionContributor.java @@ -0,0 +1,51 @@ +/******************************************************************************* + * Copyright (c) 2000, 2003 IBM Corporation 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 API and implementation + *******************************************************************************/ +package net.sourceforge.phpdt.smarty.ui.internal.editor; + +import net.sourceforge.phpeclipse.ui.editor.ShowExternalPreviewAction; + +import org.eclipse.core.resources.IFile; +import org.eclipse.ui.IEditorInput; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IFileEditorInput; +import org.eclipse.ui.texteditor.BasicTextEditorActionContributor; +import org.eclipse.ui.texteditor.ITextEditor; + +/** + * Common base class for action contributors for Java editors. + */ +public class SmartyEditorActionContributor extends BasicTextEditorActionContributor { + + /* (non-Javadoc) + * @see org.eclipse.ui.IEditorActionBarContributor#setActiveEditor(org.eclipse.ui.IEditorPart) + */ + public void setActiveEditor(IEditorPart part) { + super.setActiveEditor(part); + ITextEditor textEditor = null; + if (part instanceof ITextEditor) + textEditor = (ITextEditor) part; + + if (textEditor != null) { + IFile file = null; + IEditorInput editorInput = textEditor.getEditorInput(); + + if (editorInput instanceof IFileEditorInput) { + file = ((IFileEditorInput) editorInput).getFile(); + } + + ShowExternalPreviewAction fShowExternalPreviewAction = ShowExternalPreviewAction.getInstance(); + fShowExternalPreviewAction.setEditor(textEditor); + fShowExternalPreviewAction.update(); + if (fShowExternalPreviewAction != null) + fShowExternalPreviewAction.doRun(ShowExternalPreviewAction.SMARTY_TYPE); + } + } +} diff --git a/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/HTMLEditorMessages.java b/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/SmartyEditorMessages.java similarity index 90% rename from net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/HTMLEditorMessages.java rename to net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/SmartyEditorMessages.java index 05117e4..046db9e 100644 --- a/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/HTMLEditorMessages.java +++ b/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/SmartyEditorMessages.java @@ -15,13 +15,13 @@ import java.text.MessageFormat; import java.util.MissingResourceException; import java.util.ResourceBundle; -public class HTMLEditorMessages { +public class SmartyEditorMessages { - private static final String RESOURCE_BUNDLE= "net.sourceforge.phpdt.smarty.ui.internal.editor.HTMLEditorMessages";//$NON-NLS-1$ + private static final String RESOURCE_BUNDLE= "net.sourceforge.phpdt.smarty.ui.internal.editor.SmartyEditorMessages";//$NON-NLS-1$ private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE); - private HTMLEditorMessages() { + private SmartyEditorMessages() { } public static String getString(String key) { diff --git a/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/HTMLEditorMessages.properties b/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/SmartyEditorMessages.properties similarity index 100% rename from net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/HTMLEditorMessages.properties rename to net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/SmartyEditorMessages.properties diff --git a/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/preview/HTMLPreviewPage.java b/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/preview/HTMLPreviewPage.java deleted file mode 100644 index c60bcab..0000000 --- a/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/preview/HTMLPreviewPage.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (c) 2004 Christopher Lenz 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: - * Christopher Lenz - initial implementation - * - * $Id: HTMLPreviewPage.java,v 1.1 2004-09-02 18:25:05 jsurfer Exp $ - */ - -package net.sourceforge.phpdt.smarty.ui.internal.preview; - -import java.net.URL; - -import net.sourceforge.phpeclipse.ui.views.preview.IBrowserPreviewPage; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.browser.Browser; -import org.eclipse.swt.browser.LocationAdapter; -import org.eclipse.swt.browser.LocationEvent; -import org.eclipse.swt.layout.FillLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.ui.part.Page; -import org.eclipse.ui.texteditor.IUpdate; - -/** - * Provides a HTML preview page based on the SWT browser control. - */ -public class HTMLPreviewPage extends Page - implements IBrowserPreviewPage, IUpdate { - - // Instance Variables ------------------------------------------------------ - - /** The browser widget. */ - private Browser browser; - - /** The URL of the resource to preview. */ - private URL location; - - // Constructors ------------------------------------------------------------ - - /** - * Constructor. - * - * @param location the URL of the resource to preview - */ - public HTMLPreviewPage(URL location) { - this.location = location; - } - - // IPage Implementation ---------------------------------------------------- - - /* - * @see org.eclipse.ui.part.IPage#createControl(Composite) - */ - public void createControl(Composite parent) { - browser = new Browser(parent, SWT.NONE); - browser.setLayout(new FillLayout()); - browser.setUrl(location.toString()); - browser.addLocationListener(new LocationAdapter() { - public void changing(LocationEvent event) { - if (event.location != null) { - event.doit = false; - } - } - }); - } - - /* - * @see org.eclipse.ui.part.IPage#getControl() - */ - public Control getControl() { - return browser; - } - - /* - * @see org.eclipse.ui.part.IPage#setFocus() - */ - public void setFocus() { - browser.setFocus(); - } - - // IUpdate Implementation -------------------------------------------------- - - /* - * @see IUpdate#update() - */ - public void update() { - browser.refresh(); - } - -} diff --git a/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/text/HTMLCompletionProcessor.java b/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/text/SmartyCompletionProcessor.java similarity index 94% rename from net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/text/HTMLCompletionProcessor.java rename to net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/text/SmartyCompletionProcessor.java index 9cff545..d20fead 100644 --- a/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/text/HTMLCompletionProcessor.java +++ b/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/text/SmartyCompletionProcessor.java @@ -22,7 +22,7 @@ import org.eclipse.jface.text.templates.TemplateContextType; /** * A completion processor for XML templates. */ -public class HTMLCompletionProcessor extends BasicCompletionProcessor { +public class SmartyCompletionProcessor extends BasicCompletionProcessor { /** * Return the XML context type that is supported by this plugin. diff --git a/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/text/HTMLConfiguration.java b/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/text/SmartyConfiguration.java similarity index 95% rename from net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/text/HTMLConfiguration.java rename to net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/text/SmartyConfiguration.java index aec204a..2600db0 100644 --- a/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/text/HTMLConfiguration.java +++ b/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/text/SmartyConfiguration.java @@ -27,13 +27,13 @@ import org.eclipse.ui.texteditor.ITextEditor; * * TODO To change the template for this generated type comment go to Window - Preferences - Java - Code Style - Code Templates */ -public class HTMLConfiguration extends XMLConfiguration { +public class SmartyConfiguration extends XMLConfiguration { private SmartyTagScanner smartyTagScanner; - public HTMLConfiguration(XMLTextTools tools) { + public SmartyConfiguration(XMLTextTools tools) { this(tools, null); } - public HTMLConfiguration(XMLTextTools tools, ITextEditor editor) { + public SmartyConfiguration(XMLTextTools tools, ITextEditor editor) { super(tools, editor); Map tokens = tools.getTokens(); smartyTagScanner = new SmartyTagScanner(tokens); @@ -43,7 +43,7 @@ public class HTMLConfiguration extends XMLConfiguration { ContentAssistant assistant = new ContentAssistant(); assistant.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer)); - IContentAssistProcessor processor = new HTMLCompletionProcessor(); + IContentAssistProcessor processor = new SmartyCompletionProcessor(); assistant.setContentAssistProcessor(processor, IDocument.DEFAULT_CONTENT_TYPE); assistant.setContentAssistProcessor(processor, XMLPartitionScanner.XML_TAG); assistant.setContentAssistProcessor(processor, XMLPartitionScanner.XML_PI); diff --git a/net.sourceforge.phpeclipse.ui/cpl-v10.html b/net.sourceforge.phpeclipse.ui/cpl-v10.html new file mode 100644 index 0000000..36aa208 --- /dev/null +++ b/net.sourceforge.phpeclipse.ui/cpl-v10.html @@ -0,0 +1,125 @@ + + + +Common Public License - v 1.0 + + + + + + +

Common Public License - v 1.0 +

+

THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. +

+

1. DEFINITIONS +

"Contribution" means: + +

+ + + + + + + + + + +

+

"Contributor" means any person or entity that distributes the Program. +

+

"Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. +

+

"Program" means the Contributions distributed in accordance with this Agreement. +

+

"Recipient" means anyone who receives the Program under this Agreement, including all Contributors. +

+

2. GRANT OF RIGHTS + +

+ + + + + + + + + + + + + + + + + + + + + + +

3. REQUIREMENTS +

A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that: + +

+ + + + + + + + + + + + + + + + + + + +

When the Program is made available in source code form: + +

+ + + + +

+

Contributors may not remove or alter any copyright notices contained within the Program. +

+

Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution. +

+

4. COMMERCIAL DISTRIBUTION +

Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense. +

+

For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages. +

+

5. NO WARRANTY +

EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. +

+

6. DISCLAIMER OF LIABILITY +

EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. +

+

7. GENERAL +

If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. +

+

If Recipient institutes patent litigation against a Contributor with respect to a patent applicable to software (including a cross-claim or counterclaim in a lawsuit), then any patent licenses granted by that Contributor to such Recipient under this Agreement shall terminate as of the date such litigation is filed. In addition, if Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. +

+

All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. +

+

Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. IBM is the initial Agreement Steward. IBM may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. +

+

This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation. +

+

+ + + + \ No newline at end of file diff --git a/net.sourceforge.phpeclipse.ui/icons/full/obj16/php.gif b/net.sourceforge.phpeclipse.ui/icons/full/obj16/php.gif new file mode 100644 index 0000000..f01f87e Binary files /dev/null and b/net.sourceforge.phpeclipse.ui/icons/full/obj16/php.gif differ diff --git a/net.sourceforge.phpeclipse.ui/plugin.properties b/net.sourceforge.phpeclipse.ui/plugin.properties index 550ff12..5f1caf6 100644 --- a/net.sourceforge.phpeclipse.ui/plugin.properties +++ b/net.sourceforge.phpeclipse.ui/plugin.properties @@ -8,17 +8,17 @@ # Contributors: # Christopher Lenz - initial english resources # -# $Id: plugin.properties,v 1.1 2004-09-02 18:26:30 jsurfer Exp $ +# $Id: plugin.properties,v 1.2 2004-09-03 17:30:19 jsurfer Exp $ # pluginName = Web Development Tools UI providerName= WDTE Project preferencePageName = PHPeclipse Web Development - viewCategoryName = PHPeclipse Web Development -previewViewName = Browser Preview + templates.contextType.xml=xml templates.contextType.html=html +templates.contextType.smarty=smarty templates.contextType.javascript=javascript \ No newline at end of file diff --git a/net.sourceforge.phpeclipse.ui/plugin.xml b/net.sourceforge.phpeclipse.ui/plugin.xml index dcf6ae5..68a2be0 100644 --- a/net.sourceforge.phpeclipse.ui/plugin.xml +++ b/net.sourceforge.phpeclipse.ui/plugin.xml @@ -23,6 +23,7 @@ + @@ -39,22 +40,63 @@ class="net.sourceforge.phpeclipse.ui.templates.preferences.TemplatesPreferencePage" id="net.sourceforge.phpeclipse.ui.templates.preferences.TemplatesPreferencePage"> + + + + - + + + + + + + + + @@ -73,7 +115,12 @@ class="net.sourceforge.phpeclipse.ui.templates.template.JSContextType" id="javascript"> - + - + --> - - + --> + - + - + --> - - diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/LocalhostExpander.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/LocalhostExpander.java index 5bd3b47..2966aaf 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/LocalhostExpander.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/LocalhostExpander.java @@ -1,6 +1,7 @@ package net.sourceforge.phpdt.externaltools.variable; import net.sourceforge.phpeclipse.PHPeclipsePlugin; +import net.sourceforge.phpeclipse.ui.WebUI; import org.eclipse.jface.preference.IPreferenceStore; @@ -14,7 +15,7 @@ public class LocalhostExpander implements IVariableTextExpander { public String getText(String varTag, String varValue, ExpandVariableContext context) { IPreferenceStore store = PHPeclipsePlugin.getDefault().getPreferenceStore(); - return store.getString(PHPeclipsePlugin.PHP_LOCALHOST_PREF); + return store.getString(WebUI.PHP_LOCALHOST_PREF); } } diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/UrlExpander.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/UrlExpander.java index 66ae19d..17cbdf5 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/UrlExpander.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/UrlExpander.java @@ -1,6 +1,7 @@ package net.sourceforge.phpdt.externaltools.variable; import net.sourceforge.phpeclipse.PHPeclipsePlugin; +import net.sourceforge.phpeclipse.ui.WebUI; import org.eclipse.core.runtime.IPath; import org.eclipse.jface.preference.IPreferenceStore; @@ -32,13 +33,13 @@ public class UrlExpander extends ResourceExpander { //implements IVariableTextEx IPreferenceStore store = PHPeclipsePlugin.getDefault().getPreferenceStore(); String localhostURL = path.toString(); String lowerCaseFileName = localhostURL.toLowerCase(); - String documentRoot = store.getString(PHPeclipsePlugin.PHP_DOCUMENTROOT_PREF); + String documentRoot = store.getString(WebUI.PHP_DOCUMENTROOT_PREF); documentRoot = documentRoot.replace('\\', '/'); documentRoot = documentRoot.toLowerCase(); if (lowerCaseFileName.startsWith(documentRoot)) { localhostURL = localhostURL.substring(documentRoot.length()); - localhostURL = store.getString(PHPeclipsePlugin.PHP_LOCALHOST_PREF)+ localhostURL; + localhostURL = store.getString(WebUI.PHP_LOCALHOST_PREF)+ localhostURL; } return localhostURL; } diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/util/PHPFileUtil.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/util/PHPFileUtil.java index bd07518..8073298 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/util/PHPFileUtil.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/util/PHPFileUtil.java @@ -49,16 +49,7 @@ public class PHPFileUtil { isPHTML_FileName(name) || isINC_FileName(name); } - // static public boolean isPHPFile(String extension) { - // if ("php".equalsIgnoreCase(extension) - // || "php3".equalsIgnoreCase(extension) - // || "php4".equalsIgnoreCase(extension) - // || "inc".equalsIgnoreCase(extension)) { - // return true; - // } - // return false; - // } - + /** * Returns true iff str.toLowerCase().endsWith(".php") * implementation is not creating extra strings. diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/IPreferenceConstants.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/IPreferenceConstants.java index 7fd5ac4..8fea4a1 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/IPreferenceConstants.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/IPreferenceConstants.java @@ -214,11 +214,11 @@ public interface IPreferenceConstants { public static final String EDITOR_CORRECTION_INDICATION = null; public static final String PHP_OBFUSCATOR_DEFAULT = "_php_obfuscator_default"; - public static final String PHP_BOOKMARK_DEFAULT = "_php_bookmark_default"; - public static final String PHP_LOCALHOST_PREF = "_php_localhost"; - public static final String PHP_DOCUMENTROOT_PREF = "_php_documentroot"; - - public static final String PHP_AUTO_PREVIEW_DEFAULT = "_auto_preview"; - public static final String PHP_BRING_TO_TOP_PREVIEW_DEFAULT = "_bring_to_top_preview"; - public static final String PHP_SHOW_HTML_FILES_LOCAL = "_show_html_files_local"; +// public static final String PHP_BOOKMARK_DEFAULT = "_php_bookmark_default"; +// public static final String PHP_LOCALHOST_PREF = "_php_localhost"; +// public static final String PHP_DOCUMENTROOT_PREF = "_php_documentroot"; +// +// public static final String PHP_AUTO_PREVIEW_DEFAULT = "_auto_preview"; +// public static final String PHP_BRING_TO_TOP_PREVIEW_DEFAULT = "_bring_to_top_preview"; +// public static final String PHP_SHOW_HTML_FILES_LOCAL = "_show_html_files_local"; } \ No newline at end of file diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPPerspectiveFactory.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPPerspectiveFactory.java index f29628e..dabecf1 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPPerspectiveFactory.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPPerspectiveFactory.java @@ -1,6 +1,6 @@ package net.sourceforge.phpeclipse; -import net.sourceforge.phpeclipse.views.browser.BrowserView; +import net.sourceforge.phpeclipse.webbrowser.views.BrowserView; import org.eclipse.debug.ui.IDebugUIConstants; import org.eclipse.search.ui.NewSearchUI; diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPeclipsePlugin.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPeclipsePlugin.java index 8276b1d..1e54b0e 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPeclipsePlugin.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPeclipsePlugin.java @@ -646,19 +646,19 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements // store.setDefault(LOCALHOST_PREF, "http://localhost"); // store.setDefault(DOCUMENTROOT_PREF, // getWorkspace().getRoot().getLocation().toString()); - store.setDefault(PHP_LOCALHOST_PREF, "http://localhost"); - store.setDefault(PHP_DOCUMENTROOT_PREF, getWorkspace().getRoot() - .getLocation().toString()); +// store.setDefault(PHP_LOCALHOST_PREF, "http://localhost"); +// store.setDefault(PHP_DOCUMENTROOT_PREF, getWorkspace().getRoot() +// .getLocation().toString()); // store.setDefault(SHOW_EXTERNAL_PREVIEW_PREF, "true"); 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, ""); - - store.setDefault(PHP_AUTO_PREVIEW_DEFAULT, "true"); - store.setDefault(PHP_BRING_TO_TOP_PREVIEW_DEFAULT, "true"); - store.setDefault(PHP_SHOW_HTML_FILES_LOCAL, "true"); +// store.setDefault(PHP_BOOKMARK_DEFAULT, ""); +// +// store.setDefault(PHP_AUTO_PREVIEW_DEFAULT, "true"); +// store.setDefault(PHP_BRING_TO_TOP_PREVIEW_DEFAULT, "true"); +// store.setDefault(PHP_SHOW_HTML_FILES_LOCAL, "true"); String windowsSystem = Platform.getWS(); if (jvm == WINDOWS_9x) { diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPEclipseShowAction.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPEclipseShowAction.java index 0366b57..0d3b56f 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPEclipseShowAction.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPEclipseShowAction.java @@ -16,11 +16,11 @@ import java.net.URL; import java.text.MessageFormat; import java.util.Iterator; -import net.sourceforge.phpeclipse.IPreferenceConstants; import net.sourceforge.phpeclipse.PHPeclipsePlugin; -import net.sourceforge.phpeclipse.overlaypages.Util; +import net.sourceforge.phpeclipse.ui.editor.ShowExternalPreviewAction; import net.sourceforge.phpeclipse.views.PHPConsole; -import net.sourceforge.phpeclipse.views.browser.BrowserView; +import net.sourceforge.phpeclipse.webbrowser.views.BrowserView; + import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IResource; import org.eclipse.jface.action.IAction; @@ -35,7 +35,6 @@ import org.eclipse.ui.IObjectActionDelegate; import org.eclipse.ui.IViewPart; import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.PartInitException; //import org.eclipse.update.internal.ui.UpdatePerspective; //import org.eclipse.update.internal.ui.views.IEmbeddedWebBrowser; public class PHPEclipseShowAction implements IObjectActionDelegate { @@ -74,7 +73,7 @@ public class PHPEclipseShowAction implements IObjectActionDelegate { // single file: IFile file = (IFile) resource; String localhostURL; - if ((localhostURL = getLocalhostURL(store, (IFile) resource)) == null) { + if ((localhostURL = ShowExternalPreviewAction.getLocalhostURL(store, (IFile) resource)) == null) { MessageDialog.openInformation(shell, "Couldn't create localhost URL", "Please configure your localhost and documentRoot"); @@ -116,28 +115,28 @@ public class PHPEclipseShowAction implements IObjectActionDelegate { */ 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()); - } else { - return null; - } -// return store.getString(PHPeclipsePlugin.LOCALHOST_PREF) + localhostURL; - return Util.getMiscProjectsPreferenceValue(file.getProject(), IPreferenceConstants.PHP_LOCALHOST_PREF) + localhostURL; - } +// 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()); +// } else { +// return null; +// } +//// 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) { diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPOpenSQLTableEditorAction.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPOpenSQLTableEditorAction.java index 99fbfc5..9074af8 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPOpenSQLTableEditorAction.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPOpenSQLTableEditorAction.java @@ -14,15 +14,14 @@ import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; -import net.sourceforge.phpeclipse.IPreferenceConstants; import net.sourceforge.phpeclipse.PHPeclipsePlugin; -import net.sourceforge.phpeclipse.overlaypages.Util; import net.sourceforge.phpeclipse.phpeditor.PHPEditor; +import net.sourceforge.phpeclipse.ui.WebUI; +import net.sourceforge.phpeclipse.ui.overlaypages.Util; import org.eclipse.core.resources.IContainer; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.Path; import org.eclipse.jface.action.IAction; import org.eclipse.jface.text.BadLocationException; @@ -211,7 +210,7 @@ public class PHPOpenSQLTableEditorAction extends ActionDelegate implements BookmarkCollection sqlBookMarks = BookmarkCollection.getInstance(); if (sqlBookMarks != null) { String bookmarkString = Util.getMiscProjectsPreferenceValue(project, - IPreferenceConstants.PHP_BOOKMARK_DEFAULT); + WebUI.PHP_BOOKMARK_DEFAULT); if (bookmarkString != null && !bookmarkString.equals("")) { Bookmark bookmark = sqlBookMarks.find(bookmarkString); ArrayList sqlList = new ArrayList(); diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPStartApacheAction.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPStartApacheAction.java index 6e253c8..5f9c54c 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPStartApacheAction.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPStartApacheAction.java @@ -15,6 +15,7 @@ import java.text.MessageFormat; import net.sourceforge.phpdt.externaltools.launchConfigurations.ExternalToolsUtil; import net.sourceforge.phpeclipse.PHPeclipsePlugin; +import net.sourceforge.phpeclipse.ui.WebUI; import net.sourceforge.phpeclipse.views.PHPConsole; import org.eclipse.jface.action.IAction; @@ -29,7 +30,7 @@ public class PHPStartApacheAction implements IWorkbenchWindowActionDelegate { public void run(IAction action) { final IPreferenceStore store = PHPeclipsePlugin.getDefault().getPreferenceStore(); - String documentRoot = store.getString(PHPeclipsePlugin.PHP_DOCUMENTROOT_PREF); + String documentRoot = store.getString(WebUI.PHP_DOCUMENTROOT_PREF); // replace backslash with slash in the DocumentRoot under Windows documentRoot = documentRoot.replace('\\', '/'); String[] arguments = { documentRoot }; diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/CompilationUnitEditorActionContributor.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/CompilationUnitEditorActionContributor.java index 6eea5b8..e6708e6 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/CompilationUnitEditorActionContributor.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/CompilationUnitEditorActionContributor.java @@ -1,15 +1,15 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation 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 +/*********************************************************************************************************************************** + * Copyright (c) 2000, 2003 IBM Corporation 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 API and implementation - ******************************************************************************/ + **********************************************************************************************************************************/ package net.sourceforge.phpeclipse.phpeditor; import net.sourceforge.phpdt.ui.actions.PHPdtActionConstants; import net.sourceforge.phpeclipse.PHPeclipsePlugin; +import net.sourceforge.phpeclipse.ui.editor.ShowExternalPreviewAction; import org.eclipse.core.resources.IFile; import org.eclipse.jface.action.IAction; @@ -20,59 +20,49 @@ import org.eclipse.ui.IEditorPart; import org.eclipse.ui.IFileEditorInput; import org.eclipse.ui.texteditor.ITextEditor; -public class CompilationUnitEditorActionContributor - extends - BasicEditorActionContributor { - protected ShowExternalPreviewAction fShowExternalPreviewAction; - public CompilationUnitEditorActionContributor() { - super(); - fShowExternalPreviewAction = ShowExternalPreviewAction.getInstance(); - } +public class CompilationUnitEditorActionContributor extends BasicEditorActionContributor { + public CompilationUnitEditorActionContributor() { + super(); + } - /* - * @see IEditorActionBarContributor#setActiveEditor(IEditorPart) - */ - public void setActiveEditor(IEditorPart part) { - super.setActiveEditor(part); + /* + * @see IEditorActionBarContributor#setActiveEditor(IEditorPart) + */ + public void setActiveEditor(IEditorPart part) { + super.setActiveEditor(part); - ITextEditor textEditor = null; - if (part instanceof ITextEditor) - textEditor = (ITextEditor) part; + ITextEditor textEditor = null; + if (part instanceof ITextEditor) + textEditor = (ITextEditor) part; - // Source menu. - IActionBars bars = getActionBars(); - bars.setGlobalActionHandler(PHPdtActionConstants.COMMENT, getAction( - textEditor, "Comment")); //$NON-NLS-1$ - bars.setGlobalActionHandler(PHPdtActionConstants.UNCOMMENT, getAction( - textEditor, "Uncomment")); //$NON-NLS-1$ - bars.setGlobalActionHandler(PHPdtActionConstants.TOGGLE_COMMENT, - getAction(textEditor, "ToggleComment")); //$NON-NLS-1$ - bars.setGlobalActionHandler(PHPdtActionConstants.FORMAT, getAction( - textEditor, "Format")); //$NON-NLS-1$ -// bars.setGlobalActionHandler(PHPdtActionConstants.ADD_BLOCK_COMMENT, -// getAction(textEditor, "AddBlockComment")); //$NON-NLS-1$ -// bars.setGlobalActionHandler(PHPdtActionConstants.REMOVE_BLOCK_COMMENT, -// getAction(textEditor, "RemoveBlockComment")); //$NON-NLS-1$ -// bars.setGlobalActionHandler(PHPdtActionConstants.INDENT, getAction( -// textEditor, "Indent")); //$NON-NLS-1$ //$NON-NLS-2$ + // Source menu. + IActionBars bars = getActionBars(); + bars.setGlobalActionHandler(PHPdtActionConstants.COMMENT, getAction(textEditor, "Comment")); //$NON-NLS-1$ + bars.setGlobalActionHandler(PHPdtActionConstants.UNCOMMENT, getAction(textEditor, "Uncomment")); //$NON-NLS-1$ + bars.setGlobalActionHandler(PHPdtActionConstants.TOGGLE_COMMENT, getAction(textEditor, "ToggleComment")); //$NON-NLS-1$ + bars.setGlobalActionHandler(PHPdtActionConstants.FORMAT, getAction(textEditor, "Format")); //$NON-NLS-1$ + // bars.setGlobalActionHandler(PHPdtActionConstants.ADD_BLOCK_COMMENT, + // getAction(textEditor, "AddBlockComment")); //$NON-NLS-1$ + // bars.setGlobalActionHandler(PHPdtActionConstants.REMOVE_BLOCK_COMMENT, + // getAction(textEditor, "RemoveBlockComment")); //$NON-NLS-1$ + // bars.setGlobalActionHandler(PHPdtActionConstants.INDENT, getAction( + // textEditor, "Indent")); //$NON-NLS-1$ //$NON-NLS-2$ - if (textEditor != null) { - IFile file = null; - IEditorInput editorInput = textEditor.getEditorInput(); + if (textEditor != null) { + IFile file = null; + IEditorInput editorInput = textEditor.getEditorInput(); - if (editorInput instanceof IFileEditorInput) { - file = ((IFileEditorInput) editorInput).getFile(); - } + if (editorInput instanceof IFileEditorInput) { + file = ((IFileEditorInput) editorInput).getFile(); + } - PHPeclipsePlugin.getDefault().setLastEditorFile(file); + PHPeclipsePlugin.getDefault().setLastEditorFile(file); - fShowExternalPreviewAction.setEditor(textEditor); - fShowExternalPreviewAction.update(); - IPreferenceStore store = PHPeclipsePlugin.getDefault() - .getPreferenceStore(); - IAction a = ShowExternalPreviewAction.getInstance(); - if (a != null) - a.run(); - } - } + ShowExternalPreviewAction fShowExternalPreviewAction = ShowExternalPreviewAction.getInstance(); + fShowExternalPreviewAction.setEditor(textEditor); + fShowExternalPreviewAction.update(); + if (fShowExternalPreviewAction != null) + fShowExternalPreviewAction.doRun(ShowExternalPreviewAction.PHP_TYPE); + } + } } \ No newline at end of file diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPUnitEditor.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPUnitEditor.java index f37c360..0a2fd89 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPUnitEditor.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPUnitEditor.java @@ -29,6 +29,7 @@ import net.sourceforge.phpdt.ui.PreferenceConstants; import net.sourceforge.phpdt.ui.actions.GenerateActionGroup; import net.sourceforge.phpdt.ui.text.JavaTextTools; import net.sourceforge.phpeclipse.PHPeclipsePlugin; +import net.sourceforge.phpeclipse.ui.editor.ShowExternalPreviewAction; import org.eclipse.core.internal.runtime.ListenerList; import org.eclipse.core.resources.IFile; @@ -2241,10 +2242,6 @@ public class PHPUnitEditor extends PHPEditor { //implements } else performSave(false, progressMonitor); } - ShowExternalPreviewAction a = ShowExternalPreviewAction.getInstance(); - if (a != null) { - a.refresh(); - } } public boolean isSaveAsAllowed() { @@ -2715,4 +2712,14 @@ public class PHPUnitEditor extends PHPEditor { //implements return fReconcilerLock; } + /* (non-Javadoc) + * @see org.eclipse.ui.texteditor.AbstractTextEditor#editorSaved() + */ + protected void editorSaved() { + super.editorSaved(); + ShowExternalPreviewAction a = ShowExternalPreviewAction.getInstance(); + if (a != null) { + a.refresh(ShowExternalPreviewAction.PHP_TYPE); + } + } } \ No newline at end of file diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PHPCompletionProcessor.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PHPCompletionProcessor.java index 8ea69f7..84bfadb 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PHPCompletionProcessor.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PHPCompletionProcessor.java @@ -18,25 +18,12 @@ import java.sql.SQLException; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import java.util.Map; import java.util.SortedMap; -import net.sourceforge.phpdt.core.IBuffer; -import net.sourceforge.phpdt.core.ICompilationUnit; -import net.sourceforge.phpdt.core.IJavaProject; -import net.sourceforge.phpdt.core.JavaModelException; import net.sourceforge.phpdt.core.ToolFactory; import net.sourceforge.phpdt.core.compiler.ITerminalSymbols; import net.sourceforge.phpdt.core.compiler.InvalidInputException; -import net.sourceforge.phpdt.internal.compiler.IProblemFactory; -import net.sourceforge.phpdt.internal.compiler.SourceElementParser; -import net.sourceforge.phpdt.internal.compiler.impl.CompilerOptions; import net.sourceforge.phpdt.internal.compiler.parser.Scanner; -import net.sourceforge.phpdt.internal.compiler.problem.DefaultProblemFactory; -import net.sourceforge.phpdt.internal.core.CompilationUnit; -import net.sourceforge.phpdt.internal.core.CompilationUnitStructureRequestor; -import net.sourceforge.phpdt.internal.core.JavaModelManager; -import net.sourceforge.phpdt.internal.core.JavaProject; import net.sourceforge.phpdt.internal.corext.template.ContextType; import net.sourceforge.phpdt.internal.corext.template.ContextTypeRegistry; import net.sourceforge.phpdt.internal.corext.template.php.CompilationUnitContextType; @@ -50,13 +37,12 @@ import net.sourceforge.phpdt.internal.ui.text.template.IdentifierEngine; import net.sourceforge.phpdt.internal.ui.text.template.SQLProposal; import net.sourceforge.phpdt.internal.ui.text.template.TemplateEngine; import net.sourceforge.phpdt.ui.IWorkingCopyManager; -import net.sourceforge.phpeclipse.IPreferenceConstants; import net.sourceforge.phpeclipse.PHPeclipsePlugin; import net.sourceforge.phpeclipse.builder.IdentifierIndexManager; -import net.sourceforge.phpeclipse.internal.compiler.ast.CompilationUnitDeclaration; -import net.sourceforge.phpeclipse.overlaypages.Util; import net.sourceforge.phpeclipse.phpeditor.PHPEditor; import net.sourceforge.phpeclipse.phpeditor.PHPSyntaxRdr; +import net.sourceforge.phpeclipse.ui.IPreferenceConstants; +import net.sourceforge.phpeclipse.ui.overlaypages.Util; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IProject;