From 295ab034578c27aae565c002c180e6fbad9c5f11 Mon Sep 17 00:00:00 2001 From: pombredanne Date: Thu, 8 Feb 2007 00:00:29 +0000 Subject: [PATCH 01/16] Cleanup of static usage --- .../phpdt/internal/core/JavaModelManager.java | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core/JavaModelManager.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core/JavaModelManager.java index b64d468..a09c243 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core/JavaModelManager.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core/JavaModelManager.java @@ -2108,7 +2108,7 @@ public class JavaModelManager implements ISaveParticipant { } private synchronized Map containerClone(IJavaProject project) { - Map originalProjectContainers = (Map) this.containers.get(project); + Map originalProjectContainers = (Map) JavaModelManager.containers.get(project); if (originalProjectContainers == null) return null; Map projectContainers = new HashMap(originalProjectContainers.size()); -- 1.7.1 From 542e4bde41cf01745cb1788ee14940ae3673c49b Mon Sep 17 00:00:00 2001 From: pombredanne Date: Thu, 8 Feb 2007 00:01:57 +0000 Subject: [PATCH 02/16] Updated feature for build. --- net.sourceforge.phpeclipse.feature/feature.xml | 187 +++++------------------- 1 files changed, 40 insertions(+), 147 deletions(-) diff --git a/net.sourceforge.phpeclipse.feature/feature.xml b/net.sourceforge.phpeclipse.feature/feature.xml index 061b880..d8f567e 100644 --- a/net.sourceforge.phpeclipse.feature/feature.xml +++ b/net.sourceforge.phpeclipse.feature/feature.xml @@ -2,7 +2,7 @@ @@ -12,127 +12,11 @@ - PHPeclipse Software User Agreement - -Usage Of Content -PHPECLIPSE.DE MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT"). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT. - -Applicable Licenses -Unless otherwise indicated, all Content made available by PHPeclipse.de is provided to you under the terms and conditions of the Common Public License Version 1.0 ("CPL"). A copy of the CPL is provided with this Content and is also available at http://www.eclipse.org/legal/cpl-v10.html. For purposes of the CPL, "Program" will mean the Content. - -Content includes, but is not limited to, source code, object code, documentation and other files maintained in the PHPeclipse.de CVS repository ("Repository") in CVS modules ("Modules") and made available as downloadable archives ("Downloads"). - -Content may be apportioned into plug-ins ("Plug-ins"), plug-in fragments ("Fragments"), and features ("Features"). A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Files named "feature.xml" may contain a list of the names and version numbers of the Plug-ins and/or Fragments associated with a Feature. Plug-ins and Fragments are located in directories named "plugins" and Features are located in directories named "features". - -Features may also include other Features ("Included Features"). Files named "feature.xml" may contain a list of the names and version numbers of Included Features. - -The terms and conditions governing Plug-ins and Fragments should be contained in files named "about.html" ("Abouts"). The terms and conditions governing Features and Included Features should be contained in files named "license.html" ("Feature Licenses"). Abouts and Feature Licenses may be located in any directory of a Download or Module including, but not limited to the following locations: - -The top-level (root) directory -Plug-in and Fragment directories -Subdirectories of the directory named "src" of certain Plug-ins -Feature directories -Note: if a Feature made available by PHPeclipse.de is installed using the Eclipse Update Manager, you must agree to a license ("Feature Update License") during the installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or inform you where you can locate them. Feature Update Licenses may be found in the "license" property of files named "feature.properties". Such Abouts, Feature Licenses and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in that directory. - -THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER TO THE CPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO): - -Eclipse Public License Version 1.0 (available at http://www.eclipse.org/legal/epl-v10.html) -Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE) -IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html) -Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html) -Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html) -IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. - -Cryptography -Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import, possession, or use, and re-export of encryption software, to see if this is permitted. + Copyright (c) 2001-2007 PHPeclipse team. All rights reserved. - - 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: - - a) in the case of the initial Contributor, the initial code - and documentation distributed under this Agreement, and - b) in the case of each subsequent Contributor: - i) changes to the Program, and - ii) additions to the Program; - -where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program. - -"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 - -a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form. - -b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder. - -c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program. - -d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement. - -3. REQUIREMENTS - -A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that: - - a) it complies with the terms and conditions of this Agreement; and - - b) its license agreement: - - i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose; - - ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; - - iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and - - iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange. - -When the Program is made available in source code form: - - a) it must be made available under this Agreement; and - - b) a copy of this Agreement must be included with each copy of the Program. - -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. + + This software is licensed un der the terms of the Common Public License v1.0 @@ -140,102 +24,111 @@ This Agreement is governed by the laws of the State of New York and the intellec - - + + - - + + + + + + - - - - - - - + + - - - - + + version="0.0.0"/> + version="0.0.0"/> + version="0.0.0"/> + version="0.0.0"/> + version="0.0.0"/> + version="0.0.0"/> + version="0.0.0"/> + version="0.0.0"/> + version="0.0.0"/> + version="0.0.0"/> + version="0.0.0"/> + version="0.0.0"/> + + + + -- 1.7.1 From 5ab71fc12fa6b453ad31395ad7e5cd95d0d07a63 Mon Sep 17 00:00:00 2001 From: pombredanne Date: Thu, 8 Feb 2007 00:03:41 +0000 Subject: [PATCH 03/16] Cleanup dead code. --- .../sourceforge/phpeclipse/PHPeclipsePlugin.java | 278 +------------------- 1 files changed, 1 insertions(+), 277 deletions(-) diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPeclipsePlugin.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPeclipsePlugin.java index 2a2005c..69da86c 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPeclipsePlugin.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPeclipsePlugin.java @@ -784,37 +784,8 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements // store.setDefault(APACHE_RESTART_BACKGROUND, "true"); } - // store.setDefault(SHOW_OUTPUT_IN_CONSOLE, "true"); - // store.setDefault(PHP_OBFUSCATOR_DEFAULT, "c:\\temp"); - // if (operatingSystem.equals(Platform.OS_WIN32)) { - // store.setDefault(EXTERNAL_BROWSER_PREF, "rundll32 - // url.dll,FileProtocolHandler {0}"); - // } else if (operatingSystem.equals(Platform.OS_MACOSX)) { - // store.setDefault(PHP_OBFUSCATOR_DEFAULT, "/tmp"); - // TODO How do we start Safari on Mac OS X ? - // store.setDefault(EXTERNAL_BROWSER_PREF, "netscape {0}"); - // } else { - // store.setDefault(PHP_OBFUSCATOR_DEFAULT, "/tmp"); - // store.setDefault(EXTERNAL_BROWSER_PREF, "netscape {0}"); - // } - - // store.setDefault(PHP_EXTENSION_PREFS, - // "php,php3,php4,php5,phtml,inc,module,class"); - - // store.setDefault(PHP_PARSER_DEFAULT, PHP_EXTERNAL_PARSER); - // store.setDefault(PHP_INTERNAL_PARSER, "false"); - // store.setDefault(PHP_EXTERNAL_PARSER, "true"); - // store.setDefault(PHP_PARSE_ON_SAVE, "true"); - // show line numbers: - // store.setDefault(LINE_NUMBER_RULER, "false"); - // store.setDefault(FORMATTER_TAB_SIZE, "4"); // php syntax highlighting store.setDefault(PHP_USERDEF_XMLFILE, ""); - // assume there is none chooA - // PreferenceConverter.setDefault(store, PHP_MULTILINE_COMMENT, - // PHPColorProvider.MULTI_LINE_COMMENT); - // PreferenceConverter.setDefault(store, PHP_SINGLELINE_COMMENT, - // PHPColorProvider.SINGLE_LINE_COMMENT); PreferenceConverter.setDefault(store, PHP_TAG, PHPColorProvider.TAG); PreferenceConverter.setDefault(store, PHP_KEYWORD, PHPColorProvider.KEYWORD); @@ -827,11 +798,6 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements PreferenceConverter.setDefault(store, PHP_CONSTANT, PHPColorProvider.CONSTANT); PreferenceConverter.setDefault(store, PHP_TYPE, PHPColorProvider.TYPE); - // PreferenceConverter.setDefault(store, PHP_STRING_DQ, - // PHPColorProvider.STRING_DQ); - // store.setDefault(PHP_STRING_BOLD_DQ, true); - // PreferenceConverter.setDefault(store, PHP_STRING_SQ, - // PHPColorProvider.STRING_SQ); PreferenceConverter.setDefault(store, PHP_DEFAULT, PHPColorProvider.DEFAULT); PreferenceConverter.setDefault(store, PHPDOC_KEYWORD, @@ -857,47 +823,7 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements new RGB(0, 0, 0)); store.setDefault(EDITOR_PHP_BRACE_OPERATOR_BOLD, false); store.setDefault(EDITOR_PHP_BRACE_OPERATOR_ITALIC, false); - // PreferenceConverter.setDefault( - // store, - // PHP_EDITOR_BACKGROUND, - // PHPColorProvider.BACKGROUND); - // PreferenceConverter.setDefault( - // store, - // LINKED_POSITION_COLOR, - // PHPColorProvider.LINKED_POSITION_COLOR); - // PreferenceConverter.setDefault( - // store, - // LINE_NUMBER_COLOR, - // PHPColorProvider.LINE_NUMBER_COLOR); - // // set default PHPDoc colors: - // PreferenceConverter.setDefault( - // store, - // PHPDOC_KEYWORD, - // PHPColorProvider.PHPDOC_KEYWORD); - // PreferenceConverter.setDefault( - // store, - // PHPDOC_LINK, - // PHPColorProvider.PHPDOC_LINK); - // PreferenceConverter.setDefault( - // store, - // PHPDOC_DEFAULT, - // PHPColorProvider.PHPDOC_DEFAULT); - // PreferenceConverter.setDefault( - // store, - // PHPDOC_TAG, - // PHPColorProvider.PHPDOC_TAG); - // store.setDefault(PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT, "true"); - // PreferenceConverter.setDefault( - // store, - // PREFERENCE_COLOR_BACKGROUND, - // PHPColorProvider.BACKGROUND_COLOR); - // language stuff - // store.setDefault(RESOURCE_BUNDLE, LANGUAGE_DEFAULT); - // store.setDefault(RESOURCE_BUNDLE_EN_GB, "true"); - // store.setDefault(RESOURCE_BUNDLE_DE, "false"); - // store.setDefault(RESOURCE_BUNDLE_FR, "false"); - // store.setDefault(RESOURCE_BUNDLE_ES, "false"); - // TemplatePreferencePage.initDefaults(store); + // this will initialize the static fields in the syntaxrdr class new PHPSyntaxRdr(); JavaCore.initializeDefaultPluginPreferences(); @@ -1103,51 +1029,6 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements } /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#shutdown() - */ - // public void shutdown() throws CoreException { - // // moved down (see below): - // // super.shutdown(); - // // externalTools.shutDown(); - // ColorManager.getDefault().dispose(); - // // save the information from the php index files if necessary - // Collection collection = fIndexManagerMap.values(); - // Iterator iterator = collection.iterator(); - // IdentifierIndexManager indexManager = null; - // while (iterator.hasNext()) { - // indexManager = (IdentifierIndexManager) iterator.next(); - // indexManager.writeFile(); - // } - // if (fImageDescriptorRegistry != null) - // fImageDescriptorRegistry.dispose(); - // // unregisterAdapters(); - // super.shutdown(); - // if (fWorkingCopyManager != null) { - // fWorkingCopyManager.shutdown(); - // fWorkingCopyManager = null; - // } - // if (fCompilationUnitDocumentProvider != null) { - // fCompilationUnitDocumentProvider.shutdown(); - // fCompilationUnitDocumentProvider = null; - // } - // if (fJavaTextTools != null) { - // fJavaTextTools.dispose(); - // fJavaTextTools = null; - // } - // // JavaDocLocations.shutdownJavadocLocations(); - // // - // // - // JFaceResources.getFontRegistry().removeListener(fFontPropertyChangeListener); - // // begin JavaCore#shutdown() - // //savePluginPreferences(); - // savePluginPreferences(); - // IWorkspace workspace = ResourcesPlugin.getWorkspace(); - // workspace.removeResourceChangeListener(JavaModelManager.getJavaModelManager().deltaState); - // workspace.removeSaveParticipant(this); - // ((JavaModelManager) JavaModelManager.getJavaModelManager()).shutdown(); - // // end JavaCore#shutdown() - // } - /** * Installs backwards compatibility for the preference store. */ private void installPreferenceStoreBackwardsCompatibility() { @@ -1193,45 +1074,6 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements }; JFaceResources.getFontRegistry().addListener( fFontPropertyChangeListener); - - /* - * Backwards compatibility: propagate the Java editor tab width from a - * pre-3.0 plug-in to the new preference key. This is done only once. - */ - // final String oldTabWidthKey = PreferenceConstants.EDITOR_TAB_WIDTH; - // final String newTabWidthKey = - // AbstractDecoratedTextEditorPreferenceConstants.EDITOR_TAB_WIDTH; - // String tabWidthPropagatedKey = "tabWidthPropagated"; //$NON-NLS-1$ - // if (getPreferenceStore().contains(oldTabWidthKey) && - // !getPreferenceStore().isDefault(oldTabWidthKey)) { - // if (!getPreferenceStore().getBoolean(tabWidthPropagatedKey)) - // getPreferenceStore().setValue(newTabWidthKey, - // getPreferenceStore().getInt(oldTabWidthKey)); - // } - // getPreferenceStore().setValue(tabWidthPropagatedKey, true); - // - // /* - // * Backwards compatibility: set the Java editor tab width in this - // plug-in's preference store with the old key to let older - // * versions access it. Since 3.0 the tab width is managed by the - // extended texteditor and uses a new key. - // */ - // getPreferenceStore().putValue(oldTabWidthKey, - // getPreferenceStore().getString(newTabWidthKey)); - // fPropertyChangeListener = new IPropertyChangeListener() { - // public void propertyChange(PropertyChangeEvent event) { - // if (newTabWidthKey.equals(event.getProperty())) - // getPreferenceStore().putValue(oldTabWidthKey, - // getPreferenceStore().getString(newTabWidthKey)); - // } - // }; - // getPreferenceStore().addPropertyChangeListener(fPropertyChangeListener); - /* - * Backward compatibility for the refactoring preference key. - */ - // getPreferenceStore().setValue( - // PreferenceConstants.REFACTOR_ERROR_PAGE_SEVERITY_THRESHOLD, - // RefactoringCore.getConditionCheckingFailedSeverity()); } /** @@ -1256,7 +1098,6 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements modelManager.configurePluginDebugOptions(); // request state folder creation (workaround 19885) - // JavaCore.getPlugin().getStateLocation(); getStateLocation(); // retrieve variable values PHPeclipsePlugin.getDefault().getPluginPreferences() @@ -1272,7 +1113,6 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements | IResourceChangeEvent.PRE_DELETE | IResourceChangeEvent.PRE_CLOSE); - // startIndexing(); ISavedState savedState = workspace.addSaveParticipant( PHPeclipsePlugin.this, modelManager); @@ -1335,109 +1175,21 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements } - // registerAdapters(); - // - // // externalTools.startUp(); - // getStandardDisplay().asyncExec(new Runnable() { - // public void run() { - // //initialize the variable context manager - // VariableContextManager.getDefault(); - // } - // }); - // - // // if (USE_WORKING_COPY_OWNERS) { - // WorkingCopyOwner.setPrimaryBufferProvider(new WorkingCopyOwner() { - // public IBuffer createBuffer(ICompilationUnit workingCopy) { - // ICompilationUnit original = workingCopy.getPrimary(); - // IResource resource = original.getResource(); - // if (resource instanceof IFile) - // return new DocumentAdapter(workingCopy, (IFile) resource); - // return DocumentAdapter.NULL; - // } - // }); - // // } - - // installPreferenceStoreBackwardsCompatibility(); - - // AllTypesCache.initialize(); - - // Initialize AST provider - // getASTProvider(); - // } - - // public void startup() throws CoreException { - // super.startup(); - // // begin JavaCore.startup(); - // JavaModelManager manager = JavaModelManager.getJavaModelManager(); - // try { - // manager.configurePluginDebugOptions(); - // // request state folder creation (workaround 19885) - // // JavaCore.getPlugin().getStateLocation(); - // getStateLocation(); - // // retrieve variable values - // // - // JavaCore.getPlugin().getPluginPreferences().addPropertyChangeListener(new - // // JavaModelManager.PluginPreferencesListener()); - // getPluginPreferences().addPropertyChangeListener( - // new JavaModelManager.PluginPreferencesListener()); - // // TODO temp-del - // // manager.loadVariablesAndContainers(); - // final IWorkspace workspace = ResourcesPlugin.getWorkspace(); - // workspace.addResourceChangeListener( - // manager.deltaState, - // IResourceChangeEvent.PRE_BUILD - // | IResourceChangeEvent.POST_BUILD - // | IResourceChangeEvent.POST_CHANGE - // | IResourceChangeEvent.PRE_DELETE - // | IResourceChangeEvent.PRE_CLOSE); - // // startIndexing(); - // workspace.addSaveParticipant(PHPeclipsePlugin.getDefault(), manager); - // } catch (CoreException e) { - // } catch (RuntimeException e) { - // manager.shutdown(); - // throw e; - // } - // // end JavaCore.startup(); - // IAdapterManager platformManager = Platform.getAdapterManager(); - // platformManager.registerAdapters(new PHPElementAdapterFactory(), - // PHPElement.class); - // platformManager.registerAdapters(new ResourceAdapterFactory(), - // IResource.class); - // // externalTools.startUp(); - // getStandardDisplay().asyncExec(new Runnable() { - // public void run() { - // //initialize the variable context manager - // VariableContextManager.getDefault(); - // } - // }); - // } - private void registerAdapters() { fJavaElementAdapterFactory = new JavaElementAdapterFactory(); - // fMarkerAdapterFactory= new MarkerAdapterFactory(); - // fEditorInputAdapterFactory= new EditorInputAdapterFactory(); fResourceAdapterFactory = new ResourceAdapterFactory(); - // fLogicalPackageAdapterFactory= new LogicalPackageAdapterFactory(); IAdapterManager manager = Platform.getAdapterManager(); manager .registerAdapters(fJavaElementAdapterFactory, IJavaElement.class); - // manager.registerAdapters(fMarkerAdapterFactory, IMarker.class); - // manager.registerAdapters(fEditorInputAdapterFactory, - // IEditorInput.class); manager.registerAdapters(fResourceAdapterFactory, IResource.class); - // manager.registerAdapters(fLogicalPackageAdapterFactory, - // LogicalPackage.class); } private void unregisterAdapters() { IAdapterManager manager = Platform.getAdapterManager(); manager.unregisterAdapters(fJavaElementAdapterFactory); - // manager.unregisterAdapters(fMarkerAdapterFactory); - // manager.unregisterAdapters(fEditorInputAdapterFactory); manager.unregisterAdapters(fResourceAdapterFactory); - // manager.unregisterAdapters(fLogicalPackageAdapterFactory); } /** @@ -1592,20 +1344,9 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements */ public TemplateStore getTemplateStore() { if (fTemplateStore == null) { - // boolean alreadyMigrated= - // getPreferenceStore().getBoolean(TEMPLATES_MIGRATION_KEY); - // if (alreadyMigrated) fTemplateStore = new ContributionTemplateStore( getTemplateContextRegistry(), getPreferenceStore(), TEMPLATES_KEY); - // else { - // fTemplateStore= new - // CompatibilityTemplateStore(getTemplateContextRegistry(), - // getPreferenceStore(), TEMPLATES_KEY, - // Templates.getInstance()); - // getPreferenceStore().setValue(TEMPLATES_MIGRATION_KEY, true); - // } - try { fTemplateStore.load(); } catch (IOException e) { @@ -1643,31 +1384,14 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements */ public TemplateStore getCodeTemplateStore() { if (fCodeTemplateStore == null) { - // boolean alreadyMigrated= - // getPreferenceStore().getBoolean(CODE_TEMPLATES_MIGRATION_KEY); - // if (alreadyMigrated) fCodeTemplateStore = new ContributionTemplateStore( getCodeTemplateContextRegistry(), getPreferenceStore(), CODE_TEMPLATES_KEY); - // else { - // fCodeTemplateStore= new - // CompatibilityTemplateStore(getCodeTemplateContextRegistry(), - // getPreferenceStore(), - // CODE_TEMPLATES_KEY, CodeTemplates.getInstance()); - // getPreferenceStore().setValue(CODE_TEMPLATES_MIGRATION_KEY, - // true); - // } - try { fCodeTemplateStore.load(); } catch (IOException e) { log(e); } - - // compatibility / bug fixing code for duplicated templates - // TODO remove for 3.0 - // CompatibilityTemplateStore.pruneDuplicates(fCodeTemplateStore, - // true); } return fCodeTemplateStore; -- 1.7.1 From f2da51e5f9264ee7eb20bba7c80306762e129dbd Mon Sep 17 00:00:00 2001 From: pombredanne Date: Thu, 8 Feb 2007 00:03:53 +0000 Subject: [PATCH 04/16] Bumped up versions to 1.2.0 --- .../META-INF/MANIFEST.MF | 3 ++- .../META-INF/MANIFEST.MF | 2 +- .../META-INF/MANIFEST.MF | 2 +- .../META-INF/MANIFEST.MF | 2 +- .../META-INF/MANIFEST.MF | 2 +- .../META-INF/MANIFEST.MF | 2 +- .../META-INF/MANIFEST.MF | 2 +- net.sourceforge.phpeclipse.ui/META-INF/MANIFEST.MF | 2 +- .../META-INF/MANIFEST.MF | 2 +- .../META-INF/MANIFEST.MF | 2 +- .../META-INF/MANIFEST.MF | 2 +- net.sourceforge.phpeclipse/META-INF/MANIFEST.MF | 3 ++- 12 files changed, 14 insertions(+), 12 deletions(-) diff --git a/net.sourceforge.phpeclipse.core/META-INF/MANIFEST.MF b/net.sourceforge.phpeclipse.core/META-INF/MANIFEST.MF index 249e4d7..898933e 100644 --- a/net.sourceforge.phpeclipse.core/META-INF/MANIFEST.MF +++ b/net.sourceforge.phpeclipse.core/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: PHPeclipse Web Development Tools Core Bundle-SymbolicName: net.sourceforge.phpeclipse.core -Bundle-Version: 1.1.9 +Bundle-Version: 1.2.0 Bundle-ClassPath: webcore.jar Bundle-Activator: net.sourceforge.phpeclipse.core.WebCore Bundle-Vendor: PHPEclipse project team @@ -12,3 +12,4 @@ Export-Package: net.sourceforge.phpeclipse.core, Require-Bundle: org.eclipse.core.runtime, org.eclipse.text Eclipse-LazyStart: true +Bundle-RequiredExecutionEnvironment: J2SE-1.4 diff --git a/net.sourceforge.phpeclipse.debug.core/META-INF/MANIFEST.MF b/net.sourceforge.phpeclipse.debug.core/META-INF/MANIFEST.MF index 450ab69..9a63cf1 100644 --- a/net.sourceforge.phpeclipse.debug.core/META-INF/MANIFEST.MF +++ b/net.sourceforge.phpeclipse.debug.core/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Plugin.name Bundle-SymbolicName: net.sourceforge.phpeclipse.debug.core; singleton:=true -Bundle-Version: 1.1.9 +Bundle-Version: 1.2.0 Bundle-ClassPath: core.jar Bundle-Activator: net.sourceforge.phpdt.internal.debug.core.PHPDebugCorePlugin Bundle-Vendor: PHPEclipse project team diff --git a/net.sourceforge.phpeclipse.debug.ui/META-INF/MANIFEST.MF b/net.sourceforge.phpeclipse.debug.ui/META-INF/MANIFEST.MF index 1dadf65..636cb80 100644 --- a/net.sourceforge.phpeclipse.debug.ui/META-INF/MANIFEST.MF +++ b/net.sourceforge.phpeclipse.debug.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Plugin.name Bundle-SymbolicName: net.sourceforge.phpeclipse.debug.ui; singleton:=true -Bundle-Version: 1.1.9 +Bundle-Version: 1.2.0 Bundle-ClassPath: debug.jar Bundle-Activator: net.sourceforge.phpdt.internal.debug.ui.PHPDebugUiPlugin Bundle-Vendor: PHPEclipse project team diff --git a/net.sourceforge.phpeclipse.externaltools/META-INF/MANIFEST.MF b/net.sourceforge.phpeclipse.externaltools/META-INF/MANIFEST.MF index 4d6c028..44dec0f 100644 --- a/net.sourceforge.phpeclipse.externaltools/META-INF/MANIFEST.MF +++ b/net.sourceforge.phpeclipse.externaltools/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: PHP ExternalTools Plug-in Bundle-SymbolicName: net.sourceforge.phpeclipse.externaltools; singleton:=true -Bundle-Version: 1.1.9 +Bundle-Version: 1.2.0 Bundle-ClassPath: externaltools.jar Bundle-Activator: net.sourceforge.phpeclipse.externaltools.ExternalToolsPlugin Bundle-Vendor: PHPEclipse project team diff --git a/net.sourceforge.phpeclipse.launching/META-INF/MANIFEST.MF b/net.sourceforge.phpeclipse.launching/META-INF/MANIFEST.MF index ff25e77..d6aa685 100644 --- a/net.sourceforge.phpeclipse.launching/META-INF/MANIFEST.MF +++ b/net.sourceforge.phpeclipse.launching/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Plugin.name Bundle-SymbolicName: net.sourceforge.phpeclipse.launching; singleton:=true -Bundle-Version: 1.1.9 +Bundle-Version: 1.2.0 Bundle-ClassPath: launch.jar Bundle-Activator: net.sourceforge.phpdt.internal.launching.PHPLaunchingPlugin Bundle-Vendor: PHPEclipse project team diff --git a/net.sourceforge.phpeclipse.phphelp/META-INF/MANIFEST.MF b/net.sourceforge.phpeclipse.phphelp/META-INF/MANIFEST.MF index db8b959..6233f84 100644 --- a/net.sourceforge.phpeclipse.phphelp/META-INF/MANIFEST.MF +++ b/net.sourceforge.phpeclipse.phphelp/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: net.sourceforge.phpeclipse.phphelp; singleton:=true -Bundle-Version: 1.1.9 +Bundle-Version: 1.2.0 Bundle-ClassPath: phphelp.jar Bundle-Activator: net.sourceforge.phpdt.phphelp.PHPHelpPlugin Bundle-Vendor: %providerName diff --git a/net.sourceforge.phpeclipse.smarty.ui/META-INF/MANIFEST.MF b/net.sourceforge.phpeclipse.smarty.ui/META-INF/MANIFEST.MF index 31baec5..bcb5b41 100644 --- a/net.sourceforge.phpeclipse.smarty.ui/META-INF/MANIFEST.MF +++ b/net.sourceforge.phpeclipse.smarty.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: PHPeclipse Smarty UI Bundle-SymbolicName: net.sourceforge.phpeclipse.smarty.ui;singleton:=true -Bundle-Version: 1.1.9 +Bundle-Version: 1.2.0 Bundle-ClassPath: smartyui.jar Bundle-Activator: net.sourceforge.phpdt.smarty.ui.SmartyUI Bundle-Vendor: PHPEclipse project team diff --git a/net.sourceforge.phpeclipse.ui/META-INF/MANIFEST.MF b/net.sourceforge.phpeclipse.ui/META-INF/MANIFEST.MF index 38dc60e..8497875 100644 --- a/net.sourceforge.phpeclipse.ui/META-INF/MANIFEST.MF +++ b/net.sourceforge.phpeclipse.ui/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Generated-from: 1150021273000;type=2 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: net.sourceforge.phpeclipse.ui; singleton:=true -Bundle-Version: 1.1.9 +Bundle-Version: 1.2.0 Bundle-ClassPath: ui.jar Bundle-Activator: net.sourceforge.phpeclipse.ui.WebUI Bundle-Vendor: %providerName diff --git a/net.sourceforge.phpeclipse.webbrowser/META-INF/MANIFEST.MF b/net.sourceforge.phpeclipse.webbrowser/META-INF/MANIFEST.MF index 2933a30..ddf8ffa 100644 --- a/net.sourceforge.phpeclipse.webbrowser/META-INF/MANIFEST.MF +++ b/net.sourceforge.phpeclipse.webbrowser/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: net.sourceforge.phpeclipse.webbrowser; singleton:=true -Bundle-Version: 1.1.9 +Bundle-Version: 1.2.0 Bundle-ClassPath: webbrowser.jar Bundle-Activator: net.sourceforge.phpeclipse.webbrowser.internal.WebBrowserUIPlugin Bundle-Vendor: %providerName diff --git a/net.sourceforge.phpeclipse.xml.core/META-INF/MANIFEST.MF b/net.sourceforge.phpeclipse.xml.core/META-INF/MANIFEST.MF index 6ab4971..30ffae1 100644 --- a/net.sourceforge.phpeclipse.xml.core/META-INF/MANIFEST.MF +++ b/net.sourceforge.phpeclipse.xml.core/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: net.sourceforge.phpeclipse.xml.core;singleton:=true -Bundle-Version: 1.1.9 +Bundle-Version: 1.2.0 Bundle-ClassPath: xmlcore.jar Bundle-Vendor: %providerName Bundle-Localization: plugin diff --git a/net.sourceforge.phpeclipse.xml.ui/META-INF/MANIFEST.MF b/net.sourceforge.phpeclipse.xml.ui/META-INF/MANIFEST.MF index a19005b..564e4d0 100644 --- a/net.sourceforge.phpeclipse.xml.ui/META-INF/MANIFEST.MF +++ b/net.sourceforge.phpeclipse.xml.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: net.sourceforge.phpeclipse.xml.ui; singleton:=true -Bundle-Version: 1.1.9 +Bundle-Version: 1.2.0 Bundle-ClassPath: xmlui.jar Bundle-Activator: net.sourceforge.phpeclipse.xml.ui.XMLPlugin Bundle-Vendor: %providerName diff --git a/net.sourceforge.phpeclipse/META-INF/MANIFEST.MF b/net.sourceforge.phpeclipse/META-INF/MANIFEST.MF index 8b08c9d..eb7afc2 100644 --- a/net.sourceforge.phpeclipse/META-INF/MANIFEST.MF +++ b/net.sourceforge.phpeclipse/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: net.sourceforge.phpeclipse; singleton:=true -Bundle-Version: 1.1.9 +Bundle-Version: 1.2.0 Bundle-ClassPath: phpeclipse.jar Bundle-Activator: net.sourceforge.phpeclipse.PHPeclipsePlugin Bundle-Vendor: %providerName @@ -107,3 +107,4 @@ Require-Bundle: org.eclipse.core.runtime, org.eclipse.ltk.core.refactoring, org.eclipse.ltk.ui.refactoring Eclipse-LazyStart: true +Bundle-RequiredExecutionEnvironment: J2SE-1.4 -- 1.7.1 From 2fbb83cc9cdccdcd1b4674e83a67d8a1e553114c Mon Sep 17 00:00:00 2001 From: pombredanne Date: Thu, 8 Feb 2007 00:04:29 +0000 Subject: [PATCH 05/16] Removed unuse builder from project --- net.sourceforge.phpeclipse.phpunit/.project | 6 ------ 1 files changed, 0 insertions(+), 6 deletions(-) diff --git a/net.sourceforge.phpeclipse.phpunit/.project b/net.sourceforge.phpeclipse.phpunit/.project index 2e658c9..0033c4b 100644 --- a/net.sourceforge.phpeclipse.phpunit/.project +++ b/net.sourceforge.phpeclipse.phpunit/.project @@ -20,15 +20,9 @@ - - net.sourceforge.metrics.builder - - - org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature - net.sourceforge.metrics.nature -- 1.7.1 From bbad18d3ec237f7a3faf07f236a49de5fd9821a4 Mon Sep 17 00:00:00 2001 From: pombredanne Date: Fri, 2 Mar 2007 23:24:52 +0000 Subject: [PATCH 06/16] PATCH-1559330: PHPDoc comments are garbled in function hover. Applied patch and refactored the getencoding code in common method.bit. --- .../phpdt/internal/corext/phpdoc/PHPDocUtil.java | 34 ++++++++++++++++--- 1 files changed, 28 insertions(+), 6 deletions(-) diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/corext/phpdoc/PHPDocUtil.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/corext/phpdoc/PHPDocUtil.java index 0d477e1..9b30f8b 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/corext/phpdoc/PHPDocUtil.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/corext/phpdoc/PHPDocUtil.java @@ -1,10 +1,16 @@ package net.sourceforge.phpdt.internal.corext.phpdoc; -import java.io.FileReader; +import java.io.FileInputStream; import java.io.IOException; +import java.io.InputStreamReader; +import net.sourceforge.phpeclipse.PHPeclipsePlugin; import net.sourceforge.phpeclipse.builder.PHPIdentifierLocation; +import org.eclipse.core.resources.IFile; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.Path; + /** * Utility class for static PHPdoc helper mehods */ @@ -19,7 +25,6 @@ public class PHPDocUtil { */ public static void appendPHPDoc(StringBuffer hoverInfoBuffer, String filename, PHPIdentifierLocation location) { - FileReader phpFileReader; hoverInfoBuffer.append(location.toString()); hoverInfoBuffer.append(" - "); try { @@ -28,7 +33,9 @@ public class PHPDocUtil { // read the phpdoc for the function if (location.getPHPDocOffset() >= 0) { - phpFileReader = new FileReader(filename); + String encoding = getEncoding(filename); + InputStreamReader phpFileReader = new InputStreamReader( + new FileInputStream(filename), encoding); char[] phpDocDeclarationCharArray = new char[location .getPHPDocLength()]; phpFileReader.skip(location.getPHPDocOffset()); @@ -37,18 +44,31 @@ public class PHPDocUtil { PHPDocCharArrayCommentReader phpdocConverter = new PHPDocCharArrayCommentReader( phpDocDeclarationCharArray); hoverInfoBuffer.append(phpdocConverter.getString()); - // hoverInfoBuffer.append("

