From 81bc668ba49ba4e1a67ba34be899071fd2eb8ad7 Mon Sep 17 00:00:00 2001 From: jsurfer Date: Fri, 3 Sep 2004 17:33:50 +0000 Subject: [PATCH 1/1] misc changes --- .../cpl-v10.html | 125 +++++++ .../net.sourceforge.phpeclipse.html.ui/plugin.xml | 1 + .../html/ui/internal/editor/HTMLEditor.java | 61 ++-- .../editor/HTMLEditorActionContributor.java | 51 +++ .../html/ui/internal/preview/HTMLPreviewPage.java | 96 ----- .../cpl-v10.html | 125 +++++++ .../net.sourceforge.phpeclipse.js.ui/cpl-v10.html | 125 +++++++ .../net.sourceforge.phpeclipse.js.ui/plugin.xml | 2 +- net.sourceforge.phpeclipse.smarty.ui/cpl-v10.html | 125 +++++++ net.sourceforge.phpeclipse.smarty.ui/plugin.xml | 15 +- .../net/sourceforge/phpdt/smarty/ui/HTMLUI.java | 45 --- .../net/sourceforge/phpdt/smarty/ui/SmartyUI.java | 45 +++ .../phpdt/smarty/ui/internal/HTMLUIMessages.java | 102 ------ .../smarty/ui/internal/HTMLUIMessages.properties | 12 - .../phpdt/smarty/ui/internal/SmartyUIMessages.java | 102 ++++++ .../smarty/ui/internal/SmartyUIMessages.properties | 12 + .../ui/internal/editor/HTMLDocumentProvider.java | 24 -- .../editor/HTMLDocumentSetupParticipant.java | 24 -- .../smarty/ui/internal/editor/HTMLEditor.java | 114 ------ .../ui/internal/editor/HTMLEditorMessages.java | 45 --- .../internal/editor/HTMLEditorMessages.properties | 10 - .../ui/internal/editor/SmartyDocumentProvider.java | 24 ++ .../editor/SmartyDocumentSetupParticipant.java | 24 ++ .../smarty/ui/internal/editor/SmartyEditor.java | 102 ++++++ .../editor/SmartyEditorActionContributor.java | 51 +++ .../ui/internal/editor/SmartyEditorMessages.java | 45 +++ .../editor/SmartyEditorMessages.properties | 10 + .../ui/internal/preview/HTMLPreviewPage.java | 96 ----- .../ui/internal/text/HTMLCompletionProcessor.java | 35 -- .../smarty/ui/internal/text/HTMLConfiguration.java | 123 ------- .../internal/text/SmartyCompletionProcessor.java | 35 ++ .../ui/internal/text/SmartyConfiguration.java | 123 +++++++ net.sourceforge.phpeclipse.ui/cpl-v10.html | 125 +++++++ .../icons/full/obj16/php.gif | Bin 0 -> 889 bytes net.sourceforge.phpeclipse.ui/plugin.properties | 6 +- net.sourceforge.phpeclipse.ui/plugin.xml | 59 +++- .../phpeclipse/ui/IPreferenceConstants.java | 13 + .../phpeclipse/ui/PreferenceConstants.java | 28 ++ .../src/net/sourceforge/phpeclipse/ui/WebUI.java | 238 ++++++++------ .../phpeclipse/ui/editor/EditorMessages.java | 8 +- .../ui/editor/ShowExternalPreviewAction.java | 159 +++++++++ .../ui/overlaypages/FieldEditorOverlayPage.java | 366 ++++++++++++++++++++ .../phpeclipse/ui/overlaypages/Messages.java | 47 +++ .../phpeclipse/ui/overlaypages/Messages.properties | 5 + .../phpeclipse/ui/overlaypages/OverlayPage.java | 335 ++++++++++++++++++ .../phpeclipse/ui/overlaypages/PropertyStore.java | 234 +++++++++++++ .../phpeclipse/ui/overlaypages/Util.java | 58 +++ .../ui/preferences/IMiscProjectPreferences.java | 33 ++ .../ui/preferences/PHPMiscProjectPreferences.java | 62 ++++ .../ui/preferences/PHPPreferencesMessages.java | 39 ++ .../preferences/PHPPreferencesMessages.properties | 87 +++++ .../preferences/PHPPreviewProjectPreferences.java | 68 ++++ .../template/BasicCompletionProcessor.java | 41 +++- .../ui/templates/template/SmartyContextType.java | 43 +++ .../ui/views/preview/BrowserPreview.java | 88 ----- .../ui/views/preview/IBrowserPreviewPage.java | 23 -- .../plugin.properties | 13 +- net.sourceforge.phpeclipse.webbrowser/plugin.xml | 14 + .../phpeclipse/webbrowser/views/BrowserView.java | 74 ++++ net.sourceforge.phpeclipse.xml.core/cpl-v10.html | 125 +++++++ net.sourceforge.phpeclipse.xml.ui/cpl-v10.html | 125 +++++++ net.sourceforge.phpeclipse.xml.ui/plugin.xml | 4 +- .../xml/ui/internal/editor/XMLEditor.java | 269 ++++++++------- .../editor/XMLEditorActionContributor.java | 51 +++ .../preferences/ContentAssistPreference.java | 59 ++++ net.sourceforge.phpeclipse/plugin.properties | 3 +- net.sourceforge.phpeclipse/plugin.xml | 21 +- .../externaltools/variable/LocalhostExpander.java | 3 +- .../phpdt/externaltools/variable/UrlExpander.java | 5 +- .../phpdt/internal/ui/util/PHPFileUtil.java | 11 +- .../phpeclipse/IPreferenceConstants.java | 14 +- .../phpeclipse/PHPPerspectiveFactory.java | 2 +- .../sourceforge/phpeclipse/PHPeclipsePlugin.java | 16 +- .../phpeclipse/actions/PHPEclipseShowAction.java | 53 ++-- .../actions/PHPOpenSQLTableEditorAction.java | 7 +- .../phpeclipse/actions/PHPStartApacheAction.java | 3 +- .../overlaypages/FieldEditorOverlayPage.java | 365 ------------------- .../phpeclipse/overlaypages/Messages.java | 47 --- .../phpeclipse/overlaypages/Messages.properties | 5 - .../phpeclipse/overlaypages/OverlayPage.java | 335 ------------------ .../phpeclipse/overlaypages/PropertyStore.java | 234 ------------- .../sourceforge/phpeclipse/overlaypages/Util.java | 58 --- .../CompilationUnitEditorActionContributor.java | 98 +++--- .../phpeclipse/phpeditor/PHPUnitEditor.java | 15 +- .../phpeditor/ShowExternalPreviewAction.java | 129 ------- .../phpeditor/php/PHPCompletionProcessor.java | 18 +- .../preferences/PHPMiscProjectPreferences.java | 63 ---- .../preferences/PHPPreviewProjectPreferences.java | 69 ---- .../phpeclipse/views/browser/BrowserView.java | 74 ---- 89 files changed, 3821 insertions(+), 2655 deletions(-) create mode 100644 archive/net.sourceforge.phpeclipse.html.ui/cpl-v10.html create mode 100644 archive/net.sourceforge.phpeclipse.html.ui/src/net/sourceforge/phpeclipse/html/ui/internal/editor/HTMLEditorActionContributor.java delete mode 100644 archive/net.sourceforge.phpeclipse.html.ui/src/net/sourceforge/phpeclipse/html/ui/internal/preview/HTMLPreviewPage.java create mode 100644 archive/net.sourceforge.phpeclipse.js.core/cpl-v10.html create mode 100644 archive/net.sourceforge.phpeclipse.js.ui/cpl-v10.html create mode 100644 net.sourceforge.phpeclipse.smarty.ui/cpl-v10.html delete mode 100644 net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/HTMLUI.java create mode 100644 net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/SmartyUI.java delete mode 100644 net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/HTMLUIMessages.java delete mode 100644 net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/HTMLUIMessages.properties create mode 100644 net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/SmartyUIMessages.java create mode 100644 net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/SmartyUIMessages.properties delete mode 100644 net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/HTMLDocumentProvider.java delete mode 100644 net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/HTMLDocumentSetupParticipant.java delete mode 100644 net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/HTMLEditor.java delete mode 100644 net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/HTMLEditorMessages.java delete mode 100644 net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/HTMLEditorMessages.properties create mode 100644 net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/SmartyDocumentProvider.java create mode 100644 net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/SmartyDocumentSetupParticipant.java create mode 100644 net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/SmartyEditor.java create mode 100644 net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/SmartyEditorActionContributor.java create mode 100644 net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/SmartyEditorMessages.java create mode 100644 net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/SmartyEditorMessages.properties delete mode 100644 net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/preview/HTMLPreviewPage.java delete mode 100644 net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/text/HTMLCompletionProcessor.java delete mode 100644 net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/text/HTMLConfiguration.java create mode 100644 net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/text/SmartyCompletionProcessor.java create mode 100644 net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/text/SmartyConfiguration.java create mode 100644 net.sourceforge.phpeclipse.ui/cpl-v10.html create mode 100644 net.sourceforge.phpeclipse.ui/icons/full/obj16/php.gif create mode 100644 net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/ui/IPreferenceConstants.java create mode 100644 net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/ui/PreferenceConstants.java create mode 100644 net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/ui/editor/ShowExternalPreviewAction.java create mode 100644 net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/ui/overlaypages/FieldEditorOverlayPage.java create mode 100644 net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/ui/overlaypages/Messages.java create mode 100644 net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/ui/overlaypages/Messages.properties create mode 100644 net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/ui/overlaypages/OverlayPage.java create mode 100644 net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/ui/overlaypages/PropertyStore.java create mode 100644 net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/ui/overlaypages/Util.java create mode 100644 net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/ui/preferences/IMiscProjectPreferences.java create mode 100644 net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/ui/preferences/PHPMiscProjectPreferences.java create mode 100644 net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/ui/preferences/PHPPreferencesMessages.java create mode 100644 net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/ui/preferences/PHPPreferencesMessages.properties create mode 100644 net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/ui/preferences/PHPPreviewProjectPreferences.java create mode 100644 net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/ui/templates/template/SmartyContextType.java delete mode 100644 net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/ui/views/preview/BrowserPreview.java delete mode 100644 net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/ui/views/preview/IBrowserPreviewPage.java create mode 100644 net.sourceforge.phpeclipse.webbrowser/src/net/sourceforge/phpeclipse/webbrowser/views/BrowserView.java create mode 100644 net.sourceforge.phpeclipse.xml.core/cpl-v10.html create mode 100644 net.sourceforge.phpeclipse.xml.ui/cpl-v10.html create mode 100644 net.sourceforge.phpeclipse.xml.ui/src/net/sourceforge/phpeclipse/xml/ui/internal/editor/XMLEditorActionContributor.java create mode 100644 net.sourceforge.phpeclipse.xml.ui/src/net/sourceforge/phpeclipse/xml/ui/internal/preferences/ContentAssistPreference.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/overlaypages/FieldEditorOverlayPage.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/overlaypages/Messages.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/overlaypages/Messages.properties delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/overlaypages/OverlayPage.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/overlaypages/PropertyStore.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/overlaypages/Util.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/ShowExternalPreviewAction.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/preferences/PHPMiscProjectPreferences.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/preferences/PHPPreviewProjectPreferences.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/views/browser/BrowserView.java 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/HTMLUI.java deleted file mode 100644 index ec255d5..0000000 --- a/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/HTMLUI.java +++ /dev/null @@ -1,45 +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 API and implementation - * - * $Id: HTMLUI.java,v 1.1 2004-09-02 18:25:04 jsurfer Exp $ - */ - -package net.sourceforge.phpdt.smarty.ui; - -import org.eclipse.ui.plugin.AbstractUIPlugin; - -/** - * The main plugin class to be used in the desktop. - */ -public class HTMLUI extends AbstractUIPlugin { - - // Class Variables --------------------------------------------------------- - - /** The shared instance. */ - private static HTMLUI plugin; - - // Constructors ------------------------------------------------------------ - - /** - * The constructor. - */ - public HTMLUI() { - plugin = this; - } - - // Public Methods ---------------------------------------------------------- - - /** - * Returns the shared instance. - */ - public static HTMLUI getDefault() { - return plugin; - } -} diff --git a/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/SmartyUI.java b/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/SmartyUI.java new file mode 100644 index 0000000..695c929 --- /dev/null +++ b/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/SmartyUI.java @@ -0,0 +1,45 @@ +/* + * 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 API and implementation + * + * $Id: SmartyUI.java,v 1.1 2004-09-03 17:31:18 jsurfer Exp $ + */ + +package net.sourceforge.phpdt.smarty.ui; + +import org.eclipse.ui.plugin.AbstractUIPlugin; + +/** + * The main plugin class to be used in the desktop. + */ +public class SmartyUI extends AbstractUIPlugin { + + // Class Variables --------------------------------------------------------- + + /** The shared instance. */ + private static SmartyUI plugin; + + // Constructors ------------------------------------------------------------ + + /** + * The constructor. + */ + public SmartyUI() { + plugin = this; + } + + // Public Methods ---------------------------------------------------------- + + /** + * Returns the shared instance. + */ + 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/HTMLUIMessages.java deleted file mode 100644 index c7536ed..0000000 --- a/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/HTMLUIMessages.java +++ /dev/null @@ -1,102 +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 API and implementation - * - * $Id: HTMLUIMessages.java,v 1.1 2004-09-02 18:25:05 jsurfer Exp $ - */ - -package net.sourceforge.phpdt.smarty.ui.internal; - -import java.text.MessageFormat; -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -/** - * Utility class that provides easy access to externalized strings. - */ -public final class HTMLUIMessages { - - // Constants --------------------------------------------------------------- - - /** - * 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$ - - // Class Variables --------------------------------------------------------- - - /** - * The resource bundle. - */ - private static ResourceBundle resourceBundle = - ResourceBundle.getBundle(RESOURCE_BUNDLE); - - // Constructors ------------------------------------------------------------ - - /** - * Hidden constructor. - */ - private HTMLUIMessages() { - // Hidden - } - - // Public Methods ---------------------------------------------------------- - - /** - * Returns the resource bundle. - * - * @return the resource bundle - */ - public static ResourceBundle getResourceBundle() { - return resourceBundle; - } - - /** - * Returns the message identified by the specified key. - * - * @param key the message key - * @return the localized message, or the key enclosed by exclamation marks - * if no message was found for the key - */ - public static String getString(String key) { - try { - return resourceBundle.getString(key); - } catch (MissingResourceException e) { - return "!" + key + "!"; //$NON-NLS-2$ //$NON-NLS-1$ - } - } - - /** - * Returns the message identified by the specified key, replacing a single - * parameter with the provided value. - * - * @param key the message key - * @param arg the parameter value - * @return the formatted string, or the key enclosed by exclamation marks - * if no message was found for the key - */ - public static String getString(String key, String arg) { - return getString(key, new String[] { arg }); - } - - /** - * Returns the message identified by the specified key, replacing all - * parameters with the provided values. - * - * @param key the message key - * @param args the parameter values - * @return the formatted string, or the key enclosed by exclamation marks - * if no message was found for the key - */ - public static String getString(String key, String[] args) { - return MessageFormat.format(getString(key), args); - } - -} 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/HTMLUIMessages.properties deleted file mode 100644 index 2bca3aa..0000000 --- a/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/HTMLUIMessages.properties +++ /dev/null @@ -1,12 +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 english resources -# -# $Id: HTMLUIMessages.properties,v 1.1 2004-09-02 18:25:05 jsurfer Exp $ -# diff --git a/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/SmartyUIMessages.java b/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/SmartyUIMessages.java new file mode 100644 index 0000000..3549dab --- /dev/null +++ b/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/SmartyUIMessages.java @@ -0,0 +1,102 @@ +/* + * 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 API and implementation + * + * $Id: SmartyUIMessages.java,v 1.1 2004-09-03 17:31:19 jsurfer Exp $ + */ + +package net.sourceforge.phpdt.smarty.ui.internal; + +import java.text.MessageFormat; +import java.util.MissingResourceException; +import java.util.ResourceBundle; + +/** + * Utility class that provides easy access to externalized strings. + */ +public final class SmartyUIMessages { + + // Constants --------------------------------------------------------------- + + /** + * Qualified name of the resource bundle containing the localized messages. + */ + private static final String RESOURCE_BUNDLE = + "net.sourceforge.phpdt.smarty.ui.internal.SmartyUIMessages"; //$NON-NLS-1$ + + // Class Variables --------------------------------------------------------- + + /** + * The resource bundle. + */ + private static ResourceBundle resourceBundle = + ResourceBundle.getBundle(RESOURCE_BUNDLE); + + // Constructors ------------------------------------------------------------ + + /** + * Hidden constructor. + */ + private SmartyUIMessages() { + // Hidden + } + + // Public Methods ---------------------------------------------------------- + + /** + * Returns the resource bundle. + * + * @return the resource bundle + */ + public static ResourceBundle getResourceBundle() { + return resourceBundle; + } + + /** + * Returns the message identified by the specified key. + * + * @param key the message key + * @return the localized message, or the key enclosed by exclamation marks + * if no message was found for the key + */ + public static String getString(String key) { + try { + return resourceBundle.getString(key); + } catch (MissingResourceException e) { + return "!" + key + "!"; //$NON-NLS-2$ //$NON-NLS-1$ + } + } + + /** + * Returns the message identified by the specified key, replacing a single + * parameter with the provided value. + * + * @param key the message key + * @param arg the parameter value + * @return the formatted string, or the key enclosed by exclamation marks + * if no message was found for the key + */ + public static String getString(String key, String arg) { + return getString(key, new String[] { arg }); + } + + /** + * Returns the message identified by the specified key, replacing all + * parameters with the provided values. + * + * @param key the message key + * @param args the parameter values + * @return the formatted string, or the key enclosed by exclamation marks + * if no message was found for the key + */ + public static String getString(String key, String[] args) { + return MessageFormat.format(getString(key), args); + } + +} diff --git a/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/SmartyUIMessages.properties b/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/SmartyUIMessages.properties new file mode 100644 index 0000000..337df8e --- /dev/null +++ b/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/SmartyUIMessages.properties @@ -0,0 +1,12 @@ +# +# 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 english resources +# +# $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/HTMLDocumentProvider.java deleted file mode 100644 index 8213ad2..0000000 --- a/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/HTMLDocumentProvider.java +++ /dev/null @@ -1,24 +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 API and implementation - * - * $Id: HTMLDocumentProvider.java,v 1.1 2004-09-02 18:25:05 jsurfer Exp $ - */ - -package net.sourceforge.phpdt.smarty.ui.internal.editor; - -import net.sourceforge.phpeclipse.xml.ui.internal.editor.XMLDocumentProvider; - - -/** - * Document provider for HTML files. - */ -public class HTMLDocumentProvider 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/HTMLDocumentSetupParticipant.java deleted file mode 100644 index f76eb1b..0000000 --- a/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/HTMLDocumentSetupParticipant.java +++ /dev/null @@ -1,24 +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: HTMLDocumentSetupParticipant.java,v 1.1 2004-09-02 18:25:05 jsurfer Exp $ - */ - -package net.sourceforge.phpdt.smarty.ui.internal.editor; - -import net.sourceforge.phpeclipse.xml.ui.internal.editor.XMLDocumentSetupParticipant; - - -/** - * Document setup participant that sets up the HTML specific partitioning. - */ -public class HTMLDocumentSetupParticipant 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/HTMLEditor.java deleted file mode 100644 index dc96755..0000000 --- a/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/HTMLEditor.java +++ /dev/null @@ -1,114 +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: HTMLEditor.java,v 1.1 2004-09-02 18:25:05 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.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; - - -/** - * HTML editor implementation. - */ -public class HTMLEditor extends XMLEditor { - - // Instance Variables ------------------------------------------------------ - - /** The associated preview page. */ - 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; - } - return super.getAdapter(adapter); - } - - // Private Methods --------------------------------------------------------- - - /** - * 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; - } - protected void createActions() { - super.createActions(); - - IAction action = new ContentAssistAction(HTMLEditorMessages.getResourceBundle(), - "ContentAssistProposal.", this); //$NON-NLS-1$ - action - .setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS); - setAction("ContentAssistProposal", action); //$NON-NLS-1$ - markAsStateDependentAction("ContentAssistProposal", true); //$NON-NLS-1$ - -// IAction action= new TextOperationAction( -// TemplateMessages.getResourceBundle(), -// "Editor." + TEMPLATE_PROPOSALS + ".", //$NON-NLS-1$ //$NON-NLS-2$ -// this, -// ISourceViewer.CONTENTASSIST_PROPOSALS); -// action.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS); -// setAction(TEMPLATE_PROPOSALS, action); -// markAsStateDependentAction(TEMPLATE_PROPOSALS, true); - } - /* - * @see org.eclipse.ui.editors.text.TextEditor#initializeEditor() - */ - protected void initializeEditor() { - super.initializeEditor(); - - XMLTextTools xmlTextTools = XMLPlugin.getDefault().getXMLTextTools(); - setSourceViewerConfiguration(new HTMLConfiguration(xmlTextTools, this)); - setDocumentProvider(new XMLDocumentProvider()); - } -} 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/HTMLEditorMessages.java deleted file mode 100644 index 05117e4..0000000 --- a/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/HTMLEditorMessages.java +++ /dev/null @@ -1,45 +0,0 @@ -/********************************************************************** -Copyright (c) 2000, 2002 IBM Corp. and others. -All rights reserved. This program and the accompanying materials -are made available under the terms of the Common Public License v1.0 -which accompanies this distribution, and is available at -http://www.eclipse.org/legal/cpl-v10.html - -Contributors: - IBM Corporation - Initial implementation - Klaus Hartlage - www.eclipseproject.de -**********************************************************************/ -package net.sourceforge.phpdt.smarty.ui.internal.editor; - -import java.text.MessageFormat; -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -public class HTMLEditorMessages { - - private static final String RESOURCE_BUNDLE= "net.sourceforge.phpdt.smarty.ui.internal.editor.HTMLEditorMessages";//$NON-NLS-1$ - - private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE); - - private HTMLEditorMessages() { - } - - public static String getString(String key) { - try { - return fgResourceBundle.getString(key); - } catch (MissingResourceException e) { - return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$ - } - } - - /** - * Gets a string from the resource bundle and formats it with arguments - */ - public static String getFormattedString(String key, Object[] args) { - return MessageFormat.format(getString(key), args); - } - - public static ResourceBundle getResourceBundle() { - return fgResourceBundle; - } -} 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/HTMLEditorMessages.properties deleted file mode 100644 index bea66ef..0000000 --- a/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/HTMLEditorMessages.properties +++ /dev/null @@ -1,10 +0,0 @@ -############################################################# -# -# (c) Copyright IBM Corp. 2000, 2001. -# All Rights Reserved. -# -############################################################# -ContentAssistProposal.label=Content Assist@Ctrl+SPACE -ContentAssistProposal.tooltip=Content Assist -ContentAssistProposal.image= -ContentAssistProposal.description=Content Assist diff --git a/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/SmartyDocumentProvider.java b/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/SmartyDocumentProvider.java new file mode 100644 index 0000000..c6a5b6e --- /dev/null +++ b/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/SmartyDocumentProvider.java @@ -0,0 +1,24 @@ +/* + * 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 API and implementation + * + * $Id: SmartyDocumentProvider.java,v 1.1 2004-09-03 17:31:18 jsurfer Exp $ + */ + +package net.sourceforge.phpdt.smarty.ui.internal.editor; + +import net.sourceforge.phpeclipse.xml.ui.internal.editor.XMLDocumentProvider; + + +/** + * Document provider for HTML files. + */ +public class SmartyDocumentProvider extends XMLDocumentProvider { + +} diff --git a/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/SmartyDocumentSetupParticipant.java b/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/SmartyDocumentSetupParticipant.java new file mode 100644 index 0000000..b8fac8b --- /dev/null +++ b/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/SmartyDocumentSetupParticipant.java @@ -0,0 +1,24 @@ +/* + * 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: SmartyDocumentSetupParticipant.java,v 1.1 2004-09-03 17:31:18 jsurfer Exp $ + */ + +package net.sourceforge.phpdt.smarty.ui.internal.editor; + +import net.sourceforge.phpeclipse.xml.ui.internal.editor.XMLDocumentSetupParticipant; + + +/** + * Document setup participant that sets up the HTML specific partitioning. + */ +public class SmartyDocumentSetupParticipant extends XMLDocumentSetupParticipant { + +} diff --git a/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/SmartyEditor.java b/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/SmartyEditor.java new file mode 100644 index 0000000..77aa1b4 --- /dev/null +++ b/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/SmartyEditor.java @@ -0,0 +1,102 @@ +/* + * 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: SmartyEditor.java,v 1.1 2004-09-03 17:31:18 jsurfer Exp $ + */ + +package net.sourceforge.phpdt.smarty.ui.internal.editor; + +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.jface.action.IAction; +import org.eclipse.ui.texteditor.ContentAssistAction; +import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds; + + +/** + * HTML editor implementation. + */ +public class SmartyEditor extends XMLEditor { + + public SmartyEditor() { + super(ShowExternalPreviewAction.SMARTY_TYPE); + } + // Instance Variables ------------------------------------------------------ + + /** The associated preview page. */ +// private HTMLPreviewPage previewPage; + + // XMLEditor Implementation ------------------------------------------------ + + + /* + * @see org.eclipse.core.runtime.IAdaptable#getAdapter(Class) + */ + public Object getAdapter(Class adapter) { +// if (adapter == IBrowserPreviewPage.class) { +// if (previewPage == null) { +// previewPage = createPreviewPage(); +// } +// return previewPage; +// } + return super.getAdapter(adapter); + } + + // Private Methods --------------------------------------------------------- + + /** + * 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; +// } + protected void createActions() { + super.createActions(); + + IAction action = new ContentAssistAction(SmartyEditorMessages.getResourceBundle(), + "ContentAssistProposal.", this); //$NON-NLS-1$ + action + .setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS); + setAction("ContentAssistProposal", action); //$NON-NLS-1$ + markAsStateDependentAction("ContentAssistProposal", true); //$NON-NLS-1$ + +// IAction action= new TextOperationAction( +// TemplateMessages.getResourceBundle(), +// "Editor." + TEMPLATE_PROPOSALS + ".", //$NON-NLS-1$ //$NON-NLS-2$ +// this, +// ISourceViewer.CONTENTASSIST_PROPOSALS); +// action.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS); +// setAction(TEMPLATE_PROPOSALS, action); +// markAsStateDependentAction(TEMPLATE_PROPOSALS, true); + } + /* + * @see org.eclipse.ui.editors.text.TextEditor#initializeEditor() + */ + protected void initializeEditor() { + super.initializeEditor(); + + XMLTextTools xmlTextTools = XMLPlugin.getDefault().getXMLTextTools(); + 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/SmartyEditorMessages.java b/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/SmartyEditorMessages.java new file mode 100644 index 0000000..046db9e --- /dev/null +++ b/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/SmartyEditorMessages.java @@ -0,0 +1,45 @@ +/********************************************************************** +Copyright (c) 2000, 2002 IBM Corp. and others. +All rights reserved. This program and the accompanying materials +are made available under the terms of the Common Public License v1.0 +which accompanies this distribution, and is available at +http://www.eclipse.org/legal/cpl-v10.html + +Contributors: + IBM Corporation - Initial implementation + Klaus Hartlage - www.eclipseproject.de +**********************************************************************/ +package net.sourceforge.phpdt.smarty.ui.internal.editor; + +import java.text.MessageFormat; +import java.util.MissingResourceException; +import java.util.ResourceBundle; + +public class SmartyEditorMessages { + + 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 SmartyEditorMessages() { + } + + public static String getString(String key) { + try { + return fgResourceBundle.getString(key); + } catch (MissingResourceException e) { + return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$ + } + } + + /** + * Gets a string from the resource bundle and formats it with arguments + */ + public static String getFormattedString(String key, Object[] args) { + return MessageFormat.format(getString(key), args); + } + + public static ResourceBundle getResourceBundle() { + return fgResourceBundle; + } +} diff --git a/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/SmartyEditorMessages.properties b/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/SmartyEditorMessages.properties new file mode 100644 index 0000000..bea66ef --- /dev/null +++ b/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/SmartyEditorMessages.properties @@ -0,0 +1,10 @@ +############################################################# +# +# (c) Copyright IBM Corp. 2000, 2001. +# All Rights Reserved. +# +############################################################# +ContentAssistProposal.label=Content Assist@Ctrl+SPACE +ContentAssistProposal.tooltip=Content Assist +ContentAssistProposal.image= +ContentAssistProposal.description=Content Assist 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/HTMLCompletionProcessor.java deleted file mode 100644 index 9cff545..0000000 --- a/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/text/HTMLCompletionProcessor.java +++ /dev/null @@ -1,35 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2004 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.text; - -import net.sourceforge.phpeclipse.ui.WebUI; -import net.sourceforge.phpeclipse.ui.templates.template.BasicCompletionProcessor; -import net.sourceforge.phpeclipse.ui.templates.template.HTMLContextType; - -import org.eclipse.jface.text.IRegion; -import org.eclipse.jface.text.ITextViewer; -import org.eclipse.jface.text.templates.TemplateContextType; - - -/** - * A completion processor for XML templates. - */ -public class HTMLCompletionProcessor extends BasicCompletionProcessor { - - /** - * Return the XML context type that is supported by this plugin. - */ - protected TemplateContextType getContextType(ITextViewer viewer, IRegion region) { - return WebUI.getDefault().getContextTypeRegistry().getContextType(HTMLContextType.HTML_CONTEXT_TYPE); - } - - -} 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/HTMLConfiguration.java deleted file mode 100644 index aec204a..0000000 --- a/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/text/HTMLConfiguration.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Created on 25.08.2004 - * - * TODO To change the template for this generated file go to - * Window - Preferences - Java - Code Style - Code Templates - */ -package net.sourceforge.phpdt.smarty.ui.internal.text; - -import java.util.Map; - -import net.sourceforge.phpeclipse.xml.ui.internal.text.XMLConfiguration; -import net.sourceforge.phpeclipse.xml.ui.internal.text.XMLPartitionScanner; -import net.sourceforge.phpeclipse.xml.ui.text.XMLTextTools; - -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.contentassist.ContentAssistant; -import org.eclipse.jface.text.contentassist.IContentAssistProcessor; -import org.eclipse.jface.text.contentassist.IContentAssistant; -import org.eclipse.jface.text.presentation.IPresentationReconciler; -import org.eclipse.jface.text.presentation.PresentationReconciler; -import org.eclipse.jface.text.rules.DefaultDamagerRepairer; -import org.eclipse.jface.text.source.ISourceViewer; -import org.eclipse.ui.texteditor.ITextEditor; - -/** - * @author khartlage - * - * TODO To change the template for this generated type comment go to Window - Preferences - Java - Code Style - Code Templates - */ -public class HTMLConfiguration extends XMLConfiguration { - private SmartyTagScanner smartyTagScanner; - public HTMLConfiguration(XMLTextTools tools) { - this(tools, null); - } - - public HTMLConfiguration(XMLTextTools tools, ITextEditor editor) { - super(tools, editor); - Map tokens = tools.getTokens(); - smartyTagScanner = new SmartyTagScanner(tokens); - } - - public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) { - ContentAssistant assistant = new ContentAssistant(); - assistant.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer)); - - IContentAssistProcessor processor = new HTMLCompletionProcessor(); - assistant.setContentAssistProcessor(processor, IDocument.DEFAULT_CONTENT_TYPE); - assistant.setContentAssistProcessor(processor, XMLPartitionScanner.XML_TAG); - assistant.setContentAssistProcessor(processor, XMLPartitionScanner.XML_PI); - assistant.setContentAssistProcessor(processor, XMLPartitionScanner.XML_COMMENT); - assistant.setContentAssistProcessor(processor, XMLPartitionScanner.XML_DECL); - assistant.setContentAssistProcessor(processor, XMLPartitionScanner.XML_TAG); - assistant.setContentAssistProcessor(processor, XMLPartitionScanner.XML_ATTRIBUTE); - assistant.setContentAssistProcessor(processor, XMLPartitionScanner.XML_CDATA); - - assistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE); - assistant.setInformationControlCreator(getInformationControlCreator(sourceViewer)); - - return assistant; - } - /** - * Returns a scanner which is configured to scan XML text. - * - * @return an XML text scanner - */ - public SmartyTagScanner getSmartyScanner() { - return smartyTagScanner; - } - /* - * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getPresentationReconciler(ISourceViewer) - */ - public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) { - PresentationReconciler reconciler = new PresentationReconciler(); - - DefaultDamagerRepairer dr; - - dr = new DefaultDamagerRepairer(getSmartyScanner()); - reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE); - reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE); - - dr = new DefaultDamagerRepairer(xmlTextTools.getDTDTextScanner()); - reconciler.setDamager(dr, XMLPartitionScanner.DTD_INTERNAL); - reconciler.setRepairer(dr, XMLPartitionScanner.DTD_INTERNAL); - - dr = new DefaultDamagerRepairer(xmlTextTools.getXMLPIScanner()); - - reconciler.setDamager(dr, XMLPartitionScanner.XML_PI); - reconciler.setRepairer(dr, XMLPartitionScanner.XML_PI); - reconciler.setDamager(dr, XMLPartitionScanner.DTD_INTERNAL_PI); - reconciler.setRepairer(dr, XMLPartitionScanner.DTD_INTERNAL_PI); - - dr = new DefaultDamagerRepairer(xmlTextTools.getXMLCommentScanner()); - - reconciler.setDamager(dr, XMLPartitionScanner.XML_COMMENT); - reconciler.setRepairer(dr, XMLPartitionScanner.XML_COMMENT); - reconciler.setDamager(dr, XMLPartitionScanner.DTD_INTERNAL_COMMENT); - reconciler.setRepairer(dr, XMLPartitionScanner.DTD_INTERNAL_COMMENT); - - dr = new DefaultDamagerRepairer(xmlTextTools.getXMLDeclScanner()); - - reconciler.setDamager(dr, XMLPartitionScanner.XML_DECL); - reconciler.setRepairer(dr, XMLPartitionScanner.XML_DECL); - reconciler.setDamager(dr, XMLPartitionScanner.DTD_INTERNAL_DECL); - reconciler.setRepairer(dr, XMLPartitionScanner.DTD_INTERNAL_DECL); - - dr = new DefaultDamagerRepairer(xmlTextTools.getXMLTagScanner()); - - reconciler.setDamager(dr, XMLPartitionScanner.XML_TAG); - reconciler.setRepairer(dr, XMLPartitionScanner.XML_TAG); - - dr = new DefaultDamagerRepairer(xmlTextTools.getXMLAttributeScanner()); - - reconciler.setDamager(dr, XMLPartitionScanner.XML_ATTRIBUTE); - reconciler.setRepairer(dr, XMLPartitionScanner.XML_ATTRIBUTE); - - dr = new DefaultDamagerRepairer(xmlTextTools.getXMLCDATAScanner()); - - reconciler.setDamager(dr, XMLPartitionScanner.XML_CDATA); - reconciler.setRepairer(dr, XMLPartitionScanner.XML_CDATA); - - return reconciler; - } -} \ No newline at end of file diff --git a/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/text/SmartyCompletionProcessor.java b/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/text/SmartyCompletionProcessor.java new file mode 100644 index 0000000..d20fead --- /dev/null +++ b/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/text/SmartyCompletionProcessor.java @@ -0,0 +1,35 @@ +/******************************************************************************* + * Copyright (c) 2000, 2004 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.text; + +import net.sourceforge.phpeclipse.ui.WebUI; +import net.sourceforge.phpeclipse.ui.templates.template.BasicCompletionProcessor; +import net.sourceforge.phpeclipse.ui.templates.template.HTMLContextType; + +import org.eclipse.jface.text.IRegion; +import org.eclipse.jface.text.ITextViewer; +import org.eclipse.jface.text.templates.TemplateContextType; + + +/** + * A completion processor for XML templates. + */ +public class SmartyCompletionProcessor extends BasicCompletionProcessor { + + /** + * Return the XML context type that is supported by this plugin. + */ + protected TemplateContextType getContextType(ITextViewer viewer, IRegion region) { + return WebUI.getDefault().getContextTypeRegistry().getContextType(HTMLContextType.HTML_CONTEXT_TYPE); + } + + +} diff --git a/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/text/SmartyConfiguration.java b/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/text/SmartyConfiguration.java new file mode 100644 index 0000000..2600db0 --- /dev/null +++ b/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/text/SmartyConfiguration.java @@ -0,0 +1,123 @@ +/* + * Created on 25.08.2004 + * + * TODO To change the template for this generated file go to + * Window - Preferences - Java - Code Style - Code Templates + */ +package net.sourceforge.phpdt.smarty.ui.internal.text; + +import java.util.Map; + +import net.sourceforge.phpeclipse.xml.ui.internal.text.XMLConfiguration; +import net.sourceforge.phpeclipse.xml.ui.internal.text.XMLPartitionScanner; +import net.sourceforge.phpeclipse.xml.ui.text.XMLTextTools; + +import org.eclipse.jface.text.IDocument; +import org.eclipse.jface.text.contentassist.ContentAssistant; +import org.eclipse.jface.text.contentassist.IContentAssistProcessor; +import org.eclipse.jface.text.contentassist.IContentAssistant; +import org.eclipse.jface.text.presentation.IPresentationReconciler; +import org.eclipse.jface.text.presentation.PresentationReconciler; +import org.eclipse.jface.text.rules.DefaultDamagerRepairer; +import org.eclipse.jface.text.source.ISourceViewer; +import org.eclipse.ui.texteditor.ITextEditor; + +/** + * @author khartlage + * + * TODO To change the template for this generated type comment go to Window - Preferences - Java - Code Style - Code Templates + */ +public class SmartyConfiguration extends XMLConfiguration { + private SmartyTagScanner smartyTagScanner; + public SmartyConfiguration(XMLTextTools tools) { + this(tools, null); + } + + public SmartyConfiguration(XMLTextTools tools, ITextEditor editor) { + super(tools, editor); + Map tokens = tools.getTokens(); + smartyTagScanner = new SmartyTagScanner(tokens); + } + + public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) { + ContentAssistant assistant = new ContentAssistant(); + assistant.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer)); + + IContentAssistProcessor processor = new SmartyCompletionProcessor(); + assistant.setContentAssistProcessor(processor, IDocument.DEFAULT_CONTENT_TYPE); + assistant.setContentAssistProcessor(processor, XMLPartitionScanner.XML_TAG); + assistant.setContentAssistProcessor(processor, XMLPartitionScanner.XML_PI); + assistant.setContentAssistProcessor(processor, XMLPartitionScanner.XML_COMMENT); + assistant.setContentAssistProcessor(processor, XMLPartitionScanner.XML_DECL); + assistant.setContentAssistProcessor(processor, XMLPartitionScanner.XML_TAG); + assistant.setContentAssistProcessor(processor, XMLPartitionScanner.XML_ATTRIBUTE); + assistant.setContentAssistProcessor(processor, XMLPartitionScanner.XML_CDATA); + + assistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE); + assistant.setInformationControlCreator(getInformationControlCreator(sourceViewer)); + + return assistant; + } + /** + * Returns a scanner which is configured to scan XML text. + * + * @return an XML text scanner + */ + public SmartyTagScanner getSmartyScanner() { + return smartyTagScanner; + } + /* + * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getPresentationReconciler(ISourceViewer) + */ + public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) { + PresentationReconciler reconciler = new PresentationReconciler(); + + DefaultDamagerRepairer dr; + + dr = new DefaultDamagerRepairer(getSmartyScanner()); + reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE); + reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE); + + dr = new DefaultDamagerRepairer(xmlTextTools.getDTDTextScanner()); + reconciler.setDamager(dr, XMLPartitionScanner.DTD_INTERNAL); + reconciler.setRepairer(dr, XMLPartitionScanner.DTD_INTERNAL); + + dr = new DefaultDamagerRepairer(xmlTextTools.getXMLPIScanner()); + + reconciler.setDamager(dr, XMLPartitionScanner.XML_PI); + reconciler.setRepairer(dr, XMLPartitionScanner.XML_PI); + reconciler.setDamager(dr, XMLPartitionScanner.DTD_INTERNAL_PI); + reconciler.setRepairer(dr, XMLPartitionScanner.DTD_INTERNAL_PI); + + dr = new DefaultDamagerRepairer(xmlTextTools.getXMLCommentScanner()); + + reconciler.setDamager(dr, XMLPartitionScanner.XML_COMMENT); + reconciler.setRepairer(dr, XMLPartitionScanner.XML_COMMENT); + reconciler.setDamager(dr, XMLPartitionScanner.DTD_INTERNAL_COMMENT); + reconciler.setRepairer(dr, XMLPartitionScanner.DTD_INTERNAL_COMMENT); + + dr = new DefaultDamagerRepairer(xmlTextTools.getXMLDeclScanner()); + + reconciler.setDamager(dr, XMLPartitionScanner.XML_DECL); + reconciler.setRepairer(dr, XMLPartitionScanner.XML_DECL); + reconciler.setDamager(dr, XMLPartitionScanner.DTD_INTERNAL_DECL); + reconciler.setRepairer(dr, XMLPartitionScanner.DTD_INTERNAL_DECL); + + dr = new DefaultDamagerRepairer(xmlTextTools.getXMLTagScanner()); + + reconciler.setDamager(dr, XMLPartitionScanner.XML_TAG); + reconciler.setRepairer(dr, XMLPartitionScanner.XML_TAG); + + dr = new DefaultDamagerRepairer(xmlTextTools.getXMLAttributeScanner()); + + reconciler.setDamager(dr, XMLPartitionScanner.XML_ATTRIBUTE); + reconciler.setRepairer(dr, XMLPartitionScanner.XML_ATTRIBUTE); + + dr = new DefaultDamagerRepairer(xmlTextTools.getXMLCDATAScanner()); + + reconciler.setDamager(dr, XMLPartitionScanner.XML_CDATA); + reconciler.setRepairer(dr, XMLPartitionScanner.XML_CDATA); + + return reconciler; + } +} \ No newline at end of file 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 0000000000000000000000000000000000000000..f01f87eab7e821c148b2b9a66a1ef8b2a4137845 GIT binary patch literal 889 zcmV-<1BU!ZNk%w1VGsZi0QUd@0000^Oi<|O>Qqu%SXN-t&)wSC;>yU^#lzL#-sW3c zW=Tj_WMg!Hfu5et zY;1M!EpSz@`ziVxedwrsZiLpvcV1|gRrKitkXMSjDe`RKSbajh*eyN6v zxPpbUhKja#dZ15HX;@lxEiOBMgQ;d|gpZQ3t*^ul4iyv?9cF8eV`z$GXo$|x-knP+mSV{V~rcB^P|q;GkyV{MyYX_bD8!E=19Wo?#UXN_=qrJSYDl$^q|y4$d} z)49LfyTIGW%;v$y-O<+Wi;kVy-0R`w^GsWwQDC7`VWLuDp;Tj|Q(~f1Vxd)Jq*Y|2 zR%N7CWTRVZs##~ISZ1VKYN%Ujs9I>IS!ktMXQf_ktW;u}U2CaZX{K0ZpkZ*ZU~jHo zY^q#pr&?&ES!bajB|2MZqD)taTxp_TY^GaipJZ~aQ(us0b+JNAa$|6+IznRy2n=U* zu3c%JYeTlt;kHLzS#gd%Kq^;Gbu-CJ^;;psW zx4zxI#N)cb-MGHly~EwS!rZ>Z-j9-=Zg6KphJ+g$86F)RBO)P3MnzIlPzeYK&d$!Vva+eEsRacE0|NsA z0RjL2{{R30A^8LW007DWEC2ui01yBW000P90F?#x literal 0 HcmV?d00001 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/overlaypages/FieldEditorOverlayPage.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/overlaypages/FieldEditorOverlayPage.java deleted file mode 100644 index 54daa64..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/overlaypages/FieldEditorOverlayPage.java +++ /dev/null @@ -1,365 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003 Berthold Daum. - * 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: - * Berthold Daum - *******************************************************************************/ -package net.sourceforge.phpeclipse.overlaypages; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.QualifiedName; -import org.eclipse.jface.preference.FieldEditor; -import org.eclipse.jface.preference.FieldEditorPreferencePage; -import org.eclipse.jface.preference.IPreferenceNode; -import org.eclipse.jface.preference.IPreferencePage; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.preference.PreferenceDialog; -import org.eclipse.jface.preference.PreferenceManager; -import org.eclipse.jface.preference.PreferenceNode; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.BusyIndicator; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.ui.IWorkbenchPropertyPage; -/** - * @author Berthold Daum - */ -public abstract class FieldEditorOverlayPage extends FieldEditorPreferencePage - implements - IWorkbenchPropertyPage { - /** - * * Name of resource property for the selection of workbench or project - * settings ** - */ - public static final String USEPROJECTSETTINGS = "useProjectSettings"; //$NON-NLS-1$ - private static final String FALSE = "false"; //$NON-NLS-1$ - private static final String TRUE = "true"; //$NON-NLS-1$ - private boolean fUseFileSettings = false; - // Stores all created field editors - private List editors = new ArrayList(); - // Stores owning element of properties - private IAdaptable element; - // Additional buttons for property pages - private Button useWorkspaceSettingsButton, useProjectSettingsButton, - configureButton; - // Overlay preference store for property pages - private IPreferenceStore overlayStore; - // The image descriptor of this pages title image - private ImageDescriptor image; - // Cache for page id - private String pageId; - /** - * Constructor - * - * @param style - - * layout style - */ - public FieldEditorOverlayPage(int style) { - super(style); - } - /** - * Constructor - * - * @param style - - * layout style - */ - public FieldEditorOverlayPage(int style, boolean isFileSettings) { - super(style); - fUseFileSettings = isFileSettings; - } - /** - * Constructor - * - * @param title - - * title string - * @param style - - * layout style - */ - public FieldEditorOverlayPage(String title, int style) { - super(title, style); - } - public FieldEditorOverlayPage(String title, int style, boolean isFileSettings) { - super(title, style); - fUseFileSettings = isFileSettings; - } - /** - * Constructor - * - * @param title - - * title string - * @param image - - * title image - * @param style - - * layout style - */ - public FieldEditorOverlayPage(String title, ImageDescriptor image, int style) { - super(title, image, style); - this.image = image; - } - /** - * Returns the id of the current preference page as defined in plugin.xml - * Subclasses must implement. - * - * @return - the qualifier - */ - protected abstract String getPageId(); - /** - * Receives the object that owns the properties shown in this property page. - * - * @see org.eclipse.ui.IWorkbenchPropertyPage#setElement(org.eclipse.core.runtime.IAdaptable) - */ - public void setElement(IAdaptable element) { - this.element = element; - } - /** - * Delivers the object that owns the properties shown in this property page. - * - * @see org.eclipse.ui.IWorkbenchPropertyPage#getElement() - */ - public IAdaptable getElement() { - return element; - } - /** - * Returns true if this instance represents a property page - * - * @return - true for property pages, false for preference pages - */ - public boolean isPropertyPage() { - return getElement() != null; - } - /** - * We override the addField method. This allows us to store each field editor - * added by subclasses in a list for later processing. - * - * @see org.eclipse.jface.preference.FieldEditorPreferencePage#addField(org.eclipse.jface.preference.FieldEditor) - */ - protected void addField(FieldEditor editor) { - editors.add(editor); - super.addField(editor); - } - /** - * We override the createControl method. In case of property pages we create - * a new PropertyStore as local preference store. After all control have been - * create, we enable/disable these controls. - * - * @see org.eclipse.jface.preference.PreferencePage#createControl() - */ - public void createControl(Composite parent) { - // Special treatment for property pages - if (isPropertyPage()) { - // Cache the page id - pageId = getPageId(); - // Create an overlay preference store and fill it with properties - overlayStore = new PropertyStore((IResource) getElement(), super - .getPreferenceStore(), pageId); - // Set overlay store as current preference store - } - super.createControl(parent); - // Update state of all subclass controls - if (isPropertyPage()) - updateFieldEditors(); - } - /** - * We override the createContents method. In case of property pages we insert - * two radio buttons at the top of the page. - * - * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite) - */ - protected Control createContents(Composite parent) { - if (isPropertyPage()) - createSelectionGroup(parent); - return super.createContents(parent); - } - /** - * Creates and initializes a selection group with two choice buttons and one - * push button. - * - * @param parent - - * the parent composite - */ - private void createSelectionGroup(Composite parent) { - Composite comp = new Composite(parent, SWT.NONE); - GridLayout layout = new GridLayout(2, false); - layout.marginHeight = 0; - layout.marginWidth = 0; - comp.setLayout(layout); - comp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - Composite radioGroup = new Composite(comp, SWT.NONE); - radioGroup.setLayout(new GridLayout()); - radioGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - useWorkspaceSettingsButton = createRadioButton(radioGroup, Messages - .getString("OverlayPage.Use_Workspace_Settings")); //$NON-NLS-1$ - if (fUseFileSettings) { - useProjectSettingsButton = createRadioButton(radioGroup, Messages - .getString("OverlayPage.Use_File_Settings")); //$NON-NLS-1$ - } else { - useProjectSettingsButton = createRadioButton(radioGroup, Messages - .getString("OverlayPage.Use_Project_Settings")); //$NON-NLS-1$ - } - configureButton = new Button(comp, SWT.PUSH); - configureButton.setText(Messages - .getString("OverlayPage.Configure_Workspace_Settings")); //$NON-NLS-1$ - configureButton.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - configureWorkspaceSettings(); - } - }); - // Set workspace/project radio buttons - try { - String use = ((IResource) getElement()) - .getPersistentProperty(new QualifiedName(pageId, USEPROJECTSETTINGS)); - if (TRUE.equals(use)) { - useProjectSettingsButton.setSelection(true); - configureButton.setEnabled(false); - } else - useWorkspaceSettingsButton.setSelection(true); - } catch (CoreException e) { - useWorkspaceSettingsButton.setSelection(true); - } - } - /** - * Convenience method creating a radio button - * - * @param parent - - * the parent composite - * @param label - - * the button label - * @return - the new button - */ - private Button createRadioButton(Composite parent, String label) { - final Button button = new Button(parent, SWT.RADIO); - button.setText(label); - button.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - configureButton.setEnabled(button == useWorkspaceSettingsButton); - updateFieldEditors(); - } - }); - return button; - } - /** - * Returns in case of property pages the overlay store, in case of preference - * pages the standard preference store - * - * @see org.eclipse.jface.preference.PreferencePage#getPreferenceStore() - */ - public IPreferenceStore getPreferenceStore() { - if (isPropertyPage()) - return overlayStore; - return super.getPreferenceStore(); - } - /* - * Enables or disables the field editors and buttons of this page - */ - private void updateFieldEditors() { - // We iterate through all field editors - boolean enabled = useProjectSettingsButton.getSelection(); - updateFieldEditors(enabled); - } - /** - * Enables or disables the field editors and buttons of this page Subclasses - * may override. - * - * @param enabled - - * true if enabled - */ - protected void updateFieldEditors(boolean enabled) { - Composite parent = getFieldEditorParent(); - Iterator it = editors.iterator(); - while (it.hasNext()) { - FieldEditor editor = (FieldEditor) it.next(); - editor.setEnabled(enabled, parent); - } - } - /** - * We override the performOk method. In case of property pages we copy the - * values in the overlay store into the property values of the selected - * project. We also save the state of the radio buttons. - * - * @see org.eclipse.jface.preference.IPreferencePage#performOk() - */ - public boolean performOk() { - boolean result = super.performOk(); - if (result && isPropertyPage()) { - // Save state of radiobuttons in project properties - IResource resource = (IResource) getElement(); - try { - String value = (useProjectSettingsButton.getSelection()) ? TRUE : FALSE; - resource.setPersistentProperty(new QualifiedName(pageId, - USEPROJECTSETTINGS), value); - } catch (CoreException e) { - } - } - return result; - } - /** - * We override the performDefaults method. In case of property pages we - * switch back to the workspace settings and disable the field editors. - * - * @see org.eclipse.jface.preference.PreferencePage#performDefaults() - */ - protected void performDefaults() { - if (isPropertyPage()) { - useWorkspaceSettingsButton.setSelection(true); - useProjectSettingsButton.setSelection(false); - configureButton.setEnabled(true); - updateFieldEditors(); - } - super.performDefaults(); - } - /** - * Creates a new preferences page and opens it - * - * @see com.bdaum.SpellChecker.preferences.SpellCheckerPreferencePage#configureWorkspaceSettings() - */ - protected void configureWorkspaceSettings() { - try { - // create a new instance of the current class - IPreferencePage page = (IPreferencePage) this.getClass().newInstance(); - page.setTitle(getTitle()); - page.setImageDescriptor(image); - // and show it - showPreferencePage(pageId, page); - } catch (InstantiationException e) { - e.printStackTrace(); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } - } - /** - * Show a single preference pages - * - * @param id - - * the preference page identification - * @param page - - * the preference page - */ - protected void showPreferencePage(String id, IPreferencePage page) { - final IPreferenceNode targetNode = new PreferenceNode(id, page); - PreferenceManager manager = new PreferenceManager(); - manager.addToRoot(targetNode); - final PreferenceDialog dialog = new PreferenceDialog(getControl() - .getShell(), manager); - BusyIndicator.showWhile(getControl().getDisplay(), new Runnable() { - public void run() { - dialog.create(); - dialog.setMessage(targetNode.getLabelText()); - dialog.open(); - } - }); - } -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/overlaypages/Messages.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/overlaypages/Messages.java deleted file mode 100644 index d782dd1..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/overlaypages/Messages.java +++ /dev/null @@ -1,47 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003 Berthold Daum. - * 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: - * Berthold Daum - *******************************************************************************/ - -package net.sourceforge.phpeclipse.overlaypages; - -import java.util.ResourceBundle; - - -public class Messages { - - private final static String RESOURCE_BUNDLE= "net.sourceforge.phpeclipse.overlayPages.Messages";//$NON-NLS-1$ - - private static ResourceBundle fgResourceBundle = null; - - private static boolean notRead = true; - - public Messages() { - } - public static ResourceBundle getResourceBundle() { - if (notRead) { - notRead = false; - try { - fgResourceBundle = ResourceBundle.getBundle(RESOURCE_BUNDLE); - } - catch (Exception e) { - } - } - - return fgResourceBundle; - } - public static String getString(String key) { - try { - return getResourceBundle().getString(key); - } catch (Exception e) { - return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$ - } - } -} - diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/overlaypages/Messages.properties b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/overlaypages/Messages.properties deleted file mode 100644 index 42e1f44..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/overlaypages/Messages.properties +++ /dev/null @@ -1,5 +0,0 @@ -OverlayPage.Use_Workspace_Settings=Use &workspace settings -OverlayPage.Use_Project_Settings=Use pr&oject settings -OverlayPage.Use_File_Settings=Use &file settings -OverlayPage.Configure_Workspace_Settings=&Configure Workspace Settings ... -PropertyStore.Cannot_write_resource_property=Cannot write resource property diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/overlaypages/OverlayPage.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/overlaypages/OverlayPage.java deleted file mode 100644 index 8a07431..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/overlaypages/OverlayPage.java +++ /dev/null @@ -1,335 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003 Berthold Daum. - * 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: - * Berthold Daum - *******************************************************************************/ -package net.sourceforge.phpeclipse.overlaypages; - -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.QualifiedName; -import org.eclipse.jface.preference.IPreferenceNode; -import org.eclipse.jface.preference.IPreferencePage; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.preference.PreferenceDialog; -import org.eclipse.jface.preference.PreferenceManager; -import org.eclipse.jface.preference.PreferenceNode; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.BusyIndicator; -import org.eclipse.swt.custom.CTabFolder; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.TabFolder; -import org.eclipse.ui.dialogs.PropertyPage; -import org.eclipse.ui.part.PageBook; - -/** - * @author Berthold Daum - */ -public abstract class OverlayPage extends PropertyPage { - - /*** Name of resource property for the selection of workbench or project settings ***/ - public static final String USEPROJECTSETTINGS = "useProjectSettings"; //$NON-NLS-1$ - - private static final String FALSE = "false"; //$NON-NLS-1$ - private static final String TRUE = "true"; //$NON-NLS-1$ - - // Additional buttons for property pages - private Button useWorkspaceSettingsButton, - useProjectSettingsButton, - configureButton; - - // Overlay preference store for property pages - private PropertyStore overlayStore; - - // The image descriptor of this pages title image - private ImageDescriptor image; - - // Cache for page id - private String pageId; - - // Container for subclass controls - private Composite contents; - - /** - * Constructor - */ - public OverlayPage() { - super(); - } - - /** - * Constructor - * @param title - title string - */ - public OverlayPage(String title) { - super(); - setTitle(title); - } - - /** - * Constructor - * @param title - title string - * @param image - title image - */ - public OverlayPage(String title, ImageDescriptor image) { - super(); - setTitle(title); - setImageDescriptor(image); - this.image = image; - } - - /** - * Returns the id of the current preference page as defined in plugin.xml - * Subclasses must implement. - * - * @return - the qualifier - */ - protected abstract String getPageId(); - - /** - * Returns true if this instance represents a property page - * @return - true for property pages, false for preference pages - */ - public boolean isPropertyPage() { - return getElement() != null; - } - - /** - * We need to implement createContents method. In case of property pages we insert two radio buttons - * and a push button at the top of the page. Below this group we create a new composite for the contents - * created by subclasses. - * - * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite) - */ - protected Control createContents(Composite parent) { - if (isPropertyPage()) - createSelectionGroup(parent); - contents = new Composite(parent, SWT.NONE); - GridLayout layout = new GridLayout(); - layout.marginHeight = 0; - layout.marginWidth = 0; - contents.setLayout(layout); - contents.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - return contents; - } - - /** - * Creates and initializes a selection group with two choice buttons and one push button. - * @param parent - the parent composite - */ - private void createSelectionGroup(Composite parent) { - Composite comp = new Composite(parent, SWT.NONE); - GridLayout layout = new GridLayout(2, false); - layout.marginHeight = 0; - layout.marginWidth = 0; - comp.setLayout(layout); - comp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - Composite radioGroup = new Composite(comp, SWT.NONE); - radioGroup.setLayout(new GridLayout()); - radioGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - useWorkspaceSettingsButton = createRadioButton(radioGroup, Messages.getString("OverlayPage.Use_Workspace_Settings")); //$NON-NLS-1$ - useProjectSettingsButton = createRadioButton(radioGroup, Messages.getString("OverlayPage.Use_Project_Settings")); //$NON-NLS-1$ - configureButton = new Button(comp, SWT.PUSH); - configureButton.setText(Messages.getString("OverlayPage.Configure_Workspace_Settings")); //$NON-NLS-1$ - configureButton.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - configureWorkspaceSettings(); - } - }); - // Set workspace/project radio buttons - try { - String use = - ((IResource) getElement()).getPersistentProperty( - new QualifiedName(pageId, USEPROJECTSETTINGS)); - if (TRUE.equals(use)) { - useProjectSettingsButton.setSelection(true); - configureButton.setEnabled(false); - } else - useWorkspaceSettingsButton.setSelection(true); - } catch (CoreException e) { - useWorkspaceSettingsButton.setSelection(true); - } - } - - /** - * Convenience method creating a radio button - * @param parent - the parent composite - * @param label - the button label - * @return - the new button - */ - private Button createRadioButton(Composite parent, String label) { - final Button button = new Button(parent, SWT.RADIO); - button.setText(label); - button.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - configureButton.setEnabled( - button == useWorkspaceSettingsButton); - setControlsEnabled(); - } - }); - return button; - } - - /** - * In case of property pages we create a new PropertyStore as local overlay store. - * After all controls have been create, we enable/disable these controls - * - * @see org.eclipse.jface.preference.PreferencePage#createControl() - */ - public void createControl(Composite parent) { - // Special treatment for property pages - if (isPropertyPage()) { - // Cache the page id - pageId = getPageId(); - // Create an overlay preference store and fill it with properties - overlayStore = - new PropertyStore( - (IResource) getElement(), - super.getPreferenceStore(), - pageId); - // Set overlay store as current preference store - } - super.createControl(parent); - // Update enablement of all subclass controls - if (isPropertyPage()) - setControlsEnabled(); - } - - /* - * Returns in case of property pages the overlay store - otherwise the standard preference store - * @see org.eclipse.jface.preference.PreferencePage#getPreferenceStore() - */ - public IPreferenceStore getPreferenceStore() { - if (isPropertyPage()) - return overlayStore; - return super.getPreferenceStore(); - } - - /** - * Enables or disables the controls of this page - */ - private void setControlsEnabled() { - boolean enabled = useProjectSettingsButton.getSelection(); - setControlsEnabled(enabled); - } - - /** - * Enables or disables the controls of this page - * Subclasses may override. - * - * @param enabled - true if controls shall be enabled - */ - protected void setControlsEnabled(boolean enabled) { - setControlsEnabled(contents, enabled); - } - - /** - * Enables or disables a tree of controls starting at the specified root. - * We spare tabbed notebooks and pagebooks to allow for user navigation. - * - * @param root - the root composite - * @param enabled - true if controls shall be enabled - */ - private void setControlsEnabled(Composite root, boolean enabled) { - Control[] children = root.getChildren(); - for (int i = 0; i < children.length; i++) { - Control child = children[i]; - if (!(child instanceof CTabFolder) && !(child instanceof TabFolder) && !(child instanceof PageBook)) - child.setEnabled(enabled); - if (child instanceof Composite) - setControlsEnabled((Composite) child, enabled); - } - } - - /** - * We override the performOk method. In case of property pages - * we save the state of the radio buttons. - * - * @see org.eclipse.jface.preference.IPreferencePage#performOk() - */ - public boolean performOk() { - boolean result = super.performOk(); - if (result && isPropertyPage()) { - // Save state of radiobuttons in project properties - IResource resource = (IResource) getElement(); - try { - String value = - (useProjectSettingsButton.getSelection()) ? TRUE : FALSE; - resource.setPersistentProperty( - new QualifiedName(pageId, USEPROJECTSETTINGS), - value); - } catch (CoreException e) { - } - } - return result; - } - - /** - * We override the performDefaults method. In case of property pages we - * switch back to the workspace settings and disable the page controls. - * - * @see org.eclipse.jface.preference.PreferencePage#performDefaults() - */ - protected void performDefaults() { - if (isPropertyPage()) { - useWorkspaceSettingsButton.setSelection(true); - useProjectSettingsButton.setSelection(false); - configureButton.setEnabled(true); - setControlsEnabled(); - } - super.performDefaults(); - } - - /** - * Creates a new preferences page and opens it - * @see com.bdaum.SpellChecker.preferences.SpellCheckerPreferencePage#configureWorkspaceSettings() - */ - protected void configureWorkspaceSettings() { - try { - // create a new instance of the current class - IPreferencePage page = - (IPreferencePage) this.getClass().newInstance(); - page.setTitle(getTitle()); - page.setImageDescriptor(image); - // and show it - showPreferencePage(pageId, page); - } catch (InstantiationException e) { - e.printStackTrace(); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } - } - - /** - * Show a single preference pages - * @param id - the preference page identification - * @param page - the preference page - */ - protected void showPreferencePage(String id, IPreferencePage page) { - final IPreferenceNode targetNode = new PreferenceNode(id, page); - PreferenceManager manager = new PreferenceManager(); - manager.addToRoot(targetNode); - final PreferenceDialog dialog = - new PreferenceDialog(getControl().getShell(), manager); - BusyIndicator.showWhile(getControl().getDisplay(), new Runnable() { - public void run() { - dialog.create(); - dialog.setMessage(targetNode.getLabelText()); - dialog.open(); - } - }); - } - -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/overlaypages/PropertyStore.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/overlaypages/PropertyStore.java deleted file mode 100644 index 00572e8..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/overlaypages/PropertyStore.java +++ /dev/null @@ -1,234 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003 Berthold Daum. - * 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: - * Berthold Daum - *******************************************************************************/ - -package net.sourceforge.phpeclipse.overlaypages; - -import java.io.IOException; -import java.io.OutputStream; - -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.QualifiedName; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.preference.PreferenceStore; - -/** - * @author Berthold Daum - * - */ -public class PropertyStore extends PreferenceStore { - - private IResource resource; - private IPreferenceStore workbenchStore; - private String pageId; - private boolean inserting = false; - - public PropertyStore( - IResource resource, - IPreferenceStore workbenchStore, - String pageId) { - this.resource = resource; - this.workbenchStore = workbenchStore; - this.pageId = pageId; - } - - /*** Write modified values back to properties ***/ - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPersistentPreferenceStore#save() - */ - public void save() throws IOException { - writeProperties(); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.PreferenceStore#save(java.io.OutputStream, java.lang.String) - */ - public void save(OutputStream out, String header) throws IOException { - writeProperties(); - } - - /** - * Writes modified preferences into resource properties. - */ - private void writeProperties() throws IOException { - String[] preferences = super.preferenceNames(); - for (int i = 0; i < preferences.length; i++) { - String name = preferences[i]; - try { - setProperty(name, getString(name)); - } catch (CoreException e) { - throw new IOException(Messages.getString("PropertyStore.Cannot_write_resource_property") + name); //$NON-NLS-1$ - } - } - } - - /** - * Convenience method to set a property - * @param name - the preference name - * @param value - the property value or null to delete the property - * @throws CoreException - */ - private void setProperty(String name, String value) throws CoreException { - resource.setPersistentProperty(new QualifiedName(pageId, name), value); - } - - /*** Get default values (Delegate to workbench store) ***/ - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferenceStore#getDefaultBoolean(java.lang.String) - */ - public boolean getDefaultBoolean(String name) { - return workbenchStore.getDefaultBoolean(name); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferenceStore#getDefaultDouble(java.lang.String) - */ - public double getDefaultDouble(String name) { - return workbenchStore.getDefaultDouble(name); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferenceStore#getDefaultFloat(java.lang.String) - */ - public float getDefaultFloat(String name) { - return workbenchStore.getDefaultFloat(name); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferenceStore#getDefaultInt(java.lang.String) - */ - public int getDefaultInt(String name) { - return workbenchStore.getDefaultInt(name); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferenceStore#getDefaultLong(java.lang.String) - */ - public long getDefaultLong(String name) { - return workbenchStore.getDefaultLong(name); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferenceStore#getDefaultString(java.lang.String) - */ - public String getDefaultString(String name) { - return workbenchStore.getDefaultString(name); - } - - /*** Get property values ***/ - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferenceStore#getBoolean(java.lang.String) - */ - public boolean getBoolean(String name) { - insertValue(name); - return super.getBoolean(name); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferenceStore#getDouble(java.lang.String) - */ - public double getDouble(String name) { - insertValue(name); - return super.getDouble(name); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferenceStore#getFloat(java.lang.String) - */ - public float getFloat(String name) { - insertValue(name); - return super.getFloat(name); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferenceStore#getInt(java.lang.String) - */ - public int getInt(String name) { - insertValue(name); - return super.getInt(name); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferenceStore#getLong(java.lang.String) - */ - public long getLong(String name) { - insertValue(name); - return super.getLong(name); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferenceStore#getString(java.lang.String) - */ - public String getString(String name) { - insertValue(name); - return super.getString(name); - } - - /** - * @param name - */ - private synchronized void insertValue(String name) { - if (inserting) - return; - if (super.contains(name)) - return; - inserting = true; - String prop = null; - try { - prop = getProperty(name); - } catch (CoreException e) { - } - if (prop == null) - prop = workbenchStore.getString(name); - if (prop != null) - setValue(name, prop); - inserting = false; - } - - /** - * Convenience method to fetch a property - * @param name - the preference name - * @return - the property value - * @throws CoreException - */ - private String getProperty(String name) throws CoreException { - return resource.getPersistentProperty(new QualifiedName(pageId, name)); - } - - /*** Misc ***/ - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferenceStore#contains(java.lang.String) - */ - public boolean contains(String name) { - return workbenchStore.contains(name); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferenceStore#setToDefault(java.lang.String) - */ - public void setToDefault(String name) { - setValue(name, getDefaultString(name)); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferenceStore#isDefault(java.lang.String) - */ - public boolean isDefault(String name) { - String defaultValue = getDefaultString(name); - if (defaultValue == null) return false; - return defaultValue.equals(getString(name)); - } - -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/overlaypages/Util.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/overlaypages/Util.java deleted file mode 100644 index 26c64cb..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/overlaypages/Util.java +++ /dev/null @@ -1,58 +0,0 @@ -package net.sourceforge.phpeclipse.overlaypages; -import net.sourceforge.phpeclipse.PHPeclipsePlugin; -import net.sourceforge.phpeclipse.preferences.PHPMiscProjectPreferences; -import net.sourceforge.phpeclipse.preferences.PHPPreviewProjectPreferences; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.QualifiedName; - -public class Util { - public static String getMiscProjectsPreferenceValue(IResource resource, String key) { - return getOverlayedPrefProjectValue(resource, - PHPMiscProjectPreferences.PREF_ID, key); - } - public static String getOverlayedPrefProjectValue(IResource resource, - String pageId, String key) { - IProject project = resource.getProject(); - String value = null; - if (useProjectSettings(project, pageId)) { - value = getProperty(resource, pageId, key); - } - if (value != null) - return value; - return PHPeclipsePlugin.getDefault().getPreferenceStore().getString(key); - } - public static String getOverlayedPrefResourceValue(IResource resource, - String pageId, String key) { - String value = null; - if (useProjectSettings(resource, pageId)) { - value = getProperty(resource, pageId, key); - } - if (value != null) - return value; - return PHPeclipsePlugin.getDefault().getPreferenceStore().getString(key); - } - public static boolean getPreviewBooleanValue(IResource resource, String key) { - return getOverlayedPrefResourceValue(resource, - PHPPreviewProjectPreferences.PREF_ID, key).equals("true"); - } - public static String getPreviewStringValue(IResource resource, String key) { - return getOverlayedPrefResourceValue(resource, - PHPPreviewProjectPreferences.PREF_ID, key); - } - private static String getProperty(IResource resource, String pageId, - String key) { - try { - return resource.getPersistentProperty(new QualifiedName(pageId, key)); - } catch (CoreException e) { - } - return null; - } - private static boolean useProjectSettings(IResource resource, String pageId) { - String use = getProperty(resource, pageId, - FieldEditorOverlayPage.USEPROJECTSETTINGS); - return "true".equals(use); - } -} 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/ShowExternalPreviewAction.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/ShowExternalPreviewAction.java deleted file mode 100644 index 32256fa..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/ShowExternalPreviewAction.java +++ /dev/null @@ -1,129 +0,0 @@ -package net.sourceforge.phpeclipse.phpeditor; -/******************************************************************************* - * Copyright (c) 2000, 2002 IBM Corp. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Common Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: IBM Corporation - Initial implementation Klaus Hartlage - - * www.eclipseproject.de - ******************************************************************************/ -import net.sourceforge.phpdt.internal.ui.util.PHPFileUtil; -import net.sourceforge.phpeclipse.IPreferenceConstants; -import net.sourceforge.phpeclipse.PHPeclipsePlugin; -import net.sourceforge.phpeclipse.actions.PHPEclipseShowAction; -import net.sourceforge.phpeclipse.overlaypages.Util; -import net.sourceforge.phpeclipse.views.browser.BrowserView; - -import org.eclipse.core.resources.IFile; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IFileEditorInput; -import org.eclipse.ui.IViewPart; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.texteditor.ITextEditor; -import org.eclipse.ui.texteditor.TextEditorAction; -//import org.eclipse.update.internal.ui.UpdatePerspective; -//import org.eclipse.update.internal.ui.views.IEmbeddedWebBrowser; -/** - * ClassDeclaration that defines the action for parsing the current PHP file - */ -public class ShowExternalPreviewAction extends TextEditorAction { - private static ShowExternalPreviewAction instance = new ShowExternalPreviewAction(); - /** - * Constructs and updates the action. - */ - private ShowExternalPreviewAction() { - super(PHPEditorMessages.getResourceBundle(), "ParserAction.", null); //$NON-NLS-1$ - update(); - } - -public static ShowExternalPreviewAction getInstance() { - return instance; - } - /** - * Code called when the action is fired. - */ - public void run() { - IFile previewFile = getFile(); - if (previewFile == null) { - // should never happen - return; - } - boolean autoPreview = Util.getPreviewBooleanValue(previewFile, - IPreferenceConstants.PHP_AUTO_PREVIEW_DEFAULT); - boolean bringToTopPreview = Util.getPreviewBooleanValue(previewFile, - IPreferenceConstants.PHP_BRING_TO_TOP_PREVIEW_DEFAULT); - boolean showHTMLFilesLocal = Util.getPreviewBooleanValue(previewFile, - IPreferenceConstants.PHP_SHOW_HTML_FILES_LOCAL); - boolean isPHPFileName = PHPFileUtil.isPHPFileName(previewFile.getLocation().toString()); - - if (autoPreview) { - String localhostURL; - if (showHTMLFilesLocal && (!isPHPFileName)) { - localhostURL = previewFile.getLocation().toString(); - } else if ((localhostURL = PHPEclipseShowAction.getLocalhostURL(null, - previewFile)) == null) { - return; - } - IWorkbenchPage page = PHPeclipsePlugin.getActivePage(); - try { - IViewPart part = page.findView(BrowserView.ID_BROWSER); - if (part == null) { - part = page.showView(BrowserView.ID_BROWSER); - } else { - if (bringToTopPreview) { - page.bringToTop(part); - } - } - ((BrowserView) part).setUrl(localhostURL); - - } catch (Exception e) { - //PHPeclipsePlugin.log(e); - } - } - } - - public void refresh() { - IFile fileToParse = getFile(); - if (fileToParse == null) { - // should never happen - return; - } - boolean autoPreview = Util.getPreviewBooleanValue(fileToParse, - IPreferenceConstants.PHP_AUTO_PREVIEW_DEFAULT); - boolean bringToTopPreview = Util.getPreviewBooleanValue(fileToParse, - IPreferenceConstants.PHP_BRING_TO_TOP_PREVIEW_DEFAULT); - if (autoPreview) { - IWorkbenchPage page = PHPeclipsePlugin.getActivePage(); - try { - IViewPart part = page.findView(BrowserView.ID_BROWSER); - if (part == null) { - part = page.showView(BrowserView.ID_BROWSER); - } else { - if (bringToTopPreview) { - page.bringToTop(part); - } - } - ((BrowserView) part).refresh(); - - } catch (Exception e) { - // PHPeclipsePlugin.log(e); - } - } - } - /** - * Finds the file that's currently opened in the PHP Text Editor - */ - protected IFile getFile() { - ITextEditor editor = getTextEditor(); - IEditorInput editorInput = null; - if (editor != null) { - editorInput = editor.getEditorInput(); - } - if (editorInput instanceof IFileEditorInput) - return ((IFileEditorInput) editorInput).getFile(); - // if nothing was found, which should never happen - return null; - } -} \ 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; diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/preferences/PHPMiscProjectPreferences.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/preferences/PHPMiscProjectPreferences.java deleted file mode 100644 index d158491..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/preferences/PHPMiscProjectPreferences.java +++ /dev/null @@ -1,63 +0,0 @@ -package net.sourceforge.phpeclipse.preferences; -import net.sourceforge.phpeclipse.IPreferenceConstants; -import net.sourceforge.phpeclipse.PHPeclipsePlugin; - -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.preference.StringFieldEditor; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPreferencePage; - -import net.sourceforge.phpeclipse.overlaypages.FieldEditorOverlayPage; -/** - * - * This page will be added to the project's property page dialog when the - * "Properties..." popup menu item is selected - */ -public class PHPMiscProjectPreferences extends FieldEditorOverlayPage - implements - IWorkbenchPreferencePage, - IMiscProjectPreferences { - - public final static String PREF_ID = "net.sourceforge.phpeclipse.preferences.PHPMiscProjectPreferences"; - public PHPMiscProjectPreferences() { - super(GRID); - } - /* - * (non-Javadoc) - * - * @see com.bdaum.overlayPages.FieldEditorOverlayPage#getPageId() - */ - protected String getPageId() { - return PREF_ID; - } - - protected void createFieldEditors() { - Composite composite = getFieldEditorParent(); - - addField(new StringFieldEditor(IPreferenceConstants.PHP_LOCALHOST_PREF, - PHPPreferencesMessages.getString("PHPMiscProjectPreferences.localhost"), - composite)); - addField(new StringFieldEditor(IPreferenceConstants.PHP_DOCUMENTROOT_PREF, - PHPPreferencesMessages.getString("PHPMiscProjectPreferences.documentroot"), - composite)); - addField(new StringFieldEditor(IPreferenceConstants.PHP_BOOKMARK_DEFAULT, - PHPPreferencesMessages.getString("PHPMiscProjectPreferences.bookmark"), - composite)); - //if (!isPropertyPage)) { - // - //} - } - /* (non-Javadoc) - * @see org.eclipse.jface.preference.PreferencePage#doGetPreferenceStore() - */ - protected IPreferenceStore doGetPreferenceStore() { - return PHPeclipsePlugin.getDefault().getPreferenceStore(); - } - /* (non-Javadoc) - * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench) - */ - public void init(IWorkbench workbench) { - setDescription("Default entries for misc project settings."); - } -} \ No newline at end of file diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/preferences/PHPPreviewProjectPreferences.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/preferences/PHPPreviewProjectPreferences.java deleted file mode 100644 index 26f9d55..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/preferences/PHPPreviewProjectPreferences.java +++ /dev/null @@ -1,69 +0,0 @@ -package net.sourceforge.phpeclipse.preferences; -import net.sourceforge.phpeclipse.IPreferenceConstants; -import net.sourceforge.phpeclipse.PHPeclipsePlugin; - -import org.eclipse.jface.preference.BooleanFieldEditor; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPreferencePage; - -import net.sourceforge.phpeclipse.overlaypages.FieldEditorOverlayPage; -/** - * - * This page will be added to the project's property page dialog when the - * "Properties..." popup menu item is selected - */ -public class PHPPreviewProjectPreferences extends FieldEditorOverlayPage - implements - IWorkbenchPreferencePage { - public final static String PREF_ID = "net.sourceforge.phpeclipse.preferences.PHPPreviewProjectPreferences"; - - public PHPPreviewProjectPreferences() { - super(GRID, true); - } - /* - * (non-Javadoc) - * - * @see com.bdaum.overlayPages.FieldEditorOverlayPage#getPageId() - */ - protected String getPageId() { - return PREF_ID; - } - /* - * (non-Javadoc) - * - * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors() - */ - protected void createFieldEditors() { - Composite composite = getFieldEditorParent(); - addField(new BooleanFieldEditor( - IPreferenceConstants.PHP_AUTO_PREVIEW_DEFAULT, PHPPreferencesMessages - .getString("PHPPreviewProjectPreferences.auto_preview"), composite)); - addField(new BooleanFieldEditor( - IPreferenceConstants.PHP_BRING_TO_TOP_PREVIEW_DEFAULT, PHPPreferencesMessages - .getString("PHPPreviewProjectPreferences.bring_to_top_preview"), composite)); - addField(new BooleanFieldEditor( - IPreferenceConstants.PHP_SHOW_HTML_FILES_LOCAL, PHPPreferencesMessages - .getString("PHPPreviewProjectPreferences.show_html_files_local"), composite)); - //if (!isPropertyPage)) { - // - //} - } - /* - * (non-Javadoc) - * - * @see org.eclipse.jface.preference.PreferencePage#doGetPreferenceStore() - */ - protected IPreferenceStore doGetPreferenceStore() { - return PHPeclipsePlugin.getDefault().getPreferenceStore(); - } - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench) - */ - public void init(IWorkbench workbench) { - setDescription("Default entries for Previewer."); - } -} \ No newline at end of file diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/views/browser/BrowserView.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/views/browser/BrowserView.java deleted file mode 100644 index 7363fd9..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/views/browser/BrowserView.java +++ /dev/null @@ -1,74 +0,0 @@ -/******************************************************************************* - * 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.views.browser; -import net.sourceforge.phpeclipse.webbrowser.internal.WebBrowser; -import net.sourceforge.phpeclipse.webbrowser.internal.WebBrowserUIPlugin; -import net.sourceforge.phpeclipse.webbrowser.internal.WebBrowserUtil; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.browser.Browser; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.part.ViewPart; -/** - * BrowserView is a simple demonstration of the SWT Browser - * widget. It consists of a workbench view and tab folder where each tab in the - * folder allows the user to interact with a control. - * - * @see ViewPart - */ -public class BrowserView extends ViewPart { - public final static String ID_BROWSER = "net.sourceforge.phpeclipse.views.browser"; - WebBrowser instance = null; - /** - * Create the example - * - * @see ViewPart#createPartControl - */ - public void createPartControl(Composite frame) { - try { - if (WebBrowserUtil.canUseInternalWebBrowser() ) { - instance = new WebBrowser(frame, true, true); - } - } catch(Exception e) { - instance = null; - } - } - /** - * Called when we must grab focus. - * - * @see org.eclipse.ui.part.ViewPart#setFocus - */ - public void setFocus() { - if (instance!=null) { - instance.setFocus(); - } - } - /** - * Called when the View is to be disposed - */ - public void dispose() { - if (instance!=null) { - instance.dispose(); - instance = null; - } - super.dispose(); - } - public void setUrl(String url) { - if (instance!=null) { - instance.setURL(url); - } - } - public void refresh() { - if (instance!=null) { - instance.refresh(); - } - } -} -- 1.7.1