"); phpFileReader.close(); } } catch (IOException e) { + // TODO: smell return; } } + static String getEncoding(String filename) { + String encoding = null; + IFile file = PHPeclipsePlugin.getWorkspace().getRoot() + .getFileForLocation(new Path(filename)); + if (file != null) { + try { + encoding = file.getCharset(); + } catch (CoreException e) { + // TODO: should log the fact that we could not get the encoding? + } + } + return encoding; + } + public static String getUsage(String filename, PHPIdentifierLocation location) { - FileReader phpFileReader; String usage = location.getUsage(); if (usage != null) { return usage; @@ -56,7 +76,9 @@ public class PHPDocUtil { usage = ""; try { - phpFileReader = new FileReader(filename); + String encoding = getEncoding(filename); + InputStreamReader phpFileReader = new InputStreamReader( + new FileInputStream(filename), encoding); // read the function declaration if (location.getOffset() >= 0 && (location.isMethod() || location.isConstructor() -- 1.7.1 From 8de7143c6f67feb68a518d72d99efe8358adf81d Mon Sep 17 00:00:00 2001 From: pombredanne Date: Fri, 2 Mar 2007 23:29:25 +0000 Subject: [PATCH 07/16] PATCH-1559330: PHPDoc comments are garbled in function hover. Applied patch . --- .../phpeclipse/builder/IdentifierIndexManager.java | 13 ++++--------- 1 files changed, 4 insertions(+), 9 deletions(-) diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/builder/IdentifierIndexManager.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/builder/IdentifierIndexManager.java index 499bd82..2d84bec 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/builder/IdentifierIndexManager.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/builder/IdentifierIndexManager.java @@ -324,7 +324,6 @@ public class IdentifierIndexManager { StringBuffer buf) { char[] ident; String identifier; - int counter = 0; boolean hasModifiers = false; int phpdocOffset = -1; int phpdocLength = -1; @@ -508,12 +507,11 @@ public class IdentifierIndexManager { * */ public void addFile(IFile fileToParse) { - // InputStream iStream; LineCreator lineCreator = createLineCreator(); try { addInputStream(new BufferedInputStream(fileToParse.getContents()), fileToParse.getProjectRelativePath().toString(), - lineCreator); + lineCreator, fileToParse.getCharset()); } catch (CoreException e1) { // TODO Auto-generated catch block e1.printStackTrace(); @@ -526,17 +524,13 @@ public class IdentifierIndexManager { * @throws CoreException */ public void addInputStream(InputStream stream, String filePath, - LineCreator lineCreator) throws CoreException { + LineCreator lineCreator , String charset) throws CoreException { try { StringBuffer lineBuffer = new StringBuffer(); lineBuffer.append(filePath); - int lineLength = lineBuffer.length(); lineCreator.parseIdentifiers(Util.getInputStreamAsCharArray(stream, - -1, null), lineBuffer); - // if (lineLength != lineBuffer.length()) { - // always add the file for Open Include Action + -1, charset), lineBuffer); addLine(lineBuffer.toString()); - // } } catch (IOException e) { e.printStackTrace(); } finally { @@ -545,6 +539,7 @@ public class IdentifierIndexManager { stream.close(); } } catch (IOException e) { + //do nothing } } } -- 1.7.1 From df27a69506e6ba4dff5a3b8f1dc313d5714f4d69 Mon Sep 17 00:00:00 2001 From: axelcl Date: Sat, 17 Mar 2007 13:54:41 +0000 Subject: [PATCH 08/16] Added patch for #1589521 "3 character function names invalid?" --- .../phpdt/internal/compiler/parser/Scanner.java | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/Scanner.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/Scanner.java index 6866e27..f230cf3 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/Scanner.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/Scanner.java @@ -3684,8 +3684,8 @@ public class Scanner implements IScanner, ITerminalSymbols { // if ((data[++index] == 'r') && (data[++index] == 'u') // && (data[++index] == 'e')) // return TokenNametrue; - // else - // return TokenNameIdentifier; + else + return TokenNameIdentifier; case 5: if ((data[++index] == 'h') && (data[++index] == 'r') && (data[++index] == 'o') && (data[++index] == 'w')) -- 1.7.1 From 98dc5ad753eb7050c3b62451646ed68f65dbd134 Mon Sep 17 00:00:00 2001 From: axelcl Date: Sat, 17 Mar 2007 14:07:31 +0000 Subject: [PATCH 09/16] #1493165 phpeclise highlighting fails when using special echo "<<<" --- .../phpeditor/php/PHPPartitionScanner.java | 16 ++++++++++++---- 1 files changed, 12 insertions(+), 4 deletions(-) diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PHPPartitionScanner.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PHPPartitionScanner.java index 514e802..0b8409d 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PHPPartitionScanner.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PHPPartitionScanner.java @@ -8,7 +8,7 @@ Contributors: Igor Malinin - initial contribution - $Id: PHPPartitionScanner.java,v 1.34 2006-10-21 23:18:32 pombredanne Exp $ + $Id: PHPPartitionScanner.java,v 1.35 2007-03-17 14:07:31 axelcl Exp $ **********************************************************************/ package net.sourceforge.phpeclipse.phpeditor.php; @@ -268,7 +268,7 @@ public class PHPPartitionScanner implements IPartitionTokenScanner { return false; } ch = document.getChar(position++); // ignore escaped - // character + // character } else if (ch == '"') { return true; } @@ -293,7 +293,7 @@ public class PHPPartitionScanner implements IPartitionTokenScanner { return false; } ch = document.getChar(position++); // ignore escaped - // character + // character } else if (ch == '\'') { return true; } @@ -314,6 +314,14 @@ public class PHPPartitionScanner implements IPartitionTokenScanner { return false; } ch = document.getChar(position++); + // #1493165 start + while (ch == ' ') { + if (position >= end) { + return false; + } + ch = document.getChar(position++); + } + // #1493165 end if (!Scanner.isPHPIdentifierStart(ch)) { return false; } @@ -340,7 +348,7 @@ public class PHPPartitionScanner implements IPartitionTokenScanner { return true; } ch = document.getChar(position++); // ignore escaped - // character + // character if (ch != heredocIdent[pos]) { break; } -- 1.7.1 From 43ae4adbef1350640221c942c89753c14855cec4 Mon Sep 17 00:00:00 2001 From: dizmo Date: Sun, 18 Mar 2007 23:17:48 +0000 Subject: [PATCH 10/16] closes 1672804 --- build/phpeclipse-extssh.psf | 26 +++++++++++++------------- build/phpeclipse-pserver.psf | 26 +++++++++++++------------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/build/phpeclipse-extssh.psf b/build/phpeclipse-extssh.psf index bf1bfe2..42e2982 100644 --- a/build/phpeclipse-extssh.psf +++ b/build/phpeclipse-extssh.psf @@ -1,18 +1,18 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + diff --git a/build/phpeclipse-pserver.psf b/build/phpeclipse-pserver.psf index f327645..5cbba2a 100644 --- a/build/phpeclipse-pserver.psf +++ b/build/phpeclipse-pserver.psf @@ -1,18 +1,18 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + -- 1.7.1 From a4b10b350cf6deee8200b80cd2e4d4db52060a01 Mon Sep 17 00:00:00 2001 From: dizmo Date: Thu, 22 Mar 2007 03:16:38 +0000 Subject: [PATCH 11/16] closes [ 1033591 ] Tasks not reporting corrent line number in task view --- .../phpdt/internal/compiler/parser/Scanner.java | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/Scanner.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/Scanner.java index f230cf3..5e44d43 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/Scanner.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/Scanner.java @@ -1438,8 +1438,6 @@ public class Scanner implements IScanner, ITerminalSymbols { while ((currentCharacter == ' ') || Character.isWhitespace(currentCharacter)) { - startPosition = currentPosition; - currentCharacter = source[currentPosition++]; if ((currentCharacter == '\r') || (currentCharacter == '\n')) { checkNonExternalizeString(); @@ -1449,6 +1447,8 @@ public class Scanner implements IScanner, ITerminalSymbols { currentLine = null; } } + startPosition = currentPosition; + currentCharacter = source[currentPosition++]; } if (tokenizeWhiteSpace && (whiteStart != currentPosition - 1)) { -- 1.7.1 From 05cb0614594a8bed9a1c34e3ca587086f62febab Mon Sep 17 00:00:00 2001 From: axelcl Date: Sat, 24 Mar 2007 15:22:22 +0000 Subject: [PATCH 12/16] Fix for #1380415 (toshihiro) --- .../phpeclipse/phpeditor/PHPUnitEditor.java | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) 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 c01fc83..15c174f 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPUnitEditor.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPUnitEditor.java @@ -932,6 +932,18 @@ public class PHPUnitEditor extends PHPEditor { // implements else return new ExitFlags(LinkedPositionUI.COMMIT, true); } + // Fix for #1380415 (toshihiro) start + switch (event.keyCode) { + case SWT.ARROW_UP: + case SWT.ARROW_DOWN: + return new ExitFlags(LinkedPositionUI.COMMIT, true); + case SWT.ARROW_LEFT: + case SWT.ARROW_RIGHT: + if (!manager.anyPositionIncludes(offset, length)) + return new ExitFlags(LinkedPositionUI.COMMIT, true); + break; + } + // #1380415 end switch (event.character) { case '\b': if (manager.getFirstPosition().length == 0) -- 1.7.1 From be7c9eee2c2500c6ff93207067af8d5d37dd8291 Mon Sep 17 00:00:00 2001 From: axelcl Date: Sat, 31 Mar 2007 09:28:52 +0000 Subject: [PATCH 13/16] #1365431 (toshihiro) - PHP Editor crashes Windows with JavaScript 'windows.close()' --- .../phpeclipse/webbrowser/internal/WebBrowser.java | 6 ++++-- .../phpeclipse/webbrowser/views/BrowserView.java | 11 +++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/net.sourceforge.phpeclipse.webbrowser/src/net/sourceforge/phpeclipse/webbrowser/internal/WebBrowser.java b/net.sourceforge.phpeclipse.webbrowser/src/net/sourceforge/phpeclipse/webbrowser/internal/WebBrowser.java index 4c4f9ee..961fd5d 100644 --- a/net.sourceforge.phpeclipse.webbrowser/src/net/sourceforge/phpeclipse/webbrowser/internal/WebBrowser.java +++ b/net.sourceforge.phpeclipse.webbrowser/src/net/sourceforge/phpeclipse/webbrowser/internal/WebBrowser.java @@ -236,8 +236,10 @@ public class WebBrowser extends Composite { // else its an editor window if (shell != null) shell.dispose(); - else - editor.closeEditor(); + else { + // #1365431 (toshihiro) editor.closeEditor(); causes NPE + if (editor != null) editor.closeEditor(); + } } }); diff --git a/net.sourceforge.phpeclipse.webbrowser/src/net/sourceforge/phpeclipse/webbrowser/views/BrowserView.java b/net.sourceforge.phpeclipse.webbrowser/src/net/sourceforge/phpeclipse/webbrowser/views/BrowserView.java index 92face4..04a4cb7 100644 --- a/net.sourceforge.phpeclipse.webbrowser/src/net/sourceforge/phpeclipse/webbrowser/views/BrowserView.java +++ b/net.sourceforge.phpeclipse.webbrowser/src/net/sourceforge/phpeclipse/webbrowser/views/BrowserView.java @@ -14,9 +14,11 @@ import net.sourceforge.phpeclipse.webbrowser.internal.WebBrowser; import net.sourceforge.phpeclipse.webbrowser.internal.WebBrowserUtil; import org.eclipse.core.resources.IFile; +import org.eclipse.swt.browser.CloseWindowListener; import org.eclipse.swt.browser.ProgressListener; import org.eclipse.swt.browser.StatusTextListener; import org.eclipse.swt.browser.TitleListener; +import org.eclipse.swt.browser.WindowEvent; import org.eclipse.swt.widgets.Composite; import org.eclipse.ui.part.IShowInTarget; import org.eclipse.ui.part.ShowInContext; @@ -45,6 +47,15 @@ public class BrowserView extends ViewPart implements IShowInTarget { try { if (WebBrowserUtil.isInternalBrowserOperational()) { fInstance = new WebBrowser(frame, true, true); + // #1365431 (toshihiro) start + fInstance.getBrowser().addCloseWindowListener( + new CloseWindowListener() { + public void close(WindowEvent event) { + getViewSite().getPage().hideView( + BrowserView.this); + } + }); + // #1365431 (toshihiro) end } } catch (Exception e) { fInstance = null; -- 1.7.1 From 104d27044d267f7bf75f9e6c7dd77a89bcccc5cb Mon Sep 17 00:00:00 2001 From: axelcl Date: Sun, 1 Apr 2007 16:38:58 +0000 Subject: [PATCH 14/16] Patch 1692034 - set projects default charset to UTF-8 --- .../wizards/NewProjectCreationWizard.java | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/wizards/NewProjectCreationWizard.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/wizards/NewProjectCreationWizard.java index 0601e03..176d442 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/wizards/NewProjectCreationWizard.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/wizards/NewProjectCreationWizard.java @@ -89,6 +89,11 @@ public class NewProjectCreationWizard extends BasicNewResourceWizard implements } JavaCore.addPHPNature(newProject, new SubProgressMonitor( monitor, remainingWorkUnits)); + + // patch #1692034 - set the coding of this PHPeclipse + // project to UTF-8 by default for all operating systems: + newProject.setDefaultCharset("UTF-8", monitor); + } catch (CoreException e) { throw new InvocationTargetException(e); } finally { -- 1.7.1 From 8181a88e497663282decf511a25dedbf32a75e5a Mon Sep 17 00:00:00 2001 From: toshihiro Date: Tue, 3 Apr 2007 01:00:12 +0000 Subject: [PATCH 15/16] Fix #1693310 Missing function/method declaration in the completion list --- .../ui/text/template/DeclarationProposal.java | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/text/template/DeclarationProposal.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/text/template/DeclarationProposal.java index d2edd51..4786adc 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/text/template/DeclarationProposal.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/text/template/DeclarationProposal.java @@ -213,22 +213,25 @@ public class DeclarationProposal extends AbstractProposal { // implements */ public String getDisplayString() { String workspaceLocation; + String workspaceName; if (fProject != null) { - workspaceLocation = fProject.getName().toString() + '/'; + workspaceLocation = fProject.getLocation().toString() + '/'; + workspaceName = fProject.getName().toString() + '/'; } else { // should never happen? workspaceLocation = PHPeclipsePlugin.getWorkspace().getRoot() .getLocation().toString(); + workspaceName = workspaceLocation; } - String filename = workspaceLocation + fLocation.getFilename(); - String usage = PHPDocUtil.getUsage(filename, fLocation); + String filename = fLocation.getFilename(); + String usage = PHPDocUtil.getUsage(workspaceLocation + filename, fLocation); String result = fIdentifierName + TemplateMessages.getString("TemplateProposal.delimiter"); if (usage.length() > 0) { result += usage + TemplateMessages.getString("TemplateProposal.delimiter"); } - result += filename; + result += workspaceName + filename; return result; } -- 1.7.1 From ad6efbc424c034cb842a0b03cd3a2fac5bb442b4 Mon Sep 17 00:00:00 2001 From: toshihiro Date: Wed, 4 Apr 2007 05:53:00 +0000 Subject: [PATCH 16/16] Fix #1475484 - code formatter: bad result for array() embedding func calls --- .../phpdt/internal/formatter/CodeFormatter.java | 20 ++++++++++++++------ 1 files changed, 14 insertions(+), 6 deletions(-) diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/formatter/CodeFormatter.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/formatter/CodeFormatter.java index 986398f..c65a883 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/formatter/CodeFormatter.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/formatter/CodeFormatter.java @@ -795,7 +795,7 @@ public class CodeFormatter implements ITerminalSymbols, ICodeFormatter { // recognize array declaration for nice output if (previousCompilableToken == TokenNamearray) { arrayDeclarationCount++; - arrayDeclarationParenthesis[arrayDeclarationCount] = openParenthesis[openParenthesisCount]; + arrayDeclarationParenthesis[arrayDeclarationCount] = openParenthesis[openParenthesisCount - 1]; indentationLevel++; pendingNewLines = 1; } @@ -804,9 +804,14 @@ public class CodeFormatter implements ITerminalSymbols, ICodeFormatter { case TokenNameRPAREN: // check for closing array declaration if (arrayDeclarationCount > 0) { - if (arrayDeclarationParenthesis[arrayDeclarationCount] == openParenthesis[openParenthesisCount]) { + if (arrayDeclarationParenthesis[arrayDeclarationCount] == openParenthesis[openParenthesisCount - 1]) { if (previousCompilableToken != TokenNameLPAREN) { newLine(1); + } else if (previousToken == TokenNameCOMMENT_LINE + || previousToken == TokenNameCOMMENT_BLOCK + || previousToken == TokenNameCOMMENT_PHPDOC) { + // prevent to combine comment line and statement line (#1475484) + newLine(1); } indentationLevel--; currentLineIndentationLevel = indentationLevel; @@ -913,7 +918,10 @@ public class CodeFormatter implements ITerminalSymbols, ICodeFormatter { case TokenNameCOMMA: pendingSpace = false; if (arrayDeclarationCount > 0) { - pendingNewLines = 1; + if (arrayDeclarationParenthesis[arrayDeclarationCount] == openParenthesis[openParenthesisCount - 1]) { + // there is no left parenthesis to close in current array declaration (#1475484) + pendingNewLines = 1; + } } break; case TokenNameDOT: @@ -975,9 +983,9 @@ public class CodeFormatter implements ITerminalSymbols, ICodeFormatter { break; case Scanner.TokenNameCOMMENT_LINE: pendingNewLines = 1; - if (inAssignment) { - currentLineIndentationLevel++; - } + //if (inAssignment) { + // currentLineIndentationLevel++; + //} break; // a line is always inserted after a one-line // comment case Scanner.TokenNameCOMMENT_PHPDOC: -- 1.7.1