From 14718c153f3950c2469a47f57a4fc6104c1d1331 Mon Sep 17 00:00:00 2001 From: axelcl Date: Sat, 11 Jun 2005 17:24:07 +0000 Subject: [PATCH 01/16] All prefs for xampp administrated in external tools plugin. --- .../plugin.properties | 2 +- .../plugin.xml | 165 +++++++++++++++++++- .../prefs/default_linux.properties | 14 ++ .../prefs/default_macosx.properties | 14 ++ .../prefs/default_win32.properties | 14 ++ 5 files changed, 206 insertions(+), 3 deletions(-) create mode 100644 net.sourceforge.phpeclipse.externaltools/prefs/default_linux.properties create mode 100644 net.sourceforge.phpeclipse.externaltools/prefs/default_macosx.properties create mode 100644 net.sourceforge.phpeclipse.externaltools/prefs/default_win32.properties diff --git a/net.sourceforge.phpeclipse.externaltools/plugin.properties b/net.sourceforge.phpeclipse.externaltools/plugin.properties index 1acd37f..8a927ca 100644 --- a/net.sourceforge.phpeclipse.externaltools/plugin.properties +++ b/net.sourceforge.phpeclipse.externaltools/plugin.properties @@ -29,4 +29,4 @@ PreferencePage.externalToolsPreferences = PHP Launchers PreferencePage.antConsolePreferences = Console PreferencePage.antRuntimePreferences = Runtime -Program.externalTools = PHP Program \ No newline at end of file +Program.externalTools= PHP Program \ No newline at end of file diff --git a/net.sourceforge.phpeclipse.externaltools/plugin.xml b/net.sourceforge.phpeclipse.externaltools/plugin.xml index b570732..dc0f107 100644 --- a/net.sourceforge.phpeclipse.externaltools/plugin.xml +++ b/net.sourceforge.phpeclipse.externaltools/plugin.xml @@ -15,13 +15,14 @@ + + - @@ -242,5 +243,165 @@ expanderClass="net.sourceforge.phpdt.externaltools.variable.WorkingSetExpander"> - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/net.sourceforge.phpeclipse.externaltools/prefs/default_linux.properties b/net.sourceforge.phpeclipse.externaltools/prefs/default_linux.properties new file mode 100644 index 0000000..47e56e1 --- /dev/null +++ b/net.sourceforge.phpeclipse.externaltools/prefs/default_linux.properties @@ -0,0 +1,14 @@ +_php_run_pref=/opt/lamp/php/php +_external_parser=/opt/lamp/php/php -l -f {0} +_mysql_run_pref=/opt/lampp/lampp startmysql +_apache_run_pref=/opt/lampp/lampp +_xampp_start_pref=/opt/lampp/lampp start +_xampp_stop_pref=/opt/lampp/lampp stop +__mysql_start=startmysql +__apache_start=startapache -c \"DocumentRoot \"{0}\"\" +__apache_stop=stop +__apache_restart=restart +_mysql_start_background=true +_apache_start_background=true +_apache_stop_background=true +_apache_restart_background=true \ No newline at end of file diff --git a/net.sourceforge.phpeclipse.externaltools/prefs/default_macosx.properties b/net.sourceforge.phpeclipse.externaltools/prefs/default_macosx.properties new file mode 100644 index 0000000..47e56e1 --- /dev/null +++ b/net.sourceforge.phpeclipse.externaltools/prefs/default_macosx.properties @@ -0,0 +1,14 @@ +_php_run_pref=/opt/lamp/php/php +_external_parser=/opt/lamp/php/php -l -f {0} +_mysql_run_pref=/opt/lampp/lampp startmysql +_apache_run_pref=/opt/lampp/lampp +_xampp_start_pref=/opt/lampp/lampp start +_xampp_stop_pref=/opt/lampp/lampp stop +__mysql_start=startmysql +__apache_start=startapache -c \"DocumentRoot \"{0}\"\" +__apache_stop=stop +__apache_restart=restart +_mysql_start_background=true +_apache_start_background=true +_apache_stop_background=true +_apache_restart_background=true \ No newline at end of file diff --git a/net.sourceforge.phpeclipse.externaltools/prefs/default_win32.properties b/net.sourceforge.phpeclipse.externaltools/prefs/default_win32.properties new file mode 100644 index 0000000..251b611 --- /dev/null +++ b/net.sourceforge.phpeclipse.externaltools/prefs/default_win32.properties @@ -0,0 +1,14 @@ +_php_run_pref=c:\\xampp\\php\\php.exe +_external_parser=c:\\xampp\\php\\php.exe -l -f {0} +_mysql_run_pref=c:\\xampp\\mysql\\bin\\mysqld-nt.exe +_apache_run_pref=c:\\xampp\\apache\\bin\\apache.exe +_xampp_start_pref=c:\\xampp\\xampp_start.exe +_xampp_stop_pref=c:\\xampp\\xampp_stop.exe +__mysql_start=--standalone +__apache_start=-c \"DocumentRoot \"{0}\"\" +__apache_stop=-k shutdown +__apache_restart=-k restart +_mysql_start_background=true +_apache_start_background=true +_apache_stop_background=true +_apache_restart_background=true \ No newline at end of file -- 1.7.1 From 2ca25918197d830eb69d9ad11339a91170b600e0 Mon Sep 17 00:00:00 2001 From: axelcl Date: Sun, 12 Jun 2005 12:32:26 +0000 Subject: [PATCH 02/16] Catch exception if reading webbrowser favorites --- .../webbrowser/internal/WebBrowserPreference.java | 23 +++++++++++++------- 1 files changed, 15 insertions(+), 8 deletions(-) diff --git a/net.sourceforge.phpeclipse.webbrowser/src/net/sourceforge/phpeclipse/webbrowser/internal/WebBrowserPreference.java b/net.sourceforge.phpeclipse.webbrowser/src/net/sourceforge/phpeclipse/webbrowser/internal/WebBrowserPreference.java index 6ce17c2..f8eea79 100644 --- a/net.sourceforge.phpeclipse.webbrowser/src/net/sourceforge/phpeclipse/webbrowser/internal/WebBrowserPreference.java +++ b/net.sourceforge.phpeclipse.webbrowser/src/net/sourceforge/phpeclipse/webbrowser/internal/WebBrowserPreference.java @@ -1,10 +1,10 @@ /** * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved.   This program and the accompanying materials + * 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 - Initial API and implementation */ @@ -85,8 +85,12 @@ public class WebBrowserPreference { String temp = getPreferenceStore().getString(PREF_INTERNAL_WEB_BROWSER_FAVORITES); StringTokenizer st = new StringTokenizer(temp, "|*|"); List l = new ArrayList(); - while (st.hasMoreTokens()) { - l.add(new Favorite(st.nextToken(), st.nextToken())); + try { + while (st.hasMoreTokens()) { + l.add(new Favorite(st.nextToken(), st.nextToken())); + } + } catch (Exception e) { + // ignore } return l; } @@ -100,10 +104,13 @@ public class WebBrowserPreference { String temp = store.getString(PREF_INTERNAL_WEB_BROWSER_OLD_FAVORITES); StringTokenizer st = new StringTokenizer(temp, "|*|"); List def = new ArrayList(); - while (st.hasMoreTokens()) { - def.add(new Favorite(st.nextToken(), st.nextToken())); - } - + try { + while (st.hasMoreTokens()) { + def.add(new Favorite(st.nextToken(), st.nextToken())); + } + } catch (Exception e) { + // ignore + } List list = getInternalWebBrowserFavorites(); Iterator iterator = WebBrowserUtil.getUnlockedFavorites().iterator(); while (iterator.hasNext()) { -- 1.7.1 From 52ed29a3aab600167f1ed39f26102b5a509c2232 Mon Sep 17 00:00:00 2001 From: axelcl Date: Tue, 14 Jun 2005 04:29:07 +0000 Subject: [PATCH 03/16] Created a separated 'externaltools' plugin --- .../phpdt/internal/compiler/parser/Parser.java | 10 ++++++---- .../ui/preferences/PreferencesMessages.properties | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/Parser.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/Parser.java index fb1b3cc..f7000aa 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/Parser.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/Parser.java @@ -3703,6 +3703,11 @@ public class Parser implements ITerminalSymbols, CompilerModifiers, ParserBasicI } } + /** + * Parse and check the include file name + * + * @param includeToken + */ private void checkFileName(int includeToken) { // expr int start = scanner.getCurrentTokenStartPosition(); @@ -3765,15 +3770,12 @@ public class Parser implements ITerminalSymbols, CompilerModifiers, ParserBasicI IPath path = PHPFileUtil.determineFilePath(includeNameString, file, project); if (path == null) { - // reportSyntaxError("File: " + expression.toStringExpression() + " doesn't exist in project: " - // + project.getLocation().toString(), literal.sourceStart, literal.sourceEnd); + // SyntaxError: "File: << >> doesn't exist in project." String[] args = { expression.toStringExpression(), project.getLocation().toString() }; problemReporter.phpIncludeNotExistWarning(args, literal.sourceStart, literal.sourceEnd, referenceContext, compilationUnit.compilationResult); } else { try { - // String projectPath = ProjectPrefUtil.getDocumentRoot(file.getProject()).toString(); - // String filePath = file.getRawLocation().toString(); String filePath = path.toString(); String ext = file.getRawLocation().getFileExtension(); int fileExtensionLength = ext == null ? 0 : ext.length() + 1; diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/preferences/PreferencesMessages.properties b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/preferences/PreferencesMessages.properties index 2d4aa0e..1e8544f 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/preferences/PreferencesMessages.properties +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/preferences/PreferencesMessages.properties @@ -188,6 +188,7 @@ JavaEditorPreferencePage.wrapStringsSQ= Wra&p single quoted PHP strings JavaEditorPreferencePage.escapeStringsSQ= &Escape text when pasting into a single quoted PHP string JavaEditorPreferencePage.addJavaDocTags= Add PHPdoc &tags JavaEditorPreferencePage.smartPaste= Pasting fo&r correct indentation +JavaEditorPreferencePage.p_rtrim_on_save= Remove trailing spaces on editor save JavaEditorPreferencePage.smartHomeEnd= S&mart cursor positioning at line start and end JavaEditorPreferencePage.subWordNavigation= Smart cursor positioning in &PHP names -- 1.7.1 From 5b3106a78d3954e9bbb1c2f47fba2abdc608e978 Mon Sep 17 00:00:00 2001 From: axelcl Date: Tue, 14 Jun 2005 04:42:19 +0000 Subject: [PATCH 04/16] Created a separated 'externaltools' plugin --- .../icons/externaltools/full/clcl16/activate.gif | Bin 138 -> 0 bytes .../icons/externaltools/full/clcl16/add_co.gif | Bin 125 -> 0 bytes .../icons/externaltools/full/clcl16/deactivate.gif | Bin 108 -> 0 bytes .../icons/externaltools/full/clcl16/element.gif | Bin 140 -> 0 bytes .../icons/externaltools/full/clcl16/elements.gif | Bin 232 -> 0 bytes .../icons/externaltools/full/clcl16/error.gif | Bin 167 -> 0 bytes .../externaltools/full/clcl16/gotoobj_tsk.gif | Bin 167 -> 0 bytes .../icons/externaltools/full/clcl16/moveDown.gif | Bin 105 -> 0 bytes .../icons/externaltools/full/clcl16/moveUp.gif | Bin 132 -> 0 bytes .../icons/externaltools/full/clcl16/properties.gif | Bin 116 -> 0 bytes .../icons/externaltools/full/clcl16/refresh.gif | Bin 182 -> 0 bytes .../externaltools/full/clcl16/removeAll_co.gif | Bin 117 -> 0 bytes .../icons/externaltools/full/clcl16/remove_co.gif | Bin 97 -> 0 bytes .../icons/externaltools/full/clcl16/run_tool.gif | Bin 128 -> 0 bytes .../icons/externaltools/full/clcl16/search.gif | Bin 153 -> 0 bytes .../externaltools/full/ctool16/external_tools.gif | Bin 240 -> 0 bytes .../externaltools/full/cview16/external_tools.gif | Bin 240 -> 0 bytes .../full/cview16/log_console_view.gif | Bin 250 -> 0 bytes .../icons/externaltools/full/dlcl16/copy_tool.gif | Bin 84 -> 0 bytes .../icons/externaltools/full/dlcl16/del_tool.gif | Bin 91 -> 0 bytes .../icons/externaltools/full/dlcl16/new_tool.gif | Bin 96 -> 0 bytes .../icons/externaltools/full/dlcl16/paste_tool.gif | Bin 100 -> 0 bytes .../icons/externaltools/full/dlcl16/prop_tool.gif | Bin 116 -> 0 bytes .../icons/externaltools/full/dlcl16/refresh.gif | Bin 104 -> 0 bytes .../externaltools/full/dlcl16/rename_tool.gif | Bin 90 -> 0 bytes .../icons/externaltools/full/dlcl16/run_tool.gif | Bin 79 -> 0 bytes .../externaltools/full/dlcl16/runwith_tool.gif | Bin 79 -> 0 bytes .../externaltools/full/dtool16/external_tools.gif | Bin 96 -> 0 bytes .../icons/externaltools/full/elcl16/copy_tool.gif | Bin 160 -> 0 bytes .../icons/externaltools/full/elcl16/del_tool.gif | Bin 110 -> 0 bytes .../icons/externaltools/full/elcl16/new_tool.gif | Bin 127 -> 0 bytes .../icons/externaltools/full/elcl16/paste_tool.gif | Bin 139 -> 0 bytes .../icons/externaltools/full/elcl16/prop_tool.gif | Bin 116 -> 0 bytes .../icons/externaltools/full/elcl16/refresh.gif | Bin 144 -> 0 bytes .../externaltools/full/elcl16/rename_tool.gif | Bin 158 -> 0 bytes .../icons/externaltools/full/elcl16/run_tool.gif | Bin 97 -> 0 bytes .../externaltools/full/elcl16/runwith_tool.gif | Bin 97 -> 0 bytes .../externaltools/full/etool16/external_tools.gif | Bin 175 -> 0 bytes .../externaltools/full/eview16/external_tools.gif | Bin 175 -> 0 bytes .../full/eview16/log_console_view.gif | Bin 250 -> 0 bytes .../icons/externaltools/full/obj16/builder.gif | Bin 157 -> 0 bytes .../icons/externaltools/full/obj16/classpath.gif | Bin 171 -> 0 bytes .../externaltools/full/obj16/external_tools.gif | Bin 240 -> 0 bytes .../icons/externaltools/full/obj16/file_obj.gif | Bin 152 -> 0 bytes .../full/obj16/invalid_build_tool.gif | Bin 159 -> 0 bytes .../icons/externaltools/full/obj16/jar_l_obj.gif | Bin 259 -> 0 bytes .../icons/externaltools/full/obj16/main_tab.gif | Bin 158 -> 0 bytes .../icons/externaltools/full/obj16/options_tab.gif | Bin 108 -> 0 bytes .../icons/externaltools/full/obj16/prop_ps.gif | Bin 116 -> 0 bytes .../externaltools/full/obj16/ttype_program.gif | Bin 240 -> 0 bytes .../icons/externaltools/full/obj16/type.gif | Bin 163 -> 0 bytes net.sourceforge.phpeclipse/icons/obj16/apache.gif | Bin 157 -> 0 bytes .../icons/obj16/apache_restart.gif | Bin 159 -> 0 bytes .../icons/obj16/apache_stop.gif | Bin 154 -> 0 bytes net.sourceforge.phpeclipse/icons/obj16/sql.gif | Bin 225 -> 0 bytes .../icons/obj16/xampp_start.gif | Bin 1755 -> 0 bytes .../icons/obj16/xampp_stop.gif | Bin 1713 -> 0 bytes net.sourceforge.phpeclipse/plugin.xml | 218 ++------------ .../phpdt/internal/ui/util/PHPFileUtil.java | 2 - .../phpdt/internal/ui/util/StringUtil.java | 34 -- .../phpeclipse/actions/ExternalPHPParser.java | 318 -------------------- .../phpeclipse/actions/PHPDocumentorAction.java | 104 ------- .../actions/PHPExternalParserAction.java | 89 ------ .../actions/PHPOpenSQLTableEditorAction.java | 316 ------------------- .../phpeclipse/actions/PHPRestartApacheAction.java | 29 -- .../phpeclipse/actions/PHPStartApacheAction.java | 94 ------ .../phpeclipse/actions/PHPStartMySQLAction.java | 29 -- .../phpeclipse/actions/PHPStartXAMPPAction.java | 90 ------ .../phpeclipse/actions/PHPStopApacheAction.java | 29 -- .../phpeclipse/actions/PHPStopXAMPPAction.java | 90 ------ .../phpeclipse/phpeditor/PHPParserAction.java | 126 -------- .../phpeditor/php/PHPCompletionProcessor.java | 150 +++++----- .../PHPEclipseParserPreferencePage.java | 109 ------- 73 files changed, 104 insertions(+), 1723 deletions(-) delete mode 100644 net.sourceforge.phpeclipse/icons/externaltools/full/clcl16/activate.gif delete mode 100644 net.sourceforge.phpeclipse/icons/externaltools/full/clcl16/add_co.gif delete mode 100644 net.sourceforge.phpeclipse/icons/externaltools/full/clcl16/deactivate.gif delete mode 100644 net.sourceforge.phpeclipse/icons/externaltools/full/clcl16/element.gif delete mode 100644 net.sourceforge.phpeclipse/icons/externaltools/full/clcl16/elements.gif delete mode 100644 net.sourceforge.phpeclipse/icons/externaltools/full/clcl16/error.gif delete mode 100644 net.sourceforge.phpeclipse/icons/externaltools/full/clcl16/gotoobj_tsk.gif delete mode 100644 net.sourceforge.phpeclipse/icons/externaltools/full/clcl16/moveDown.gif delete mode 100644 net.sourceforge.phpeclipse/icons/externaltools/full/clcl16/moveUp.gif delete mode 100644 net.sourceforge.phpeclipse/icons/externaltools/full/clcl16/properties.gif delete mode 100644 net.sourceforge.phpeclipse/icons/externaltools/full/clcl16/refresh.gif delete mode 100644 net.sourceforge.phpeclipse/icons/externaltools/full/clcl16/removeAll_co.gif delete mode 100644 net.sourceforge.phpeclipse/icons/externaltools/full/clcl16/remove_co.gif delete mode 100644 net.sourceforge.phpeclipse/icons/externaltools/full/clcl16/run_tool.gif delete mode 100644 net.sourceforge.phpeclipse/icons/externaltools/full/clcl16/search.gif delete mode 100644 net.sourceforge.phpeclipse/icons/externaltools/full/ctool16/external_tools.gif delete mode 100644 net.sourceforge.phpeclipse/icons/externaltools/full/cview16/external_tools.gif delete mode 100644 net.sourceforge.phpeclipse/icons/externaltools/full/cview16/log_console_view.gif delete mode 100644 net.sourceforge.phpeclipse/icons/externaltools/full/dlcl16/copy_tool.gif delete mode 100644 net.sourceforge.phpeclipse/icons/externaltools/full/dlcl16/del_tool.gif delete mode 100644 net.sourceforge.phpeclipse/icons/externaltools/full/dlcl16/new_tool.gif delete mode 100644 net.sourceforge.phpeclipse/icons/externaltools/full/dlcl16/paste_tool.gif delete mode 100644 net.sourceforge.phpeclipse/icons/externaltools/full/dlcl16/prop_tool.gif delete mode 100644 net.sourceforge.phpeclipse/icons/externaltools/full/dlcl16/refresh.gif delete mode 100644 net.sourceforge.phpeclipse/icons/externaltools/full/dlcl16/rename_tool.gif delete mode 100644 net.sourceforge.phpeclipse/icons/externaltools/full/dlcl16/run_tool.gif delete mode 100644 net.sourceforge.phpeclipse/icons/externaltools/full/dlcl16/runwith_tool.gif delete mode 100644 net.sourceforge.phpeclipse/icons/externaltools/full/dtool16/external_tools.gif delete mode 100644 net.sourceforge.phpeclipse/icons/externaltools/full/elcl16/copy_tool.gif delete mode 100644 net.sourceforge.phpeclipse/icons/externaltools/full/elcl16/del_tool.gif delete mode 100644 net.sourceforge.phpeclipse/icons/externaltools/full/elcl16/new_tool.gif delete mode 100644 net.sourceforge.phpeclipse/icons/externaltools/full/elcl16/paste_tool.gif delete mode 100644 net.sourceforge.phpeclipse/icons/externaltools/full/elcl16/prop_tool.gif delete mode 100644 net.sourceforge.phpeclipse/icons/externaltools/full/elcl16/refresh.gif delete mode 100644 net.sourceforge.phpeclipse/icons/externaltools/full/elcl16/rename_tool.gif delete mode 100644 net.sourceforge.phpeclipse/icons/externaltools/full/elcl16/run_tool.gif delete mode 100644 net.sourceforge.phpeclipse/icons/externaltools/full/elcl16/runwith_tool.gif delete mode 100644 net.sourceforge.phpeclipse/icons/externaltools/full/etool16/external_tools.gif delete mode 100644 net.sourceforge.phpeclipse/icons/externaltools/full/eview16/external_tools.gif delete mode 100644 net.sourceforge.phpeclipse/icons/externaltools/full/eview16/log_console_view.gif delete mode 100644 net.sourceforge.phpeclipse/icons/externaltools/full/obj16/builder.gif delete mode 100644 net.sourceforge.phpeclipse/icons/externaltools/full/obj16/classpath.gif delete mode 100644 net.sourceforge.phpeclipse/icons/externaltools/full/obj16/external_tools.gif delete mode 100644 net.sourceforge.phpeclipse/icons/externaltools/full/obj16/file_obj.gif delete mode 100644 net.sourceforge.phpeclipse/icons/externaltools/full/obj16/invalid_build_tool.gif delete mode 100644 net.sourceforge.phpeclipse/icons/externaltools/full/obj16/jar_l_obj.gif delete mode 100644 net.sourceforge.phpeclipse/icons/externaltools/full/obj16/main_tab.gif delete mode 100644 net.sourceforge.phpeclipse/icons/externaltools/full/obj16/options_tab.gif delete mode 100644 net.sourceforge.phpeclipse/icons/externaltools/full/obj16/prop_ps.gif delete mode 100644 net.sourceforge.phpeclipse/icons/externaltools/full/obj16/ttype_program.gif delete mode 100644 net.sourceforge.phpeclipse/icons/externaltools/full/obj16/type.gif delete mode 100644 net.sourceforge.phpeclipse/icons/obj16/apache.gif delete mode 100644 net.sourceforge.phpeclipse/icons/obj16/apache_restart.gif delete mode 100644 net.sourceforge.phpeclipse/icons/obj16/apache_stop.gif delete mode 100644 net.sourceforge.phpeclipse/icons/obj16/sql.gif delete mode 100644 net.sourceforge.phpeclipse/icons/obj16/xampp_start.gif delete mode 100644 net.sourceforge.phpeclipse/icons/obj16/xampp_stop.gif delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/util/StringUtil.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/ExternalPHPParser.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPDocumentorAction.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPExternalParserAction.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPOpenSQLTableEditorAction.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPRestartApacheAction.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPStartApacheAction.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPStartMySQLAction.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPStartXAMPPAction.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPStopApacheAction.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPStopXAMPPAction.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPParserAction.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/preferences/PHPEclipseParserPreferencePage.java diff --git a/net.sourceforge.phpeclipse/icons/externaltools/full/clcl16/activate.gif b/net.sourceforge.phpeclipse/icons/externaltools/full/clcl16/activate.gif deleted file mode 100644 index 7a1511dd8e0da3fca9c8daf75e6334e6284f8c80..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 138 zcmZ?wbhEHb6krfw*v!E2|G#~Gz5W0H_5c6R|9{{9{(SrTcpw)97_b4wpDc_F3>*wP zAW4uJ3@qjXCp}m1wa6AR0ha6X$UPxIA4GB8dJ_OU>C!b3 diff --git a/net.sourceforge.phpeclipse/icons/externaltools/full/clcl16/deactivate.gif b/net.sourceforge.phpeclipse/icons/externaltools/full/clcl16/deactivate.gif deleted file mode 100644 index 740419b4a18ab0cf162c701caf8635acfdf36a49..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 108 zcmZ?wbhEHb6krfwSj52a|G#~Gz5W0H^Z(zszdzr;J|4&h0mYvzj0_Cy3_1)z08-1q zY*?}D&Od`w3Xu!GvNSIj43`i&t2So^!vt@~6$cc~=XjrRS$F+gz#oTsz7juEqmDl@ IWMr@g0CDgwHUIzs diff --git a/net.sourceforge.phpeclipse/icons/externaltools/full/clcl16/element.gif b/net.sourceforge.phpeclipse/icons/externaltools/full/clcl16/element.gif deleted file mode 100644 index 06d007905b264182beffbb389d5b836f58f0a74d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 140 zcmZ?wbhEHb6krfw*!-X2z<~qy_VEiAEU}NTx38aXKYzdd{{8j)_us$2|NsC0`}gl> zKn03FSr|bgIv@gMh69VGzzNT6-=kBUJUp&V=}GpOxO8P3XOhgV1r1?~cVG diff --git a/net.sourceforge.phpeclipse/icons/externaltools/full/clcl16/elements.gif b/net.sourceforge.phpeclipse/icons/externaltools/full/clcl16/elements.gif deleted file mode 100644 index 76b351e0452b676339ec1f56e7d3b27e1ceb0129..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 232 zcmZ?wbhEHb6krfwIKlt~4fgi??d{|3h=(hvE?DY; zrO+Dl1V-1T%&K2D-)-?qI$*Y7n%`s=Msp_xpFN$84tlc}i8{9@J46e;ZC0GK^0uZR GgEaspw>pUc diff --git a/net.sourceforge.phpeclipse/icons/externaltools/full/clcl16/gotoobj_tsk.gif b/net.sourceforge.phpeclipse/icons/externaltools/full/clcl16/gotoobj_tsk.gif deleted file mode 100644 index 082e49fbe666f9bb0fed3b66dbe70d17c1e805be..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 167 zcmZ?wbhEHb6krfw*v!DNV8N3A|LyDR?f?I;|Nnpf|NHj$=iArE1G)bX95^t4{(J@o z1|S diff --git a/net.sourceforge.phpeclipse/icons/externaltools/full/clcl16/moveUp.gif b/net.sourceforge.phpeclipse/icons/externaltools/full/clcl16/moveUp.gif deleted file mode 100644 index 9b278e6fa81e0c65af60510fdcd9e6212432c53b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 132 zcmZ?wbhEHb6krfw*v!E2|G#~Gz5W0H_5c6R|9{{9{(SrTcpw)97_b4wpDc_F3>*wP zAW4uJ3@nBMCp}m1oiQuM`KFAJ%%S7G%nmceX9;P0u$CAcaqGKTcw+O+`8nmx??R4w N=SgN+2?{b;0|4zHEKL9a diff --git a/net.sourceforge.phpeclipse/icons/externaltools/full/clcl16/properties.gif b/net.sourceforge.phpeclipse/icons/externaltools/full/clcl16/properties.gif deleted file mode 100644 index ec0cba1aad910c9e7c40b3fde1fab65e8078cd53..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 116 zcmZ?wbhEHb6krfwSj52a|NsB}`}a3AG{ncp1KA8Pp!k!8k%57QK?fuNQp><>>9On1 zKi?kD*CJUhy4$`xr}YN2%{jPomEywM57+pzc5RB3IsdhHx0M9{Q|q%$^A!&~%l7mT Lx4%E%zCPam|NsB{ zfkN}=0~ripp!k!8k%57iK?lSGnZdx4yy2uL^Ir3ap5|M3p71&;7@R&L;67QxL54l! zu*}gfQtm|zTcZ0WIjBgri1Vs5s`jxmIW;RhF|qP|cz{DfsHKg4$1sH2{nEMt%SQ diff --git a/net.sourceforge.phpeclipse/icons/externaltools/full/clcl16/removeAll_co.gif b/net.sourceforge.phpeclipse/icons/externaltools/full/clcl16/removeAll_co.gif deleted file mode 100644 index 2c069ab3f436fd881cf865d804334c046b01ea8c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 117 zcmZ?wbhEHb6krfwSj50!Zy#?TUvD{UZ}qOdQL$0~|NmzI1I3>#j0_B{3_2hlNG$`i zRm844{|vl5oAyrMVzBG`0X3dvPo~CYEKaX?9T3oBNw{yWxFGA`zV$cO1RQ=?a#+;h QhK5w`-p&#!PX-2S0EeR~4gdfE diff --git a/net.sourceforge.phpeclipse/icons/externaltools/full/clcl16/remove_co.gif b/net.sourceforge.phpeclipse/icons/externaltools/full/clcl16/remove_co.gif deleted file mode 100644 index 12a9167c59da498127a6cf382a9b95d4db744c2e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 97 zcmZ?wbhEHb6krfwSj50!Zy#?TUvD{UZ}qOdQL$0~|NmzI1I3>#j0_B{3_2hlNG$`i vTEwn9{|rufYO5$_`$kD5NHEPanDN5XsPVzR_qzlfa&OOF`o1P!g~1vCV?ZBe diff --git a/net.sourceforge.phpeclipse/icons/externaltools/full/clcl16/run_tool.gif b/net.sourceforge.phpeclipse/icons/externaltools/full/clcl16/run_tool.gif deleted file mode 100644 index 2088548a49976e78327ba108045cd744910b045f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 128 zcmZ?wbhEHb6krfw*v!CSZy!4ifB2K)W?_Va-}`vZ3l?BBot|Ns9C*nr|s7DfgJ z4h9{NB*+W~7F~gpo~!p-yzXr=h%x72St07|HA{Tfs?^`-jwbG0AHcF{SGtC*KeGUj L^9dCrCI)K&>p~+|9^k@e}De}|Nj{n z7$78&0R)OaSr{1@co=j*9FQ3dEN&A{damA^lVE-1*5w8bIgLq&%a<;mki^`mv+k5& ym(guegCkZ<{Y4fmNn1}Z3^4fDHtFdK&IY3;R;xA{I4KCVz4c&co2f3yU=09-x;`ra diff --git a/net.sourceforge.phpeclipse/icons/externaltools/full/ctool16/external_tools.gif b/net.sourceforge.phpeclipse/icons/externaltools/full/ctool16/external_tools.gif deleted file mode 100644 index 2133b4582a8da9cab60d1c0acce1d6c3c4034fa7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 240 zcmZ?wbhEHb6krfwIP#z2zkU4w`TGwXIKaTrU~eBEA74Lz{(k%V{R|Ba2ksnbXkfU1 zfB%1=90S9Bd;9(N_V?rC@7LGw-@kwU{P_()X+l8pCkrD30~3P|NFm5h2G-mK3VJG< z^HvxLvOe^Cxih5O=lI3N@2jVnF*-0aB$!BW9(_=-%0#Oz{cwOMkJi-7&59`%!U?Am z7U&wuq;rZ@OF2k=_>p38JVNrZ0A`Q#K`;)5rHHup` JOF0x7tO1FyP*MN@ diff --git a/net.sourceforge.phpeclipse/icons/externaltools/full/cview16/external_tools.gif b/net.sourceforge.phpeclipse/icons/externaltools/full/cview16/external_tools.gif deleted file mode 100644 index 2133b4582a8da9cab60d1c0acce1d6c3c4034fa7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 240 zcmZ?wbhEHb6krfwIP#z2zkU4w`TGwXIKaTrU~eBEA74Lz{(k%V{R|Ba2ksnbXkfU1 zfB%1=90S9Bd;9(N_V?rC@7LGw-@kwU{P_()X+l8pCkrD30~3P|NFm5h2G-mK3VJG< z^HvxLvOe^Cxih5O=lI3N@2jVnF*-0aB$!BW9(_=-%0#Oz{cwOMkJi-7&59`%!U?Am z7U&wuq;rZ@OF2k=_>p38JVNrZ0A`Q#K`;)5rHHup` JOF0x7tO1FyP*MN@ diff --git a/net.sourceforge.phpeclipse/icons/externaltools/full/cview16/log_console_view.gif b/net.sourceforge.phpeclipse/icons/externaltools/full/cview16/log_console_view.gif deleted file mode 100644 index 3200ac39357b3c3b094dfdfc6c3c63a4d61b4f90..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 250 zcmZ?wbhEHb6krfwIP#z2zkU4w`TGwXIACudA0J;ofByaj3zqEPKmY#y{r~UV|7T!m zU|_g!Z@=H({(gM?{rdX<|NjFO?+2=wKfj@&0jP%oFHro+!pOkD#GnIG1+tTYwR}NA zPfBK&fJx*LgNWc+avDjlMJb9#wKlyA0$$AM6k|NV#1Nn(($o4eVWrrrY1yT>0vL3- zyi$FZ{gCo)U8H2VgLhKb`Hd^|wb<4iRd7G4P$9+{T4Pt=P#Mu$XOxp)P|MyfQWcuk WQ(q`16s$H+g=yiU#Y>nJ8LR@|~0e|P@db;^Q^!5RQVyB-k$ diff --git a/net.sourceforge.phpeclipse/icons/externaltools/full/dlcl16/del_tool.gif b/net.sourceforge.phpeclipse/icons/externaltools/full/dlcl16/del_tool.gif deleted file mode 100644 index a6bfcfd98d7d8a3b592fac81eb992431979de093..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 91 zcmZ?wbhEHb6krfwn8?7efB*jZ^XLEn|DS<@LGdRGBLf2ygAR}llobH7b*A*MJiS+- up)tr&FhAsBOI|}q1gH4)Ibu6?AAPBEUwP`8`qg`qM<2iE;NoXxum%7>t{^o4 diff --git a/net.sourceforge.phpeclipse/icons/externaltools/full/dlcl16/new_tool.gif b/net.sourceforge.phpeclipse/icons/externaltools/full/dlcl16/new_tool.gif deleted file mode 100644 index 813cb2f7bfab10d0dedda811ca5fbdbd85eae111..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 96 zcmZ?wbhEHb6krfwn8?7efB*jZ^XLEn|DS<@LGdRGBLf2ygAR}llobH74X5<4-2Lz+ y6O&PcbF1mQOS@{NOq3RUFKOBlHhp5Q`;w*Sh4%NHGJ7Jo%dm)N@`eteR%-wY%_9W> diff --git a/net.sourceforge.phpeclipse/icons/externaltools/full/dlcl16/paste_tool.gif b/net.sourceforge.phpeclipse/icons/externaltools/full/dlcl16/paste_tool.gif deleted file mode 100644 index 0dd5d216d9bd3351a5646a9b58a388740cd88b6d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 100 zcmZ?wbhEHb6krfwn8?7efB*jZ^XLEn|DS<@LGdRGBLf2ygAR}llobH7O{ee*7To1r z;JoVA)uxDz*|ixbk2bVf=FTi$xI${yd-vwgDVw8N?_0^-(yZD)H6i8T(iU+?Mh0sD Dl*%OH diff --git a/net.sourceforge.phpeclipse/icons/externaltools/full/dlcl16/prop_tool.gif b/net.sourceforge.phpeclipse/icons/externaltools/full/dlcl16/prop_tool.gif deleted file mode 100644 index eb165ffcadbcfc1e5bb2f8a762fd289b1d25171c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 116 zcmZ?wbhEHb6krfwSj52a|NsB}`}fbEKfj@&0mx>60mYvzj0_Ac3_2hIkXi<2OOIW5 z{`vNJz81-9(cSjlIjuLCZO*}!s}vX3ez?Y$wQEzP%=xdqyR9VnpIV=7ny+}^S+=K# LC=bgd1_o;YZ(%Du diff --git a/net.sourceforge.phpeclipse/icons/externaltools/full/dlcl16/refresh.gif b/net.sourceforge.phpeclipse/icons/externaltools/full/dlcl16/refresh.gif deleted file mode 100644 index b2281b40cc6021d69a9c5d0e0d4097e9e3f67463..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 104 zcmZ?wbhEHb6krfwn8?7efB*jZ^XLEn|DS<@LGdRGBLf2ygAR}llobH7EvNK1?p}E2 zO7n9|cD{n7R}*q)CKfKZQF7>7V#-p6+p62A8hX#%((&f&p~kSoQ@lAs0`umnrq65; IV_>ib0D3tm>i_@% diff --git a/net.sourceforge.phpeclipse/icons/externaltools/full/dlcl16/rename_tool.gif b/net.sourceforge.phpeclipse/icons/externaltools/full/dlcl16/rename_tool.gif deleted file mode 100644 index 99f30921c7b4caa70fbcaade63894ec27dab0180..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 90 zcmZ?wbhEHb6krfwn8?7efB*jZ^XLEn|DS<@LGdRGBLf2ygAR}llobH7wWsv26l2^Q t(vf|tZL^qJ>9N+!Cn8nUnl8-jTJmbz!Y5O2@w&>he(IV0S(l5!8UQXsAh-Yk diff --git a/net.sourceforge.phpeclipse/icons/externaltools/full/dlcl16/run_tool.gif b/net.sourceforge.phpeclipse/icons/externaltools/full/dlcl16/run_tool.gif deleted file mode 100644 index a281bc1196dad271034a1edd6e612ad8c285529f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 79 zcmZ?wbhEHb6krfwn8?7efB*jZ^XLEn|DS<@LGdRGBLf2ygAR}llobH76{hsBJpESR hiNWC5&qEWZWFFCtZW<877+$15bKHRsJe!IHP^*q2Lty595|aNKb4ky6SP(O_V(1^^CxA@TqK diff --git a/net.sourceforge.phpeclipse/icons/externaltools/full/elcl16/copy_tool.gif b/net.sourceforge.phpeclipse/icons/externaltools/full/elcl16/copy_tool.gif deleted file mode 100644 index 41bf445a98ef6895216de294eb9c0b2976d03aca..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 160 zcmZ?wbhEHb6krfw*v!Ci|Nj2}|NkF2aA5!b{qyI~Z)j+!udk1fj|U1eU;~OjSr{1@ zI2d$5k{~k}SbPOedal;75V!XJAzxU~!JZ}gRPso|yvM9;@1Gydp3VQ|;q=W?90s?Z ta;#+#teC~y%{WcF%SSK!(D~2x^*_gxkSYXFH$F600J diff --git a/net.sourceforge.phpeclipse/icons/externaltools/full/elcl16/paste_tool.gif b/net.sourceforge.phpeclipse/icons/externaltools/full/elcl16/paste_tool.gif deleted file mode 100644 index 6e761529a97bf000e7689556be0c9a171475f6ed..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 139 zcmZ?wbhEHb6krfwSj52a|Ns932M+AtzkmMx`3(&X_4W1f@$o=G#h)yU3=HfHIt)Mn zQp>;`P_Zh-P5YSGp~+c0&YtaP6XkiLAeC^Tq-APYL66=-pF8Kcg&p|sY?;9oAi-eP rb?e;o*_zsWoG!i)`84DBlBpJF<>ooR@!2dX!1Ce?&*oP$LJZabhN3!0 diff --git a/net.sourceforge.phpeclipse/icons/externaltools/full/elcl16/prop_tool.gif b/net.sourceforge.phpeclipse/icons/externaltools/full/elcl16/prop_tool.gif deleted file mode 100644 index eb165ffcadbcfc1e5bb2f8a762fd289b1d25171c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 116 zcmZ?wbhEHb6krfwSj52a|NsB}`}fbEKfj@&0mx>60mYvzj0_Ac3_2hIkXi<2OOIW5 z{`vNJz81-9(cSjlIjuLCZO*}!s}vX3ez?Y$wQEzP%=xdqyR9VnpIV=7ny+}^S+=K# LC=bgd1_o;YZ(%Du diff --git a/net.sourceforge.phpeclipse/icons/externaltools/full/elcl16/refresh.gif b/net.sourceforge.phpeclipse/icons/externaltools/full/elcl16/refresh.gif deleted file mode 100644 index 919423d435727bf8525c777e1957a3606e413047..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 144 zcmZ?wbhEHb6krfwSj51vV8N3A|NrmbzkmMx`3(&X_4W1f@$o;`TCpqU&w2|E?-?aG4NgfMQsOz1$l*AvN>NfP-9h5WSHbs1QpXc+Sg;;DAkC=4 waKUj=FbBunhQtkfZ05p=4}w|!EUhi`1Wy{CNgTm}Yf0Og}O-v9sr diff --git a/net.sourceforge.phpeclipse/icons/externaltools/full/elcl16/rename_tool.gif b/net.sourceforge.phpeclipse/icons/externaltools/full/elcl16/rename_tool.gif deleted file mode 100644 index 8337ba9a731362b92b8ccac296ec2c85c2d468a7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 158 zcmZ?wbhEHb6krfw*v!CSZy$gE{{H{}{~tJTVE_L8^XJd6udk1fk7ryIiJ=fx#L8)r>i& diff --git a/net.sourceforge.phpeclipse/icons/externaltools/full/elcl16/run_tool.gif b/net.sourceforge.phpeclipse/icons/externaltools/full/elcl16/run_tool.gif deleted file mode 100644 index 053738cf6b36cd3a7d303776923fd5ddf758b13d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 97 zcmZ?wbhEHb6krfwSj50!Zy&#Z|Ni;&=QlJo#K*_~|Nox>3>1H|FfuT(GU$MKAhit4 vY7x8c{4+Qe$-%jW%V>j&(}_xciLThnb<>mQO3>1H|FfuT(GU$MKAhit4 vY7x8c{4+Qe$-%jW%V>j&(}_xciLThnb<>mQOOK5TI_DE2Ma=ECUjj)SgEvXT6U>ap@B}{ z@f4rBA4(Q zvM@3*a53nB#6V^+uy_TW^nC4N5#81G^M;yYn}LL<)}(lCttFNMj0`MX2ez^?)>z$L tYBJ+5&%xN!>}Lx3E;KJHD~=0Vb=}S5XlIN2!!V(`#@X?n;ew0|)&Q<|Hv<3w diff --git a/net.sourceforge.phpeclipse/icons/externaltools/full/obj16/classpath.gif b/net.sourceforge.phpeclipse/icons/externaltools/full/obj16/classpath.gif deleted file mode 100644 index f966fc39d9b2531c732fd3025c47fe6a9e5f37d0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 171 zcmZ?wbhEHb6krfw*vtR~4fgT#?d#|7-(P?K{{H{>jke}4S^`S$zk?d#+1 z=f~T}+uQ&D{~xGY@h1x-0|Os}4oEA=3p38JVNrZ0A`Q#K`;)5rHHup` JOF0x7tO1FyP*MN@ diff --git a/net.sourceforge.phpeclipse/icons/externaltools/full/obj16/file_obj.gif b/net.sourceforge.phpeclipse/icons/externaltools/full/obj16/file_obj.gif deleted file mode 100644 index 6b86d079780c2b7ec903f8d74607748e933632a1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 152 zcmZ?wbhEHb6krfw*v!Dd(9jS+fByXa`|sc1|Ns8{|Ns9VIB=i=C>S3PWCP{VfZ|UU zMg|5>1|5(%$P5M+SA&zD+O`(S+WeXd6$*C*+vFl=ItXwa?N~9nvW@w!=-S_6JFoIC o_uf#m|3NB8(6tJW8O6uvNX2S00V0|RR910 diff --git a/net.sourceforge.phpeclipse/icons/externaltools/full/obj16/invalid_build_tool.gif b/net.sourceforge.phpeclipse/icons/externaltools/full/obj16/invalid_build_tool.gif deleted file mode 100644 index b04020bc723a345d97f68c485286138159294b51..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 159 zcmZ?wbhEHb6krfw*v!E2zux{wgvI}O`yUn-_wDWX+uP5uu&B4U|G$6#{QCO;V8DO` z6o0ZXGB9v6=zzpPW-ze$6rA*2z1QM-NY$mI3PP=oty~H$UYV-Q4I0f&6XZpi*4R!^ xyPL3d!C$U+FAW1@CT-3`IR?znG}u@ZyB#DZi90XElaV`uD)&M;ZHrxOJ diff --git a/net.sourceforge.phpeclipse/icons/externaltools/full/obj16/jar_l_obj.gif b/net.sourceforge.phpeclipse/icons/externaltools/full/obj16/jar_l_obj.gif deleted file mode 100644 index 11e04e21bc641147f8e76fd857cbd3c4ead74c16..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 259 zcmZ?wbhEHb6krfwIKlt~4fgT#?d$h1IPqcr{QCX-=ij)o}hrA8%i8Zy#@O|NsC0{Xh-#=QlJo#K*@2xghgUf#OdVMg|5+ z1|5(v$W8{mSkfQbZOa`yV6}_pWKYj0t?F@TGJbgR&J4qJjs~q zb@kz-D=wWvnKoiQqGeKrK0D%$IO(X)X1>e%C{d>PY?Foa+>O)KE8~jzYjevRV&jY1 r#aY?ex#}BBs=39)#l%D>bxQIVONvQoI&m{_^SAIM*sZlwWUvMR&n91; diff --git a/net.sourceforge.phpeclipse/icons/externaltools/full/obj16/main_tab.gif b/net.sourceforge.phpeclipse/icons/externaltools/full/obj16/main_tab.gif deleted file mode 100644 index f9fb6b0cabf363fe7a2db9c4986a151e85e5a297..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 158 zcmZ?wbhEHb6krfw*vtR~4fgi&_VN4e%wS;g{&3QB^=^FA!;RnB(@#GnRXe|KT$w zXDxy^zp0u3K&!_fO<#sYK GSOWkQuSGEc diff --git a/net.sourceforge.phpeclipse/icons/externaltools/full/obj16/options_tab.gif b/net.sourceforge.phpeclipse/icons/externaltools/full/obj16/options_tab.gif deleted file mode 100644 index 8670a384bd36f59f518211ebd6c6bdb1d4e69e7a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 108 zcmZ?wbhEHb6krfwSj51vfB*jZ^XJFM$1^Z6{Qv(SNJ4<(PZmZ71{MY#5ErDDf!WYw z*PVX`n+$Go^gXJay+YQNrzteZ;d`&Mx7MspM*6Fo-bpp7Zr9z|*70q!ME{8=%8U%w E0J$b3w*UYD diff --git a/net.sourceforge.phpeclipse/icons/externaltools/full/obj16/prop_ps.gif b/net.sourceforge.phpeclipse/icons/externaltools/full/obj16/prop_ps.gif deleted file mode 100644 index ec0cba1aad910c9e7c40b3fde1fab65e8078cd53..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 116 zcmZ?wbhEHb6krfwSj52a|NsB}`}a3AG{ncp1KA8Pp!k!8k%57QK?fuNQp><>>9On1 zKi?kD*CJUhy4$`xr}YN2%{jPomEywM57+pzc5RB3IsdhHx0M9{Q|q%$^A!&~%l7mT Lp38JVNrZ0A`Q#K`;)5rHHup` JOF0x7tO1FyP*MN@ diff --git a/net.sourceforge.phpeclipse/icons/externaltools/full/obj16/type.gif b/net.sourceforge.phpeclipse/icons/externaltools/full/obj16/type.gif deleted file mode 100644 index 2db76045e86fc1fc21ca61494fd9268e57ca7244..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 163 zcmZ?wbhEHb6krfw*!-X2z<~qy^Xu*FhORpel2U#ho+$=$UM2?{p+cUonWE;#?u+kCI#hILfS;Z$Mf dSg+oYr=ry>jcR2dPM6l3WZO`3ONf!d8UUDxM412p diff --git a/net.sourceforge.phpeclipse/icons/obj16/apache_restart.gif b/net.sourceforge.phpeclipse/icons/obj16/apache_restart.gif deleted file mode 100644 index 55d97b333049ba1852050d0ea379ea8772a124a7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 159 zcmZ?wbhEHb6krfwc+3C+4Gjz+_@4oY{x>u<{0CA%j14IMWMO1r;AhYQNrKE^VDb4N z^KsSQFs`O*QHAG;ECC(Kt|A9J`%=9nOzy6ANKmlhztbw4f8lp*n(dK>7l+?)Tu{B7 gQR%jnBkQQwfwZ|NQ#UGy^w~a5<2sNQt;Apr0C8?I^Z)<= diff --git a/net.sourceforge.phpeclipse/icons/obj16/apache_stop.gif b/net.sourceforge.phpeclipse/icons/obj16/apache_stop.gif deleted file mode 100644 index 1649c3d74f2b58102a398c0bb5ee0cd0e225dfe4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 154 zcmZ?wbhEHb6krfwc+AcK1`Q1i4gVP!{xke*wPAdMh17+Bmd zNHnh68`jlWEvoQ5k=dam*;L?QXJ4wdh{@fx4goSY{C8Sn*MHxArtQQc*9r-XPKjm3 b40}E1@6#w+5tGLsn{Cv}Fyrhr4hCxg_(Dbr diff --git a/net.sourceforge.phpeclipse/icons/obj16/sql.gif b/net.sourceforge.phpeclipse/icons/obj16/sql.gif deleted file mode 100644 index c17116d767e0874e154b918fdcde8cc23c7794a5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 225 zcmV<703QEGNk%w1VGsZi0J9GO`~CZmyKhF6Qa^}F$=u3#scf3VnJj%jezS#6oLYa( zBV?&>UzcGxi9>F*E&u=jA^8LW000jFEC2ui01yBW000Dz@X1Ll1rLeVMlugJ0ZXGO zfngxYfQY1koM>Pd^3)W8FbodcO(4+(aEAkBdp`qO3i zr`zGrB%eRCBmXQ;|GT>M@0RAjdnW!pI{)9lDjK>BAM+OdAjhGVxiVTf>j3zTY3X@zq1hu2~>^R`)!XT_>_v44df@U^( zeUBeE7Ni`XCU2jXq4~j)nS(n?>CJ|Nji)E`8kKZJE@Wn#r7xQy@oQrS>k>1?f(x7t zhkd38u2g#SQ#jRyS1jV+pAJPQW-b*&t1B - + + @@ -241,17 +242,7 @@ id="net.sourceforge.phpeclipse.PHPPerspective"> - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + --> @@ -1458,97 +1295,97 @@ - + --> + + - - - @@ -1872,6 +1709,7 @@ expanderClass="net.sourceforge.phpdt.externaltools.variable.WorkingSetExpander"> + ", indx)) != -1) { - // newer php error output (tested with 4.2.3) - scanLine(output, file, indx, brIndx); - indx = brIndx + 6; - flag = false; - } - if (flag) { - while ((brIndx = output.indexOf("
", indx)) != -1) { - // older php error output (tested with 4.2.3) - scanLine(output, file, indx, brIndx); - indx = brIndx + 4; - } - } - } - - private void scanLine(final String output, final IFile file, final int indx, final int brIndx) throws CoreException { - String current; - // String outLineNumberString; never used - final StringBuffer lineNumberBuffer = new StringBuffer(10); - char ch; - current = output.substring(indx, brIndx); - - if (current.indexOf(PARSE_WARNING_STRING) != -1 || current.indexOf(PARSE_ERROR_STRING) != -1) { - final int onLine = current.indexOf("on line "); - if (onLine != -1) { - lineNumberBuffer.delete(0, lineNumberBuffer.length()); - for (int i = onLine; i < current.length(); i++) { - ch = current.charAt(i); - if ('0' <= ch && '9' >= ch) { - lineNumberBuffer.append(ch); - } - } - - final int lineNumber = Integer.parseInt(lineNumberBuffer.toString()); - - final Hashtable attributes = new Hashtable(); - - current = StringUtil.replaceAll(current, "\n", ""); - current = StringUtil.replaceAll(current, "", ""); - current = StringUtil.replaceAll(current, "", ""); - MarkerUtilities.setMessage(attributes, current); - - if (current.indexOf(PARSE_ERROR_STRING) != -1) - attributes.put(IMarker.SEVERITY, new Integer(IMarker.SEVERITY_ERROR)); - else if (current.indexOf(PARSE_WARNING_STRING) != -1) - attributes.put(IMarker.SEVERITY, new Integer(IMarker.SEVERITY_WARNING)); - else - attributes.put(IMarker.SEVERITY, new Integer(IMarker.SEVERITY_INFO)); - MarkerUtilities.setLineNumber(attributes, lineNumber); - MarkerUtilities.createMarker(file, attributes, PROBLEM_ID); - } - } - } - - /** - * This will set a marker. - * - * @param file - * the file that generated the marker - * @param message - * the message - * @param charStart - * the starting character - * @param charEnd - * the end character - * @param errorLevel - * the error level ({@link ExternalPHPParser#ERROR},{@link ExternalPHPParser#INFO},{@link ExternalPHPParser#WARNING}), - * {@link ExternalPHPParser#TASK}) - * @throws CoreException - * an exception throwed by the MarkerUtilities - */ - private void setMarker(final IFile file, final String message, final int charStart, final int charEnd, final int errorLevel) - throws CoreException { - if (file != null) { - final Hashtable attributes = new Hashtable(); - MarkerUtilities.setMessage(attributes, message); - switch (errorLevel) { - case ERROR: - attributes.put(IMarker.SEVERITY, new Integer(IMarker.SEVERITY_ERROR)); - break; - case WARNING: - attributes.put(IMarker.SEVERITY, new Integer(IMarker.SEVERITY_WARNING)); - break; - case INFO: - attributes.put(IMarker.SEVERITY, new Integer(IMarker.SEVERITY_INFO)); - break; - case TASK: - attributes.put(IMarker.SEVERITY, new Integer(IMarker.TASK)); - break; - } - MarkerUtilities.setCharStart(attributes, charStart); - MarkerUtilities.setCharEnd(attributes, charEnd); - MarkerUtilities.createMarker(file, attributes, PROBLEM_ID); - } - } - - /** - * This will set a marker. - * - * @param file - * the file that generated the marker - * @param message - * the message - * @param line - * the line number - * @param errorLevel - * the error level ({@link ExternalPHPParser#ERROR},{@link ExternalPHPParser#INFO},{@link ExternalPHPParser#WARNING}) - * @throws CoreException - * an exception throwed by the MarkerUtilities - */ - private void setMarker(final IFile file, final String message, final int line, final int errorLevel, final String location) - throws CoreException { - if (file != null) { - String markerKind = PROBLEM_ID; - final Hashtable attributes = new Hashtable(); - MarkerUtilities.setMessage(attributes, message); - switch (errorLevel) { - case ERROR: - attributes.put(IMarker.SEVERITY, new Integer(IMarker.SEVERITY_ERROR)); - break; - case WARNING: - attributes.put(IMarker.SEVERITY, new Integer(IMarker.SEVERITY_WARNING)); - break; - case INFO: - attributes.put(IMarker.SEVERITY, new Integer(IMarker.SEVERITY_INFO)); - break; - case TASK: - attributes.put(IMarker.SEVERITY, new Integer(IMarker.SEVERITY_INFO)); - markerKind = IMarker.TASK; - break; - } - attributes.put(IMarker.LOCATION, location); - MarkerUtilities.setLineNumber(attributes, line); - MarkerUtilities.createMarker(file, attributes, markerKind); - } - } - - /** - * This will set a marker. - * - * @param message - * the message - * @param charStart - * the starting character - * @param charEnd - * the end character - * @param errorLevel - * the error level ({@link ExternalPHPParser#ERROR},{@link ExternalPHPParser#INFO},{@link ExternalPHPParser#WARNING}) - * @throws CoreException - * an exception throwed by the MarkerUtilities - */ - private void setMarker(final String message, final int charStart, final int charEnd, final int errorLevel, final String location) - throws CoreException { - if (fFileToParse != null) { - setMarker(fFileToParse, message, charStart, charEnd, errorLevel, location); - } - } - - /** - * This will set a marker. - * - * @param file - * the file that generated the marker - * @param message - * the message - * @param charStart - * the starting character - * @param charEnd - * the end character - * @param errorLevel - * the error level ({@link ExternalPHPParser#ERROR},{@link ExternalPHPParser#INFO},{@link ExternalPHPParser#WARNING}) - * @param location - * the location of the error - * @throws CoreException - * an exception throwed by the MarkerUtilities - */ - private void setMarker(final IFile file, final String message, final int charStart, final int charEnd, final int errorLevel, - final String location) throws CoreException { - if (file != null) { - final Hashtable attributes = new Hashtable(); - MarkerUtilities.setMessage(attributes, message); - switch (errorLevel) { - case ERROR: - attributes.put(IMarker.SEVERITY, new Integer(IMarker.SEVERITY_ERROR)); - break; - case WARNING: - attributes.put(IMarker.SEVERITY, new Integer(IMarker.SEVERITY_WARNING)); - break; - case INFO: - attributes.put(IMarker.SEVERITY, new Integer(IMarker.SEVERITY_INFO)); - break; - case TASK: - attributes.put(IMarker.SEVERITY, new Integer(IMarker.TASK)); - break; - } - attributes.put(IMarker.LOCATION, location); - MarkerUtilities.setCharStart(attributes, charStart); - MarkerUtilities.setCharEnd(attributes, charEnd); - MarkerUtilities.createMarker(file, attributes, PROBLEM_ID); //IMarker.PROBLEM); - } - } - - private String getParserOutput(String command, String consoleMessage) { - try { - PHPConsole console = new PHPConsole(); - try { - console.println(consoleMessage + command); - } catch (Throwable th) { - - } - - Runtime runtime = Runtime.getRuntime(); - - // runs the command - Process p = runtime.exec(command); - - // gets the input stream to have the post-compile-time information - InputStream stream = p.getInputStream(); - - // get the string from Stream - String consoleOutput = PHPConsole.getStringFromStream(stream); - - // prints out the information - if (console != null) { - console.print(consoleOutput); - } - return consoleOutput; - - } catch (IOException e) { - MessageDialog.openInformation(null, "IOException: ", e.getMessage()); - } - return ""; - } -} \ No newline at end of file diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPDocumentorAction.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPDocumentorAction.java deleted file mode 100644 index 420c23a..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPDocumentorAction.java +++ /dev/null @@ -1,104 +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 - www.phpeclipse.de -**********************************************************************/ -package net.sourceforge.phpeclipse.actions; - -import java.util.Iterator; - -import net.sourceforge.phpdt.externaltools.launchConfigurations.ExternalToolsUtil; -import net.sourceforge.phpeclipse.PHPeclipsePlugin; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionProvider; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.ui.IActionDelegate; -import org.eclipse.ui.IObjectActionDelegate; -import org.eclipse.ui.IWorkbenchPart; - -public class PHPDocumentorAction implements IObjectActionDelegate { - - private IWorkbenchPart workbenchPart; - /** - * Constructor for Action1. - */ - public PHPDocumentorAction() { - super(); - } - - /** - * @see IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart) - */ - public void setActivePart(IAction action, IWorkbenchPart targetPart) { - workbenchPart = targetPart; - } - - // public static void open(final URL url, final Shell shell, final String dialogTitle) { - // IHelp help= WorkbenchHelp.getHelpSupport(); - // if (help != null) { - // WorkbenchHelp.getHelpSupport().displayHelpResource(url.toExternalForm()); - // } else { - // showMessage(shell, dialogTitle, ActionMessages.getString("OpenBrowserUtil.help_not_available"), false); //$NON-NLS-1$ - // } - // } - - public void run(IAction action) { - ISelectionProvider selectionProvider = null; - selectionProvider = workbenchPart.getSite().getSelectionProvider(); - - StructuredSelection selection = null; - selection = (StructuredSelection) selectionProvider.getSelection(); - - final IPreferenceStore store = PHPeclipsePlugin.getDefault().getPreferenceStore(); - final String phpExecutable = store.getString(PHPeclipsePlugin.PHP_RUN_PREF); - - //Shell shell = null; - Iterator iterator = null; - iterator = selection.iterator(); - while (iterator.hasNext()) { - // obj => selected object in the view - Object obj = iterator.next(); - - // is it a resource - if (obj instanceof IResource) { - IResource resource = (IResource) obj; - - // check the resource - switch (resource.getType()) { - case IResource.PROJECT : - IProject project = (IProject) resource; - String projectName = project.getLocation().toString(); - String targetDirectory = projectName + "/phpdoc"; - // example: - // C:\>php.exe "C:\Path\To\phpdoc" -t targetdir -o HTML:default:default -d parsedir - String argument = - "\"C:\\php\\phpDocumentor\\phpdoc\" -t " + targetDirectory + " -o HTML:default:default -d " + projectName; - ExternalToolsUtil.execute("phpdocumentor", phpExecutable, argument, true); - break; - // case IResource.FILE : - // // single file: - // IFile file = (IFile) resource; - // PHPParserSuperclass.phpExternalParse(file); - } - } - } - } - - /** - * @see IActionDelegate#selectionChanged(IAction, ISelection) - */ - public void selectionChanged(IAction action, ISelection selection) { - } - -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPExternalParserAction.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPExternalParserAction.java deleted file mode 100644 index ff9ef33..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPExternalParserAction.java +++ /dev/null @@ -1,89 +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 - www.phpeclipse.de -**********************************************************************/ -package net.sourceforge.phpeclipse.actions; - -import java.util.Iterator; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IResource; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionProvider; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.ui.IActionDelegate; -import org.eclipse.ui.IObjectActionDelegate; -import org.eclipse.ui.IWorkbenchPart; - - -public class PHPExternalParserAction implements IObjectActionDelegate { - - private IWorkbenchPart workbenchPart; - /** - * Constructor for Action1. - */ - public PHPExternalParserAction() { - super(); - } - - /** - * @see IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart) - */ - public void setActivePart(IAction action, IWorkbenchPart targetPart) { - workbenchPart = targetPart; - } - - // public static void open(final URL url, final Shell shell, final String dialogTitle) { - // IHelp help= WorkbenchHelp.getHelpSupport(); - // if (help != null) { - // WorkbenchHelp.getHelpSupport().displayHelpResource(url.toExternalForm()); - // } else { - // showMessage(shell, dialogTitle, ActionMessages.getString("OpenBrowserUtil.help_not_available"), false); //$NON-NLS-1$ - // } - // } - - public void run(IAction action) { - ISelectionProvider selectionProvider = null; - selectionProvider = workbenchPart.getSite().getSelectionProvider(); - - StructuredSelection selection = null; - selection = (StructuredSelection) selectionProvider.getSelection(); - - //Shell shell = null; - Iterator iterator = null; - iterator = selection.iterator(); - while (iterator.hasNext()) { - // obj => selected object in the view - Object obj = iterator.next(); - - // is it a resource - if (obj instanceof IResource) { - IResource resource = (IResource) obj; - - // check if it's a file resource - switch (resource.getType()) { - - case IResource.FILE : - // single file: - ExternalPHPParser parser = new ExternalPHPParser((IFile)resource); - parser.phpExternalParse(); - } - } - } - } - - /** - * @see IActionDelegate#selectionChanged(IAction, ISelection) - */ - public void selectionChanged(IAction action, ISelection selection) { - } - -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPOpenSQLTableEditorAction.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPOpenSQLTableEditorAction.java deleted file mode 100644 index 2900c62..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPOpenSQLTableEditorAction.java +++ /dev/null @@ -1,316 +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: www.phpeclipse.de - **********************************************************************************************************************************/ -package net.sourceforge.phpeclipse.actions; - -import java.sql.SQLException; - -import net.sourceforge.phpeclipse.phpeditor.PHPEditor; -import net.sourceforge.phpeclipse.ui.WebUI; -import net.sourceforge.phpeclipse.ui.overlaypages.ProjectPrefUtil; - -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.Path; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.ITextSelection; -import org.eclipse.jface.text.TextSelection; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.swt.graphics.Point; -import org.eclipse.ui.IEditorActionDelegate; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IFileEditorInput; -import org.eclipse.ui.IViewPart; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.actions.ActionDelegate; - -import com.quantum.ExternalInterface; -import com.quantum.QuantumPlugin; -// import com.quantum.util.connection.NotConnectedException; - -public class PHPOpenSQLTableEditorAction extends ActionDelegate implements IEditorActionDelegate { - - private IWorkbenchWindow fWindow; - - private PHPEditor fEditor; - - private IProject fProject; - - public void dispose() { - } - - public void init(IWorkbenchWindow window) { - this.fWindow = window; - } - - public void selectionChanged(IAction action, ISelection selection) { - if (!selection.isEmpty()) { - if (selection instanceof TextSelection) { - action.setEnabled(true); - } else if (fWindow.getActivePage() != null && fWindow.getActivePage().getActivePart() != null) { - // - } - } - } - - private IWorkbenchPage getActivePage() { - fWindow = fEditor.getEditorSite().getWorkbenchWindow(); - IWorkbenchPage page = fWindow.getActivePage(); - return page; - } - - public IContainer getWorkingLocation(IFileEditorInput editorInput) { - if (editorInput == null || editorInput.getFile() == null) { - return null; - } - return editorInput.getFile().getParent(); - } - - private IFile getIncludeFile(IProject project, IFileEditorInput editorInput, String relativeFilename) { - // IContainer container = getWorkingLocation(editorInput); - // String fullPath = project.getLocation().toString(); - Path path = new Path(relativeFilename); - IFile file = project.getFile(path); - return file; - } - - public void run(IAction action) { - if (fEditor == null) { - IEditorPart targetEditor = fWindow.getActivePage().getActiveEditor(); - if (targetEditor != null && (targetEditor instanceof PHPEditor)) { - fEditor = (PHPEditor) targetEditor; - } - } - if (fEditor != null) { - fWindow = fEditor.getEditorSite().getWorkbenchWindow(); - IFile f = ((IFileEditorInput) fEditor.getEditorInput()).getFile(); - fProject = f.getProject(); - String bookmarkString = ProjectPrefUtil.getMiscProjectsPreferenceValue(fProject, WebUI.PHP_BOOKMARK_DEFAULT); - if (bookmarkString != null && !bookmarkString.equals("")) { - ITextSelection selection = (ITextSelection) fEditor.getSelectionProvider().getSelection(); - IDocument doc = fEditor.getDocumentProvider().getDocument(fEditor.getEditorInput()); - int pos = selection.getOffset(); - // System.out.println(selection.getText()); - String tableName = getSQLTableName(doc, pos); - if (tableName != null && tableName.length() > 0) - try { - ExternalInterface.displayTable(bookmarkString, tableName); - - IViewPart viewPart = null; - String view = "com.quantum.view.tableview.TableView"; - try { - IWorkbenchPage page = QuantumPlugin.getDefault().getActivePage(); - viewPart = page.findView(view); - if (viewPart == null) { - viewPart = page.showView(view); - } - page.bringToTop(viewPart); - } catch (PartInitException e) { - e.printStackTrace(); - } - } catch (SQLException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (Exception /* NotConnectedException */ e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - // - // IViewPart viewPart = null; - // String view = "com.quantum.view.tableview.TableView"; - // try { - // IWorkbenchPage page = QuantumPlugin.getDefault().getActivePage(); - // viewPart = page.findView(view); - // if (viewPart == null) { - // viewPart = page.showView(view); - // } - // page.bringToTop(viewPart); - // getTables((TableView) viewPart, fProject, tableName); - // } catch (PartInitException e) { - // e.printStackTrace(); - // } - - } - } - - public void setActiveEditor(IAction action, IEditorPart targetEditor) { - if (targetEditor != null && (targetEditor instanceof PHPEditor)) { - fEditor = (PHPEditor) targetEditor; - } - } - - private String getSQLTableName(IDocument doc, int pos) { - Point word = null; - int start = -1; - int end = -1; - - try { - - int position = pos; - char character; - - while (position >= 0) { - character = doc.getChar(position); - if (Character.isWhitespace(character) || (character == '\"') || (character == '\'') || (character == '\r') - || (character == '\n')) - break; - --position; - } - - start = position; - - position = pos; - int length = doc.getLength(); - - while (position < length) { - character = doc.getChar(position); - if (Character.isWhitespace(character) || (character == '\"') || (character == '\'') || (character == '\r') - || (character == '\n')) - break; - ++position; - } - - start++; - end = position; - - if (end > start) - word = new Point(start, end - start); - - } catch (BadLocationException x) { - } - - if (word != null) { - try { - return doc.get(word.x, word.y); - } catch (BadLocationException e) { - } - } - return ""; - } - - // public void getTables(TableView tableView, IProject project, String tableName) { - // // Get The Database bookmark from the Quantum SQL plugin: - // BookmarkCollection sqlBookMarks = BookmarkCollection.getInstance(); - // if (sqlBookMarks != null) { - // String bookmarkString = ProjectPrefUtil.getMiscProjectsPreferenceValue(project, - // WebUI.PHP_BOOKMARK_DEFAULT); - // if (bookmarkString != null && !bookmarkString.equals("")) { - // Bookmark bookmark = sqlBookMarks.find(bookmarkString); - // ArrayList sqlList = new ArrayList(); - // if (bookmark != null && !bookmark.isConnected()) { - // new ConnectionUtil().connect(bookmark, null); - // } - // if (bookmark != null && bookmark.isConnected()) { - // try { - // Connection connection = bookmark.getConnection(); - // DatabaseMetaData metaData = connection.getMetaData(); - // ConnectionUtil connectionUtil = new ConnectionUtil(); - // Entity entity; - // DatabaseAdapter adapter; - // - // if (metaData != null) { - // String columnName; - // String prefixWithoutDollar = tableName; - // if (prefixWithoutDollar.charAt(0) == '$') { - // prefixWithoutDollar = prefixWithoutDollar.substring(1); - // } - // ResultSet set; - // set = metaData.getTables(null, null, "%" + prefixWithoutDollar - // + "%", null); - // while (set.next()) { - // tableName = set.getString("TABLE_NAME"); - // tableName = (tableName == null) ? "" : tableName.trim(); - // if (tableName != null && tableName.length() > 0) { - // sqlList.add(tableName); - // } - // } - // set.close(); - // EntityFactory entityFactory = EntityFactory.getInstance(); - // if (sqlList.size() == 1) { - // adapter = bookmark.getAdapter(); - // entity = entityFactory.create(bookmark, null, (String) sqlList - // .get(0), Entity.TABLE_TYPE, false); - // String query = adapter.getTableQuery(entity.getQualifiedName()); - // - // try { - // SQLResults results = MultiSQLServer.getInstance().execute( - // bookmark, connectionUtil.connect(bookmark, fWindow.getShell()), - // entity, query); - // - // if (results != null && results.isResultSet()) { - // SQLResultSetCollection.getInstance().addSQLResultSet( - // (SQLResultSetResults) results); - // } - // } catch (SQLException e) { - // ExceptionDisplayDialog.openError(fWindow.getShell(), null, null, e); - // } - // // tableView.loadTable(entityFactory.create( - // // bookmark, null, - // // (String) sqlList.get(0), - // // Entity.TABLE_TYPE)); - // } else if (sqlList.size() > 1) { - // ListSelectionDialog listSelectionDialog = new ListSelectionDialog( - // PHPeclipsePlugin.getDefault().getWorkbench() - // .getActiveWorkbenchWindow().getShell(), sqlList, - // new ListContentProvider(), new LabelProvider(), - // "Select the SQL table to open."); - // listSelectionDialog.setTitle("Multiple tablenames found"); - // if (listSelectionDialog.open() == Window.OK) { - // Object[] locations = listSelectionDialog.getResult(); - // if (locations != null) { - // for (int i = 0; i < locations.length; i++) { - // adapter = bookmark.getAdapter(); - // entity = entityFactory.create(bookmark, null, - // (String) locations[i], Entity.TABLE_TYPE, false); - // String query = adapter.getTableQuery(entity - // .getQualifiedName()); - // - // try { - // SQLResults results = MultiSQLServer.getInstance() - // .execute(bookmark, - // connectionUtil.connect(bookmark, fWindow.getShell()), - // entity, query); - // - // if (results != null && results.isResultSet()) { - // SQLResultSetCollection.getInstance().addSQLResultSet( - // (SQLResultSetResults) results); - // } - // } catch (SQLException e) { - // ExceptionDisplayDialog.openError(fWindow.getShell(), null, null, e); - // } - // - // // tableView - // // .loadTable(entityFactory - // // .create( - // // bookmark, - // // null, - // // (String) locations[i], - // // Entity.TABLE_TYPE)); - // } - // - // } - // } - // } - // } - // } catch (NotConnectedException e) { - // // ignore this - not mission critical - // } catch (SQLException e) { - // e.printStackTrace(); - // } - // } - // } - // } - // } - -} \ No newline at end of file diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPRestartApacheAction.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPRestartApacheAction.java deleted file mode 100644 index dc350e7..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPRestartApacheAction.java +++ /dev/null @@ -1,29 +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 - www.phpeclipse.de -**********************************************************************/ -package net.sourceforge.phpeclipse.actions; - -import net.sourceforge.phpeclipse.PHPeclipsePlugin; - -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.preference.IPreferenceStore; - -public class PHPRestartApacheAction extends PHPStartApacheAction { - public void run(IAction action) { - final IPreferenceStore store = PHPeclipsePlugin.getDefault().getPreferenceStore(); - // execute(store.getString(PHPeclipsePlugin.APACHE_RESTART_PREF), "Restart Apache: "); - execute( - "apache_restart", - store.getString(PHPeclipsePlugin.APACHE_RUN_PREF), - store.getString(PHPeclipsePlugin.APACHE_RESTART_PREF), - store.getBoolean(PHPeclipsePlugin.APACHE_RESTART_BACKGROUND)); - } -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPStartApacheAction.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPStartApacheAction.java deleted file mode 100644 index a87c8a1..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPStartApacheAction.java +++ /dev/null @@ -1,94 +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 - www.phpeclipse.de -**********************************************************************/ -package net.sourceforge.phpeclipse.actions; - -import java.text.MessageFormat; - -import net.sourceforge.phpdt.externaltools.launchConfigurations.ExternalToolsUtil; -import net.sourceforge.phpeclipse.PHPConsole; -import net.sourceforge.phpeclipse.PHPeclipsePlugin; -import net.sourceforge.phpeclipse.ui.WebUI; - -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.IWorkbenchWindowActionDelegate; - -public class PHPStartApacheAction implements IWorkbenchWindowActionDelegate { - protected IWorkbenchWindow activeWindow = null; - - public void run(IAction action) { - final IPreferenceStore store = - PHPeclipsePlugin.getDefault().getPreferenceStore(); - String documentRoot = store.getString(WebUI.PHP_DOCUMENTROOT_PREF); - // replace backslash with slash in the DocumentRoot under Windows - documentRoot = documentRoot.replace('\\', '/'); - String[] arguments = { documentRoot }; - MessageFormat form = - new MessageFormat(store.getString(PHPeclipsePlugin.APACHE_START_PREF)); - execute( - "apache_start", - store.getString(PHPeclipsePlugin.APACHE_RUN_PREF), - form.format(arguments), - store.getBoolean(PHPeclipsePlugin.APACHE_START_BACKGROUND)); - } - - /** - * Executes an external progam and saves the LaunchConfiguration under external tools - * @param command external tools command name - * @param executable executable path i.e.c:\apache\apache.exe - * @param arguments arguments for this configuration - * @param background run this configuration in background mode - */ - public static void execute( - String command, - String executable, - String arguments, - boolean background) { - PHPConsole console = new PHPConsole(); - String consoleMessage; - if (background) { - consoleMessage = - "run in background mode-" - + command - + ": " - + executable - + " " - + arguments; - } else { - consoleMessage = - "run in foreground mode-" - + command - + ": " - + executable - + " " - + arguments; - } - console.println(consoleMessage); - - ExternalToolsUtil.execute(command, executable, arguments, background); - } - - public void selectionChanged(IAction action, ISelection selection) { - - } - - public void init(IWorkbenchWindow window) { - this.activeWindow = window; - } - - public void dispose() { - - } - -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPStartMySQLAction.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPStartMySQLAction.java deleted file mode 100644 index cc237ea..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPStartMySQLAction.java +++ /dev/null @@ -1,29 +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 - www.phpeclipse.de -**********************************************************************/ -package net.sourceforge.phpeclipse.actions; - -import net.sourceforge.phpeclipse.PHPeclipsePlugin; - -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.preference.IPreferenceStore; - -public class PHPStartMySQLAction extends PHPStartApacheAction { - public void run(IAction action) { - final IPreferenceStore store = PHPeclipsePlugin.getDefault().getPreferenceStore(); - // execute(store.getString(PHPeclipsePlugin.MYSQL_PREF), "Start MySQL: "); - execute( - "mysql_start", - store.getString(PHPeclipsePlugin.MYSQL_RUN_PREF), - store.getString(PHPeclipsePlugin.MYSQL_PREF), - store.getBoolean(PHPeclipsePlugin.MYSQL_START_BACKGROUND)); - } -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPStartXAMPPAction.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPStartXAMPPAction.java deleted file mode 100644 index e3dcfff..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPStartXAMPPAction.java +++ /dev/null @@ -1,90 +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 - www.phpeclipse.de -**********************************************************************/ -package net.sourceforge.phpeclipse.actions; - -import java.io.File; - -import net.sourceforge.phpdt.externaltools.launchConfigurations.ExternalToolsUtil; -import net.sourceforge.phpeclipse.PHPConsole; -import net.sourceforge.phpeclipse.PHPeclipsePlugin; - -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.IWorkbenchWindowActionDelegate; - -public class PHPStartXAMPPAction implements IWorkbenchWindowActionDelegate { - protected IWorkbenchWindow activeWindow = null; - - public void run(IAction action) { - final IPreferenceStore store = - PHPeclipsePlugin.getDefault().getPreferenceStore(); - String executable = store.getString(PHPeclipsePlugin.XAMPP_START_PREF); - String workingDirectory = null; - if (executable!=null && executable.length()>0) { - int index = executable.lastIndexOf(File.separatorChar); - if (index>0) { - workingDirectory = executable.substring(0, index); - } - } - execute( - "xampp_start", - executable, - workingDirectory, - true); - } - - /** - * Executes an external progam and saves the LaunchConfiguration under external tools - * @param command external tools command name - * @param executable executable path i.e.c:\apache\apache.exe - * @param background run this configuration in background mode - */ - public static void execute( - String command, - String executable, - String workingDirectory, - boolean background) { - PHPConsole console = new PHPConsole(); - String consoleMessage; - if (background) { - consoleMessage = - "run in background mode-" - + command - + ": " - + executable; - } else { - consoleMessage = - "run in foreground mode-" - + command - + ": " - + executable; - } - console.println(consoleMessage); - - ExternalToolsUtil.execute(command, executable, workingDirectory, null, background); - } - - public void selectionChanged(IAction action, ISelection selection) { - - } - - public void init(IWorkbenchWindow window) { - this.activeWindow = window; - } - - public void dispose() { - - } - -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPStopApacheAction.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPStopApacheAction.java deleted file mode 100644 index e5b75e9..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPStopApacheAction.java +++ /dev/null @@ -1,29 +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 - www.phpeclipse.de -**********************************************************************/ -package net.sourceforge.phpeclipse.actions; - -import net.sourceforge.phpeclipse.PHPeclipsePlugin; - -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.preference.IPreferenceStore; - -public class PHPStopApacheAction extends PHPStartApacheAction { - public void run(IAction action) { - final IPreferenceStore store = PHPeclipsePlugin.getDefault().getPreferenceStore(); - // execute(store.getString(PHPeclipsePlugin.APACHE_STOP_PREF), "Stop Apache: "); - execute( - "apache_stop", - store.getString(PHPeclipsePlugin.APACHE_RUN_PREF), - store.getString(PHPeclipsePlugin.APACHE_STOP_PREF), - store.getBoolean(PHPeclipsePlugin.APACHE_STOP_BACKGROUND)); - } -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPStopXAMPPAction.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPStopXAMPPAction.java deleted file mode 100644 index 89c6e0d..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPStopXAMPPAction.java +++ /dev/null @@ -1,90 +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 - www.phpeclipse.de -**********************************************************************/ -package net.sourceforge.phpeclipse.actions; - -import java.io.File; - -import net.sourceforge.phpdt.externaltools.launchConfigurations.ExternalToolsUtil; -import net.sourceforge.phpeclipse.PHPConsole; -import net.sourceforge.phpeclipse.PHPeclipsePlugin; - -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.IWorkbenchWindowActionDelegate; - -public class PHPStopXAMPPAction implements IWorkbenchWindowActionDelegate { - protected IWorkbenchWindow activeWindow = null; - - public void run(IAction action) { - final IPreferenceStore store = - PHPeclipsePlugin.getDefault().getPreferenceStore(); - String executable = store.getString(PHPeclipsePlugin.XAMPP_STOP_PREF); - String workingDirectory = null; - if (executable!=null && executable.length()>0) { - int index = executable.lastIndexOf(File.separatorChar); - if (index>0) { - workingDirectory = executable.substring(0, index); - } - } - execute( - "xampp_stop", - executable, - workingDirectory, - true); - } - - /** - * Executes an external progam and saves the LaunchConfiguration under external tools - * @param command external tools command name - * @param executable executable path i.e.c:\apache\apache.exe - * @param background run this configuration in background mode - */ - public static void execute( - String command, - String executable, - String workingDirectory, - boolean background) { - PHPConsole console = new PHPConsole(); - String consoleMessage; - if (background) { - consoleMessage = - "run in background mode-" - + command - + ": " - + executable; - } else { - consoleMessage = - "run in foreground mode-" - + command - + ": " - + executable; - } - console.println(consoleMessage); - - ExternalToolsUtil.execute(command, executable, workingDirectory, null, background); - } - - public void selectionChanged(IAction action, ISelection selection) { - - } - - public void init(IWorkbenchWindow window) { - this.activeWindow = window; - } - - public void dispose() { - - } - -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPParserAction.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPParserAction.java deleted file mode 100644 index 6197bae..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPParserAction.java +++ /dev/null @@ -1,126 +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 - www.phpeclipse.de - **********************************************************************/ - -import java.io.BufferedInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.List; - -import net.sourceforge.phpdt.internal.compiler.util.Util; -import net.sourceforge.phpdt.internal.ui.util.PHPFileUtil; -import net.sourceforge.phpeclipse.PHPeclipsePlugin; -import net.sourceforge.phpeclipse.actions.ExternalPHPParser; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IFileEditorInput; -import org.eclipse.ui.texteditor.ITextEditor; -import org.eclipse.ui.texteditor.TextEditorAction; - -//import test.PHPParserManager; - -/** - * ClassDeclaration that defines the action for parsing the current PHP file - */ -public class PHPParserAction extends TextEditorAction { - - private static PHPParserAction instance = new PHPParserAction(); - - protected IFile fileToParse; - - protected List fVariables = new ArrayList(100); - - /** - * Constructs and updates the action. - */ - private PHPParserAction() { - super(PHPEditorMessages.getResourceBundle(), "ParserAction.", null); //$NON-NLS-1$ - update(); - } - - public static PHPParserAction getInstance() { - return instance; - } - - /** - * Code called when the action is fired. - */ - public void run() { - boolean phpFlag = false; - - // try { - fileToParse = getPHPFile(); - parseFile(fileToParse); - } - - public static void parseFile(IFile fileToParse) { - boolean phpFlag = false; - // try { - - if (fileToParse == null) { - // TODO should never happen => should throw an exception - System.err.println("Error : no file in the editor"); - - return; - } - String name = fileToParse.getName(); //.toLowerCase(); - - if (PHPFileUtil.isPHPFileName(name)) { - IPreferenceStore store = PHPeclipsePlugin.getDefault().getPreferenceStore(); - ExternalPHPParser parser = new ExternalPHPParser(fileToParse); - parser.phpExternalParse(); - } - } - - /** - * Finds the file that's currently opened in the PHP Text Editor - */ - protected IFile getPHPFile() { - 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; - } - - protected static void parse(IFile fileToParse) { - InputStream stream = null; - char[] charArray; - try { - stream = new BufferedInputStream(fileToParse.getContents()); - charArray = Util.getInputStreamAsCharArray(stream, -1, null); - ExternalPHPParser parser = new ExternalPHPParser(fileToParse); - parser.phpExternalParse(); - } catch (CoreException e) { - } catch (IOException e) { - } finally { - try { - if (stream != null) { - stream.close(); - } - } catch (IOException e) { - } - } - } -} \ 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 54fe5a6..0ccf4c7 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 @@ -78,7 +78,7 @@ import org.eclipse.swt.graphics.Point; import org.eclipse.ui.IEditorPart; import org.eclipse.ui.IFileEditorInput; -import com.quantum.ExternalInterface; +//import com.quantum.ExternalInterface; // import com.quantum.util.connection.NotConnectedException; /** @@ -650,23 +650,25 @@ public class PHPCompletionProcessor implements IContentAssistProcessor { builtinResults = builtinEngine.getResults(); } } - ICompletionProposal[] sqlResults = new ICompletionProposal[0]; - if (project != null) { - sqlResults = getSQLProposals(viewer, project, context, prefix, sqlTable); - } +// ICompletionProposal[] sqlResults = new ICompletionProposal[0]; +// if (project != null) { +// sqlResults = getSQLProposals(viewer, project, context, prefix, sqlTable); +// } // concatenate the result arrays IPHPCompletionProposal[] total; total = new IPHPCompletionProposal[localVariableResults.length + templateResults.length + identifierResults.length - + builtinResults.length + declarationResults.length + sqlResults.length]; + + builtinResults.length + declarationResults.length];// + sqlResults.length]; System.arraycopy(templateResults, 0, total, 0, templateResults.length); System.arraycopy(identifierResults, 0, total, templateResults.length, identifierResults.length); System.arraycopy(builtinResults, 0, total, templateResults.length + identifierResults.length, builtinResults.length); System.arraycopy(declarationResults, 0, total, templateResults.length + identifierResults.length + builtinResults.length, declarationResults.length); - System.arraycopy(sqlResults, 0, total, templateResults.length + identifierResults.length + builtinResults.length - + declarationResults.length, sqlResults.length); +// System.arraycopy(sqlResults, 0, total, templateResults.length + identifierResults.length + builtinResults.length +// + declarationResults.length, sqlResults.length); +// System.arraycopy(localVariableResults, 0, total, templateResults.length + identifierResults.length + builtinResults.length +// + declarationResults.length + sqlResults.length, localVariableResults.length); System.arraycopy(localVariableResults, 0, total, templateResults.length + identifierResults.length + builtinResults.length - + declarationResults.length + sqlResults.length, localVariableResults.length); + + declarationResults.length, localVariableResults.length); results = total; fNumberOfComputedResults = (results == null ? 0 : results.length); /* @@ -814,71 +816,71 @@ public class PHPCompletionProcessor implements IContentAssistProcessor { * @param sqlResults * @return */ - private ICompletionProposal[] getSQLProposals(ITextViewer viewer, IProject project, DocumentTemplateContext context, - String prefix, TableName sqlTable) { - ICompletionProposal[] sqlResults = new ICompletionProposal[0]; - // Get The Database bookmark from the Quantum SQL plugin: - // BookmarkCollection sqlBookMarks = BookmarkCollection.getInstance(); - // if (sqlBookMarks != null) { - String bookmarkString = ProjectPrefUtil.getMiscProjectsPreferenceValue(project, IPreferenceConstants.PHP_BOOKMARK_DEFAULT); - if (bookmarkString != null && !bookmarkString.equals("")) { - String[] bookmarks = ExternalInterface.getBookmarkNames(); - boolean foundBookmark = false; - for (int i = 0; i < bookmarks.length; i++) { - if (bookmarks[i].equals(bookmarkString)) { - foundBookmark = true; - } - } - if (!foundBookmark) { - return sqlResults; - } - // Bookmark bookmark = sqlBookMarks.find(bookmarkString); - ArrayList sqlList = new ArrayList(); - if (!ExternalInterface.isBookmarkConnected(bookmarkString)) { - ExternalInterface.connectBookmark(bookmarkString, null); - if (!ExternalInterface.isBookmarkConnected(bookmarkString)) { - return sqlResults; - } - } - // if (ExternalInterface.isBookmarkConnected(bookmarkString)) { - try { - int start = context.getStart(); - int end = context.getEnd(); - String foundSQLTableName = sqlTable.getTableName(); - String tableName; - String columnName; - String prefixWithoutDollar = prefix; - boolean isDollarPrefix = false; - if (prefix.length() > 0 && prefix.charAt(0) == '$') { - prefixWithoutDollar = prefix.substring(1); - isDollarPrefix = true; - } - IRegion region = new Region(start, end - start); - ResultSet set; - if (!isDollarPrefix) { - String[] tableNames = ExternalInterface.getMatchingTableNames(null, bookmarkString, prefixWithoutDollar, null, false); - for (int i = 0; i < tableNames.length; i++) { - sqlList.add(new SQLProposal(tableNames[i], context, region, viewer, PHPUiImages.get(PHPUiImages.IMG_TABLE))); - } - } - - String[] columnNames = ExternalInterface.getMatchingColumnNames(null, bookmarkString, prefixWithoutDollar, null, false); - for (int i = 0; i < columnNames.length; i++) { - sqlList.add(new SQLProposal(columnNames[i], context, region, viewer, PHPUiImages.get(PHPUiImages.IMG_TABLE))); - } - - sqlResults = new IPHPCompletionProposal[sqlList.size()]; - for (int i = 0; i < sqlList.size(); i++) { - sqlResults[i] = (SQLProposal) sqlList.get(i); - } - } catch (Exception /* NotConnectedException */ e) { - - } - // } - } - // } - return sqlResults; - } +// private ICompletionProposal[] getSQLProposals(ITextViewer viewer, IProject project, DocumentTemplateContext context, +// String prefix, TableName sqlTable) { +// ICompletionProposal[] sqlResults = new ICompletionProposal[0]; +// // Get The Database bookmark from the Quantum SQL plugin: +// // BookmarkCollection sqlBookMarks = BookmarkCollection.getInstance(); +// // if (sqlBookMarks != null) { +// String bookmarkString = ProjectPrefUtil.getMiscProjectsPreferenceValue(project, IPreferenceConstants.PHP_BOOKMARK_DEFAULT); +// if (bookmarkString != null && !bookmarkString.equals("")) { +// String[] bookmarks = ExternalInterface.getBookmarkNames(); +// boolean foundBookmark = false; +// for (int i = 0; i < bookmarks.length; i++) { +// if (bookmarks[i].equals(bookmarkString)) { +// foundBookmark = true; +// } +// } +// if (!foundBookmark) { +// return sqlResults; +// } +// // Bookmark bookmark = sqlBookMarks.find(bookmarkString); +// ArrayList sqlList = new ArrayList(); +// if (!ExternalInterface.isBookmarkConnected(bookmarkString)) { +// ExternalInterface.connectBookmark(bookmarkString, null); +// if (!ExternalInterface.isBookmarkConnected(bookmarkString)) { +// return sqlResults; +// } +// } +// // if (ExternalInterface.isBookmarkConnected(bookmarkString)) { +// try { +// int start = context.getStart(); +// int end = context.getEnd(); +// String foundSQLTableName = sqlTable.getTableName(); +// String tableName; +// String columnName; +// String prefixWithoutDollar = prefix; +// boolean isDollarPrefix = false; +// if (prefix.length() > 0 && prefix.charAt(0) == '$') { +// prefixWithoutDollar = prefix.substring(1); +// isDollarPrefix = true; +// } +// IRegion region = new Region(start, end - start); +// ResultSet set; +// if (!isDollarPrefix) { +// String[] tableNames = ExternalInterface.getMatchingTableNames(null, bookmarkString, prefixWithoutDollar, null, false); +// for (int i = 0; i < tableNames.length; i++) { +// sqlList.add(new SQLProposal(tableNames[i], context, region, viewer, PHPUiImages.get(PHPUiImages.IMG_TABLE))); +// } +// } +// +// String[] columnNames = ExternalInterface.getMatchingColumnNames(null, bookmarkString, prefixWithoutDollar, null, false); +// for (int i = 0; i < columnNames.length; i++) { +// sqlList.add(new SQLProposal(columnNames[i], context, region, viewer, PHPUiImages.get(PHPUiImages.IMG_TABLE))); +// } +// +// sqlResults = new IPHPCompletionProposal[sqlList.size()]; +// for (int i = 0; i < sqlList.size(); i++) { +// sqlResults[i] = (SQLProposal) sqlList.get(i); +// } +// } catch (Exception /* NotConnectedException */ e) { +// +// } +// // } +// } +// // } +// return sqlResults; +// } private boolean looksLikeMethod(PHPCodeReader reader) throws IOException { int curr = reader.read(); diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/preferences/PHPEclipseParserPreferencePage.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/preferences/PHPEclipseParserPreferencePage.java deleted file mode 100644 index 43a1175..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/preferences/PHPEclipseParserPreferencePage.java +++ /dev/null @@ -1,109 +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.PreferencePage; -import org.eclipse.jface.preference.StringFieldEditor; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Group; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPreferencePage; - -public class PHPEclipseParserPreferencePage extends PreferencePage implements IWorkbenchPreferencePage { - -// private SelectionListener SelectionListener; -// private ModifyListener ModifyListener; -// private ModifyListener TextModifyListener; -// -// private ArrayList CheckBoxes = new ArrayList(); -// private ArrayList ComboBoxes = new ArrayList(); -// private ArrayList TextBoxes = new ArrayList(); -// private ArrayList RadioButtons = new ArrayList(); - - -// RadioGroupFieldEditor chooseParser; - StringFieldEditor externalParserSFE; - // BooleanFieldEditor parseOnSave; - - public PHPEclipseParserPreferencePage() { - super(); - setPreferenceStore(PHPeclipsePlugin.getDefault().getPreferenceStore()); - setDescription(PHPPreferencesMessages.getString("PHPBasePreferencePage.description")); //$NON-NLS-1$ - } - - public void init(IWorkbench workbench) { - } - protected void performDefaults() { -// chooseParser.loadDefault(); - externalParserSFE.loadDefault(); -// parseOnSave.loadDefault(); - super.performDefaults(); - } - - public boolean performOk() { -// chooseParser.store(); - externalParserSFE.store(); -// parseOnSave.store(); - return super.performOk(); - } - - protected Control createContents(Composite parent) { - initializeDialogUnits(parent); - final IPreferenceStore store = PHPeclipsePlugin.getDefault().getPreferenceStore(); - Composite composite = new Composite(parent, SWT.LEFT); - composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - composite.setLayout(new GridLayout()); - - //Create parser settings composite - Composite parserSettingsComposite = new Composite(composite, SWT.NONE); - parserSettingsComposite.setLayout(new GridLayout()); - parserSettingsComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - Group parserSettingsGroup = new Group(parserSettingsComposite, SWT.NONE); - parserSettingsGroup.setText(PHPPreferencesMessages.getString("PHPBasePreferencePage.parsers")); - parserSettingsGroup.setLayout(new GridLayout()); - parserSettingsGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - -// chooseParser = -// new RadioGroupFieldEditor( -// IPreferenceConstants.PHP_PARSER_DEFAULT, -// PHPPreferencesMessages.getString("PHPBasePreferencePage.parsers.choose"), -// 1, -// new String[][] { -// { PHPPreferencesMessages.getString("PHPBasePreferencePage.parsers.internal"), IPreferenceConstants.PHP_INTERNAL_PARSER }, -// { -// PHPPreferencesMessages.getString("PHPBasePreferencePage.parsers.external"), IPreferenceConstants.PHP_EXTERNAL_PARSER } -// }, parserSettingsGroup); -// chooseParser.setPreferencePage(this); -// chooseParser.setPreferenceStore(getPreferenceStore()); -// chooseParser.load(); - //create a copmposte just for the StringEditor - makes layout simpler - Composite externalParserCompo = new Composite(parserSettingsGroup, SWT.NONE); - externalParserSFE = - new StringFieldEditor( - IPreferenceConstants.EXTERNAL_PARSER_PREF, - PHPPreferencesMessages.getString("PHPBasePreferencePage.parsers.extcommand"), - externalParserCompo - /*parserSettingsGroup*/ - ); - externalParserSFE.setPreferencePage(this); - externalParserSFE.setPreferenceStore(getPreferenceStore()); - externalParserSFE.load(); - -// parseOnSave = -// new BooleanFieldEditor( -// PHPeclipsePlugin.PHP_PARSE_ON_SAVE, -// PHPPreferencesMessages.getString("PHPBasePreferencePage.parsers.pos"), -// parserSettingsGroup); -// parseOnSave.setPreferencePage(this); -// parseOnSave.setPreferenceStore(getPreferenceStore()); -// parseOnSave.load(); - - return composite; - } -} -- 1.7.1 From b427dca6d6b796a216a40dabd68c7717bb288d9e Mon Sep 17 00:00:00 2001 From: axelcl Date: Tue, 14 Jun 2005 05:01:56 +0000 Subject: [PATCH 05/16] Created a separated 'externaltools' plugin --- net.sourceforge.phpeclipse/plugin.properties | 36 -- .../prefs/default_linux.properties | 14 - .../prefs/default_macosx.properties | 14 - .../externaltools/group/IGroupDialogPage.java | 62 -- .../internal/dialog/ExternalToolVariableForm.java | 221 ------- .../externaltools/internal/model/ColorManager.java | 53 -- .../internal/model/ExternalToolsImages.java | 196 ------- .../internal/model/ExternalToolsModelMessages.java | 61 -- .../model/ExternalToolsModelMessages.properties | 300 ---------- .../internal/model/ExternalToolsPlugin.java | 207 ------- .../internal/model/IHelpContextIds.java | 58 -- .../internal/model/IPreferenceConstants.java | 31 - .../externaltools/internal/model/ToolMessages.java | 61 -- .../internal/model/VariableContextManager.java | 171 ------ .../internal/model/messages.properties | 332 ----------- .../BackgroundResourceRefresher.java | 107 ---- .../ProgramBuilderTabGroup.java | 29 - .../ProgramLaunchDelegate.java | 138 ----- .../launchConfigurations/ProgramMainTab.java | 34 -- .../launchConfigurations/ProgramTabGroup.java | 30 - .../internal/registry/ArgumentVariable.java | 66 --- .../registry/ArgumentVariableRegistry.java | 51 -- .../internal/registry/ExternalToolMigration.java | 363 ------------ .../internal/registry/ExternalToolVariable.java | 156 ----- .../registry/ExternalToolVariableRegistry.java | 137 ----- .../internal/registry/PathLocationVariable.java | 63 -- .../registry/PathLocationVariableRegistry.java | 49 -- .../internal/registry/RefreshScopeVariable.java | 63 -- .../registry/RefreshScopeVariableRegistry.java | 51 -- .../internal/ui/ExternalToolsContentProvider.java | 64 --- .../internal/ui/FileSelectionDialog.java | 210 ------- .../internal/ui/IExternalToolsUIConstants.java | 39 -- .../internal/ui/MessageDialogWithToggle.java | 209 ------- .../externaltools/internal/ui/MessageLine.java | 92 --- .../externaltools/internal/ui/StatusDialog.java | 163 ------ .../externaltools/internal/ui/StatusInfo.java | 169 ------ .../internal/ui/TreeAndListGroup.java | 287 ---------- .../ExternalToolsLaunchConfigurationMessages.java | 30 - ...rnalToolsLaunchConfigurationMessages.properties | 45 -- .../launchConfigurations/ExternalToolsMainTab.java | 599 -------------------- .../ExternalToolsRefreshTab.java | 253 --------- .../launchConfigurations/ExternalToolsUtil.java | 363 ------------ .../model/IExternalToolConstants.java | 384 ------------- .../phpdt/externaltools/model/IRunnerLog.java | 43 -- .../phpdt/externaltools/model/StringMatcher.java | 388 ------------- .../phpdt/externaltools/model/ToolUtil.java | 451 --------------- .../externaltools/variable/BuildTypeExpander.java | 9 - .../variable/ExpandVariableContext.java | 102 ---- .../phpdt/externaltools/variable/FileExpander.java | 34 -- .../externaltools/variable/IVariableComponent.java | 77 --- .../variable/IVariableLocationExpander.java | 39 -- .../variable/IVariableResourceExpander.java | 38 -- .../variable/IVariableTextExpander.java | 35 -- .../externaltools/variable/LocalhostExpander.java | 21 - .../variable/ProjectNameExpander.java | 22 - .../externaltools/variable/ResourceComponent.java | 265 --------- .../variable/ResourceContainerExpander.java | 40 -- .../externaltools/variable/ResourceExpander.java | 124 ---- .../variable/ResourceProjectExpander.java | 47 -- .../variable/SpecificFileResourceComponent.java | 73 --- .../variable/SpecificFolderResourceComponent.java | 111 ---- .../phpdt/externaltools/variable/UrlExpander.java | 49 -- .../externaltools/variable/WorkingSetExpander.java | 56 -- .../externaltools/variable/WorkspaceExpander.java | 36 -- .../phpeclipse/IPreferenceConstants.java | 2 +- .../phpeclipse/PHPEclipseBasePreferencePage.java | 241 -------- .../sourceforge/phpeclipse/PHPeclipsePlugin.java | 7 +- 67 files changed, 4 insertions(+), 8367 deletions(-) delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/group/IGroupDialogPage.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/dialog/ExternalToolVariableForm.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/model/ColorManager.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/model/ExternalToolsImages.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/model/ExternalToolsModelMessages.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/model/ExternalToolsModelMessages.properties delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/model/ExternalToolsPlugin.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/model/IHelpContextIds.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/model/IPreferenceConstants.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/model/ToolMessages.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/model/VariableContextManager.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/model/messages.properties delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/program/launchConfigurations/BackgroundResourceRefresher.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/program/launchConfigurations/ProgramBuilderTabGroup.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/program/launchConfigurations/ProgramLaunchDelegate.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/program/launchConfigurations/ProgramMainTab.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/program/launchConfigurations/ProgramTabGroup.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/registry/ArgumentVariable.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/registry/ArgumentVariableRegistry.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/registry/ExternalToolMigration.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/registry/ExternalToolVariable.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/registry/ExternalToolVariableRegistry.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/registry/PathLocationVariable.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/registry/PathLocationVariableRegistry.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/registry/RefreshScopeVariable.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/registry/RefreshScopeVariableRegistry.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/ui/ExternalToolsContentProvider.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/ui/FileSelectionDialog.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/ui/IExternalToolsUIConstants.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/ui/MessageDialogWithToggle.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/ui/MessageLine.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/ui/StatusDialog.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/ui/StatusInfo.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/ui/TreeAndListGroup.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/launchConfigurations/ExternalToolsLaunchConfigurationMessages.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/launchConfigurations/ExternalToolsLaunchConfigurationMessages.properties delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/launchConfigurations/ExternalToolsMainTab.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/launchConfigurations/ExternalToolsRefreshTab.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/launchConfigurations/ExternalToolsUtil.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/model/IExternalToolConstants.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/model/IRunnerLog.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/model/StringMatcher.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/model/ToolUtil.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/BuildTypeExpander.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/ExpandVariableContext.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/FileExpander.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/IVariableComponent.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/IVariableLocationExpander.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/IVariableResourceExpander.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/IVariableTextExpander.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/LocalhostExpander.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/ProjectNameExpander.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/ResourceComponent.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/ResourceContainerExpander.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/ResourceExpander.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/ResourceProjectExpander.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/SpecificFileResourceComponent.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/SpecificFolderResourceComponent.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/UrlExpander.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/WorkingSetExpander.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/WorkspaceExpander.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPEclipseBasePreferencePage.java diff --git a/net.sourceforge.phpeclipse/plugin.properties b/net.sourceforge.phpeclipse/plugin.properties index bee79f8..9f44838 100644 --- a/net.sourceforge.phpeclipse/plugin.properties +++ b/net.sourceforge.phpeclipse/plugin.properties @@ -370,42 +370,6 @@ ActionDefinition.implementorsInWorkingSet.description= Search for Implementors o ActionDefinition.togglePresentation.name= Show Source of Selected Element Only ActionDefinition.togglePresentation.description= Show Source of Selected Element Only -###################### -### External Tools ### -###################### -LaunchConfigurationTypePHPApplication.name=PHP Application - -ExtPoint.configurationDuplicationMaps = Launch Configuration Duplication Maps -ExtPoint.toolTypes = External Tool Types -ExtPoint.argumentVariables = Argument Variables -ExtPoint.directoryVariables = Directory Variables -ExtPoint.fileVariables = File Variables -ExtPoint.refreshVariables = Refresh Scope Variables -ExternalToolsLaunchGroup.label = &External Tools -ToolType.programName = Program -ToolType.programDescription = An external tool that runs an application, a batch file, etc. -Menu.run = &Run -ActionSet.externalTools = External Tools -Action.externalTools = &External Tools -Action.externalToolsTip = Run Last Tool -PropertyPage.main = Main -PropertyPage.option = Options -PropertyPage.refresh = Refresh Scope -PropertyPage.antTargets = Targets -PropertyPage.externalToolsBuilders = PHP Launch Builders -CategoryView.externalTools = PHP Launchers -CategoryNewWizard.externalTools = PHP Launchers -NewWizard.programName = Program -NewWizard.programDescription = Create an external tool to run an application, a batch file, etc. -Builder.externalTools = Integrated PHP Launcher Builder -View.externalToolView = PHP Launchers -View.logConsole = Log Console -PreferencePage.externalToolsPreferences = PHP Launchers -PreferencePage.antConsolePreferences = Console -PreferencePage.antRuntimePreferences = Runtime - -Program.externalTools = PHP Program - OccurrenceAnnotation.label= PHP Marker Occurrences phpEditorFontDefiniton.label= PHP Editor Text Font diff --git a/net.sourceforge.phpeclipse/prefs/default_linux.properties b/net.sourceforge.phpeclipse/prefs/default_linux.properties index 4303a36..02ef658 100644 --- a/net.sourceforge.phpeclipse/prefs/default_linux.properties +++ b/net.sourceforge.phpeclipse/prefs/default_linux.properties @@ -1,16 +1,2 @@ -_php_run_pref=/opt/lampp/php/php -_external_parser=/opt/lampp/php/php -l -f {0} -_mysql_run_pref=/opt/lampp/lampp startmysql -_apache_run_pref=/opt/lampp/lampp -_xampp_start_pref=/opt/lampp/lampp start -_xampp_stop_pref=/opt/lampp/lampp stop -__mysql_start=startmysql -__apache_start=startapache -c \"DocumentRoot \"{0}\"\" -__apache_stop=stop -__apache_restart=restart -_mysql_start_background=true -_apache_start_background=true -_apache_stop_background=true -_apache_restart_background=true __httpd_conf_path=/opt/lampp/apache/conf/httpd.conf __etc_hosts_path=/etc/hosts \ No newline at end of file diff --git a/net.sourceforge.phpeclipse/prefs/default_macosx.properties b/net.sourceforge.phpeclipse/prefs/default_macosx.properties index 59c12f5..bdcf81d 100644 --- a/net.sourceforge.phpeclipse/prefs/default_macosx.properties +++ b/net.sourceforge.phpeclipse/prefs/default_macosx.properties @@ -1,16 +1,2 @@ -_php_run_pref=/usr/bin/php -_external_parser=/usr/bin/php -l -f {0} -_mysql_run_pref= -_apache_run_pref= -_xampp_start_pref= -_xampp_stop_pref= -__mysql_start= -__apache_start=sudo /usr/sbin/apachectl start -__apache_stop=sudo /usr/sbin/apachectl stop -__apache_restart=sudo /usr/sbin/apachectl restart -_mysql_start_background=true -_apache_start_background=true -_apache_stop_background=true -_apache_restart_background=true __httpd_conf_path=/etc/httpd/httpd.conf __etc_hosts_path=/etc/hosts \ No newline at end of file diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/group/IGroupDialogPage.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/group/IGroupDialogPage.java deleted file mode 100644 index d441165..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/group/IGroupDialogPage.java +++ /dev/null @@ -1,62 +0,0 @@ -package net.sourceforge.phpdt.externaltools.group; - -/********************************************************************** -Copyright (c) 2002 IBM Corp. and others. All rights reserved. -This file is 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: -**********************************************************************/ - -import org.eclipse.jface.dialogs.IMessageProvider; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Button; - -/** - * Represents the API for a group of visual components - * to access the dialog page that contains it. - *

- * This interface is not intended to be extended - * nor implemented by clients. - *

- */ -public interface IGroupDialogPage extends IMessageProvider { - /** - * Sets the GridData on the specified button to - * be one that is spaced for the current dialog page units. - * - * @param button the button to set the GridData - * @return the GridData set on the specified button - */ - public GridData setButtonGridData(Button button); - - /** - * Sets the message for this page with an indication of what type - * of message it is. - *

- * The valid message types are one of NONE, - * INFORMATION, WARNING, or ERROR. - *

- * - * @param newMessage the message, or null to clear the message - * @param newType the message type - */ - public void setMessage(String newMessage, int newType); - - /** - * Updates the page's valid state using the group's - * current valid state. This will cause the dialog's - * buttons dependent on the page's valid state to - * update to reflect the new state. - */ - public void updateValidState(); - - /** - * Converts a height in characters to a height in pixels. - * - * @param chars the height in characters to be converted - * @return the corresponding height in pixels - */ - public int convertHeightHint(int chars); -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/dialog/ExternalToolVariableForm.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/dialog/ExternalToolVariableForm.java deleted file mode 100644 index 5a9de70..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/dialog/ExternalToolVariableForm.java +++ /dev/null @@ -1,221 +0,0 @@ -package net.sourceforge.phpdt.externaltools.internal.dialog; - -/********************************************************************** -Copyright (c) 2002 IBM Corp. and others. All rights reserved. -This file is 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: -**********************************************************************/ - -import net.sourceforge.phpdt.externaltools.group.IGroupDialogPage; -import net.sourceforge.phpdt.externaltools.internal.registry.ExternalToolVariable; -import net.sourceforge.phpdt.externaltools.model.ToolUtil; -import net.sourceforge.phpdt.externaltools.variable.IVariableComponent; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.StackLayout; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.graphics.Font; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.List; - -/** - * Visual grouping of controls that allows the user to - * select a variable and configure it with extra - * information. - */ -public class ExternalToolVariableForm { - private static final int VISIBLE_ITEM_COUNT = 9; - - private String variableListLabelText; - private ExternalToolVariable[] variables; - private IVariableComponent[] components; - private IGroupDialogPage page; - - private Label variableListLabel; - private List variableList; - private Composite variableComposite; - private StackLayout variableLayout; - private int activeComponentIndex = -1; - - /** - * Creates the visual grouping - * - * @param variableListLabelText the label text to use for identifying the list of variables - * @param variables the collection of variables to display to the user - */ - public ExternalToolVariableForm(String variableListLabelText, ExternalToolVariable[] variables) { - super(); - this.variableListLabelText = variableListLabelText; - this.variables = variables; - this.components = new IVariableComponent[variables.length]; - } - - public Composite createContents(Composite parent, IGroupDialogPage page) { - Font font = parent.getFont(); - - this.page = page; - - Composite mainComposite = new Composite(parent, SWT.NONE); - GridLayout layout = new GridLayout(); - layout.marginWidth = 0; - layout.marginHeight = 0; - layout.numColumns = 1; - GridData data = new GridData(GridData.FILL_BOTH); - mainComposite.setLayout(layout); - mainComposite.setLayoutData(data); - - variableListLabel = new Label(mainComposite, SWT.NONE); - variableListLabel.setText(variableListLabelText); - data = new GridData(GridData.HORIZONTAL_ALIGN_FILL); - data.horizontalSpan = 1; - variableListLabel.setLayoutData(data); - variableListLabel.setFont(font); - - variableList = new List(mainComposite, SWT.SINGLE | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL); - data = new GridData(GridData.FILL_HORIZONTAL); - data.heightHint = variableList.getItemHeight() * VISIBLE_ITEM_COUNT; - variableList.setLayoutData(data); - variableList.setFont(font); - - variableComposite = new Composite(mainComposite, SWT.NONE); - variableLayout = new StackLayout(); - variableLayout.marginWidth = 0; - variableLayout.marginHeight = 0; - data = new GridData(GridData.FILL_BOTH); - variableComposite.setLayout(variableLayout); - variableComposite.setLayoutData(data); - variableComposite.setFont(font); - - createVariableComponents(data); - - populateVariableList(); - - variableList.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - updateVariableComposite(null, false); - } - }); - - setEnabled(true); - return mainComposite; - } - - /** - * Creates the visual component for each variable - * and determine the initial size so the form - * can be layout properly. - */ - private void createVariableComponents(GridData data) { - for (int i = 0; i < variables.length; i++) { - ExternalToolVariable var = variables[i]; - components[i] = var.getComponent(); - components[i].createContents(variableComposite, var.getTag(), page); - Control control = components[i].getControl(); - if (control != null) { - Point newSize = control.computeSize(SWT.DEFAULT, SWT.DEFAULT, true); - data.widthHint = Math.max(newSize.x, data.widthHint); - data.heightHint = Math.max(newSize.y, data.heightHint); - } - } - } - - /** - * Returns the formatted variable or null if - * none selected. - */ - public String getSelectedVariable() { - if (activeComponentIndex != -1) { - String varValue = components[activeComponentIndex].getVariableValue(); - return ToolUtil.buildVariableTag(variables[activeComponentIndex].getTag(), varValue); - } - - return null; - } - - /** - * Returns whether the current variable selection is - * valid, including the selected variable value. - */ - public boolean isValid() { - if (activeComponentIndex != -1) - return components[activeComponentIndex].isValid(); - - return true; - } - - private void populateVariableList() { - String[] items = new String[variables.length]; - StringBuffer buffer = new StringBuffer(80); - for (int i = 0; i < variables.length; i++) { - ToolUtil.buildVariableTag(variables[i].getTag(), null, buffer); - buffer.append(" - "); //$NON-NLS-1$ - buffer.append(variables[i].getDescription()); - items[i] = buffer.toString(); - buffer.setLength(0); - } - variableList.setItems(items); - } - - public void selectVariable(String varName, String varValue) { - if (varName != null && varName.length() > 0) { - for (int i = 0; i < variables.length; i++) { - if (varName.equals(variables[i].getTag())) { - variableList.select(i); - updateVariableComposite(varValue, true); - return; - } - } - } - - variableList.deselectAll(); - updateVariableComposite(varValue, false); - } - - private void setComponentVisible(int index) { - if (index == -1) - variableLayout.topControl = null; - else - variableLayout.topControl = components[index].getControl(); - variableComposite.layout(); - } - - /** - * Enables or disables the variable form controls. - */ - public void setEnabled(boolean enabled) { - variableListLabel.setEnabled(enabled); - variableList.setEnabled(enabled); - if (enabled && variableList.getSelection().length == 0) { - if (variableList.getItemCount() > 0) { - variableList.select(0); - activeComponentIndex= 0; - } - } - variableComposite.setVisible(enabled); - } - - private void updateVariableComposite(String value, boolean setValue) { - activeComponentIndex = variableList.getSelectionIndex(); - setComponentVisible(activeComponentIndex); - if (activeComponentIndex != -1 && setValue) - components[activeComponentIndex].setVariableValue(value); - } - - /** - * Validates the current variable selection is and - * its value are acceptable. - */ - public void validate() { - if (activeComponentIndex != -1) - components[activeComponentIndex].validate(); - } -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/model/ColorManager.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/model/ColorManager.java deleted file mode 100644 index c82cdb4..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/model/ColorManager.java +++ /dev/null @@ -1,53 +0,0 @@ -package net.sourceforge.phpdt.externaltools.internal.model; - -/********************************************************************** -Copyright (c) 2000, 2002 IBM Corp. All rights reserved. -This file is 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 -**********************************************************************/ - -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; - -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.RGB; -import org.eclipse.swt.widgets.Display; - -/** - * Generic color manager. - */ -public class ColorManager { - - private static ColorManager fgColorManager; - - private ColorManager() { - } - - public static ColorManager getDefault() { - if (fgColorManager == null) { - fgColorManager= new ColorManager(); - } - return fgColorManager; - } - - protected Map fColorTable= new HashMap(10); - - public Color getColor(RGB rgb) { - Color color= (Color) fColorTable.get(rgb); - if (color == null) { - color= new Color(Display.getCurrent(), rgb); - fColorTable.put(rgb, color); - } - return color; - } - - public void dispose() { - Iterator e= fColorTable.values().iterator(); - while (e.hasNext()) - ((Color) e.next()).dispose(); - } -} - - diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/model/ExternalToolsImages.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/model/ExternalToolsImages.java deleted file mode 100644 index 24abd4b..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/model/ExternalToolsImages.java +++ /dev/null @@ -1,196 +0,0 @@ -package net.sourceforge.phpdt.externaltools.internal.model; - -/********************************************************************** -Copyright (c) 2002 IBM Corp. and others. All rights reserved. -This file is 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: -**********************************************************************/ - -import java.net.MalformedURLException; -import java.net.URL; -import java.util.HashMap; - -import net.sourceforge.phpdt.externaltools.internal.ui.IExternalToolsUIConstants; -import net.sourceforge.phpdt.externaltools.model.IExternalToolConstants; -import net.sourceforge.phpeclipse.PHPeclipsePlugin; - -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.resource.ImageRegistry; -import org.eclipse.swt.graphics.Image; -import org.eclipse.ui.externaltools.internal.model.ExternalToolsPlugin; - -/** - * The images provided by the external tools plugin. - */ -public class ExternalToolsImages { - - /** - * The image registry containing Images. - */ - private static ImageRegistry imageRegistry; - - /** - * A table of all the ImageDescriptors. - */ - private static HashMap imageDescriptors; - - private static final String ATTR_LAUNCH_CONFIG_TYPE_ICON = "icon"; //$NON-NLS-1$ - private static final String ATTR_LAUNCH_CONFIG_TYPE_ID = "configTypeID"; //$NON-NLS-1$ - - /* Declare Common paths */ - private static URL ICON_BASE_URL= null; - -// static { -// String pathSuffix = "icons/externaltools/full/"; //$NON-NLS-1$ -// -// try { -// ICON_BASE_URL= new URL(PHPeclipsePlugin.getDefault().getDescriptor().getInstallURL(), pathSuffix); -// } catch (MalformedURLException e) { -// // do nothing -// } -// } - static { - String pathSuffix = "icons/full/"; //$NON-NLS-1$ - ICON_BASE_URL= ExternalToolsPlugin.getDefault().getBundle().getEntry(pathSuffix); - } - - // Use IPath and toOSString to build the names to ensure they have the slashes correct - private final static String CTOOL= "ctool16/"; //basic colors - size 16x16 //$NON-NLS-1$ - private final static String LOCALTOOL= "clcl16/"; //basic colors - size 16x16 //$NON-NLS-1$ - private final static String DLCL= "dlcl16/"; //disabled - size 16x16 //$NON-NLS-1$ - private final static String ELCL= "elcl16/"; //enabled - size 16x16 //$NON-NLS-1$ - private final static String OBJECT= "obj16/"; //basic colors - size 16x16 //$NON-NLS-1$ - private final static String WIZBAN= "wizban/"; //basic colors - size 16x16 //$NON-NLS-1$ - private final static String OVR= "ovr16/"; //basic colors - size 7x8 //$NON-NLS-1$ - private final static String VIEW= "cview16/"; // views //$NON-NLS-1$ - - /** - * Declare all images - */ - private static void declareImages() { - // Ant View Actions - declareRegistryImage(IExternalToolsUIConstants.IMG_REMOVE, LOCALTOOL + "remove_co.gif"); //$NON-NLS-1$ - declareRegistryImage(IExternalToolsUIConstants.IMG_REMOVE_ALL, LOCALTOOL + "removeAll_co.gif"); //$NON-NLS-1$ - declareRegistryImage(IExternalToolsUIConstants.IMG_ADD, LOCALTOOL + "add_co.gif"); //$NON-NLS-1$ - declareRegistryImage(IExternalToolsUIConstants.IMG_RUN, LOCALTOOL + "run_tool.gif"); //$NON-NLS-1$ - declareRegistryImage(IExternalToolsUIConstants.IMG_SEARCH, LOCALTOOL + "search.gif"); //$NON-NLS-1$ - declareRegistryImage(IExternalToolsUIConstants.IMG_MOVE_UP, LOCALTOOL + "moveUp.gif"); //$NON-NLS-1$ - declareRegistryImage(IExternalToolsUIConstants.IMG_MOVE_DOWN, LOCALTOOL + "moveDown.gif"); //$NON-NLS-1$ - declareRegistryImage(IExternalToolsUIConstants.IMG_ACTIVATE, LOCALTOOL + "activate.gif"); //$NON-NLS-1$ - declareRegistryImage(IExternalToolsUIConstants.IMG_DEACTIVATE, LOCALTOOL + "deactivate.gif"); //$NON-NLS-1$ - declareRegistryImage(IExternalToolsUIConstants.IMG_GO_TO_FILE, LOCALTOOL + "gotoobj_tsk.gif"); //$NON-NLS-1$ - // Ant View Labels -// declareRegistryImage(IExternalToolsUIConstants.IMG_ANT_PROJECT, OBJECT + "file_obj.gif"); //$NON-NLS-1$ -// declareRegistryImage(IExternalToolsUIConstants.IMG_ANT_PROJECT_ERROR, LOCALTOOL + "ant_project_err.gif"); //$NON-NLS-1$ -// declareRegistryImage(IExternalToolsUIConstants.IMG_ANT_TARGET, LOCALTOOL + "ant_target.gif"); //$NON-NLS-1$ -// declareRegistryImage(IExternalToolsUIConstants.IMG_ANT_TARGET_ERROR, LOCALTOOL + "error.gif"); //$NON-NLS-1$ -// declareRegistryImage(IExternalToolsUIConstants.IMG_ANT_TARGET_ELEMENTS, LOCALTOOL + "elements.gif"); //$NON-NLS-1$ -// declareRegistryImage(IExternalToolsUIConstants.IMG_ANT_TARGET_ELEMENT, LOCALTOOL + "element.gif"); //$NON-NLS-1$ - // Wizards - declareRegistryImage(IExternalToolConstants.IMG_WIZBAN_EXTERNAL_TOOLS, WIZBAN + "ext_tools_wiz.gif"); //$NON-NLS-1$ - - // Actions - declareRegistryImage(IExternalToolConstants.IMG_ACTION_REFRESH, LOCALTOOL + "refresh.gif"); //$NON-NLS-1$ - - // Objects - declareRegistryImage(IExternalToolConstants.IMG_TAB_MAIN, OBJECT + "main_tab.gif"); //$NON-NLS-1$ - declareRegistryImage(IExternalToolConstants.IMG_TAB_OPTIONS, OBJECT + "options_tab.gif"); //$NON-NLS-1$ - - //ANT object - declareRegistryImage(IExternalToolConstants.IMG_TAB_ANT_TARGETS, LOCALTOOL + "ant_tsk_check.gif"); //$NON-NLS-1$ - } - - /** - * Declare an Image in the registry table. - * @param key The key to use when registering the image - * @param path The path where the image can be found. This path is relative to where - * this plugin class is found (i.e. typically the packages directory) - */ - private final static void declareRegistryImage(String key, String path) { - ImageDescriptor desc= ImageDescriptor.getMissingImageDescriptor(); - try { - desc= ImageDescriptor.createFromURL(makeIconFileURL(path)); - } catch (MalformedURLException me) { - //ExternalToolsPlugin.log(me); - } - imageRegistry.put(key, desc); - imageDescriptors.put(key, desc); - } - - /** - * Returns the ImageRegistry. - */ - public static ImageRegistry getImageRegistry() { - if (imageRegistry == null) { - initializeImageRegistry(); - } - return imageRegistry; - } - - /** - * Initialize the image registry by declaring all of the required - * graphics. This involves creating JFace image descriptors describing - * how to create/find the image should it be needed. - * The image is not actually allocated until requested. - * - * Prefix conventions - * Wizard Banners WIZBAN_ - * Preference Banners PREF_BAN_ - * Property Page Banners PROPBAN_ - * Color toolbar CTOOL_ - * Enable toolbar ETOOL_ - * Disable toolbar DTOOL_ - * Local enabled toolbar ELCL_ - * Local Disable toolbar DLCL_ - * Object large OBJL_ - * Object small OBJS_ - * View VIEW_ - * Product images PROD_ - * Misc images MISC_ - * - * Where are the images? - * The images (typically gifs) are found in the same location as this plugin class. - * This may mean the same package directory as the package holding this class. - * The images are declared using this.getClass() to ensure they are looked up via - * this plugin class. - * @see JFace's ImageRegistry - */ - public static ImageRegistry initializeImageRegistry() { - imageRegistry= new ImageRegistry(PHPeclipsePlugin.getStandardDisplay()); - imageDescriptors = new HashMap(30); - declareImages(); - return imageRegistry; - } - - /** - * Returns the Image identified by the given key, - * or null if it does not exist. - */ - public static Image getImage(String key) { - return getImageRegistry().get(key); - } - - /** - * Returns the ImageDescriptor identified by the given key, - * or null if it does not exist. - */ - public static ImageDescriptor getImageDescriptor(String key) { - if (imageDescriptors == null) { - initializeImageRegistry(); - } - return (ImageDescriptor)imageDescriptors.get(key); - } - - private static URL makeIconFileURL(String iconPath) throws MalformedURLException { - if (ICON_BASE_URL == null) { - throw new MalformedURLException(); - } - - return new URL(ICON_BASE_URL, iconPath); - } -} - - diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/model/ExternalToolsModelMessages.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/model/ExternalToolsModelMessages.java deleted file mode 100644 index 7e56a8b..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/model/ExternalToolsModelMessages.java +++ /dev/null @@ -1,61 +0,0 @@ -package net.sourceforge.phpdt.externaltools.internal.model; - -/********************************************************************** -Copyright (c) 2002 IBM Corp. and others. All rights reserved. -This file is 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: -**********************************************************************/ - -import java.text.MessageFormat; -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -/** - * Utility class which helps managing messages - */ -public final class ExternalToolsModelMessages { - private static final String RESOURCE_BUNDLE= "net.sourceforge.phpdt.externaltools.internal.model.ExternalToolsModelMessages"; //$NON-NLS-1$ - private static ResourceBundle bundle = ResourceBundle.getBundle(RESOURCE_BUNDLE); - - private ExternalToolsModelMessages(){ - // prevent instantiation of class - } - - /** - * Returns the formatted message for the given key in - * the resource bundle. - * - * @param key the message name - * @param args the message arguments - * @return the formatted message - */ - public static String format(String key, Object[] args) { - return MessageFormat.format(getString(key), args); - } - - /** - * Returns the message with the given key in - * the resource bundle. If there isn't any value under - * the given key, the key is returned. - * - * @param key the message name - * @return the message - */ - public static String getString(String key) { - try { - return bundle.getString(key); - } catch (MissingResourceException e) { - return key; - } - } - - /** - * Returns the resource bundle for the plug-in - */ - public static ResourceBundle getResourceBundle() { - return bundle; - } -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/model/ExternalToolsModelMessages.properties b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/model/ExternalToolsModelMessages.properties deleted file mode 100644 index a16efff..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/model/ExternalToolsModelMessages.properties +++ /dev/null @@ -1,300 +0,0 @@ -# ====================================================================== -# Copyright (c) 2002 IBM Corp. and others. All rights reserved. -# This file is 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: -# ====================================================================== - -# ======================================================================= -# Base External Tool -# ======================================================================= - -ExternalTool.nameMustContainOneChar = The external tool name must contain at least one letter or number. -ExternalTool.nameContainsInvalidChar = The external tool name must contain only letters, numbers, hyphens, and spaces. - -ToolUtil.dirLocVarBetweenText = The variable for the directory location cannot have any other text before or after itself. -ToolUtil.dirLocVarFormatWrong = The variable for the directory location is not in a valid format. -ToolUtil.dirLocVarMissing = The variable named ''{0}'' for the directory location does not exist. -ToolUtil.dirLocVarExpandFailed = The variable named ''{0}'' for the directory location could not be expanded. -ToolUtil.fileLocVarBetweenText = The variable for the file location cannot have any other text before or after itself. -ToolUtil.fileLocVarFormatWrong = The variable for the file location is not in a valid format. -ToolUtil.fileLocVarMissing = The variable named ''{0}'' for the file location does not exist. -ToolUtil.fileLocVarExpandFailed = The variable named ''{0}'' for the file location could not be expanded. -ToolUtil.argumentVarFormatWrong = A variable for the arguments is not in a valid format. -ToolUtil.argumentVarMissing = The variable named ''{0}'' for the arguments does not exist. -ToolUtil.argumentVarExpandFailed = The variable named ''{0}'' for the arguments could not be expanded. - -ExternalToolRegistry.loadToolFailure = Press the Details button for more information. -ExternalToolRegistry.fileNotFoundError = Could not find external tool storage file. -ExternalToolRegistry.ioLoadError = Problems reading external tool storage file. -ExternalToolRegistry.ioSaveError = Problems writing external tool storage file. -ExternalToolRegistry.loadErrorTitle = Problem Loading External Tools. -ExternalToolRegistry.loadErrorMessage = Could not load all external tools. -ExternalToolRegistry.noToolFilename = External tool filename for storage not specified. -ExternalToolRegistry.deleteToolFileFailed = Could not delete external tool file ''{0}''. - -ExternalToolStorage.deleteErrorTitle = Problem Deleting External Tool. -ExternalToolStorage.deleteErrorMessage = Could not delete external tool. Refresh list and try again. -ExternalToolStorage.reloadErrorTitle = Problem Refreshing External Tools -ExternalToolStorage.reloadErrorMessage = Could not load all external tools. -ExternalToolStorage.saveErrorTitle = Problem Saving External Tool. -ExternalToolStorage.saveErrorMessage = Could not save external tool. Please try again. - -NewExternalToolAction.text = &New -NewExternalToolAction.toolTip = New External Tool Wizard - -CopyExternalToolAction.text = &Copy -CopyExternalToolAction.toolTip = Copy External Tool - -PasteExternalToolAction.text = &Paste -PasteExternalToolAction.toolTip = Paste External Tool - -DeleteExternalToolAction.text = &Delete -DeleteExternalToolAction.toolTip = Delete External Tool -DeleteExternalToolAction.confirmToolDeleteTitle = Confirm External Tool Delete -DeleteExternalToolAction.confirmToolDeleteMsg = Are you sure want to delete ''{0}''? - -RenameExternalToolAction.text = Rena&me -RenameExternalToolAction.toolTip = Rename External Tool - -RefreshViewAction.text = Re&fresh -RefreshViewAction.toolTip = Refresh External Tool View - -RunExternalToolAction.text = R&un -RunExternalToolAction.toolTip = Run External Tool - -RunWithExternalToolAction.text = Run &With... -RunWithExternalToolAction.toolTip = Prompt for Arguments and Run External Tool - -EditExternalToolPropertiesAction.text = P&roperties -EditExternalToolPropertiesAction.toolTip = Edit External Tool Properties - -ExternalToolMainGroup.locationLabel = &Location: -ExternalToolMainGroup.locationBrowseLabel = B&rowse... -ExternalToolMainGroup.descriptionLabel = D&escription: -ExternalToolMainGroup.nameLabel = Na&me: -ExternalToolMainGroup.workDirLabel = &Working Directory: -ExternalToolMainGroup.workDirBrowseLabel = Br&owse... -ExternalToolMainGroup.nameRequired = External tool name cannot be empty. -ExternalToolMainGroup.nameAlreadyExist = Another external tool exists with the same name. -ExternalToolMainGroup.locationRequired = External tool location cannot be empty. -ExternalToolMainGroup.invalidLocation = External tool location does not exist or is invalid. -ExternalToolMainGroup.invalidWorkDir = External tool working directory does not exist or is invalid. - -ExternalToolOptionGroup.captureOutputLabel = &Capture output messages from running tool -ExternalToolOptionGroup.showConsoleLabel = &Show console when tool is run -ExternalToolOptionGroup.runBackgroundLabel = &Run tool in background -ExternalToolOptionGroup.openPerspLabel = &Open perspective when tool is run: -ExternalToolOptionGroup.argumentLabel = Ar&guments: -ExternalToolOptionGroup.argumentInstruction = Note: Enclose an argument containing spaces using double-quotes ("). Not\napplicable for variables. -ExternalToolOptionGroup.argumentVariableLabel = &Variables... -ExternalToolOptionGroup.promptArgLabel = &Prompt for arguments before running tool -ExternalToolOptionGroup.showInMenuLabel = S&how in Run > External Tools menu -ExternalToolOptionGroup.saveDirtyEditorsLabel = Save dirty &editors before running tool - -ExternalToolRefreshGroup.refreshLabel = &Refresh resources after running tool -ExternalToolRefreshGroup.recursiveLabel = Recursively &include sub-folders -ExternalToolRefreshGroup.scopeLabel = Choose &Scope Variable: - -ExternalToolNewWizard.shellTitle = New External Tool -ExternalToolNewWizard.optionPageTitle = Options -ExternalToolNewWizard.optionPageDescription = Configure the options when the external tool is run. -ExternalToolNewWizard.refreshPageTitle = Refresh Scope -ExternalToolNewWizard.refreshPageDescription = Specify which resources to refresh after the external tool is run. - -ExternalToolVariable.componentErrorMessage = Problem displaying UI component of selected variable. - -ResourceComponent.selectedResLabel = &Use selected resource -ResourceComponent.specificResLabel = Us&e specific resource: -ResourceComponent.selectionRequired = A specific resource must be selected from the list. - -RunExternalToolAction.openPerspProblem = Failed to open the perspective. -RunExternalToolAction.openPerspTitle = Open Perspective Problem -RunExternalToolAction.runProblem = Could not run the external tool. -RunExternalToolAction.runErrorTitle = Run Tool Problem -RunExternalToolAction.internalError = External tool runner internal error - -DefaultRunnerContext.runningExternalTool = Running external tool... -DefaultRunnerContext.invalidLocation = The file does not exist for the external tool named {0}. -DefaultRunnerContext.invalidDirectory = The working directory does not exist for the external tool named {0}. -DefaultRunnerContext.refreshResources = Refresh resources... -DefaultRunnerContext.noToolRunner = The no valid runner provided for the external tool named {0}. -DefaultRunnerContext.invalidRefreshVarFormat = Invalid refresh scope variable format for the external tool named {0}. -DefaultRunnerContext.noRefreshVarNamed = Could not find refresh scope variable called ''{1}'' for the external tool named {0}. - -ExternalToolMenuDelegate.showView = Show External Tools View -ExternalToolMenuDelegate.runRecent = Run Last Tool -ExternalToolMenuDelegate.configure = Configure... - - -# ======================================================================= -# Program External Tool Type -# ======================================================================= - -ProgramRunner.runningToolLabel = Running external tool: {0} -ProgramRunner.internalErrorMessage = Internal error -ProgramRunner.callingRuntimeExec = Calling runtime exec with:\n -ProgramRunner.program = Program: {0}\n -ProgramRunner.argument = Argument: {0}\n -ProgramRunner.workDir = Working Directory: {0}\n - - -# ======================================================================= -# OLD STUFF -# ======================================================================= - -ConfigurationDialog.shellTitle = External Tools Configuration -ConfigurationDialog.dialogTitle = External Tools -ConfigurationDialog.dialogMessage = Configure an external tool to run a program, batch file, or Ant build file. -ConfigurationDialog.toolList = &Tools: -ConfigurationDialog.newButton = &New... -ConfigurationDialog.editButton = &Edit... -ConfigurationDialog.removeButton = &Remove -ConfigurationDialog.upButton = &Up -ConfigurationDialog.downButton = &Down -ConfigurationDialog.details = Det&ails: -ConfigurationDialog.detailMessage = Location: {0}\nArguments: {1}\nDirectory: {2} - -EditDialog.newShellTitle = New External Tool -EditDialog.editShellTitle = Edit External Tool -EditDialog.dialogTitle = External Tool -EditDialog.newDialogMessage = Create an external tool to run a program, batch file, or Ant build file. -EditDialog.editDialogMessage = Edit an external tool to run a program, batch file, or Ant build file. -EditDialog.howToSelectAntTargets = To choose Ant targets, press the ''Browse Variables'' button and select ''Ant targets''. -EditDialog.nameLabel = &Name: -EditDialog.locationLabel = Tool &Location: -EditDialog.argumentLabel = Tool &Arguments: -EditDialog.dirLabel = Working &Directory: -EditDialog.refreshOption = After running, &refresh: -EditDialog.browseWkspButton1 = Browse &Workspace... -EditDialog.browseFileSysButton1 = Browse &File System... -EditDialog.browseVarsButton = Browse &Variables... -EditDialog.directoryBrowseButton = Browse &Options... -EditDialog.refreshOptionButton = Browse O&ptions... -EditDialog.browseWorkspaceTitle = Browse Workspace -EditDialog.selectTool = &Select the external tool to use: -EditDialog.selectResource = &Select the resource to use: -EditDialog.selectContainer = &Select the container to use: -EditDialog.selectDirectory = &Select the working directory to use: -EditDialog.selectTargets = &Select the Ant targets to use: -EditDialog.selectFolder = &Select the folder to use: -EditDialog.browseVarTitle = Browse Variables -EditDialog.browseDirTitle = Browse Working Directory Options -EditDialog.selectVar = &Select a variable to use: -EditDialog.selectDir = &Select a working directory option: -EditDialog.dirBrowseWorkspace = Browse workspace -EditDialog.dirBrowseFileSystem = Browse file system -EditDialog.varWorkspaceLocLabel = Workspace location -EditDialog.varProjectLocLabel = Selected resource's project location -EditDialog.varContainerLocLabel = Selected resource's container location -EditDialog.varResourceLocLabel = Selected resource location -EditDialog.varProjectPathLabel = Selected resource's project full path -EditDialog.varContainerPathLabel = Selected resource's container full path -EditDialog.varResourcePathLabel = Selected resource full path -EditDialog.varProjectNameLabel = Selected resource's project name -EditDialog.varContainerNameLabel = Selected resource's container name -EditDialog.varResourceNameLabel = Selected resource name -EditDialog.varProjectXLocLabel = Specific resource's project location -EditDialog.varContainerXLocLabel = Specific resource's container location -EditDialog.varResourceXLocLabel = Specific resource location -EditDialog.varProjectXPathLabel = Specific resource's project full path -EditDialog.varContainerXPathLabel = Specific resource's container full path -EditDialog.varResourceXPathLabel = Specific resource full path -EditDialog.varProjectXNameLabel = Specific resource's project name -EditDialog.varContainerXNameLabel = Specific resource's container name -EditDialog.varResourceXNameLabel = Specific resource name -EditDialog.varBuildTypeNameLabel = Build type -EditDialog.varAntTargetLabel = Ant targets -EditDialog.browseProjectTitle = Browse Projects -EditDialog.selectProject = &Select a project to use: -EditDialog.noToolName = Enter a name for the tool -EditDialog.noToolLocation = Enter a location for the tool -EditDialog.missingToolLocation = Tool location does not exist or is invalid -EditDialog.missingToolDirectory = Tool working directory does not exist or is invalid -EditDialog.refreshScopeNone = Nothing -EditDialog.refreshScopeWorkspace = Workspace -EditDialog.refreshScopeProject = Current project -EditDialog.refreshScopeProjectX = Project named {0} -EditDialog.refreshScopeWorkingSet = Working set named {0} -EditDialog.browseRefreshTitle = Browse Refresh Scopes -EditDialog.selectRefresh = &Select the refresh scope to use: -EditDialog.refreshNothingLabel = Nothing -EditDialog.refreshWorkspaceLabel = Current workspace -EditDialog.refreshProjectLabel = Current project -EditDialog.refreshProjectXLabel = Specific project -EditDialog.refreshWorkingSetLabel = Specific working set -EditDialog.showLogLabel = S&how execution log on console -EditDialog.errorTitle = Edit External Tool Problem -EditDialog.errorReadAntFile = Problems reading Ant build file: {0} -EditDialog.noAntTargets = Could not find any targets in Ant build file: {0} - -ExternalToolsRegistry.saveStateErrorTitle = Problem Saving External Tool -ExternalToolsRegistry.saveStateError = Could not write external tool configurations to disk.\n\nPlease try again. - -BuilderPropertyPage.description = Add external tools to the build order. -BuilderPropertyPage.newButton = &New... -BuilderPropertyPage.editButton = &Edit... -BuilderPropertyPage.removeButton = &Remove -BuilderPropertyPage.upButton = &Up -BuilderPropertyPage.downButton = &Down -BuilderPropertyPage.statusMessage = Internal error -BuilderPropertyPage.errorTitle = External Tool Builder Problem -BuilderPropertyPage.errorMessage = Internal error -BuilderPropertyPage.invalidBuildTool = Invalid External Tool Builder -BuilderPropertyPage.missingBuilder = Missing builder ({0}) - -ExternalToolsAction.configure = &Configure... - -LogConsoleDocument.externalTool = External Tool - -LogConsoleView.copy = &Copy@Ctrl+C -LogConsoleView.expandAll = &Expand All -LogConsoleView.selectAll = Select &All@Ctrl+A -LogConsoleView.clearOutput = Clear Output -LogConsoleView.hideOutputStructureTree = Hide Output Structure Tree -LogConsoleView.showOutputStructureTree = Show Output Structure Tree -LogConsoleView.showTree = &Show Tree -LogConsoleView.showSelectedElementOnly = Show Output of Selected Element Only -LogConsoleView.showCompleteOutput = Show Complete Output -LogConsoleView.findAction.label = Find/Replace - -LogTreeLabelProvider.invalidItemName = Invalid item name - -ToolsPreferencePage.errorColor = &Error: -ToolsPreferencePage.warningColor = &Warning: -ToolsPreferencePage.infoColor = I&nformation: -ToolsPreferencePage.verboseColor = Ve&rbose: -ToolsPreferencePage.debugColor = Deb&ug: -ToolsPreferencePage.font = Console font setting: -ToolsPreferencePage.description = Console text color settings. - -BuildCanceledException.canceled = Canceled - -AntUtil.antFileNotFound = Could not open Ant build file. -AntUtil.parserConfigError = Internal parser configuration error. -AntUtil.ioError = Could not read content of Ant build file. -AntUtil.formatError = Could not parse content of Ant build file. -AntUtil.invalidAntBuildFile = Invalid content format of Ant build file. - -AntAction.runErrorTitle = Run Ant Problem -AntAction.errorReadAntFile = Problems reading Ant build file: {0} -AntAction.noAntTargets = Could not find any targets in Ant build file: {0} - -AntLaunchWizard.shellTitle = Run Ant -AntLaunchWizard.dialogTitle = Run -AntLaunchWizard.dialogDescription = Run an Ant build file -AntLaunchWizard.runningAnt = Running Ant -AntLaunchWizard.runAntProblem = A problem occurred executing the Ant file. See the log console for details. -AntLaunchWizard.runErrorTitle = Run Ant Problem -AntLaunchWizard.internalAntError = Ant runner internal error - -AntLaunchWizardPage.targetLabel = Available &targets: -AntLaunchWizardPage.argsLabel = &Arguments: -AntLaunchWizardPage.showLogLabel = S&how execution log in console - -AntTargetLabelProvider.defaultTarget = Default - -ExternalToolsDialog.External_Tools_1=External Tools -ExternalToolsDialog.Create,_manage,_and_run_external_tools_2=Create, manage, and run external tools diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/model/ExternalToolsPlugin.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/model/ExternalToolsPlugin.java deleted file mode 100644 index 40d31b9..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/model/ExternalToolsPlugin.java +++ /dev/null @@ -1,207 +0,0 @@ -package net.sourceforge.phpdt.externaltools.internal.model; - -/********************************************************************** -Copyright (c) 2002 IBM Corp. and others. All rights reserved. -This file is 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: -**********************************************************************/ - -import java.net.MalformedURLException; -import java.net.URL; - -import net.sourceforge.phpdt.externaltools.internal.registry.ArgumentVariableRegistry; -import net.sourceforge.phpdt.externaltools.internal.registry.PathLocationVariableRegistry; -import net.sourceforge.phpdt.externaltools.internal.registry.RefreshScopeVariableRegistry; -import net.sourceforge.phpdt.externaltools.model.IExternalToolConstants; -import net.sourceforge.phpeclipse.PHPeclipsePlugin; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.preference.PreferenceConverter; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.resource.ImageRegistry; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.RGB; -import org.eclipse.ui.IWorkbenchWindow; -import org.osgi.framework.Bundle; - -/** - * External tools plug-in class - */ -public final class ExternalToolsPlugin { // extends AbstractUIPlugin { - /** - * Status representing no problems encountered during operation. - */ - public static final IStatus OK_STATUS = new Status(IStatus.OK, IExternalToolConstants.PLUGIN_ID, 0, "", null); //$NON-NLS-1$ - - private static ExternalToolsPlugin plugin; - - private RefreshScopeVariableRegistry refreshVarRegistry; - private PathLocationVariableRegistry fileLocVarRegistry; - private PathLocationVariableRegistry dirLocVarRegistry; - private ArgumentVariableRegistry argumentVarRegistry; - - /** - * Create an instance of the External Tools plug-in. - */ - public ExternalToolsPlugin() { // IPluginDescriptor descriptor) { - // super(descriptor); - plugin = this; - } - - /** - * Returns the default instance of the receiver. - * This represents the runtime plugin. - */ - public static ExternalToolsPlugin getDefault() { - return plugin; - } - - /** - * Returns a new IStatus for this plug-in - */ - public static IStatus newErrorStatus(String message, Throwable exception) { - return new Status(Status.ERROR, IExternalToolConstants.PLUGIN_ID, 0, message, exception); - } - - /** - * Returns a new CoreException for this plug-in - */ - public static CoreException newError(String message, Throwable exception) { - return new CoreException(new Status(Status.ERROR, IExternalToolConstants.PLUGIN_ID, 0, message, exception)); - } - - /** - * Returns the registry of refresh scope variables. - */ - public ArgumentVariableRegistry getArgumentVariableRegistry() { - if (argumentVarRegistry == null) - argumentVarRegistry = new ArgumentVariableRegistry(); - return argumentVarRegistry; - } - - /** - * Returns the registry of directory location variables. - */ - public PathLocationVariableRegistry getDirectoryLocationVariableRegistry() { - if (dirLocVarRegistry == null) - dirLocVarRegistry = new PathLocationVariableRegistry(IExternalToolConstants.EXTENSION_POINT_DIRECTORY_VARIABLES); - return dirLocVarRegistry; - } - - /** - * Returns the registry of file location variables. - */ - public PathLocationVariableRegistry getFileLocationVariableRegistry() { - if (fileLocVarRegistry == null) - fileLocVarRegistry = new PathLocationVariableRegistry(IExternalToolConstants.EXTENSION_POINT_FILE_VARIABLES); - return fileLocVarRegistry; - } - - /** - * Returns the registry of refresh scope variables. - */ - public RefreshScopeVariableRegistry getRefreshVariableRegistry() { - if (refreshVarRegistry == null) - refreshVarRegistry = new RefreshScopeVariableRegistry(); - return refreshVarRegistry; - } - - /** - * Writes the message to the plug-in's log - * - * @param message the text to write to the log - */ - public void log(String message, Throwable exception) { - IStatus status = newErrorStatus(message, exception); - // getLog().log(status); - PHPeclipsePlugin.log(status); - } - - /** - * Returns the ImageDescriptor for the icon with the given path - * - * @return the ImageDescriptor object - */ - public ImageDescriptor getImageDescriptor(String path) { - try { - Bundle bundle= PHPeclipsePlugin.getDefault().getBundle(); - URL installURL = bundle.getEntry("/"); //$NON-NLS-1$ - URL url = new URL(installURL, path); - return ImageDescriptor.createFromURL(url); - } catch (MalformedURLException e) { - return null; - } - } - - /* (non-Javadoc) - * Method declared in AbstractUIPlugin. - */ - public void initializeDefaultPreferences(IPreferenceStore prefs) { - prefs.setDefault(IPreferenceConstants.PROMPT_FOR_MIGRATION, true); - - PreferenceConverter.setDefault(prefs, IPreferenceConstants.CONSOLE_ERROR_RGB, new RGB(255, 0, 0)); // red - exactly the same as debug Consol - PreferenceConverter.setDefault(prefs, IPreferenceConstants.CONSOLE_WARNING_RGB, new RGB(255, 100, 0)); // orange - PreferenceConverter.setDefault(prefs, IPreferenceConstants.CONSOLE_INFO_RGB, new RGB(0, 0, 255)); // blue - PreferenceConverter.setDefault(prefs, IPreferenceConstants.CONSOLE_VERBOSE_RGB, new RGB(0, 200, 125)); // green - PreferenceConverter.setDefault(prefs, IPreferenceConstants.CONSOLE_DEBUG_RGB, new RGB(0, 0, 0)); // black - } - - public static IWorkbenchWindow getActiveWorkbenchWindow() { - return PHPeclipsePlugin.getDefault().getWorkbench().getActiveWorkbenchWindow(); - } - - /** - * Returns the standard display to be used. The method first checks, if - * the thread calling this method has an associated display. If so, this - * display is returned. Otherwise the method returns the default display. - */ -// public static Display getStandardDisplay() { -// Display display = Display.getCurrent(); -// if (display == null) { -// display = Display.getDefault(); -// } -// return display; -// } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#createImageRegistry() - */ - protected ImageRegistry createImageRegistry() { - return ExternalToolsImages.initializeImageRegistry(); - } - - /** - * @see org.eclipse.core.runtime.Plugin#startup() - */ -// public void startup() throws CoreException { -//// super.startup(); -// getStandardDisplay().asyncExec( -// new Runnable() { -// public void run() { -// //initialize the variable context manager -// VariableContextManager.getDefault(); -// } -// }); -// } -// -// /** -// * @see org.eclipse.core.runtime.Plugin#shutdown() -// */ -// public void shutdown() throws CoreException { -// // super.shutdown(); -// ColorManager.getDefault().dispose(); -// } - - /** - * Returns the preference color, identified by the given preference. - */ - public static Color getPreferenceColor(String pref) { - return ColorManager.getDefault().getColor(PreferenceConverter.getColor(PHPeclipsePlugin.getDefault().getPreferenceStore(), pref)); - } -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/model/IHelpContextIds.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/model/IHelpContextIds.java deleted file mode 100644 index 1517fc2..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/model/IHelpContextIds.java +++ /dev/null @@ -1,58 +0,0 @@ -package net.sourceforge.phpdt.externaltools.internal.model; - -/********************************************************************** -Copyright (c) 2002 IBM Corp. and others. All rights reserved. -This file is 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: -**********************************************************************/ - -/** - * Help context ids for the external tools. - *

- * This interface contains constants only; it is not intended to be implemented - * or extended. - *

- */ -public interface IHelpContextIds { - public static final String PREFIX = "net.sourceforge.phpdt.externaltools."; //$NON-NLS-1$ - - // Actions - public static final String NEW_TOOL_ACTION = PREFIX + "new_tool_action_context"; //$NON-NLS-1$ - public static final String DUPLICATE_TOOL_ACTION = PREFIX + "duplicate_tool_action_context"; //$NON-NLS-1$ - public static final String DELETE_TOOL_ACTION = PREFIX + "delete_tool_action_context"; //$NON-NLS-1$ - public static final String RENAME_TOOL_ACTION = PREFIX + "rename_tool_action_context"; //$NON-NLS-1$ - public static final String REFRESH_VIEW_ACTION = PREFIX + "refresh_view_action_context"; //$NON-NLS-1$ - public static final String RUN_TOOL_ACTION = PREFIX + "run_tool_action_context"; //$NON-NLS-1$ - public static final String RUN_WITH_TOOL_ACTION = PREFIX + "run_with_tool_action_context"; //$NON-NLS-1$ - public static final String EDIT_TOOL_PROPERTIES_ACTION = PREFIX + "edit_tool_properties_action_context"; //$NON-NLS-1$ - //public static final String ANT_ACTION = PREFIX + "ant_action_context"; //$NON-NLS-1$ - - // Dialogs - public static final String RESOURCE_SELECTION_DIALOG = PREFIX + "resource_selection_dialog_context"; //$NON-NLS-1$ - - // Preference Pages - //public static final String ANT_PREFERENCE_PAGE = PREFIX + "ant_preference_page_context"; //$NON-NLS-1$ - public static final String ADD_TASK_DIALOG = PREFIX + "add_task_dialog_context"; //$NON-NLS-1$ - - // Property Pages - public static final String TOOL_MAIN_PROPERTY_PAGE = PREFIX + "tool_main_property_page_context"; //$NON-NLS-1$ - public static final String TOOL_OPTION_PROPERTY_PAGE = PREFIX + "tool_option_property_page_context"; //$NON-NLS-1$ - public static final String TOOL_REFRESH_PROPERTY_PAGE = PREFIX + "tool_refresh_property_page_context"; //$NON-NLS-1$ - public static final String ANT_TARGETS_PROPERTY_PAGE = PREFIX + "ant_targets_property_page_context"; //$NON-NLS-1$ - - // Views - public static final String EXTERNAL_TOOLS_VIEW = PREFIX + "external_tools_view_context"; //$NON-NLS-1$ - - // Wizards -// public static final String ANT_LAUNCH_WIZARD = PREFIX + "ant_launch_wizard_context"; //$NON-NLS-1$ - - // Wizard Pages - public static final String TOOL_MAIN_WIZARD_PAGE = PREFIX + "tool_main_wizard_page_context"; //$NON-NLS-1$ - public static final String TOOL_OPTION_WIZARD_PAGE = PREFIX + "tool_option_wizard_page_context"; //$NON-NLS-1$ - public static final String TOOL_REFRESH_WIZARD_PAGE = PREFIX + "tool_refresh_wizard_page_context"; //$NON-NLS-1$ -// public static final String ANT_TARGETS_WIZARD_PAGE = PREFIX + "ant_targets_wizard_page_context"; //$NON-NLS-1$ -// public static final String ANT_LAUNCH_WIZARD_PAGE = PREFIX + "ant_launch_wizard_page_context"; //$NON-NLS-1$ -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/model/IPreferenceConstants.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/model/IPreferenceConstants.java deleted file mode 100644 index c6b52fb..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/model/IPreferenceConstants.java +++ /dev/null @@ -1,31 +0,0 @@ -package net.sourceforge.phpdt.externaltools.internal.model; - -/********************************************************************** -Copyright (c) 2002 IBM Corp. and others. All rights reserved. -This file is 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: -**********************************************************************/ - -/** - * Constants used to identify user preferences. - */ -public interface IPreferenceConstants { - - public static final String PROMPT_FOR_MIGRATION = "externaltools.builders.promptForMigration"; //$NON-NLS-1$ - - public static final String CONSOLE_ERROR_RGB = "externaltools.console.errorColor"; //$NON-NLS-1$ - public static final String CONSOLE_WARNING_RGB = "externaltools.console.warningColor"; //$NON-NLS-1$ - public static final String CONSOLE_INFO_RGB = "externaltools.console.infoColor"; //$NON-NLS-1$ - public static final String CONSOLE_VERBOSE_RGB = "externaltools.console.verboseColor"; //$NON-NLS-1$ - public static final String CONSOLE_DEBUG_RGB = "externaltools.console.debugColor"; //$NON-NLS-1$ - - public static final String ANTVIEW_INCLUDE_ERROR_SEARCH_RESULTS = "externaltools.antview.includeErrorSearchResults"; //$NON-NLS-1$ - public static final String ANTVIEW_LAST_SEARCH_STRING = "externaltools.antview.lastSearchString"; //$NON-NLS-1$ - public static final String ANTVIEW_LAST_WORKINGSET_SEARCH_SCOPE = "externaltools.antview.lastSearchScope"; //$NON-NLS-1$ - public static final String ANTVIEW_USE_WORKINGSET_SEARCH_SCOPE = "externaltools.antview.useWorkingSetSearchScope"; //$NON-NLS-1$ - - public static final String ANT_FIND_BUILD_FILE_NAMES = "ant.findBuildFileNames"; //$NON-NLS-1$ -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/model/ToolMessages.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/model/ToolMessages.java deleted file mode 100644 index c2b9bf7..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/model/ToolMessages.java +++ /dev/null @@ -1,61 +0,0 @@ -package net.sourceforge.phpdt.externaltools.internal.model; - -/********************************************************************** -Copyright (c) 2002 IBM Corp. and others. All rights reserved. -This file is 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: -**********************************************************************/ - -import java.text.MessageFormat; -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -/** - * Utility class which helps managing messages - */ -public final class ToolMessages { - private static final String RESOURCE_BUNDLE= "net.sourceforge.phpdt.externaltools.internal.model.messages"; //$NON-NLS-1$ - private static ResourceBundle bundle = ResourceBundle.getBundle(RESOURCE_BUNDLE); - - private ToolMessages(){ - // prevent instantiation of class - } - - /** - * Returns the formatted message for the given key in - * the resource bundle. - * - * @param key the message name - * @param args the message arguments - * @return the formatted message - */ - public static String format(String key, Object[] args) { - return MessageFormat.format(getString(key), args); - } - - /** - * Returns the message with the given key in - * the resource bundle. If there isn't any value under - * the given key, the key is returned. - * - * @param key the message name - * @return the message - */ - public static String getString(String key) { - try { - return bundle.getString(key); - } catch (MissingResourceException e) { - return key; - } - } - - /** - * Returns the resource bundle for the plug-in - */ - public static ResourceBundle getResourceBundle() { - return bundle; - } -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/model/VariableContextManager.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/model/VariableContextManager.java deleted file mode 100644 index 686413e..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/model/VariableContextManager.java +++ /dev/null @@ -1,171 +0,0 @@ -package net.sourceforge.phpdt.externaltools.internal.model; - -/********************************************************************** -Copyright (c) 2000, 2002 IBM Corp. All rights reserved. -This file is 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 -**********************************************************************/ - -import java.util.Map; - -import net.sourceforge.phpdt.externaltools.variable.ExpandVariableContext; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.ISelectionListener; -import org.eclipse.ui.ISelectionService; -import org.eclipse.ui.IWindowListener; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.externaltools.internal.model.ExternalToolBuilder; - -/** - * Maintains the context used to expand variables. The context is based on - * the selected resource, unless a build is in progress - in which case - * the context is based on the project being built.. - */ -public class VariableContextManager implements IWindowListener, ISelectionListener { - - // singleton - private static VariableContextManager fgDefault; - - private IResource fSelectedResource = null; - - private boolean fBuilding = false; - private IProject fProject = null; - private int fKind; - - private VariableContextManager() { - IWorkbench workbench = PlatformUI.getWorkbench(); - if (workbench != null) { //may be running headless - workbench.addWindowListener(this); - IWorkbenchWindow activeWindow = workbench.getActiveWorkbenchWindow(); - if (activeWindow != null) { - windowActivated(activeWindow); - } - } - } - - /** - * Returns the singleton resource selection manager - * - * @return VariableContextManager - */ - public static VariableContextManager getDefault() { - if (fgDefault == null) { - fgDefault = new VariableContextManager(); - } - return fgDefault; - } - - /** - * @see org.eclipse.ui.IWindowListener#windowActivated(org.eclipse.ui.IWorkbenchWindow) - */ - public void windowActivated(IWorkbenchWindow window) { - fSelectedResource = null; - ISelectionService service = window.getSelectionService(); - service.addSelectionListener(this); - IWorkbenchPage page = window.getActivePage(); - if (page != null) { - IWorkbenchPart part = page.getActivePart(); - if (part != null) { - ISelection selection = service.getSelection(); - if (selection != null) { - selectionChanged(part, selection); - } - } - } - } - - /** - * @see org.eclipse.ui.IWindowListener#windowClosed(org.eclipse.ui.IWorkbenchWindow) - */ - public void windowClosed(IWorkbenchWindow window) { - window.getSelectionService().removeSelectionListener(this); - } - - /** - * @see org.eclipse.ui.IWindowListener#windowDeactivated(org.eclipse.ui.IWorkbenchWindow) - */ - public void windowDeactivated(IWorkbenchWindow window) { - window.getSelectionService().removeSelectionListener(this); - } - - /** - * @see org.eclipse.ui.IWindowListener#windowOpened(org.eclipse.ui.IWorkbenchWindow) - */ - public void windowOpened(IWorkbenchWindow window) { - } - - /** - * @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection) - */ - public void selectionChanged(IWorkbenchPart part, ISelection selection) { - IResource selectedResource = null; - if (selection instanceof IStructuredSelection) { - Object result = ((IStructuredSelection)selection).getFirstElement(); - if (result instanceof IResource) { - selectedResource = (IResource) result; - } else if (result instanceof IAdaptable) { - selectedResource = (IResource)((IAdaptable) result).getAdapter(IResource.class); - } - } - - if (selectedResource == null) { - // If the active part is an editor, get the file resource used as input. - if (part instanceof IEditorPart) { - IEditorPart editorPart = (IEditorPart) part; - IEditorInput input = editorPart.getEditorInput(); - selectedResource = (IResource) input.getAdapter(IResource.class); - } - } - - fSelectedResource = selectedResource; - } - - /** - * Returns the active variable context. The context is that of the selected - * resource, or a project being built. - * - * @return variable context - */ - public ExpandVariableContext getVariableContext() { - if (fBuilding) { - return new ExpandVariableContext(fProject, fKind); - } else { - return new ExpandVariableContext(fSelectedResource); - } - } - - /** - * Notification that the given project is being built. - * - * @param project - * @param kind - * @see ExternalToolBuilder#build(int, Map, IProgressMonitor) - */ - public void buildStarted(IProject project, int kind) { - fBuilding = true; - fProject = project; - fKind = kind; - } - - /** - * Notification the building the current project has completed. - * @see ExternalToolBuilder#build(int, Map, IProgressMonitor) - */ - public void buildEnded() { - fBuilding = false; - fProject= null; - } -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/model/messages.properties b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/model/messages.properties deleted file mode 100644 index 875ed09..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/model/messages.properties +++ /dev/null @@ -1,332 +0,0 @@ -# ====================================================================== -# Copyright (c) 2002 IBM Corp. and others. All rights reserved. -# This file is 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: -# ====================================================================== - -# ======================================================================= -# Base External Tool -# ======================================================================= - -ExternalTool.nameMustContainOneChar = The external tool name must contain at least one letter or number. -ExternalTool.nameContainsInvalidChar = The external tool name must contain only letters, numbers, hyphens, and spaces. - -ToolUtil.dirLocVarBetweenText = The variable for the directory location cannot have any other text before or after itself. -ToolUtil.dirLocVarFormatWrong = The variable for the directory location is not in a valid format. -ToolUtil.dirLocVarMissing = The variable named ''{0}'' for the directory location does not exist. -ToolUtil.dirLocVarExpandFailed = The variable named ''{0}'' for the directory location could not be expanded. -ToolUtil.fileLocVarBetweenText = The variable for the file location cannot have any other text before or after itself. -ToolUtil.fileLocVarFormatWrong = The variable for the file location is not in a valid format. -ToolUtil.fileLocVarMissing = The variable named ''{0}'' for the file location does not exist. -ToolUtil.fileLocVarExpandFailed = The variable named ''{0}'' for the file location could not be expanded. -ToolUtil.argumentVarFormatWrong = A variable for the arguments is not in a valid format. -ToolUtil.argumentVarMissing = The variable named ''{0}'' for the arguments does not exist. -ToolUtil.argumentVarExpandFailed = The variable named ''{0}'' for the arguments could not be expanded. - -ExternalToolRegistry.loadToolFailure = Press the Details button for more information. -ExternalToolRegistry.fileNotFoundError = Could not find external tool storage file. -ExternalToolRegistry.ioLoadError = Problems reading external tool storage file. -ExternalToolRegistry.ioSaveError = Problems writing external tool storage file. -ExternalToolRegistry.loadErrorTitle = Problem Loading External Tools. -ExternalToolRegistry.loadErrorMessage = Could not load all external tools. -ExternalToolRegistry.noToolFilename = External tool filename for storage not specified. -ExternalToolRegistry.deleteToolFileFailed = Could not delete external tool file ''{0}''. - -ExternalToolStorage.deleteErrorTitle = Problem Deleting External Tool. -ExternalToolStorage.deleteErrorMessage = Could not delete external tool. Refresh list and try again. -ExternalToolStorage.reloadErrorTitle = Problem Refreshing External Tools -ExternalToolStorage.reloadErrorMessage = Could not load all external tools. -ExternalToolStorage.saveErrorTitle = Problem Saving External Tool. -ExternalToolStorage.saveErrorMessage = Could not save external tool. Please try again. - -NewExternalToolAction.text = &New -NewExternalToolAction.toolTip = New External Tool Wizard - -CopyExternalToolAction.text = &Copy -CopyExternalToolAction.toolTip = Copy External Tool - -PasteExternalToolAction.text = &Paste -PasteExternalToolAction.toolTip = Paste External Tool - -DeleteExternalToolAction.text = &Delete -DeleteExternalToolAction.toolTip = Delete External Tool -DeleteExternalToolAction.confirmToolDeleteTitle = Confirm External Tool Delete -DeleteExternalToolAction.confirmToolDeleteMsg = Are you sure want to delete ''{0}''? - -RenameExternalToolAction.text = Rena&me -RenameExternalToolAction.toolTip = Rename External Tool - -RefreshViewAction.text = Re&fresh -RefreshViewAction.toolTip = Refresh External Tool View - -RunExternalToolAction.text = R&un -RunExternalToolAction.toolTip = Run External Tool - -RunWithExternalToolAction.text = Run &With... -RunWithExternalToolAction.toolTip = Prompt for Arguments and Run External Tool - -EditExternalToolPropertiesAction.text = P&roperties -EditExternalToolPropertiesAction.toolTip = Edit External Tool Properties - -ExternalToolMainGroup.locationLabel = &Location: -ExternalToolMainGroup.locationBrowseLabel = B&rowse... -ExternalToolMainGroup.descriptionLabel = D&escription: -ExternalToolMainGroup.nameLabel = Na&me: -ExternalToolMainGroup.workDirLabel = &Working Directory: -ExternalToolMainGroup.workDirBrowseLabel = Br&owse... -ExternalToolMainGroup.nameRequired = External tool name cannot be empty. -ExternalToolMainGroup.nameAlreadyExist = Another external tool exists with the same name. -ExternalToolMainGroup.locationRequired = External tool location cannot be empty. -ExternalToolMainGroup.invalidLocation = External tool location does not exist or is invalid. -ExternalToolMainGroup.invalidWorkDir = External tool working directory does not exist or is invalid. - -ExternalToolOptionGroup.captureOutputLabel = &Capture output messages from running tool -ExternalToolOptionGroup.showConsoleLabel = &Show console when tool is run -ExternalToolOptionGroup.runBackgroundLabel = &Run tool in background -ExternalToolOptionGroup.openPerspLabel = &Open perspective when tool is run: -ExternalToolOptionGroup.argumentLabel = Ar&guments: -ExternalToolOptionGroup.argumentInstruction = Note: Enclose an argument containing spaces using double-quotes ("). Not\napplicable for variables. -ExternalToolOptionGroup.argumentVariableLabel = &Variables... -ExternalToolOptionGroup.promptArgLabel = &Prompt for arguments before running tool -ExternalToolOptionGroup.showInMenuLabel = S&how in Run > External Tools menu -ExternalToolOptionGroup.saveDirtyEditorsLabel = Save dirty &editors before running tool - -ExternalToolRefreshGroup.refreshLabel = &Refresh resources after running tool -ExternalToolRefreshGroup.recursiveLabel = Recursively &include sub-folders -ExternalToolRefreshGroup.scopeLabel = Choose &Scope Variable: - -ExternalToolNewWizard.shellTitle = New External Tool -ExternalToolNewWizard.optionPageTitle = Options -ExternalToolNewWizard.optionPageDescription = Configure the options when the external tool is run. -ExternalToolNewWizard.refreshPageTitle = Refresh Scope -ExternalToolNewWizard.refreshPageDescription = Specify which resources to refresh after the external tool is run. - -ExternalToolVariable.componentErrorMessage = Problem displaying UI component of selected variable. - -ResourceComponent.selectedResLabel = &Use selected resource -ResourceComponent.specificResLabel = Us&e specific resource: -ResourceComponent.selectionRequired = A specific resource must be selected from the list. - -RunExternalToolAction.openPerspProblem = Failed to open the perspective. -RunExternalToolAction.openPerspTitle = Open Perspective Problem -RunExternalToolAction.runProblem = Could not run the external tool. -RunExternalToolAction.runErrorTitle = Run Tool Problem -RunExternalToolAction.internalError = External tool runner internal error - -DefaultRunnerContext.runningExternalTool = Running external tool... -DefaultRunnerContext.invalidLocation = The file does not exist for the external tool named {0}. -DefaultRunnerContext.invalidDirectory = The working directory does not exist for the external tool named {0}. -DefaultRunnerContext.refreshResources = Refresh resources... -DefaultRunnerContext.noToolRunner = The no valid runner provided for the external tool named {0}. -DefaultRunnerContext.invalidRefreshVarFormat = Invalid refresh scope variable format for the external tool named {0}. -DefaultRunnerContext.noRefreshVarNamed = Could not find refresh scope variable called ''{1}'' for the external tool named {0}. - -ExternalToolMenuDelegate.showView = Show External Tools View -ExternalToolMenuDelegate.runRecent = Run Last Tool -ExternalToolMenuDelegate.configure = Configure... - - -# ======================================================================= -# Program External Tool Type -# ======================================================================= - -ProgramRunner.runningToolLabel = Running external tool: {0} -ProgramRunner.internalErrorMessage = Internal error -ProgramRunner.callingRuntimeExec = Calling runtime exec with:\n -ProgramRunner.program = Program: {0}\n -ProgramRunner.argument = Argument: {0}\n -ProgramRunner.workDir = Working Directory: {0}\n - - -# ======================================================================= -# Ant Build File External Tool Type -# ======================================================================= - -AntFileRunner.callingAntRunner = Calling Ant runner with:\n -AntFileRunner.antFile = Ant build file: {0}\n -AntFileRunner.argument = Argument: {0}\n -AntFileRunner.target = Target: {0}\n - -AntTargetsGroup.availableTargetsLabel = A&vailable targets: -AntTargetsGroup.activeTargetsLabel = A&ctive targets: -AntTargetsGroup.addLabel = > -AntTargetsGroup.removeLabel = < -AntTargetsGroup.addAllLabel = >> -AntTargetsGroup.removeAllLabel = << -AntTargetsGroup.descriptionLabel = &Target description: -AntTargetsGroup.upLabel = U&p -AntTargetsGroup.downLabel = D&own -AntTargetsGroup.getTargetsTitle = Problem retrieving targets -AntTargetsGroup.getTargetsProblem = Could not retrieve targets. -AntTargetsGroup.runDefaultTargetLabel = R&un default target ({0}) -AntTargetsGroup.runDefaultTargetUnknownLabel = R&un default target -AntTargetsGroup.showSubTargetsLabel = S&how sub-targets - -AntExternalToolNewWizard.antTargetsPageTitle = Ant Targets -AntExternalToolNewWizard.antTargetsPageDescription = Specify which Ant targets to execute when the external tool is run. -AntExternalToolNewWizard.promptForArgumentLabel = &Prompt for targets and arguments before running tool - -AntOptionGroupPropertyPage.promptForArgumentLabel = &Prompt for targets and arguments before running tool - - - -# ======================================================================= -# OLD STUFF -# ======================================================================= - -ConfigurationDialog.shellTitle = External Tools Configuration -ConfigurationDialog.dialogTitle = External Tools -ConfigurationDialog.dialogMessage = Configure an external tool to run a program, batch file, or Ant build file. -ConfigurationDialog.toolList = &Tools: -ConfigurationDialog.newButton = &New... -ConfigurationDialog.editButton = &Edit... -ConfigurationDialog.removeButton = &Remove -ConfigurationDialog.upButton = &Up -ConfigurationDialog.downButton = &Down -ConfigurationDialog.details = Det&ails: -ConfigurationDialog.detailMessage = Location: {0}\nArguments: {1}\nDirectory: {2} - -EditDialog.newShellTitle = New External Tool -EditDialog.editShellTitle = Edit External Tool -EditDialog.dialogTitle = External Tool -EditDialog.newDialogMessage = Create an external tool to run a program, batch file, or Ant build file. -EditDialog.editDialogMessage = Edit an external tool to run a program, batch file, or Ant build file. -EditDialog.howToSelectAntTargets = To choose Ant targets, press the ''Browse Variables'' button and select ''Ant targets''. -EditDialog.nameLabel = &Name: -EditDialog.locationLabel = Tool &Location: -EditDialog.argumentLabel = Tool &Arguments: -EditDialog.dirLabel = Working &Directory: -EditDialog.refreshOption = After running, &refresh: -EditDialog.browseWkspButton1 = Browse &Workspace... -EditDialog.browseFileSysButton1 = Browse &File System... -EditDialog.browseVarsButton = Browse &Variables... -EditDialog.directoryBrowseButton = Browse &Options... -EditDialog.refreshOptionButton = Browse O&ptions... -EditDialog.browseWorkspaceTitle = Browse Workspace -EditDialog.selectTool = &Select the external tool to use: -EditDialog.selectResource = &Select the resource to use: -EditDialog.selectContainer = &Select the container to use: -EditDialog.selectDirectory = &Select the working directory to use: -EditDialog.selectTargets = &Select the Ant targets to use: -EditDialog.selectFolder = &Select the folder to use: -EditDialog.browseVarTitle = Browse Variables -EditDialog.browseDirTitle = Browse Working Directory Options -EditDialog.selectVar = &Select a variable to use: -EditDialog.selectDir = &Select a working directory option: -EditDialog.dirBrowseWorkspace = Browse workspace -EditDialog.dirBrowseFileSystem = Browse file system -EditDialog.varWorkspaceLocLabel = Workspace location -EditDialog.varProjectLocLabel = Selected resource's project location -EditDialog.varContainerLocLabel = Selected resource's container location -EditDialog.varResourceLocLabel = Selected resource location -EditDialog.varProjectPathLabel = Selected resource's project full path -EditDialog.varContainerPathLabel = Selected resource's container full path -EditDialog.varResourcePathLabel = Selected resource full path -EditDialog.varProjectNameLabel = Selected resource's project name -EditDialog.varContainerNameLabel = Selected resource's container name -EditDialog.varResourceNameLabel = Selected resource name -EditDialog.varProjectXLocLabel = Specific resource's project location -EditDialog.varContainerXLocLabel = Specific resource's container location -EditDialog.varResourceXLocLabel = Specific resource location -EditDialog.varProjectXPathLabel = Specific resource's project full path -EditDialog.varContainerXPathLabel = Specific resource's container full path -EditDialog.varResourceXPathLabel = Specific resource full path -EditDialog.varProjectXNameLabel = Specific resource's project name -EditDialog.varContainerXNameLabel = Specific resource's container name -EditDialog.varResourceXNameLabel = Specific resource name -EditDialog.varBuildTypeNameLabel = Build type -EditDialog.varAntTargetLabel = Ant targets -EditDialog.browseProjectTitle = Browse Projects -EditDialog.selectProject = &Select a project to use: -EditDialog.noToolName = Enter a name for the tool -EditDialog.noToolLocation = Enter a location for the tool -EditDialog.missingToolLocation = Tool location does not exist or is invalid -EditDialog.missingToolDirectory = Tool working directory does not exist or is invalid -EditDialog.refreshScopeNone = Nothing -EditDialog.refreshScopeWorkspace = Workspace -EditDialog.refreshScopeProject = Current project -EditDialog.refreshScopeProjectX = Project named {0} -EditDialog.refreshScopeWorkingSet = Working set named {0} -EditDialog.browseRefreshTitle = Browse Refresh Scopes -EditDialog.selectRefresh = &Select the refresh scope to use: -EditDialog.refreshNothingLabel = Nothing -EditDialog.refreshWorkspaceLabel = Current workspace -EditDialog.refreshProjectLabel = Current project -EditDialog.refreshProjectXLabel = Specific project -EditDialog.refreshWorkingSetLabel = Specific working set -EditDialog.showLogLabel = S&how execution log on console -EditDialog.errorTitle = Edit External Tool Problem -EditDialog.errorReadAntFile = Problems reading Ant build file: {0} -EditDialog.noAntTargets = Could not find any targets in Ant build file: {0} - -ExternalToolsRegistry.saveStateErrorTitle = Problem Saving External Tool -ExternalToolsRegistry.saveStateError = Could not write external tool configurations to disk.\n\nPlease try again. - -BuilderPropertyPage.description = Add external tools to the build order. -BuilderPropertyPage.newButton = &New... -BuilderPropertyPage.editButton = &Edit... -BuilderPropertyPage.removeButton = &Remove -BuilderPropertyPage.upButton = &Up -BuilderPropertyPage.downButton = &Down -BuilderPropertyPage.statusMessage = Internal error -BuilderPropertyPage.errorTitle = External Tool Builder Problem -BuilderPropertyPage.errorMessage = Internal error -BuilderPropertyPage.invalidBuildTool = Invalid External Tool Builder -BuilderPropertyPage.missingBuilder = Missing builder ({0}) - -ExternalToolsAction.configure = &Configure... - -LogConsoleDocument.externalTool = External Tool - -LogConsoleView.copy = &Copy@Ctrl+C -LogConsoleView.expandAll = &Expand All -LogConsoleView.selectAll = Select &All@Ctrl+A -LogConsoleView.clearOutput = Clear Output -LogConsoleView.hideOutputStructureTree = Hide Output Structure Tree -LogConsoleView.showOutputStructureTree = Show Output Structure Tree -LogConsoleView.showTree = &Show Tree -LogConsoleView.showSelectedElementOnly = Show Output of Selected Element Only -LogConsoleView.showCompleteOutput = Show Complete Output -LogConsoleView.findAction.label = Find/Replace - -LogTreeLabelProvider.invalidItemName = Invalid item name - -ToolsPreferencePage.errorColor = &Error: -ToolsPreferencePage.warningColor = &Warning: -ToolsPreferencePage.infoColor = I&nformation: -ToolsPreferencePage.verboseColor = Ve&rbose: -ToolsPreferencePage.debugColor = Deb&ug: -ToolsPreferencePage.font = Console font setting: -ToolsPreferencePage.description = Console text color settings. - -BuildCanceledException.canceled = Canceled - -AntUtil.antFileNotFound = Could not open Ant build file. -AntUtil.parserConfigError = Internal parser configuration error. -AntUtil.ioError = Could not read content of Ant build file. -AntUtil.formatError = Could not parse content of Ant build file. -AntUtil.invalidAntBuildFile = Invalid content format of Ant build file. - -AntAction.runErrorTitle = Run Ant Problem -AntAction.errorReadAntFile = Problems reading Ant build file: {0} -AntAction.noAntTargets = Could not find any targets in Ant build file: {0} - -AntLaunchWizard.shellTitle = Run Ant -AntLaunchWizard.dialogTitle = Run -AntLaunchWizard.dialogDescription = Run an Ant build file -AntLaunchWizard.runningAnt = Running Ant -AntLaunchWizard.runAntProblem = A problem occurred executing the Ant file. See the log console for details. -AntLaunchWizard.runErrorTitle = Run Ant Problem -AntLaunchWizard.internalAntError = Ant runner internal error - -AntLaunchWizardPage.targetLabel = Available &targets: -AntLaunchWizardPage.argsLabel = &Arguments: -AntLaunchWizardPage.showLogLabel = S&how execution log in console - -AntTargetLabelProvider.defaultTarget = Default - -ExternalToolsDialog.External_Tools_1=External Tools -ExternalToolsDialog.Create,_manage,_and_run_external_tools_2=Create, manage, and run external tools diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/program/launchConfigurations/BackgroundResourceRefresher.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/program/launchConfigurations/BackgroundResourceRefresher.java deleted file mode 100644 index 3b1136a..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/program/launchConfigurations/BackgroundResourceRefresher.java +++ /dev/null @@ -1,107 +0,0 @@ -package net.sourceforge.phpdt.externaltools.internal.program.launchConfigurations; - -/********************************************************************** -Copyright (c) 2002 IBM Corp. and others. All rights reserved. -This file is 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: -**********************************************************************/ - -import java.lang.reflect.InvocationTargetException; - -import net.sourceforge.phpdt.externaltools.launchConfigurations.ExternalToolsUtil; -import net.sourceforge.phpdt.externaltools.variable.ExpandVariableContext; -import net.sourceforge.phpeclipse.PHPeclipsePlugin; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.debug.core.DebugEvent; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.IDebugEventSetListener; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.model.IProcess; -import org.eclipse.jface.dialogs.ProgressMonitorDialog; -import org.eclipse.jface.operation.IRunnableWithProgress; - -/** - * Refreshes resources as specified by a lanunch configuration, when - * an associated process terminates. - */ -public class BackgroundResourceRefresher implements IDebugEventSetListener, Runnable, IRunnableWithProgress { - - private ExpandVariableContext fContext; - private ILaunchConfiguration fConfiguration; - private IProcess fProcess; - - public BackgroundResourceRefresher(ILaunchConfiguration configuration, IProcess process, ExpandVariableContext context) { - fConfiguration = configuration; - fProcess = process; - fContext = context; - } - - /** - * If the process has already terminated, resource refreshing is done - * immediately in the current thread. Otherwise, refreshing is done when the - * process terminates. - */ - public void startBackgroundRefresh() { - synchronized (fProcess) { - if (fProcess.isTerminated()) { - refresh(); - } else { - DebugPlugin.getDefault().addDebugEventListener(this); - } - } - } - - /** - * @see org.eclipse.debug.core.IDebugEventSetListener#handleDebugEvents(org.eclipse.debug.core.DebugEvent) - */ - public void handleDebugEvents(DebugEvent[] events) { - for (int i = 0; i < events.length; i++) { - DebugEvent event = events[i]; - if (event.getSource() == fProcess && event.getKind() == DebugEvent.TERMINATE) { - DebugPlugin.getDefault().removeDebugEventListener(this); - refresh(); - break; - } - } - } - - /** - * Submits a runnable to do the refresh - */ - protected void refresh() { - PHPeclipsePlugin.getStandardDisplay().asyncExec(this); - } - - /** - * Creates a dialog to run the refresh - * - * @see java.lang.Runnable#run() - */ - public void run() { - ProgressMonitorDialog dialog = new ProgressMonitorDialog(PHPeclipsePlugin.getStandardDisplay().getActiveShell()); - try { - dialog.run(true, true, this); - } catch (InvocationTargetException e) { - // report the exception - } catch (InterruptedException e) { - } - } - /** - * Peforms the refresh - * - * @see org.eclipse.jface.operation.IRunnableWithProgress#run(org.eclipse.core.runtime.IProgressMonitor) - */ - public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { - try { - ExternalToolsUtil.refreshResources(fConfiguration, fContext, monitor); - } catch (CoreException e) { - throw new InvocationTargetException(e); - } - } - -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/program/launchConfigurations/ProgramBuilderTabGroup.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/program/launchConfigurations/ProgramBuilderTabGroup.java deleted file mode 100644 index 46c3b6d..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/program/launchConfigurations/ProgramBuilderTabGroup.java +++ /dev/null @@ -1,29 +0,0 @@ -package net.sourceforge.phpdt.externaltools.internal.program.launchConfigurations; - -/********************************************************************** -Copyright (c) 2000, 2002 IBM Corp. All rights reserved. -This file is 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 -**********************************************************************/ - -import net.sourceforge.phpdt.externaltools.launchConfigurations.ExternalToolsRefreshTab; - -import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup; -import org.eclipse.debug.ui.ILaunchConfigurationDialog; -import org.eclipse.debug.ui.ILaunchConfigurationTab; - -public class ProgramBuilderTabGroup extends AbstractLaunchConfigurationTabGroup { - - /** - * @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#createTabs(org.eclipse.debug.ui.ILaunchConfigurationDialog, java.lang.String) - */ - public void createTabs(ILaunchConfigurationDialog dialog, String mode) { - ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[] { - new ProgramMainTab(), - new ExternalToolsRefreshTab(), - }; - setTabs(tabs); - } - -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/program/launchConfigurations/ProgramLaunchDelegate.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/program/launchConfigurations/ProgramLaunchDelegate.java deleted file mode 100644 index 7df974e..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/program/launchConfigurations/ProgramLaunchDelegate.java +++ /dev/null @@ -1,138 +0,0 @@ -package net.sourceforge.phpdt.externaltools.internal.program.launchConfigurations; - -/********************************************************************** -Copyright (c) 2002 IBM Corp. and others. All rights reserved. -This file is 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: -**********************************************************************/ - -import java.io.File; - -import net.sourceforge.phpdt.externaltools.launchConfigurations.ExternalToolsUtil; -import net.sourceforge.phpdt.externaltools.variable.ExpandVariableContext; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.ILaunch; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.model.ILaunchConfigurationDelegate; -import org.eclipse.debug.core.model.IProcess; - -/** - * Launch delegate for a program. - */ -public class ProgramLaunchDelegate implements ILaunchConfigurationDelegate { - - /** - * Constructor for ProgramLaunchDelegate. - */ - public ProgramLaunchDelegate() { - super(); - } - - /** - * @see org.eclipse.debug.core.model.ILaunchConfigurationDelegate#launch(org.eclipse.debug.core.ILaunchConfiguration, java.lang.String, org.eclipse.debug.core.ILaunch, org.eclipse.core.runtime.IProgressMonitor) - */ - public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException { - - if (monitor.isCanceled()) { - return; - } - - // get variable context - ExpandVariableContext resourceContext = ExternalToolsUtil.getVariableContext(); - - if (monitor.isCanceled()) { - return; - } - - // resolve location - IPath location = ExternalToolsUtil.getLocation(configuration, resourceContext); - - if (monitor.isCanceled()) { - return; - } - - // resolve working directory - IPath workingDirectory = ExternalToolsUtil.getWorkingDirectory(configuration, resourceContext); - - if (monitor.isCanceled()) { - return; - } - - // resolve arguments - String[] arguments = ExternalToolsUtil.getArguments(configuration, resourceContext); - - if (monitor.isCanceled()) { - return; - } - - int cmdLineLength = 1; - if (arguments != null) { - cmdLineLength += arguments.length; - } - String[] cmdLine = new String[cmdLineLength]; - cmdLine[0] = location.toOSString(); - if (arguments != null) { - System.arraycopy(arguments, 0, cmdLine, 1, arguments.length); - } - - File workingDir = null; - if (workingDirectory != null) { - workingDir = workingDirectory.toFile(); - } - - if (monitor.isCanceled()) { - return; - } - - Process p = DebugPlugin.exec(cmdLine, workingDir); - IProcess process = null; - if (p != null) { - process = DebugPlugin.newProcess(launch, p, location.toOSString()); - } - process.setAttribute(IProcess.ATTR_CMDLINE, renderCommandLine(cmdLine)); - - if (ExternalToolsUtil.isBackground(configuration)) { - // refresh resources after process finishes - if (ExternalToolsUtil.getRefreshScope(configuration) != null) { - BackgroundResourceRefresher refresher = new BackgroundResourceRefresher(configuration, process, resourceContext); - refresher.startBackgroundRefresh(); - } - } else { - // wait for process to exit - while (!process.isTerminated()) { - try { - if (monitor.isCanceled()) { - process.terminate(); - break; - } - Thread.sleep(50); - } catch (InterruptedException e) { - } - } - - // refresh resources - ExternalToolsUtil.refreshResources(configuration, resourceContext, monitor); - } - - - } - - protected static String renderCommandLine(String[] commandLine) { - if (commandLine.length < 1) - return ""; //$NON-NLS-1$ - StringBuffer buf= new StringBuffer(commandLine[0]); - for (int i= 1; i < commandLine.length; i++) { - buf.append(' '); - buf.append(commandLine[i]); - } - return buf.toString(); - } - -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/program/launchConfigurations/ProgramMainTab.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/program/launchConfigurations/ProgramMainTab.java deleted file mode 100644 index 6217692..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/program/launchConfigurations/ProgramMainTab.java +++ /dev/null @@ -1,34 +0,0 @@ -package net.sourceforge.phpdt.externaltools.internal.program.launchConfigurations; - -import net.sourceforge.phpdt.externaltools.internal.ui.FileSelectionDialog; -import net.sourceforge.phpdt.externaltools.launchConfigurations.ExternalToolsMainTab; -import net.sourceforge.phpdt.externaltools.model.IExternalToolConstants; -import net.sourceforge.phpdt.externaltools.model.ToolUtil; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.ResourcesPlugin; - -public class ProgramMainTab extends ExternalToolsMainTab { - - /** - * Prompts the user for a program location within the workspace and sets the - * location as a String containing the workspace_loc variable or - * null if no location was obtained from the user. - */ - protected void handleWorkspaceLocationButtonSelected() { - FileSelectionDialog dialog; - dialog = new FileSelectionDialog(getShell(), ResourcesPlugin.getWorkspace().getRoot(), "&Select a program"); - dialog.open(); - IFile file = dialog.getResult(); - if (file == null) { - return; - } - StringBuffer buf = new StringBuffer(); - ToolUtil.buildVariableTag(IExternalToolConstants.VAR_WORKSPACE_LOC, file.getFullPath().toString(), buf); - String text= buf.toString(); - if (text != null) { - locationField.setText(text); - } - } - -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/program/launchConfigurations/ProgramTabGroup.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/program/launchConfigurations/ProgramTabGroup.java deleted file mode 100644 index 19d81a9..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/program/launchConfigurations/ProgramTabGroup.java +++ /dev/null @@ -1,30 +0,0 @@ -package net.sourceforge.phpdt.externaltools.internal.program.launchConfigurations; - -/********************************************************************** -Copyright (c) 2000, 2002 IBM Corp. All rights reserved. -This file is 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 -**********************************************************************/ - -import net.sourceforge.phpdt.externaltools.launchConfigurations.ExternalToolsRefreshTab; - -import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup; -import org.eclipse.debug.ui.CommonTab; -import org.eclipse.debug.ui.ILaunchConfigurationDialog; -import org.eclipse.debug.ui.ILaunchConfigurationTab; - -public class ProgramTabGroup extends AbstractLaunchConfigurationTabGroup { - - /** - * @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#createTabs(org.eclipse.debug.ui.ILaunchConfigurationDialog, java.lang.String) - */ - public void createTabs(ILaunchConfigurationDialog dialog, String mode) { - ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[] { - new ProgramMainTab(), - new ExternalToolsRefreshTab(), - new CommonTab() - }; - setTabs(tabs); - } -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/registry/ArgumentVariable.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/registry/ArgumentVariable.java deleted file mode 100644 index e3fc7b2..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/registry/ArgumentVariable.java +++ /dev/null @@ -1,66 +0,0 @@ -package net.sourceforge.phpdt.externaltools.internal.registry; - -/********************************************************************** -Copyright (c) 2002 IBM Corp. and others. All rights reserved. -This file is 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: -**********************************************************************/ - -import net.sourceforge.phpdt.externaltools.variable.ExpandVariableContext; -import net.sourceforge.phpdt.externaltools.variable.IVariableTextExpander; - -import org.eclipse.core.runtime.IConfigurationElement; - -/** - * Represents the variable for the argument - */ -public final class ArgumentVariable extends ExternalToolVariable { - private static final DefaultTextExpander defaultExpander = new DefaultTextExpander(); - - private IVariableTextExpander expander = null; - - /** - * Creates an argument variable - * - * @param tag the variable tag - * @param description a short description of what the variable will expand to - * @param element the configuration element - */ - /*package*/ ArgumentVariable(String tag, String description, IConfigurationElement element) { - super(tag, description, element); - } - - /** - * Returns the object that can expand the variable - * as text. - */ - public IVariableTextExpander getExpander() { - if (expander == null) { - try { - expander = (IVariableTextExpander) createObject(ExternalToolVariableRegistry.TAG_EXPANDER_CLASS); - } catch (ClassCastException exception) { - } - if (expander == null) { - expander = defaultExpander; - } - } - return expander; - } - - - /** - * Default variable text expander implementation which does - * not expand variables, but just returns null. - */ - private static final class DefaultTextExpander implements IVariableTextExpander { - /* (non-Javadoc) - * Method declared on IVariableTextExpander. - */ - public String getText(String varTag, String varValue, ExpandVariableContext context) { - return null; - } - } -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/registry/ArgumentVariableRegistry.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/registry/ArgumentVariableRegistry.java deleted file mode 100644 index 5e02868..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/registry/ArgumentVariableRegistry.java +++ /dev/null @@ -1,51 +0,0 @@ -package net.sourceforge.phpdt.externaltools.internal.registry; - -/********************************************************************** -Copyright (c) 2002 IBM Corp. and others. All rights reserved. -This file is 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: -**********************************************************************/ - -import net.sourceforge.phpdt.externaltools.model.IExternalToolConstants; - -import org.eclipse.core.runtime.IConfigurationElement; - -/** - * Registry of all available argument variables. - */ -public class ArgumentVariableRegistry extends ExternalToolVariableRegistry { - - /** - * Creates the registry and loads the variables. - */ - public ArgumentVariableRegistry() { - super(IExternalToolConstants.EXTENSION_POINT_ARGUMENT_VARIABLES); - } - - /** - * Returns the argument variable for the given tag - * or null if none. - */ - public ArgumentVariable getArgumentVariable(String tag) { - return (ArgumentVariable) findVariable(tag); - } - - /** - * Returns the list of argument variables in the registry. - */ - public ArgumentVariable[] getArgumentVariables() { - ArgumentVariable[] results = new ArgumentVariable[getVariableCount()]; - copyVariables(results); - return results; - } - - /* (non-Javadoc) - * Method declared on ExternalToolVariableRegistry. - */ - protected ExternalToolVariable newVariable(String tag, String description, IConfigurationElement element) { - return new ArgumentVariable(tag, description, element); - } -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/registry/ExternalToolMigration.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/registry/ExternalToolMigration.java deleted file mode 100644 index 9205e17..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/registry/ExternalToolMigration.java +++ /dev/null @@ -1,363 +0,0 @@ -package net.sourceforge.phpdt.externaltools.internal.registry; - -/********************************************************************** -Copyright (c) 2002 IBM Corp. and others. All rights reserved. -This file is 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: -**********************************************************************/ - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStreamReader; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; -import java.util.StringTokenizer; - -import net.sourceforge.phpdt.externaltools.internal.model.ExternalToolsPlugin; -import net.sourceforge.phpdt.externaltools.model.IExternalToolConstants; -import net.sourceforge.phpdt.externaltools.model.ToolUtil; -import net.sourceforge.phpeclipse.PHPeclipsePlugin; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.ILaunchConfigurationType; -import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; -import org.eclipse.debug.core.ILaunchManager; -import org.eclipse.ui.IMemento; -import org.eclipse.ui.WorkbenchException; -import org.eclipse.ui.XMLMemento; - -/** - * Responsible reading an old external tool format and creating - * and migrating it to create a new external tool. - */ -public final class ExternalToolMigration { - private static final String SEPERATOR = ";"; //$NON-NLS-1$ - private static final String STATE_FILE_NAME_OLD = "oldexternaltools.xml"; //$NON-NLS-1$ - private static final String STATE_FILE_NAME = "externaltools.xml"; //$NON-NLS-1$ - private static final String TAG_EXTERNALTOOLS = "externaltools"; //$NON-NLS-1$ - private static final String TAG_TOOL = "tool"; //$NON-NLS-1$ - private static final String TAG_ENTRY = "entry"; //$NON-NLS-1$ - //private static final String TAG_KEY = "key"; //$NON-NLS-1$ - private static final String TAG_VALUE = "value"; //$NON-NLS-1$ - - /* - * Ant tags - */ - //public static final String RUN_TARGETS_ATTRIBUTE = IExternalToolConstants.TOOL_TYPE_ANT_BUILD + ".runTargets"; //$NON-NLS-1$; - - /* - * 2.0 External Tool Tags - */ - private static final String TAG_TOOL_TYPE = "!{tool_type}"; //$NON-NLS-1$ - private static final String TAG_TOOL_NAME = "!{tool_name}"; //$NON-NLS-1$ - private static final String TAG_TOOL_LOCATION = "!{tool_loc}"; //$NON-NLS-1$ - private static final String TAG_TOOL_ARGUMENTS = "!{tool_args}"; //$NON-NLS-1$ - private static final String TAG_TOOL_DIRECTORY = "!{tool_dir}"; //$NON-NLS-1$ - private static final String TAG_TOOL_REFRESH = "!{tool_refresh}"; //$NON-NLS-1$ - private static final String TAG_TOOL_SHOW_LOG = "!{tool_show_log}"; //$NON-NLS-1$ - private static final String TAG_TOOL_BUILD_TYPES = "!{tool_build_types}"; //$NON-NLS-1$ - private static final String TAG_TOOL_BLOCK = "!{tool_block}"; //$NON-NLS-1$ - - // Known kind of tools - private static final String TOOL_TYPE_PROGRAM = "net.sourceforge.phpdt.externaltools.type.program"; //$NON-NLS-1$ - //private static final String TOOL_TYPE_ANT = "org.eclipse.ui.externaltools.type.ant"; //$NON-NLS-1$ - - /* - * 2.1 External Tool Keys - */ - private static final String TAG_EXTERNAL_TOOL = "externalTool"; //$NON-NLS-1$ - private static final String TAG_TYPE = "type"; //$NON-NLS-1$ - private static final String TAG_NAME = "name"; //$NON-NLS-1$ - private static final String TAG_LOCATION = "location"; //$NON-NLS-1$ - private static final String TAG_WORK_DIR = "workDirectory"; //$NON-NLS-1$ - private static final String TAG_CAPTURE_OUTPUT = "captureOutput"; //$NON-NLS-1$ - private static final String TAG_SHOW_CONSOLE = "showConsole"; //$NON-NLS-1$ - private static final String TAG_RUN_BKGRND = "runInBackground"; //$NON-NLS-1$ - private static final String TAG_OPEN_PERSP = "openPerspective"; //$NON-NLS-1$ - private static final String TAG_PROMPT_ARGS = "promptForArguments"; //$NON-NLS-1$ - private static final String TAG_SHOW_MENU = "showInMenu"; //$NON-NLS-1$ - private static final String TAG_SAVE_DIRTY = "saveDirtyEditors"; //$NON-NLS-1$ - private static final String TAG_ARGS = "arguments"; //$NON-NLS-1$ - private static final String TAG_REFRESH_SCOPE = "refreshScope"; //$NON-NLS-1$ - private static final String TAG_REFRESH_RECURSIVE = "refreshRecursive"; //$NON-NLS-1$ - private static final String TAG_RUN_BUILD_KINDS = "runForBuildKinds"; //$NON-NLS-1$ - private static final String TAG_EXTRA_ATTR = "extraAttribute"; //$NON-NLS-1$ - private static final String TAG_KEY = "key"; //$NON-NLS-1$ - private static final String TAG_VERSION = "version"; //$NON-NLS-1$ - - private static final String BUILD_TYPE_SEPARATOR = ","; //$NON-NLS-1$ - private static final String EXTRA_ATTR_SEPARATOR = "="; //$NON-NLS-1$ - - private static final String VERSION_21 = "2.1"; //$NON-NLS-1$; - - private static final String TRUE = "true"; //$NON-NLS-1$ - private static final String FALSE = "false"; //$NON-NLS-1$ - - /** - * Allows no instances. - */ - private ExternalToolMigration() { - super(); - } - - /** - * Loads the external tools from storage and - * adds them to the registry. - */ - /*package*/ - // This method is not called. It is left here in case - // we decide to do tool migration in the future - private static void readInOldTools() { - readIn20Tools(); - readIn21Tools(); - } - - private static void readIn21Tools() { - } - - public static void readIn20Tools() { - boolean migrationSuccessful = true; - IPath path = PHPeclipsePlugin.getDefault().getStateLocation(); - File file = path.append(STATE_FILE_NAME).toFile(); - if (!file.exists()) - return; - - InputStreamReader reader = null; - try { - FileInputStream input = new FileInputStream(file); - reader = new InputStreamReader(input, "utf-8"); //$NON-NLS-1$ - XMLMemento memento = XMLMemento.createReadRoot(reader); - - // Get the external tool children element - IMemento[] tools = memento.getChildren(TAG_TOOL); - for (int i = 0; i < tools.length; i++) { - HashMap args = new HashMap(); - IMemento[] entries = tools[i].getChildren(TAG_ENTRY); - for (int j = 0; j < entries.length; j++) { - String key = entries[j].getString(TAG_KEY); - if (key != null) { - String value = entries[j].getTextData(); - args.put(key, value); - } - } - ILaunchConfigurationWorkingCopy config = configFromArgumentMap(args); - if (config != null) { - try { - config.doSave(); - } catch (CoreException e) { - // TODO: Decide what to do when saving fails. - } - } - } - } catch (FileNotFoundException e) { - // Silently ignore this... - } catch (IOException e) { - ExternalToolsPlugin.getDefault().log("File I/O error with reading old external tools.", e); - migrationSuccessful = false; - } catch (WorkbenchException e) { - PHPeclipsePlugin.getDefault().getLog().log(e.getStatus()); - System.err.println("Error reading old external tools. See .log file for more details"); - migrationSuccessful = false; - } finally { - if (reader != null) { - try { - reader.close(); - } catch (IOException e) { - ExternalToolsPlugin.getDefault().log("Unable to close external tool old state reader.", e); - } - } - } - - if (migrationSuccessful) { - if (!file.renameTo(path.append(STATE_FILE_NAME_OLD).toFile())) { - ExternalToolsPlugin.getDefault().log("Unable to rename old external tool state file. Please rename externaltools.xml to oldexternaltools.xml manually.", null); - System.err.println("Unable to rename old external tool state file. Please rename externaltools.xml to oldexternaltools.xml manually."); - } - } - } - - /** - * Returns a launch configuration working copy from the argument map or - * null if the given map cannot be interpreted as a 2.0 or 2.1 - * branch external tool. The returned working copy will be unsaved and its - * location will be set to the metadata area. - */ - public static ILaunchConfigurationWorkingCopy configFromArgumentMap(Map args) { - String version = (String) args.get(TAG_VERSION); - if (VERSION_21.equals(version)) { - return configFrom21ArgumentMap(args); - } - return configFrom20ArgumentMap(args); - } - - public static ILaunchConfigurationWorkingCopy configFrom21ArgumentMap(Map commandArgs) { - String name = (String) commandArgs.get(TAG_NAME); - String type = (String) commandArgs.get(TAG_TYPE); - - ILaunchConfigurationWorkingCopy config = newConfig(type, name); - if (config == null) { - return null; - } - - config.setAttribute(IExternalToolConstants.ATTR_LOCATION, (String) commandArgs.get(TAG_LOCATION)); - config.setAttribute(IExternalToolConstants.ATTR_WORKING_DIRECTORY, (String) commandArgs.get(TAG_WORK_DIR)); - config.setAttribute(IExternalToolConstants.ATTR_CAPTURE_OUTPUT, TRUE.equals((String) commandArgs.get(TAG_CAPTURE_OUTPUT))); - config.setAttribute(IExternalToolConstants.ATTR_SHOW_CONSOLE, TRUE.equals((String) commandArgs.get(TAG_SHOW_CONSOLE))); - config.setAttribute(IExternalToolConstants.ATTR_RUN_IN_BACKGROUND, TRUE.equals((String) commandArgs.get(TAG_RUN_BKGRND))); - config.setAttribute(IExternalToolConstants.ATTR_PROMPT_FOR_ARGUMENTS, TRUE.equals((String) commandArgs.get(TAG_PROMPT_ARGS))); - config.setAttribute(IExternalToolConstants.ATTR_REFRESH_SCOPE, (String) commandArgs.get(TAG_REFRESH_SCOPE)); - config.setAttribute(IExternalToolConstants.ATTR_REFRESH_RECURSIVE, TRUE.equals((String) commandArgs.get(TAG_REFRESH_RECURSIVE))); - - config.setAttribute(IExternalToolConstants.ATTR_RUN_BUILD_KINDS, (String) commandArgs.get(TAG_RUN_BUILD_KINDS)); - - String args = (String) commandArgs.get(TAG_ARGS); - if (args != null) { - config.setAttribute(IExternalToolConstants.ATTR_TOOL_ARGUMENTS, args); - } - - String extraAttributes = (String) commandArgs.get(TAG_EXTRA_ATTR); - if (extraAttributes != null) { - StringTokenizer tokenizer = new StringTokenizer(extraAttributes, EXTRA_ATTR_SEPARATOR); - while (tokenizer.hasMoreTokens()) { - String key = tokenizer.nextToken(); - if (!tokenizer.hasMoreTokens()) - break; - String value = tokenizer.nextToken(); -// if (key.equals(RUN_TARGETS_ATTRIBUTE)) { -// // 2.1 implementation only defined 1 "extra attribute" -// config.setAttribute(IExternalToolConstants.ATTR_ANT_TARGETS, value); -// } - } - } - return config; - } - - /** - * Creates an external tool from the map. - */ - public static ILaunchConfigurationWorkingCopy configFrom20ArgumentMap(Map args) { - // Update the type... - String type = (String) args.get(TAG_TOOL_TYPE); -// if (TOOL_TYPE_ANT.equals(type)) -// type = IExternalToolConstants.TOOL_TYPE_ANT_BUILD; -// else - type = IExternalToolConstants.TOOL_TYPE_PROGRAM; - - String name = (String) args.get(TAG_TOOL_NAME); - - ILaunchConfigurationWorkingCopy config = newConfig(type, name); - if (config == null) { - return null; - } - - // Update the location... - String location = (String) args.get(TAG_TOOL_LOCATION); - if (location != null) { - ToolUtil.VariableDefinition varDef = ToolUtil.extractVariableTag(location, 0); - if (IExternalToolConstants.VAR_WORKSPACE_LOC.equals(varDef.name)) { - location = ToolUtil.buildVariableTag(IExternalToolConstants.VAR_RESOURCE_LOC, varDef.argument); - } - config.setAttribute(IExternalToolConstants.ATTR_LOCATION, location); - } - - // Update the refresh scope... - String refresh = (String) args.get(TAG_TOOL_REFRESH); - if (refresh != null) { - ToolUtil.VariableDefinition varDef = ToolUtil.extractVariableTag(refresh, 0); - if ("none".equals(varDef.name)) { //$NON-NLS-1$ - refresh = null; - } - config.setAttribute(IExternalToolConstants.ATTR_REFRESH_SCOPE, refresh); - } - - // Update the arguments - String arguments = (String) args.get(TAG_TOOL_ARGUMENTS); - String targetNames = null; - if (arguments != null) { - int start = 0; - ArrayList targets = new ArrayList(); - StringBuffer buffer = new StringBuffer(); - ToolUtil.VariableDefinition varDef = ToolUtil.extractVariableTag(arguments, start); - while (varDef.end != -1) { - if ("ant_target".equals(varDef.name) && varDef.argument != null) { //$NON-NLS-1$ - targets.add(varDef.argument); - buffer.append(arguments.substring(start, varDef.start)); - } else { - buffer.append(arguments.substring(start, varDef.end)); - } - start = varDef.end; - varDef = ToolUtil.extractVariableTag(arguments, start); - } - buffer.append(arguments.substring(start, arguments.length())); - arguments = buffer.toString(); - - buffer.setLength(0); - for (int i = 0; i < targets.size(); i++) { - String target = (String) targets.get(i); - if (target != null && target.length() > 0) { - buffer.append(target); - buffer.append(","); //$NON-NLS-1$ - } - } - targetNames = buffer.toString(); - } - if (targetNames != null && targetNames.length() > 0) { - config.setAttribute(IExternalToolConstants.ATTR_ANT_TARGETS, targetNames); - } - - // Collect the rest of the information - config.setAttribute(IExternalToolConstants.ATTR_SHOW_CONSOLE, TRUE.equals((String) args.get(TAG_TOOL_SHOW_LOG))); - config.setAttribute(IExternalToolConstants.ATTR_CAPTURE_OUTPUT, TRUE.equals((String) args.get(TAG_TOOL_SHOW_LOG))); - config.setAttribute(IExternalToolConstants.ATTR_RUN_IN_BACKGROUND, FALSE.equals((String) args.get(TAG_TOOL_BLOCK))); - config.setAttribute(IExternalToolConstants.ATTR_RUN_BUILD_KINDS, (String) args.get(TAG_TOOL_BUILD_TYPES)); - config.setAttribute(IExternalToolConstants.ATTR_TOOL_ARGUMENTS, arguments); - config.setAttribute(IExternalToolConstants.ATTR_WORKING_DIRECTORY, (String) args.get(TAG_TOOL_DIRECTORY)); - return config; - } - - /** - * Returns a new working copy with the given external tool name and external - * tool type or null if no config could be created. - */ - private static ILaunchConfigurationWorkingCopy newConfig(String type, String name) { - if (type == null || name == null) { - return null; - } - ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager(); - ILaunchConfigurationType configType; -// if (IExternalToolConstants.TOOL_TYPE_ANT_BUILD.equals(type)) { -// configType = manager.getLaunchConfigurationType(IExternalToolConstants.ID_ANT_BUILDER_LAUNCH_CONFIGURATION_TYPE); -// } else - if (IExternalToolConstants.TOOL_TYPE_PROGRAM.equals(type)) { - configType = manager.getLaunchConfigurationType(IExternalToolConstants.ID_PROGRAM_BUILDER_LAUNCH_CONFIGURATION_TYPE); - } else { - return null; - } - try { - return configType.newInstance(null, name); - } catch (CoreException e) { - return null; - } - } - - /** - * Returns the tool name extracted from the given command argument map. - * Extraction is attempted using 2.0 and 2.1 external tool formats. - */ - public static String getNameFromCommandArgs(Map commandArgs) { - String name= (String) commandArgs.get(TAG_NAME); - if (name == null) { - name= (String) commandArgs.get(TAG_TOOL_NAME); - } - return name; - } - -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/registry/ExternalToolVariable.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/registry/ExternalToolVariable.java deleted file mode 100644 index 6fbbefb..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/registry/ExternalToolVariable.java +++ /dev/null @@ -1,156 +0,0 @@ -package net.sourceforge.phpdt.externaltools.internal.registry; - -/********************************************************************** -Copyright (c) 2002 IBM Corp. and others. All rights reserved. -This file is 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: -**********************************************************************/ - -import net.sourceforge.phpdt.externaltools.group.IGroupDialogPage; -import net.sourceforge.phpdt.externaltools.internal.model.ExternalToolsModelMessages; -import net.sourceforge.phpdt.externaltools.variable.IVariableComponent; -import net.sourceforge.phpeclipse.PHPeclipsePlugin; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.jface.resource.JFaceColors; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Label; - -/** - * Abtract representation of the different variables. - */ -public abstract class ExternalToolVariable { - private static final IVariableComponent defaultComponent = new DefaultVariableComponent(false); - - private String tag; - private String description; - private IConfigurationElement element; - - /** - * Creates an variable definition - * - * @param tag the variable tag - * @param description a short description of what the variable will expand to - * @param element the configuration element - */ - /*package*/ ExternalToolVariable(String tag, String description, IConfigurationElement element) { - super(); - this.tag = tag; - this.description = description; - this.element = element; - } - - /** - * Creates an instance of the class specified by - * the given element attribute name. Can return - * null if none or if problems creating - * the instance. - */ - protected final Object createObject(String attributeName) { - try { - return element.createExecutableExtension(attributeName); - } catch (CoreException e) { - PHPeclipsePlugin.getDefault().getLog().log(e.getStatus()); - return null; - } - } - - /** - * Returns the component class to allow - * visual editing of the variable's value. - */ - public final IVariableComponent getComponent() { - String className = element.getAttribute(ExternalToolVariableRegistry.TAG_COMPONENT_CLASS); - if (className == null || className.trim().length() == 0) - return defaultComponent; - - Object component = createObject(ExternalToolVariableRegistry.TAG_COMPONENT_CLASS); - if (component == null) - return new DefaultVariableComponent(true); - else - return (IVariableComponent)component; - } - - /** - * Returns the variable's description - */ - public final String getDescription() { - return description; - } - - /** - * Returns the variable's tag - */ - public final String getTag() { - return tag; - } - - - /** - * Default variable component implementation which does not - * allow variable value editing visually. - */ - private static final class DefaultVariableComponent implements IVariableComponent { - private boolean showError = false; - private Label message = null; - - public DefaultVariableComponent(boolean showError) { - super(); - this.showError = showError; - } - - /* (non-Javadoc) - * Method declared on IVariableComponent. - */ - public Control getControl() { - return message; - } - - /* (non-Javadoc) - * Method declared on IVariableComponent. - */ - public void createContents(Composite parent, String varTag, IGroupDialogPage page) { - if (showError) { - message = new Label(parent, SWT.NONE); - GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL); - message.setLayoutData(data); - message.setFont(parent.getFont()); - message.setText(ExternalToolsModelMessages.getString("ExternalToolVariable.componentErrorMessage")); //$NON-NLS-1$ - message.setForeground(JFaceColors.getErrorText(message.getDisplay())); - } - } - - /* (non-Javadoc) - * Method declared on IVariableComponent. - */ - public String getVariableValue() { - return null; - } - - /* (non-Javadoc) - * Method declared on IVariableComponent. - */ - public boolean isValid() { - return true; - } - - /* (non-Javadoc) - * Method declared on IVariableComponent. - */ - public void setVariableValue(String varValue) { - } - - /* (non-Javadoc) - * Method declared on IVariableComponent. - */ - public void validate() { - } - } -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/registry/ExternalToolVariableRegistry.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/registry/ExternalToolVariableRegistry.java deleted file mode 100644 index bd450ba..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/registry/ExternalToolVariableRegistry.java +++ /dev/null @@ -1,137 +0,0 @@ -package net.sourceforge.phpdt.externaltools.internal.registry; - -/********************************************************************** -Copyright (c) 2002 IBM Corp. and others. All rights reserved. -This file is 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: -**********************************************************************/ - -import java.util.HashMap; - -import net.sourceforge.phpdt.externaltools.internal.model.ExternalToolsPlugin; -import net.sourceforge.phpdt.externaltools.model.IExternalToolConstants; - -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IExtension; -import org.eclipse.core.runtime.IExtensionPoint; -import org.eclipse.core.runtime.IExtensionRegistry; -import org.eclipse.core.runtime.Platform; - -/** - * General registry reader for external tool variables. - */ -public abstract class ExternalToolVariableRegistry { - // Format of the variable extension points - // null
if none found. - */ - protected final ExternalToolVariable findVariable(String tag) { - return (ExternalToolVariable) variables.get(tag); - } - - /** - * Returns the number of variables in the registry. - */ - public final int getVariableCount() { - return variables.size(); - } - - /** - * Load the available variables - */ - private void loadVariables() { - variables = new HashMap(); - IExtensionRegistry registry= Platform.getExtensionRegistry(); -// IPluginRegistry registry = Platform.getPluginRegistry(); - IExtensionPoint point = registry.getExtensionPoint(IExternalToolConstants.PLUGIN_ID, extensionPointId); - if (point != null) { - IExtension[] extensions = point.getExtensions(); - for (int i = 0; i < extensions.length; i++) { - IConfigurationElement[] elements = extensions[i].getConfigurationElements(); - for (int j = 0; j < elements.length; j++) { - IConfigurationElement element = elements[j]; - if (element.getName().equals(TAG_VARIABLE)) { - String tag = element.getAttribute(TAG_TAG); - String description = element.getAttribute(TAG_DESCRIPTION); - String className = element.getAttribute(TAG_EXPANDER_CLASS); - - boolean valid = true; - if (tag == null || tag.length() == 0) { - valid = false; - ExternalToolsPlugin.getDefault().log("Missing tag attribute value for variable element.", null); //$NON-NLS-1$ - } - if (description == null || description.length() == 0) { - valid = false; - ExternalToolsPlugin.getDefault().log("Missing description attribute value for variable element.", null); //$NON-NLS-1$ - } - if (className == null || className.length() == 0) { - valid = false; - ExternalToolsPlugin.getDefault().log("Missing expander class attribute value for variable element.", null); //$NON-NLS-1$ - } - - if (valid) - variables.put(tag, newVariable(tag, description, element)); - } - } - } - } - } - - /** - * Creates a new variable from the specified information. - */ - protected abstract ExternalToolVariable newVariable(String tag, String description, IConfigurationElement element); -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/registry/PathLocationVariable.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/registry/PathLocationVariable.java deleted file mode 100644 index 4385da3..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/registry/PathLocationVariable.java +++ /dev/null @@ -1,63 +0,0 @@ -package net.sourceforge.phpdt.externaltools.internal.registry; - -/********************************************************************** -Copyright (c) 2002 IBM Corp. and others. All rights reserved. -This file is 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: -**********************************************************************/ - -import net.sourceforge.phpdt.externaltools.variable.ExpandVariableContext; -import net.sourceforge.phpdt.externaltools.variable.IVariableLocationExpander; - -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IPath; - -/** - * Represents the variable for the path location - */ -public final class PathLocationVariable extends ExternalToolVariable { - private static final DefaultLocationExpander defaultExpander = new DefaultLocationExpander(); - - private IVariableLocationExpander expander = null; - - /** - * Creates a path location variable - * - * @param tag the variable tag - * @param description a short description of what the variable will expand to - * @param element the configuration element - */ - /*package*/ PathLocationVariable(String tag, String description, IConfigurationElement element) { - super(tag, description, element); - } - - /** - * Returns the object that can expand the variable - * into a path location. - */ - public IVariableLocationExpander getExpander() { - if (expander == null) { - expander = (IVariableLocationExpander) createObject(ExternalToolVariableRegistry.TAG_EXPANDER_CLASS); - if (expander == null) - expander = defaultExpander; - } - return expander; - } - - - /** - * Default variable location implementation which does - * not expand variables, but just returns null. - */ - private static final class DefaultLocationExpander implements IVariableLocationExpander { - /* (non-Javadoc) - * Method declared on IVariableLocationExpander. - */ - public IPath getPath(String varTag, String varValue, ExpandVariableContext context) { - return null; - } - } -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/registry/PathLocationVariableRegistry.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/registry/PathLocationVariableRegistry.java deleted file mode 100644 index 1a2fa3e..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/registry/PathLocationVariableRegistry.java +++ /dev/null @@ -1,49 +0,0 @@ -package net.sourceforge.phpdt.externaltools.internal.registry; - -/********************************************************************** -Copyright (c) 2002 IBM Corp. and others. All rights reserved. -This file is 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: -**********************************************************************/ - -import org.eclipse.core.runtime.IConfigurationElement; - -/** - * Registry of all available path location variables. - */ -public class PathLocationVariableRegistry extends ExternalToolVariableRegistry { - - /** - * Creates the registry and loads the variables. - */ - public PathLocationVariableRegistry(String extensionPointId) { - super(extensionPointId); - } - - /** - * Returns the path location variable for the given tag - * or null if none. - */ - public PathLocationVariable getPathLocationVariable(String tag) { - return (PathLocationVariable) findVariable(tag); - } - - /** - * Returns the list of path location variables in the registry. - */ - public PathLocationVariable[] getPathLocationVariables() { - PathLocationVariable[] results = new PathLocationVariable[getVariableCount()]; - copyVariables(results); - return results; - } - - /* (non-Javadoc) - * Method declared on ExternalToolVariableRegistry. - */ - protected ExternalToolVariable newVariable(String tag, String description, IConfigurationElement element) { - return new PathLocationVariable(tag, description, element); - } -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/registry/RefreshScopeVariable.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/registry/RefreshScopeVariable.java deleted file mode 100644 index ea634ec..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/registry/RefreshScopeVariable.java +++ /dev/null @@ -1,63 +0,0 @@ -package net.sourceforge.phpdt.externaltools.internal.registry; - -/********************************************************************** -Copyright (c) 2002 IBM Corp. and others. All rights reserved. -This file is 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: -**********************************************************************/ - -import net.sourceforge.phpdt.externaltools.variable.ExpandVariableContext; -import net.sourceforge.phpdt.externaltools.variable.IVariableResourceExpander; - -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IConfigurationElement; - -/** - * Represents the variable for a refresh scope. - */ -public final class RefreshScopeVariable extends ExternalToolVariable { - private static final DefaultResourceExpander defaultExpander = new DefaultResourceExpander(); - - private IVariableResourceExpander expander = null; - - /** - * Creates a refresh scope variable - * - * @param tag the variable tag - * @param description a short description of what the variable will expand to - * @param element the configuration element - */ - /*package*/ RefreshScopeVariable(String tag, String description, IConfigurationElement element) { - super(tag, description, element); - } - - /** - * Returns the object that can expand the variable - * as resources. - */ - public IVariableResourceExpander getExpander() { - if (expander == null) { - expander = (IVariableResourceExpander) createObject(ExternalToolVariableRegistry.TAG_EXPANDER_CLASS); - if (expander == null) - expander = defaultExpander; - } - return expander; - } - - - /** - * Default variable resource expander implementation which does - * not expand variables, but just returns null. - */ - private static final class DefaultResourceExpander implements IVariableResourceExpander { - /* (non-Javadoc) - * Method declared on IVariableResourceExpander. - */ - public IResource[] getResources(String varTag, String varValue, ExpandVariableContext context) { - return null; - } - } -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/registry/RefreshScopeVariableRegistry.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/registry/RefreshScopeVariableRegistry.java deleted file mode 100644 index d0b3d99..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/registry/RefreshScopeVariableRegistry.java +++ /dev/null @@ -1,51 +0,0 @@ -package net.sourceforge.phpdt.externaltools.internal.registry; - -/********************************************************************** -Copyright (c) 2002 IBM Corp. and others. All rights reserved. -This file is 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: -**********************************************************************/ - -import net.sourceforge.phpdt.externaltools.model.IExternalToolConstants; - -import org.eclipse.core.runtime.IConfigurationElement; - -/** - * Registry of all available refresh scope variables. - */ -public class RefreshScopeVariableRegistry extends ExternalToolVariableRegistry { - - /** - * Creates the registry and loads the variables. - */ - public RefreshScopeVariableRegistry() { - super(IExternalToolConstants.EXTENSION_POINT_REFRESH_VARIABLES); - } - - /** - * Returns the refresh scope variable for the given tag - * or null if none. - */ - public RefreshScopeVariable getRefreshVariable(String tag) { - return (RefreshScopeVariable) findVariable(tag); - } - - /** - * Returns the list of refresh scope variables in the registry. - */ - public RefreshScopeVariable[] getRefreshVariables() { - RefreshScopeVariable[] results = new RefreshScopeVariable[getVariableCount()]; - copyVariables(results); - return results; - } - - /* (non-Javadoc) - * Method declared on ExternalToolVariableRegistry. - */ - protected ExternalToolVariable newVariable(String tag, String description, IConfigurationElement element) { - return new RefreshScopeVariable(tag, description, element); - } -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/ui/ExternalToolsContentProvider.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/ui/ExternalToolsContentProvider.java deleted file mode 100644 index 1227293..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/ui/ExternalToolsContentProvider.java +++ /dev/null @@ -1,64 +0,0 @@ -package net.sourceforge.phpdt.externaltools.internal.ui; - -/********************************************************************** -Copyright (c) 2000, 2002 IBM Corp. All rights reserved. -This file is 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 -**********************************************************************/ - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import org.eclipse.jface.viewers.IStructuredContentProvider; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.TableViewer; -import org.eclipse.jface.viewers.Viewer; - -/** - * Content provider that maintains a generic list of objects which are shown in - * a table viewer. - */ -public class ExternalToolsContentProvider implements IStructuredContentProvider { - protected List elements = new ArrayList(); - protected TableViewer viewer; - - public void add(Object o) { - if (elements.contains(o)) { - return; - } - elements.add(o); - viewer.add(o); - } - - public void dispose() { - } - - public Object[] getElements(Object inputElement) { - return (Object[]) elements.toArray(new Object[elements.size()]); - } - - public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { - this.viewer = (TableViewer) viewer; - elements.clear(); - if (newInput != null) { - if (newInput instanceof List) { - elements.addAll((List) newInput); - } else { - elements.addAll(Arrays.asList((Object[]) newInput)); - } - } - } - - public void remove(Object o) { - elements.remove(o); - viewer.remove(o); - } - - public void remove(IStructuredSelection selection) { - Object[] array= selection.toArray(); - elements.removeAll(Arrays.asList(array)); - viewer.remove(array); - } -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/ui/FileSelectionDialog.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/ui/FileSelectionDialog.java deleted file mode 100644 index 01f95f9..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/ui/FileSelectionDialog.java +++ /dev/null @@ -1,210 +0,0 @@ -package net.sourceforge.phpdt.externaltools.internal.ui; - -import java.util.ArrayList; -import java.util.List; - -import net.sourceforge.phpdt.externaltools.model.StringMatcher; - -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.ITreeContentProvider; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.ControlEvent; -import org.eclipse.swt.events.ControlListener; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.TableColumn; -import org.eclipse.ui.model.WorkbenchContentProvider; -import org.eclipse.ui.model.WorkbenchLabelProvider; - -/** - * Dialog for selecting a file in the workspace. Derived from - * org.eclipse.ui.dialogs.ResourceSelectionDialog - */ -public class FileSelectionDialog extends MessageDialog { - // the root element to populate the viewer with - private IAdaptable root; - - // the visual selection widget group - private TreeAndListGroup selectionGroup; - // constants - private final static int SIZING_SELECTION_WIDGET_WIDTH = 400; - private final static int SIZING_SELECTION_WIDGET_HEIGHT = 300; - /** - * The file selected by the user. - */ - private IFile result= null; - /** - * String matcher used to filter content - */ - private StringMatcher stringMatcher= null; -/** - * Creates a resource selection dialog rooted at the given element. - * - * @param parentShell the parent shell - * @param rootElement the root element to populate this dialog with - * @param message the message to be displayed at the top of this dialog, or - * null to display a default message - */ -public FileSelectionDialog(Shell parentShell, IAdaptable rootElement, String message) { - super(parentShell, "Add Build File", null, message, MessageDialog.NONE, new String[] {"Ok", "Cancel"}, 0); - root = rootElement; - setShellStyle(getShellStyle() | SWT.RESIZE); -} -/** - * Limits the files displayed in this dialog to files matching the given - * pattern. The string can be a filename or a regular expression containing - * '*' for any series of characters or '?' for any single character. - * - * @param pattern a pattern used to filter the displayed files or - * null to display all files. If a pattern is supplied, only files - * whose names match the given pattern will be available for selection. - * @param ignoreCase if true, case is ignored. If the pattern argument is - * null, this argument is ignored. - */ -public void setFileFilter(String pattern, boolean ignoreCase) { - if (pattern != null) { - stringMatcher= new StringMatcher(pattern, ignoreCase, false); - } else { - stringMatcher= null; - } -} -/* (non-Javadoc) - * Method declared in Window. - */ -protected void configureShell(Shell shell) { - super.configureShell(shell); - //WorkbenchHelp.setHelp(shell, IHelpContextIds.RESOURCE_SELECTION_DIALOG); -} - -protected void createButtonsForButtonBar(Composite parent) { - super.createButtonsForButtonBar(parent); - initializeDialog(); -} -/* (non-Javadoc) - * Method declared on Dialog. - */ -protected Control createDialogArea(Composite parent) { - // page group - Composite composite = (Composite) super.createDialogArea(parent); - - //create the input element, which has the root resource - //as its only child - - selectionGroup = - new TreeAndListGroup( - composite, - root, - getResourceProvider(IResource.FOLDER | IResource.PROJECT | IResource.ROOT), - new WorkbenchLabelProvider(), - getResourceProvider(IResource.FILE), - new WorkbenchLabelProvider(), - SWT.NONE, - // since this page has no other significantly-sized - // widgets we need to hardcode the combined widget's - // size, otherwise it will open too small - SIZING_SELECTION_WIDGET_WIDTH, - SIZING_SELECTION_WIDGET_HEIGHT); - - composite.addControlListener(new ControlListener() { - public void controlMoved(ControlEvent e) {}; - public void controlResized(ControlEvent e) { - //Also try and reset the size of the columns as appropriate - TableColumn[] columns = selectionGroup.getListTable().getColumns(); - for (int i = 0; i < columns.length; i++) { - columns[i].pack(); - } - } - }); - - return composite; -} -/** - * Returns a content provider for IResources that returns - * only children of the given resource type. - */ -private ITreeContentProvider getResourceProvider(final int resourceType) { - return new WorkbenchContentProvider() { - public Object[] getChildren(Object o) { - if (o instanceof IContainer) { - IResource[] members = null; - try { - members = ((IContainer)o).members(); - List accessibleMembers= new ArrayList(members.length); - for (int i = 0; i < members.length; i++) { - IResource resource = members[i]; - if (resource.isAccessible()) { - accessibleMembers.add(resource); - } - } - members= (IResource[])accessibleMembers.toArray(new IResource[accessibleMembers.size()]); - } catch (CoreException e) { - //just return an empty set of children - return new Object[0]; - } - - //filter out the desired resource types - ArrayList results = new ArrayList(); - for (int i = 0; i < members.length; i++) { - //And the test bits with the resource types to see if they are what we want - if ((members[i].getType() & resourceType) > 0) { - if (members[i].getType() == IResource.FILE && - stringMatcher != null && - !stringMatcher.match(members[i].getName())) { - continue; - } - results.add(members[i]); - } - } - return results.toArray(); - } else { - return new Object[0]; - } - } - }; -} -/** - * Initializes this dialog's controls. - */ -private void initializeDialog() { - selectionGroup.addSelectionChangedListener(new ISelectionChangedListener() { - public void selectionChanged(SelectionChangedEvent event) { - getOkButton().setEnabled(!selectionGroup.getListTableSelection().isEmpty()); - } - }); - - getOkButton().setEnabled(false); -} - -/** - * Returns this dialog's OK button. - */ -protected Button getOkButton() { - return getButton(0); -} -/** - * Returns the file the user chose or null if none. - */ -public IFile getResult() { - return result; -} - -protected void buttonPressed(int buttonId) { - if (buttonId == 0) { - Object resource= selectionGroup.getListTableSelection().getFirstElement(); - if (resource instanceof IFile) { - result = (IFile) resource; - } - } - super.buttonPressed(buttonId); -} - -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/ui/IExternalToolsUIConstants.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/ui/IExternalToolsUIConstants.java deleted file mode 100644 index 10b049e..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/ui/IExternalToolsUIConstants.java +++ /dev/null @@ -1,39 +0,0 @@ -package net.sourceforge.phpdt.externaltools.internal.ui; - -/********************************************************************** -Copyright (c) 2002 IBM Corp. and others. All rights reserved. -This file is 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 -**********************************************************************/ - -import net.sourceforge.phpdt.externaltools.model.IExternalToolConstants; - - -public interface IExternalToolsUIConstants { - - // Action images - public static final String IMG_REMOVE= IExternalToolConstants.PLUGIN_ID + ".remove"; //$NON-NLS-1$ - public static final String IMG_MOVE_UP = IExternalToolConstants.PLUGIN_ID + ".moveUp"; //$NON-NLS-1$ - public static final String IMG_MOVE_DOWN = IExternalToolConstants.PLUGIN_ID + ".moveDown"; //$NON-NLS-1$ - public static final String IMG_ACTIVATE = IExternalToolConstants.PLUGIN_ID + ".activate"; //$NON-NLS-1$ - public static final String IMG_DEACTIVATE = IExternalToolConstants.PLUGIN_ID + ".deactivate"; //$NON-NLS-1$ - public static final String IMG_REMOVE_ALL= IExternalToolConstants.PLUGIN_ID + ".removeAll"; //$NON-NLS-1$ - public static final String IMG_ADD= IExternalToolConstants.PLUGIN_ID + ".add"; //$NON-NLS-1$ - public static final String IMG_RUN= IExternalToolConstants.PLUGIN_ID + ".run"; //$NON-NLS-1$ - public static final String IMG_SEARCH= IExternalToolConstants.PLUGIN_ID + ".search"; //$NON-NLS-1$ - public static final String IMG_GO_TO_FILE= IExternalToolConstants.PLUGIN_ID + ".goToFile"; //$NON-NLS-1$ - - // Label images -// public static final String IMG_ANT_PROJECT= IExternalToolConstants.PLUGIN_ID + ".antProject"; //$NON-NLS-1$ -// public static final String IMG_ANT_PROJECT_ERROR = IExternalToolConstants.PLUGIN_ID + ".antProjectError"; //$NON-NLS-1$ -// public static final String IMG_ANT_TARGET= IExternalToolConstants.PLUGIN_ID + ".antTarget"; //$NON-NLS-1$ -// public static final String IMG_ANT_TARGET_ERROR = IExternalToolConstants.PLUGIN_ID + ".antTargetError"; //$NON-NLS-1$ -// public static final String IMG_ANT_TARGET_ELEMENTS= IExternalToolConstants.PLUGIN_ID + ".antTargetElements"; //$NON-NLS-1$ -// public static final String IMG_ANT_TARGET_ELEMENT= IExternalToolConstants.PLUGIN_ID + ".antTargetElement"; //$NON-NLS-1$ - - public static final String DIALOGSTORE_LASTEXTJAR= IExternalToolConstants.PLUGIN_ID + ".lastextjar"; //$NON-NLS-1$ - public static final String DIALOGSTORE_LASTEXTFILE= IExternalToolConstants.PLUGIN_ID + ".lastextfile"; //$NON-NLS-1$ - public static final String DIALOGSTORE_LASTFOLDER= IExternalToolConstants.PLUGIN_ID + ".lastfolder"; //$NON-NLS-1$ - public static final String DIALOGSTORE_LASTANTHOME= IExternalToolConstants.PLUGIN_ID + ".lastanthome"; //$NON-NLS-1$ -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/ui/MessageDialogWithToggle.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/ui/MessageDialogWithToggle.java deleted file mode 100644 index 959db60..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/ui/MessageDialogWithToggle.java +++ /dev/null @@ -1,209 +0,0 @@ -package net.sourceforge.phpdt.externaltools.internal.ui; - -/********************************************************************** -Copyright (c) 2000, 2002 IBM Corp. All rights reserved. -This file is 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 -**********************************************************************/ - -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Shell; - -/** - * An message dialog which allows the user to set a boolean preference. - * - * This is typically used to set a preference that determines if the dialog - * should be shown in the future - */ -public class MessageDialogWithToggle extends MessageDialog { - - /** - * The preference key which is set by the toggle button. - * This key must be a boolean preference in the preference store. - */ - private String fPreferenceKey = null; - /** - * The message displayed to the user, with the toggle button - */ - private String fToggleMessage = null; - private Button fToggleButton = null; - /** - * The preference store which will be affected by the toggle button - */ - IPreferenceStore fStore = null; - - public MessageDialogWithToggle(Shell parentShell, String dialogTitle, Image image, String message, int dialogImageType, String[] dialogButtonLabels, int defaultIndex, String preferenceKey, String toggleMessage, IPreferenceStore store) { - super(parentShell, dialogTitle, image, message, dialogImageType, dialogButtonLabels, defaultIndex); - fStore = store; - fPreferenceKey = preferenceKey; - fToggleMessage = toggleMessage; - } - - protected Control createDialogArea(Composite parent) { - Composite dialogArea = (Composite) super.createDialogArea(parent); - fToggleButton = createCheckButton(dialogArea, fToggleMessage); - getToggleButton().setSelection(fStore.getBoolean(fPreferenceKey)); - return dialogArea; - } - - /** - * Creates a button with the given label and sets the default - * configuration data. - */ - protected Button createCheckButton(Composite parent, String label) { - Button button= new Button(parent, SWT.CHECK | SWT.LEFT); - button.setText(label); - - GridData data = new GridData(SWT.NONE); - data.horizontalSpan= 2; - data.horizontalAlignment= GridData.CENTER; - button.setLayoutData(data); - button.setFont(parent.getFont()); - - return button; - } - - /** - * When the OK button is pressed, store the preference. - * - * @see org.eclipse.jface.dialogs.Dialog#buttonPressed(int) - */ - protected void buttonPressed(int id) { - if (id == IDialogConstants.OK_ID) { // was the OK button pressed? - storePreference(); - } - super.buttonPressed(id); - } - - /** - * Store the preference based on the user's selection - */ - protected void storePreference() { - fStore.setValue(fPreferenceKey, getToggleButton().getSelection()); - } - - /** - * Returns the button used to toggle the dialog preference - * - * @return Button the preference toggle button - */ - protected Button getToggleButton() { - return fToggleButton; - } - - /** - * Convenience method to open a simple confirm (OK/Cancel) dialog. - * - * @param parent the parent shell of the dialog, or null if none - * @param title the dialog's title, or null if none - * @param message the message - * @return true if the user presses the OK button, - * false otherwise - */ - public static boolean openConfirm(Shell parent, String title, String message, String preferenceKey, String toggleMessage, IPreferenceStore store) { - MessageDialogWithToggle dialog = new MessageDialogWithToggle( - parent, - title, - null, // accept the default window icon - message, - QUESTION, - new String[] {IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL}, - 0, // OK is the default - preferenceKey, - toggleMessage, - store); - return dialog.open() == 0; - } - /** - * Convenience method to open a standard error dialog. - * - * @param parent the parent shell of the dialog, or null if none - * @param title the dialog's title, or null if none - * @param message the message - */ - public static void openError(Shell parent, String title, String message, String preferenceKey, String toggleMessage, IPreferenceStore store) { - MessageDialogWithToggle dialog = new MessageDialogWithToggle( - parent, - title, - null, // accept the default window icon - message, - ERROR, - new String[] {IDialogConstants.OK_LABEL}, - 0, // ok is the default - preferenceKey, - toggleMessage, - store); - dialog.open(); - } - /** - * Convenience method to open a standard information dialog. - * - * @param parent the parent shell of the dialog, or null if none - * @param title the dialog's title, or null if none - * @param message the message - */ - public static void openInformation( - Shell parent, - String title, - String message, String preferenceKey, String toggleMessage, IPreferenceStore store) { - MessageDialogWithToggle dialog = - new MessageDialogWithToggle(parent, title, null, // accept the default window icon - message, INFORMATION, new String[] { IDialogConstants.OK_LABEL }, 0, // ok is the default - preferenceKey, toggleMessage, store); - dialog.open(); - } - /** - * Convenience method to open a simple Yes/No question dialog. - * - * @param parent the parent shell of the dialog, or null if none - * @param title the dialog's title, or null if none - * @param message the message - * @return true if the user presses the OK button, - * false otherwise - */ - public static boolean openQuestion(Shell parent, String title, String message, String preferenceKey, String toggleMessage, IPreferenceStore store) { - MessageDialogWithToggle dialog = new MessageDialogWithToggle( - parent, - title, - null, // accept the default window icon - message, - QUESTION, - new String[] {IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL}, - 0, // yes is the default - preferenceKey, - toggleMessage, - store); - return dialog.open() == 0; - } - /** - * Convenience method to open a standard warning dialog. - * - * @param parent the parent shell of the dialog, or null if none - * @param title the dialog's title, or null if none - * @param message the message - */ - public static void openWarning(Shell parent, String title, String message, String preferenceKey, String toggleMessage, IPreferenceStore store) { - MessageDialogWithToggle dialog = new MessageDialogWithToggle( - parent, - title, - null, // accept the default window icon - message, - WARNING, - new String[] {IDialogConstants.OK_LABEL}, - 0, // ok is the default - preferenceKey, - toggleMessage, - store); - dialog.open(); - } - -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/ui/MessageLine.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/ui/MessageLine.java deleted file mode 100644 index b724f3b..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/ui/MessageLine.java +++ /dev/null @@ -1,92 +0,0 @@ -package net.sourceforge.phpdt.externaltools.internal.ui; - -/********************************************************************** -Copyright (c) 2000, 2002 IBM Corp. All rights reserved. -This file is 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 -**********************************************************************/ - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.CLabel; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.graphics.RGB; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.ISharedImages; -import org.eclipse.ui.PlatformUI; - -/** - * A message line displaying a status. - */ -public class MessageLine extends CLabel { - - private static final RGB ERROR_BACKGROUND_RGB = new RGB(230, 226, 221); - - private Color fNormalMsgAreaBackground; - private Color fErrorMsgAreaBackground; - - /** - * Creates a new message line as a child of the given parent. - */ - public MessageLine(Composite parent) { - this(parent, SWT.LEFT); - } - - /** - * Creates a new message line as a child of the parent and with the given SWT stylebits. - */ - public MessageLine(Composite parent, int style) { - super(parent, style); - fNormalMsgAreaBackground= getBackground(); - fErrorMsgAreaBackground= null; - } - - - private Image findImage(IStatus status) { - if (status.isOK()) { - return null; - } else if (status.matches(IStatus.ERROR)) { - return PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_ERROR_TSK); - } else if (status.matches(IStatus.WARNING)) { - return PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_WARN_TSK); - } else if (status.matches(IStatus.INFO)) { - return PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_INFO_TSK); - } - return null; - } - - /** - * Sets the message and image to the given status. - * null is a valid argument and will set the empty text and no image - */ - public void setErrorStatus(IStatus status) { - if (status != null) { - String message= status.getMessage(); - if (message != null && message.length() > 0) { - setText(message); - setImage(findImage(status)); - if (fErrorMsgAreaBackground == null) { - fErrorMsgAreaBackground= new Color(getDisplay(), ERROR_BACKGROUND_RGB); - } - setBackground(fErrorMsgAreaBackground); - return; - } - } - setText(""); //$NON-NLS-1$ - setImage(null); - setBackground(fNormalMsgAreaBackground); - } - - /* - * @see Widget#dispose() - */ - public void dispose() { - if (fErrorMsgAreaBackground != null) { - fErrorMsgAreaBackground.dispose(); - fErrorMsgAreaBackground= null; - } - super.dispose(); - } -} \ No newline at end of file diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/ui/StatusDialog.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/ui/StatusDialog.java deleted file mode 100644 index 5b19da3..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/ui/StatusDialog.java +++ /dev/null @@ -1,163 +0,0 @@ -package net.sourceforge.phpdt.externaltools.internal.ui; - -/********************************************************************** -Copyright (c) 2000, 2002 IBM Corp. All rights reserved. -This file is 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 -**********************************************************************/ - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Image; -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.Shell; - -/** - * An abstract base class for dialogs with a status bar and ok/cancel buttons. - * The status message must be passed over as StatusInfo object and can be - * an error, warning or ok. The OK button is enabled or disabled depending - * on the status. - */ -public abstract class StatusDialog extends Dialog { - - private Button fOkButton; - private MessageLine fStatusLine; - private IStatus fLastStatus; - private String fTitle; - private Image fImage; - - private boolean fStatusLineAboveButtons; - - /** - * Creates an instane of a status dialog. - */ - public StatusDialog(Shell parent) { - super(parent); - fStatusLineAboveButtons= false; - fLastStatus= new StatusInfo(); - } - - /** - * Specifies whether status line appears to the left of the buttons (default) - * or above them. - * - * @param aboveButtons if true status line is placed above buttons; if - * false to the right - */ - public void setStatusLineAboveButtons(boolean aboveButtons) { - fStatusLineAboveButtons= aboveButtons; - } - - /** - * Update the dialog's status line to reflect the given status. - * It is save to call this method before the dialog has been opened. - */ - protected void updateStatus(IStatus status) { - fLastStatus= status; - if (fStatusLine != null && !fStatusLine.isDisposed()) { - updateButtonsEnableState(status); - fStatusLine.setErrorStatus(status); - } - } - - /** - * Returns the last status. - */ - public IStatus getStatus() { - return fLastStatus; - } - - /** - * Updates the status of the ok button to reflect the given status. - * Subclasses may override this method to update additional buttons. - * @param status the status. - */ - protected void updateButtonsEnableState(IStatus status) { - if (fOkButton != null && !fOkButton.isDisposed()) - fOkButton.setEnabled(!status.matches(IStatus.ERROR)); - } - - /* - * @see Window#create(Shell) - */ - protected void configureShell(Shell shell) { - super.configureShell(shell); - if (fTitle != null) - shell.setText(fTitle); - } - - /* - * @see Window#create() - */ - public void create() { - super.create(); - if (fLastStatus != null) { - // policy: dialogs are not allowed to come up with an error message - if (fLastStatus.matches(IStatus.ERROR)) { - StatusInfo status= new StatusInfo(); - status.setError(""); //$NON-NLS-1$ - fLastStatus= status; - } - updateStatus(fLastStatus); - } - } - - /* - * @see Dialog#createButtonsForButtonBar(Composite) - */ - protected void createButtonsForButtonBar(Composite parent) { - fOkButton= createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); - createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); - } - - /* - * @see Dialog#createButtonBar(Composite) - */ - protected Control createButtonBar(Composite parent) { - Composite composite= new Composite(parent, SWT.NULL); - GridLayout layout= new GridLayout(); - layout.numColumns= 1; - layout.marginHeight= 0; - layout.marginWidth= convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); - composite.setLayout(layout); - composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - - fStatusLine= new MessageLine(composite); - fStatusLine.setAlignment(SWT.LEFT); - fStatusLine.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - fStatusLine.setErrorStatus(null); //$NON-NLS-1$ - - super.createButtonBar(composite); - return composite; - } - - /** - * Sets the title for this dialog. - * @param title the title. - */ - public void setTitle(String title) { - fTitle= title != null ? title : ""; //$NON-NLS-1$ - Shell shell= getShell(); - if ((shell != null) && !shell.isDisposed()) - shell.setText(fTitle); - } - - /** - * Sets the image for this dialog. - * @param image the image. - */ - public void setImage(Image image) { - fImage= image; - Shell shell= getShell(); - if ((shell != null) && !shell.isDisposed()) - shell.setImage(fImage); - } - -} \ No newline at end of file diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/ui/StatusInfo.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/ui/StatusInfo.java deleted file mode 100644 index 418cef8..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/ui/StatusInfo.java +++ /dev/null @@ -1,169 +0,0 @@ -package net.sourceforge.phpdt.externaltools.internal.ui; - -/********************************************************************** -Copyright (c) 2000, 2002 IBM Corp. All rights reserved. -This file is 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 -**********************************************************************/ - -import net.sourceforge.phpdt.externaltools.model.IExternalToolConstants; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.jface.util.Assert; - -/** - * A settable IStatus. - * Can be an error, warning, info or ok. For error, info and warning states, - * a message describes the problem. - */ -public class StatusInfo implements IStatus { - - private String fStatusMessage; - private int fSeverity; - - /** - * Creates a status set to OK (no message) - */ - public StatusInfo() { - this(OK, null); - } - - /** - * Creates a status . - * @param severity The status severity: ERROR, WARNING, INFO and OK. - * @param message The message of the status. Applies only for ERROR, - * WARNING and INFO. - */ - public StatusInfo(int severity, String message) { - fStatusMessage= message; - fSeverity= severity; - } - - /** - * Returns if the status' severity is OK. - */ - public boolean isOK() { - return fSeverity == IStatus.OK; - } - - /** - * Returns if the status' severity is WARNING. - */ - public boolean isWarning() { - return fSeverity == IStatus.WARNING; - } - - /** - * Returns if the status' severity is INFO. - */ - public boolean isInfo() { - return fSeverity == IStatus.INFO; - } - - /** - * Returns if the status' severity is ERROR. - */ - public boolean isError() { - return fSeverity == IStatus.ERROR; - } - - /** - * @see IStatus#getMessage - */ - public String getMessage() { - return fStatusMessage; - } - - /** - * Sets the status to ERROR. - * @param The error message (can be empty, but not null) - */ - public void setError(String errorMessage) { - Assert.isNotNull(errorMessage); - fStatusMessage= errorMessage; - fSeverity= IStatus.ERROR; - } - - /** - * Sets the status to WARNING. - * @param The warning message (can be empty, but not null) - */ - public void setWarning(String warningMessage) { - Assert.isNotNull(warningMessage); - fStatusMessage= warningMessage; - fSeverity= IStatus.WARNING; - } - - /** - * Sets the status to INFO. - * @param The info message (can be empty, but not null) - */ - public void setInfo(String infoMessage) { - Assert.isNotNull(infoMessage); - fStatusMessage= infoMessage; - fSeverity= IStatus.INFO; - } - - /** - * Sets the status to OK. - */ - public void setOK() { - fStatusMessage= null; - fSeverity= IStatus.OK; - } - - /* - * @see IStatus#matches(int) - */ - public boolean matches(int severityMask) { - return (fSeverity & severityMask) != 0; - } - - /** - * Returns always false. - * @see IStatus#isMultiStatus() - */ - public boolean isMultiStatus() { - return false; - } - - /* - * @see IStatus#getSeverity() - */ - public int getSeverity() { - return fSeverity; - } - - /* - * @see IStatus#getPlugin() - */ - public String getPlugin() { - return IExternalToolConstants.PLUGIN_ID; - } - - /** - * Returns always null. - * @see IStatus#getException() - */ - public Throwable getException() { - return null; - } - - /** - * Returns always the error severity. - * @see IStatus#getCode() - */ - public int getCode() { - return fSeverity; - } - - /** - * Returns always null. - * @see IStatus#getChildren() - */ - public IStatus[] getChildren() { - return new IStatus[0]; - } - -} \ No newline at end of file diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/ui/TreeAndListGroup.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/ui/TreeAndListGroup.java deleted file mode 100644 index 9da2dea..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/ui/TreeAndListGroup.java +++ /dev/null @@ -1,287 +0,0 @@ -package net.sourceforge.phpdt.externaltools.internal.ui; - -/********************************************************************** -Copyright (c) 2002 IBM Corp. and others. All rights reserved. -This file is 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 -**********************************************************************/ - -import java.util.Collection; -import java.util.HashSet; -import java.util.Iterator; - -import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.IStructuredContentProvider; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.ITreeContentProvider; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.viewers.TableViewer; -import org.eclipse.jface.viewers.TreeViewer; -import org.eclipse.jface.viewers.ViewerSorter; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Table; -import org.eclipse.swt.widgets.Tree; - -/** - * This class was derived from org.eclipse.ui.internal.misc.CheckboxTreeAndListGroup - * - */ -public class TreeAndListGroup implements ISelectionChangedListener { - private Object root; - private Object currentTreeSelection; - private Collection listeners = new HashSet(); - - private ITreeContentProvider treeContentProvider; - private IStructuredContentProvider listContentProvider; - private ILabelProvider treeLabelProvider; - private ILabelProvider listLabelProvider; - - // widgets - private TreeViewer treeViewer; - private TableViewer listViewer; - private boolean allowMultiselection= false; - - /** - * Create an instance of this class. Use this constructor if you wish to specify - * the width and/or height of the combined widget (to only hardcode one of the - * sizing dimensions, specify the other dimension's value as -1) - * - * @param parent org.eclipse.swt.widgets.Composite - * @param style int - * @param rootObject java.lang.Object - * @param childPropertyName java.lang.String - * @param parentPropertyName java.lang.String - * @param listPropertyName java.lang.String - * @param width int - * @param height int - */ - public TreeAndListGroup(Composite parent, Object rootObject, ITreeContentProvider treeContentProvider, ILabelProvider treeLabelProvider, IStructuredContentProvider listContentProvider, ILabelProvider listLabelProvider, int style, int width, int height) { - - root = rootObject; - this.treeContentProvider = treeContentProvider; - this.listContentProvider = listContentProvider; - this.treeLabelProvider = treeLabelProvider; - this.listLabelProvider = listLabelProvider; - createContents(parent, width, height, style); - } - /** - * This method must be called just before this window becomes visible. - */ - public void aboutToOpen() { - currentTreeSelection = null; - - //select the first element in the list - Object[] elements = treeContentProvider.getElements(root); - Object primary = elements.length > 0 ? elements[0] : null; - if (primary != null) { - treeViewer.setSelection(new StructuredSelection(primary)); - } - treeViewer.getControl().setFocus(); - } - /** - * Add the passed listener to collection of clients - * that listen for changes to list viewer selection state - * - * @param listener ISelectionChangedListener - */ - public void addSelectionChangedListener(ISelectionChangedListener listener) { - listeners.add(listener); - } - - /** - * Notify all checked state listeners that the passed element - *has had its checked state changed to the passed state - */ - protected void notifySelectionListeners(SelectionChangedEvent event) { - Iterator listenersEnum = listeners.iterator(); - while (listenersEnum.hasNext()) { - ((ISelectionChangedListener) listenersEnum.next()).selectionChanged(event); - } - } - - /** - * Lay out and initialize self's visual components. - * - * @param parent org.eclipse.swt.widgets.Composite - * @param width int - * @param height int - */ - protected void createContents(Composite parent, int width, int height, int style) { - // group pane - Composite composite = new Composite(parent, style); - composite.setFont(parent.getFont()); - GridLayout layout = new GridLayout(); - layout.numColumns = 2; - layout.makeColumnsEqualWidth = true; - layout.marginHeight = 0; - layout.marginWidth = 0; - composite.setLayout(layout); - composite.setLayoutData(new GridData(GridData.FILL_BOTH)); - - createTreeViewer(composite, width / 2, height); - createListViewer(composite, width / 2, height); - - initialize(); - } - /** - * Create this group's list viewer. - */ - protected void createListViewer(Composite parent, int width, int height) { - int style; - if (allowMultiselection) { - style= SWT.MULTI; - } else { - style= SWT.SINGLE; - } - listViewer = new TableViewer(parent, SWT.BORDER | style); - GridData data = new GridData(GridData.FILL_BOTH); - data.widthHint = width; - data.heightHint = height; - listViewer.getTable().setLayoutData(data); - listViewer.getTable().setFont(parent.getFont()); - listViewer.setContentProvider(listContentProvider); - listViewer.setLabelProvider(listLabelProvider); - listViewer.addSelectionChangedListener(new ISelectionChangedListener() { - public void selectionChanged(SelectionChangedEvent event) { - notifySelectionListeners(event); - } - }); - } - /** - * Create this group's tree viewer. - */ - protected void createTreeViewer(Composite parent, int width, int height) { - Tree tree = new Tree(parent, SWT.BORDER); - GridData data = new GridData(GridData.FILL_BOTH); - data.widthHint = width; - data.heightHint = height; - tree.setLayoutData(data); - tree.setFont(parent.getFont()); - - treeViewer = new TreeViewer(tree); - treeViewer.setContentProvider(treeContentProvider); - treeViewer.setLabelProvider(treeLabelProvider); - treeViewer.addSelectionChangedListener(this); - } - - public Table getListTable() { - return listViewer.getTable(); - } - - public IStructuredSelection getListTableSelection() { - ISelection selection= this.listViewer.getSelection(); - if (selection instanceof IStructuredSelection) { - return (IStructuredSelection)selection; - } else { - return StructuredSelection.EMPTY; - } - } - - protected void initialListItem(Object element) { - Object parent = treeContentProvider.getParent(element); - selectAndRevealFolder(parent); - } - - public void selectAndRevealFolder(Object treeElement) { - treeViewer.reveal(treeElement); - IStructuredSelection selection = new StructuredSelection(treeElement); - treeViewer.setSelection(selection); - } - - public void selectAndRevealFile(Object treeElement) { - listViewer.reveal(treeElement); - IStructuredSelection selection = new StructuredSelection(treeElement); - listViewer.setSelection(selection); - } - - /** - * Initialize this group's viewers after they have been laid out. - */ - protected void initialize() { - treeViewer.setInput(root); - } - - /** - * Handle the selection of an item in the tree viewer - * - * @param selection ISelection - */ - public void selectionChanged(SelectionChangedEvent event) { - IStructuredSelection selection = (IStructuredSelection) event.getSelection(); - Object selectedElement = selection.getFirstElement(); - if (selectedElement == null) { - currentTreeSelection = null; - listViewer.setInput(currentTreeSelection); - return; - } - - // ie.- if not an item deselection - if (selectedElement != currentTreeSelection) { - listViewer.setInput(selectedElement); - } - - currentTreeSelection = selectedElement; - } - /** - * Set the list viewer's providers to those passed - * - * @param contentProvider ITreeContentProvider - * @param labelProvider ILabelProvider - */ - public void setListProviders(IStructuredContentProvider contentProvider, ILabelProvider labelProvider) { - listViewer.setContentProvider(contentProvider); - listViewer.setLabelProvider(labelProvider); - } - /** - * Set the sorter that is to be applied to self's list viewer - */ - public void setListSorter(ViewerSorter sorter) { - listViewer.setSorter(sorter); - } - /** - * Set the root of the widget to be new Root. Regenerate all of the tables and lists from this - * value. - * @param newRoot - */ - public void setRoot(Object newRoot) { - this.root = newRoot; - initialize(); - } - - /** - * Set the tree viewer's providers to those passed - * - * @param contentProvider ITreeContentProvider - * @param labelProvider ILabelProvider - */ - public void setTreeProviders(ITreeContentProvider contentProvider, ILabelProvider labelProvider) { - treeViewer.setContentProvider(contentProvider); - treeViewer.setLabelProvider(labelProvider); - } - /** - * Set the sorter that is to be applied to self's tree viewer - */ - public void setTreeSorter(ViewerSorter sorter) { - treeViewer.setSorter(sorter); - } - - /** - * Set the focus on to the list widget. - */ - public void setFocus() { - - this.treeViewer.getTree().setFocus(); - } - - public void setAllowMultiselection(boolean allowMultiselection) { - this.allowMultiselection= allowMultiselection; - - } -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/launchConfigurations/ExternalToolsLaunchConfigurationMessages.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/launchConfigurations/ExternalToolsLaunchConfigurationMessages.java deleted file mode 100644 index 56b3319..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/launchConfigurations/ExternalToolsLaunchConfigurationMessages.java +++ /dev/null @@ -1,30 +0,0 @@ -package net.sourceforge.phpdt.externaltools.launchConfigurations; - -/********************************************************************** -Copyright (c) 2000, 2002 IBM Corp. All rights reserved. -This file is 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 -**********************************************************************/ - -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -public class ExternalToolsLaunchConfigurationMessages { - - private static final String BUNDLE_NAME = "net.sourceforge.phpdt.externaltools.launchConfigurations.ExternalToolsLaunchConfigurationMessages"; //$NON-NLS-1$ - - private static final ResourceBundle RESOURCE_BUNDLE = - ResourceBundle.getBundle(BUNDLE_NAME); - - private ExternalToolsLaunchConfigurationMessages() { - } - - public static String getString(String key) { - try { - return RESOURCE_BUNDLE.getString(key); - } catch (MissingResourceException e) { - return '!' + key + '!'; - } - } -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/launchConfigurations/ExternalToolsLaunchConfigurationMessages.properties b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/launchConfigurations/ExternalToolsLaunchConfigurationMessages.properties deleted file mode 100644 index c70c6f9..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/launchConfigurations/ExternalToolsLaunchConfigurationMessages.properties +++ /dev/null @@ -1,45 +0,0 @@ -###################################################################### -# Copyright (c) 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 -###################################################################### - -ExternalToolsMainTab.Descri&ption__1=Descri&ption: -ExternalToolsMainTab.&Location___2=&Location: -ExternalToolsMainTab.&Browse_Workspace..._3=&Browse Workspace... -ExternalToolsMainTab.Brows&e_File_System..._4=Brows&e File System... -ExternalToolsMainTab.Working_&Directory__5=Working &Directory: -ExternalToolsMainTab.Browse_Wor&kspace..._6=Browse Wor&kspace... -ExternalToolsMainTab.Browse_F&ile_System..._7=Browse F&ile System... -ExternalToolsMainTab.Error_reading_configuration_10=Error reading configuration -ExternalToolsMainTab.&Main_17=Main -ExternalToolsMainTab.External_tool_location_cannot_be_empty_18=External tool location cannot be empty -ExternalToolsMainTab.External_tool_location_does_not_exist_19=External tool location does not exist -ExternalToolsMainTab.External_tool_location_specified_is_not_a_file_20=External tool location specified is not a file -ExternalToolsMainTab.External_tool_working_directory_does_not_exist_or_is_invalid_21=External tool working directory does not exist or is invalid -ExternalToolsMainTab.Select_a_resource_22=Select a resource: -ExternalToolsMainTab.&Select_a_directory__23=&Select a working directory: - -ExternalToolsOptionTab.&Arguments___1=&Arguments: -ExternalToolsOptionTab.Varia&bles..._2=Varia&bles... -ExternalToolsOptionTab.Note__Enclose_an_argument_containing_spaces_using_double-quotes_(__)._Not_applicable_for_variables._3=Note: Enclose an argument containing spaces using double-quotes (\").\nNot applicable for variables. -ExternalToolsOptionTab.Run_tool_in_bac&kground_4=&Run tool in background -ExternalToolsOptionTab.Error_reading_configuration_7=Error reading configuration -ExternalToolsOptionTab.Option&s_9=Options -ExternalToolsOptionTab.Select_variable_10=Select variable -ExternalToolsOptionTab.&Choose_a_variable__11=&Choose a variable: -ExternalToolsOptionTab.Invalid_selection_12=Invalid selection - -ExternalToolsRefreshTab.Recursively_&include_sub-folders_1=Recursively &include sub-folders -ExternalToolsRefreshTab.Choose_scope_v&ariable___2=Choose scope v&ariable: -ExternalToolsRefreshTab.Exception_reading_launch_configuration_3=Exception reading launch configuration -ExternalToolsRefreshTab.Refres&h_6=Refresh -ExternalToolsRefreshTab.&Refresh_resources_after_running_tool_1=&Refresh resources after running tool - -ExternalToolsUtil.Location_not_specified_by_{0}_1=Location not specified by {0} -ExternalToolsUtil.Exception(s)_occurred_during_refresh._2=Exception(s) occurred during refresh. \ No newline at end of file diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/launchConfigurations/ExternalToolsMainTab.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/launchConfigurations/ExternalToolsMainTab.java deleted file mode 100644 index 2aa0933..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/launchConfigurations/ExternalToolsMainTab.java +++ /dev/null @@ -1,599 +0,0 @@ -package net.sourceforge.phpdt.externaltools.launchConfigurations; - -/*********************************************************************************************************************************** - * Copyright (c) 2000, 2002 IBM Corp. All rights reserved. This file is 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 - **********************************************************************************************************************************/ - -import java.io.File; - -import net.sourceforge.phpdt.externaltools.group.IGroupDialogPage; -import net.sourceforge.phpdt.externaltools.internal.dialog.ExternalToolVariableForm; -import net.sourceforge.phpdt.externaltools.internal.model.ExternalToolsImages; -import net.sourceforge.phpdt.externaltools.internal.model.ExternalToolsPlugin; -import net.sourceforge.phpdt.externaltools.internal.registry.ExternalToolVariable; -import net.sourceforge.phpdt.externaltools.model.IExternalToolConstants; -import net.sourceforge.phpdt.externaltools.model.ToolUtil; -import net.sourceforge.phpdt.externaltools.variable.ExpandVariableContext; -import net.sourceforge.phpeclipse.PHPeclipsePlugin; - -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.MultiStatus; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; -import org.eclipse.debug.ui.AbstractLaunchConfigurationTab; -import org.eclipse.debug.ui.ILaunchConfigurationTab; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.jface.dialogs.IMessageProvider; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.graphics.Font; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.DirectoryDialog; -import org.eclipse.swt.widgets.FileDialog; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; -import org.eclipse.ui.dialogs.ContainerSelectionDialog; -import org.eclipse.ui.dialogs.ResourceSelectionDialog; -import org.eclipse.ui.dialogs.SelectionDialog; - -public class ExternalToolsMainTab extends AbstractLaunchConfigurationTab { - - protected Combo locationField; - - protected Text workDirectoryField; - - protected Button fileLocationButton; - - protected Button workspaceLocationButton; - - protected Button fileWorkingDirectoryButton; - - protected Button workspaceWorkingDirectoryButton; - - protected Button runBackgroundButton; - - protected Text argumentField; - - protected Button variableButton; - - protected SelectionAdapter selectionAdapter; - - protected ModifyListener modifyListener = new ModifyListener() { - public void modifyText(ModifyEvent e) { - updateLaunchConfigurationDialog(); - } - }; - - /** - * @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite) - */ - public void createControl(Composite parent) { - Composite mainComposite = new Composite(parent, SWT.NONE); - setControl(mainComposite); - GridLayout layout = new GridLayout(); - layout.numColumns = 2; - GridData gridData = new GridData(GridData.FILL_HORIZONTAL); - mainComposite.setLayout(layout); - mainComposite.setLayoutData(gridData); - mainComposite.setFont(parent.getFont()); - createLocationComponent(mainComposite); - createWorkDirectoryComponent(mainComposite); - createArgumentComponent(mainComposite); - createVerticalSpacer(mainComposite, 2); - createRunBackgroundComponent(mainComposite); - } - - /** - * Creates the controls needed to edit the location attribute of an external tool - * - * @param parent - * the composite to create the controls in - */ - protected void createLocationComponent(Composite parent) { - Font font = parent.getFont(); - - Composite composite = new Composite(parent, SWT.NONE); - GridLayout layout = new GridLayout(); - layout.marginWidth = 0; - layout.marginHeight = 0; - layout.numColumns = 1; - GridData gridData = new GridData(GridData.FILL_HORIZONTAL); - composite.setLayout(layout); - composite.setLayoutData(gridData); - - Label label = new Label(composite, SWT.NONE); - label.setText(ExternalToolsLaunchConfigurationMessages.getString("ExternalToolsMainTab.&Location___2")); //$NON-NLS-1$ - label.setFont(font); - - final IPreferenceStore store = PHPeclipsePlugin.getDefault().getPreferenceStore(); - locationField = new Combo(composite, SWT.DROP_DOWN | SWT.BORDER); - GridData data = new GridData(GridData.FILL_HORIZONTAL); - data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH; - locationField.setLayoutData(data); - locationField.setFont(font); - locationField.add(store.getString(PHPeclipsePlugin.PHP_RUN_PREF), 0); - locationField.add(store.getString(PHPeclipsePlugin.APACHE_RUN_PREF), 1); - locationField.add(store.getString(PHPeclipsePlugin.MYSQL_RUN_PREF), 2); - locationField.add(store.getString(PHPeclipsePlugin.XAMPP_START_PREF), 3); - locationField.add(store.getString(PHPeclipsePlugin.XAMPP_STOP_PREF), 4); - Composite buttonComposite = new Composite(parent, SWT.NONE); - layout = new GridLayout(); - layout.marginWidth = 0; - layout.marginHeight = 0; - layout.numColumns = 1; - gridData = new GridData(GridData.HORIZONTAL_ALIGN_END); - buttonComposite.setLayout(layout); - buttonComposite.setLayoutData(gridData); - buttonComposite.setFont(font); - - createVerticalSpacer(buttonComposite, 1); - - workspaceLocationButton = createPushButton(buttonComposite, ExternalToolsLaunchConfigurationMessages - .getString("ExternalToolsMainTab.&Browse_Workspace..._3"), null); //$NON-NLS-1$ - workspaceLocationButton.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent evt) { - handleWorkspaceLocationButtonSelected(); - } - }); - fileLocationButton = createPushButton(buttonComposite, ExternalToolsLaunchConfigurationMessages - .getString("ExternalToolsMainTab.Brows&e_File_System..._4"), null); //$NON-NLS-1$ - fileLocationButton.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent evt) { - handleLocationButtonSelected(); - } - }); - } - - /** - * Creates the controls needed to edit the working directory attribute of an external tool - * - * @param parent - * the composite to create the controls in - */ - protected void createWorkDirectoryComponent(Composite parent) { - Font font = parent.getFont(); - - Composite composite = new Composite(parent, SWT.NONE); - GridLayout layout = new GridLayout(); - layout.marginWidth = 0; - layout.marginHeight = 0; - layout.numColumns = 1; - GridData gridData = new GridData(GridData.FILL_HORIZONTAL); - composite.setLayout(layout); - composite.setLayoutData(gridData); - - Label label = new Label(composite, SWT.NONE); - label.setText(ExternalToolsLaunchConfigurationMessages.getString("ExternalToolsMainTab.Working_&Directory__5")); //$NON-NLS-1$ - label.setFont(font); - - workDirectoryField = new Text(composite, SWT.BORDER); - GridData data = new GridData(GridData.FILL_HORIZONTAL); - data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH; - workDirectoryField.setLayoutData(data); - workDirectoryField.setFont(font); - - Composite buttonComposite = new Composite(parent, SWT.NONE); - layout = new GridLayout(); - layout.marginWidth = 0; - layout.marginHeight = 0; - layout.numColumns = 1; - gridData = new GridData(GridData.HORIZONTAL_ALIGN_END); - buttonComposite.setLayout(layout); - buttonComposite.setLayoutData(gridData); - buttonComposite.setFont(font); - - createVerticalSpacer(buttonComposite, 1); - workspaceWorkingDirectoryButton = createPushButton(buttonComposite, ExternalToolsLaunchConfigurationMessages - .getString("ExternalToolsMainTab.Browse_Wor&kspace..._6"), null); //$NON-NLS-1$ - workspaceWorkingDirectoryButton.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent evt) { - handleWorkspaceWorkingDirectoryButtonSelected(); - } - }); - fileWorkingDirectoryButton = createPushButton(buttonComposite, ExternalToolsLaunchConfigurationMessages - .getString("ExternalToolsMainTab.Browse_F&ile_System..._7"), null); //$NON-NLS-1$ - fileWorkingDirectoryButton.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent evt) { - handleFileWorkingDirectoryButtonSelected(); - } - }); - } - - /** - * Creates the controls needed to edit the argument and prompt for argument attributes of an external tool - * - * @param parent - * the composite to create the controls in - */ - protected void createArgumentComponent(Composite parent) { - Font font = parent.getFont(); - - Label label = new Label(parent, SWT.NONE); - label.setText(ExternalToolsLaunchConfigurationMessages.getString("ExternalToolsOptionTab.&Arguments___1")); //$NON-NLS-1$ - GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL); - data.horizontalSpan = 2; - label.setLayoutData(data); - label.setFont(font); - - argumentField = new Text(parent, SWT.BORDER); - data = new GridData(GridData.FILL_HORIZONTAL); - data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH; - argumentField.setLayoutData(data); - argumentField.setFont(font); - argumentField.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e) { - updateLaunchConfigurationDialog(); - } - }); - - variableButton = createPushButton(parent, ExternalToolsLaunchConfigurationMessages - .getString("ExternalToolsOptionTab.Varia&bles..._2"), null); //$NON-NLS-1$ - variableButton.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - VariableSelectionDialog dialog = new VariableSelectionDialog(getShell()); - if (dialog.open() == SelectionDialog.OK) { - argumentField.insert(dialog.getForm().getSelectedVariable()); - } - } - }); - - Label instruction = new Label(parent, SWT.NONE); - instruction - .setText(ExternalToolsLaunchConfigurationMessages - .getString("ExternalToolsOptionTab.Note__Enclose_an_argument_containing_spaces_using_double-quotes_(__)._Not_applicable_for_variables._3")); //$NON-NLS-1$ - data = new GridData(GridData.HORIZONTAL_ALIGN_FILL); - data.horizontalSpan = 2; - instruction.setLayoutData(data); - instruction.setFont(font); - } - - /** - * Creates the controls needed to edit the run in background attribute of an external tool - * - * @param parent - * the composite to create the controls in - */ - protected void createRunBackgroundComponent(Composite parent) { - runBackgroundButton = new Button(parent, SWT.CHECK); - runBackgroundButton.setText(ExternalToolsLaunchConfigurationMessages - .getString("ExternalToolsOptionTab.Run_tool_in_bac&kground_4")); //$NON-NLS-1$ - GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL); - runBackgroundButton.setLayoutData(data); - runBackgroundButton.setFont(parent.getFont()); - runBackgroundButton.addSelectionListener(getSelectionAdapter()); - } - - /** - * @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) - */ - public void setDefaults(ILaunchConfigurationWorkingCopy configuration) { - configuration.setAttribute(IExternalToolConstants.ATTR_RUN_IN_BACKGROUND, false); - } - - /** - * @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration) - */ - public void initializeFrom(ILaunchConfiguration configuration) { - updateLocation(configuration); - updateWorkingDirectory(configuration); - updateArgument(configuration); - updateRunBackground(configuration); - } - - protected void updateWorkingDirectory(ILaunchConfiguration configuration) { - String workingDir = ""; //$NON-NLS-1$ - try { - workingDir = configuration.getAttribute(IExternalToolConstants.ATTR_WORKING_DIRECTORY, ""); //$NON-NLS-1$ - } catch (CoreException ce) { - ExternalToolsPlugin.getDefault().log( - ExternalToolsLaunchConfigurationMessages.getString("ExternalToolsMainTab.Error_reading_configuration_10"), ce); //$NON-NLS-1$ - } - workDirectoryField.setText(workingDir); - workDirectoryField.addModifyListener(modifyListener); - - } - - protected void updateLocation(ILaunchConfiguration configuration) { - String location = ""; //$NON-NLS-1$ - try { - location = configuration.getAttribute(IExternalToolConstants.ATTR_LOCATION, ""); //$NON-NLS-1$ - } catch (CoreException ce) { - ExternalToolsPlugin.getDefault().log( - ExternalToolsLaunchConfigurationMessages.getString("ExternalToolsMainTab.Error_reading_configuration_10"), ce); //$NON-NLS-1$ - } - locationField.setText(location); - locationField.addModifyListener(modifyListener); - } - - protected void updateArgument(ILaunchConfiguration configuration) { - String arguments = ""; //$NON-NLS-1$ - try { - arguments = configuration.getAttribute(IExternalToolConstants.ATTR_TOOL_ARGUMENTS, ""); //$NON-NLS-1$ - } catch (CoreException ce) { - ExternalToolsPlugin.getDefault().log( - ExternalToolsLaunchConfigurationMessages.getString("ExternalToolsOptionTab.Error_reading_configuration_7"), ce); //$NON-NLS-1$ - } - argumentField.setText(arguments); - } - - protected void updateRunBackground(ILaunchConfiguration configuration) { - boolean runInBackgroud = true; - try { - runInBackgroud = configuration.getAttribute(IExternalToolConstants.ATTR_RUN_IN_BACKGROUND, false); - } catch (CoreException ce) { - ExternalToolsPlugin.getDefault().log( - ExternalToolsLaunchConfigurationMessages.getString("ExternalToolsOptionTab.Error_reading_configuration_7"), ce); //$NON-NLS-1$ - } - runBackgroundButton.setSelection(runInBackgroud); - } - - /** - * @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) - */ - public void performApply(ILaunchConfigurationWorkingCopy configuration) { - String location = locationField.getText().trim(); - if (location.length() == 0) { - configuration.setAttribute(IExternalToolConstants.ATTR_LOCATION, (String) null); - } else { - configuration.setAttribute(IExternalToolConstants.ATTR_LOCATION, location); - } - - String workingDirectory = workDirectoryField.getText().trim(); - if (workingDirectory.length() == 0) { - configuration.setAttribute(IExternalToolConstants.ATTR_WORKING_DIRECTORY, (String) null); - } else { - configuration.setAttribute(IExternalToolConstants.ATTR_WORKING_DIRECTORY, workingDirectory); - } - - setAttribute(IExternalToolConstants.ATTR_RUN_IN_BACKGROUND, configuration, runBackgroundButton.getSelection(), false); - - String arguments = argumentField.getText().trim(); - if (arguments.length() == 0) { - configuration.setAttribute(IExternalToolConstants.ATTR_TOOL_ARGUMENTS, (String) null); - } else { - configuration.setAttribute(IExternalToolConstants.ATTR_TOOL_ARGUMENTS, arguments); - } - } - - /** - * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName() - */ - public String getName() { - return ExternalToolsLaunchConfigurationMessages.getString("ExternalToolsMainTab.&Main_17"); //$NON-NLS-1$ - } - - /** - * @see ILaunchConfigurationTab#isValid(org.eclipse.debug.core.ILaunchConfiguration) - */ - public boolean isValid(ILaunchConfiguration launchConfig) { - setErrorMessage(null); - setMessage(null); - return validateLocation() && validateWorkDirectory(); - } - - /** - * Validates the content of the location field. - */ - protected boolean validateLocation() { - String value = locationField.getText().trim(); - if (value.length() < 1) { - setErrorMessage(ExternalToolsLaunchConfigurationMessages - .getString("ExternalToolsMainTab.External_tool_location_cannot_be_empty_18")); //$NON-NLS-1$ - setMessage(null); - return false; - } - - // Translate field contents to the actual file location so we - // can check to ensure the file actually exists. - MultiStatus multiStatus = new MultiStatus(IExternalToolConstants.PLUGIN_ID, 0, "", null); //$NON-NLS-1$ - value = ToolUtil.expandFileLocation(value, ExpandVariableContext.EMPTY_CONTEXT, multiStatus); - if (!multiStatus.isOK()) { - IStatus[] children = multiStatus.getChildren(); - if (children.length > 0) { - setErrorMessage(children[0].getMessage()); - setMessage(null); - } - return false; - } - - File file = new File(value); - if (!file.exists()) { // The file does not exist. - setErrorMessage(ExternalToolsLaunchConfigurationMessages - .getString("ExternalToolsMainTab.External_tool_location_does_not_exist_19")); //$NON-NLS-1$ - return false; - } - if (!file.isFile()) { - setErrorMessage(ExternalToolsLaunchConfigurationMessages - .getString("ExternalToolsMainTab.External_tool_location_specified_is_not_a_file_20")); //$NON-NLS-1$ - return false; - } - return true; - } - - /** - * Validates the content of the working directory field. - */ - protected boolean validateWorkDirectory() { - - String value = workDirectoryField.getText().trim(); - if (value.length() > 0) { - // Translate field contents to the actual directory location so we - // can check to ensure the directory actually exists. - MultiStatus multiStatus = new MultiStatus(IExternalToolConstants.PLUGIN_ID, 0, "", null); //$NON-NLS-1$ - value = ToolUtil.expandDirectoryLocation(value, ExpandVariableContext.EMPTY_CONTEXT, multiStatus); - if (!multiStatus.isOK()) { - IStatus[] children = multiStatus.getChildren(); - if (children.length > 0) { - setErrorMessage(children[0].getMessage()); - } - return false; - } - - File file = new File(value); - if (!file.exists()) { // The directory does not exist. - setErrorMessage(ExternalToolsLaunchConfigurationMessages - .getString("ExternalToolsMainTab.External_tool_working_directory_does_not_exist_or_is_invalid_21")); //$NON-NLS-1$ - return false; - } - } - return true; - } - - protected void handleLocationButtonSelected() { - FileDialog fileDialog = new FileDialog(getShell(), SWT.NONE); - fileDialog.setFileName(locationField.getText()); - String text = fileDialog.open(); - if (text != null) { - locationField.setText(text); - } - } - - /** - * Prompts the user for a workspace location within the workspace and sets the location as a String containing the workspace_loc - * variable or null if no location was obtained from the user. - */ - protected void handleWorkspaceLocationButtonSelected() { - ResourceSelectionDialog dialog; - dialog = new ResourceSelectionDialog(getShell(), ResourcesPlugin.getWorkspace().getRoot(), - ExternalToolsLaunchConfigurationMessages.getString("ExternalToolsMainTab.Select_a_resource_22")); //$NON-NLS-1$ - dialog.open(); - Object[] results = dialog.getResult(); - if (results == null || results.length < 1) { - return; - } - IResource resource = (IResource) results[0]; - StringBuffer buf = new StringBuffer(); - ToolUtil.buildVariableTag(IExternalToolConstants.VAR_WORKSPACE_LOC, resource.getFullPath().toString(), buf); - String text = buf.toString(); - if (text != null) { - locationField.setText(text); - } - } - - /** - * Prompts the user for a working directory location within the workspace and sets the working directory as a String containing - * the workspace_loc variable or null if no location was obtained from the user. - */ - protected void handleWorkspaceWorkingDirectoryButtonSelected() { - ContainerSelectionDialog containerDialog; - containerDialog = new ContainerSelectionDialog(getShell(), ResourcesPlugin.getWorkspace().getRoot(), false, - ExternalToolsLaunchConfigurationMessages.getString("ExternalToolsMainTab.&Select_a_directory__23")); //$NON-NLS-1$ - containerDialog.open(); - Object[] resource = containerDialog.getResult(); - String text = null; - if (resource != null && resource.length > 0) { - text = ToolUtil.buildVariableTag(IExternalToolConstants.VAR_RESOURCE_LOC, ((IPath) resource[0]).toString()); - } - if (text != null) { - workDirectoryField.setText(text); - } - } - - protected void handleFileWorkingDirectoryButtonSelected() { - DirectoryDialog dialog = new DirectoryDialog(getShell(), SWT.SAVE); - dialog.setMessage(ExternalToolsLaunchConfigurationMessages.getString("ExternalToolsMainTab.&Select_a_directory__23")); //$NON-NLS-1$ - dialog.setFilterPath(workDirectoryField.getText()); - String text = dialog.open(); - if (text != null) { - workDirectoryField.setText(text); - } - } - - /** - * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getImage() - */ - public Image getImage() { - return ExternalToolsImages.getImage(IExternalToolConstants.IMG_TAB_MAIN); - } - - /** - * Method getSelectionAdapter. - * - * @return SelectionListener - */ - protected SelectionListener getSelectionAdapter() { - if (selectionAdapter == null) { - selectionAdapter = new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - updateLaunchConfigurationDialog(); - } - }; - } - return selectionAdapter; - } - - private class VariableSelectionDialog extends SelectionDialog { - private ExternalToolVariableForm form; - - private VariableSelectionDialog(Shell parent) { - super(parent); - setTitle(ExternalToolsLaunchConfigurationMessages.getString("ExternalToolsOptionTab.Select_variable_10")); //$NON-NLS-1$ - } - - protected Control createDialogArea(Composite parent) { - // Create the dialog area - Composite composite = (Composite) super.createDialogArea(parent); - ExternalToolVariable[] variables = ExternalToolsPlugin.getDefault().getArgumentVariableRegistry().getArgumentVariables(); - form = new ExternalToolVariableForm(ExternalToolsLaunchConfigurationMessages - .getString("ExternalToolsOptionTab.&Choose_a_variable__11"), variables); //$NON-NLS-1$ - form.createContents(composite, new IGroupDialogPage() { - public GridData setButtonGridData(Button button) { - GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL); - data.heightHint = convertVerticalDLUsToPixels(IDialogConstants.BUTTON_HEIGHT); - int widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH); - data.widthHint = Math.max(widthHint, button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x); - button.setLayoutData(data); - return data; - } - - public void setMessage(String newMessage, int newType) { - VariableSelectionDialog.this.setMessage(newMessage); - } - - public void updateValidState() { - } - - public int convertHeightHint(int chars) { - return convertHeightInCharsToPixels(chars); - } - - public String getMessage() { - if (!form.isValid()) { - return ExternalToolsLaunchConfigurationMessages.getString("ExternalToolsOptionTab.Invalid_selection_12"); //$NON-NLS-1$ - } - return null; - } - - public int getMessageType() { - if (!form.isValid()) { - return IMessageProvider.ERROR; - } - return 0; - } - }); - return composite; - } - - private ExternalToolVariableForm getForm() { - return form; - } - } - -} \ No newline at end of file diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/launchConfigurations/ExternalToolsRefreshTab.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/launchConfigurations/ExternalToolsRefreshTab.java deleted file mode 100644 index c5c6df7..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/launchConfigurations/ExternalToolsRefreshTab.java +++ /dev/null @@ -1,253 +0,0 @@ -package net.sourceforge.phpdt.externaltools.launchConfigurations; - -/********************************************************************** -Copyright (c) 2000, 2002 IBM Corp. All rights reserved. -This file is 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 -**********************************************************************/ - -import net.sourceforge.phpdt.externaltools.group.IGroupDialogPage; -import net.sourceforge.phpdt.externaltools.internal.dialog.ExternalToolVariableForm; -import net.sourceforge.phpdt.externaltools.internal.model.ExternalToolsImages; -import net.sourceforge.phpdt.externaltools.internal.model.ExternalToolsPlugin; -import net.sourceforge.phpdt.externaltools.internal.registry.ExternalToolVariable; -import net.sourceforge.phpdt.externaltools.model.IExternalToolConstants; -import net.sourceforge.phpdt.externaltools.model.ToolUtil; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; -import org.eclipse.debug.ui.AbstractLaunchConfigurationTab; -import org.eclipse.jface.dialogs.IMessageProvider; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; - -public class ExternalToolsRefreshTab extends AbstractLaunchConfigurationTab implements IGroupDialogPage { - - private ExternalToolVariableForm variableForm; - - protected Button refreshField; - protected Button recursiveField; - - /** - * @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite) - */ - public void createControl(Composite parent) { - Composite mainComposite = new Composite(parent, SWT.NONE); - setControl(mainComposite); - - GridLayout layout = new GridLayout(); - layout.numColumns = 1; - GridData gridData = new GridData(GridData.FILL_HORIZONTAL); - mainComposite.setLayout(layout); - mainComposite.setLayoutData(gridData); - mainComposite.setFont(parent.getFont()); - createVerticalSpacer(mainComposite, 1); - createRefreshComponent(mainComposite); - createRecursiveComponent(mainComposite); - createScopeComponent(mainComposite); - } - - /** - * Creates the controls needed to edit the refresh recursive - * attribute of an external tool - * - * @param parent the composite to create the controls in - */ - protected void createRecursiveComponent(Composite parent) { - recursiveField = new Button(parent, SWT.CHECK); - recursiveField.setText(ExternalToolsLaunchConfigurationMessages.getString("ExternalToolsRefreshTab.Recursively_&include_sub-folders_1")); //$NON-NLS-1$ - GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL); - recursiveField.setLayoutData(data); - recursiveField.setFont(parent.getFont()); - recursiveField.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - updateLaunchConfigurationDialog(); - } - }); - } - - /** - * Creates the controls needed to edit the refresh scope - * attribute of an external tool - * - * @param parent the composite to create the controls in - */ - protected void createRefreshComponent(Composite parent) { - refreshField = new Button(parent, SWT.CHECK); - refreshField.setText(ExternalToolsLaunchConfigurationMessages.getString("ExternalToolsRefreshTab.&Refresh_resources_after_running_tool_1")); //$NON-NLS-1$ - GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL); - refreshField.setLayoutData(data); - refreshField.setFont(parent.getFont()); - refreshField.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - updateEnabledState(); - updateLaunchConfigurationDialog(); - } - }); - } - - /** - * Creates the controls needed to edit the refresh scope variable - * attribute of an external tool - * - * @param parent the composite to create the controls in - */ - protected void createScopeComponent(Composite parent) { - String label = ExternalToolsLaunchConfigurationMessages.getString("ExternalToolsRefreshTab.Choose_scope_v&ariable___2"); //$NON-NLS-1$ - ExternalToolVariable[] vars = ExternalToolsPlugin.getDefault().getRefreshVariableRegistry().getRefreshVariables(); - variableForm = new ExternalToolVariableForm(label, vars); - variableForm.createContents(parent, this); - } - - - /** - * @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) - */ - public void setDefaults(ILaunchConfigurationWorkingCopy configuration) { - } - - /** - * @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration) - */ - public void initializeFrom(ILaunchConfiguration configuration) { - updateRefresh(configuration); - updateRecursive(configuration); - updateScope(configuration); - } - /** - * Method udpateScope. - * @param configuration - */ - private void updateScope(ILaunchConfiguration configuration) { - String scope = null; - try { - scope= configuration.getAttribute(IExternalToolConstants.ATTR_REFRESH_SCOPE, (String)null); - } catch (CoreException ce) { - ExternalToolsPlugin.getDefault().log(ExternalToolsLaunchConfigurationMessages.getString("ExternalToolsRefreshTab.Exception_reading_launch_configuration_3"), ce); //$NON-NLS-1$ - } - String varName = null; - String varValue = null; - if (scope != null) { - ToolUtil.VariableDefinition varDef = ToolUtil.extractVariableTag(scope, 0); - varName = varDef.name; - varValue = varDef.argument; - } - variableForm.selectVariable(varName, varValue); - } - /** - * Method updateRecursive. - * @param configuration - */ - private void updateRecursive(ILaunchConfiguration configuration) { - boolean recursive= true; - try { - recursive= configuration.getAttribute(IExternalToolConstants.ATTR_REFRESH_RECURSIVE, false); - } catch (CoreException ce) { - ExternalToolsPlugin.getDefault().log(ExternalToolsLaunchConfigurationMessages.getString("ExternalToolsRefreshTab.Exception_reading_launch_configuration_3"), ce); //$NON-NLS-1$ - } - recursiveField.setSelection(recursive); - } - /** - * Method updateRefresh. - * @param configuration - */ - private void updateRefresh(ILaunchConfiguration configuration) { - String scope= null; - try { - scope= configuration.getAttribute(IExternalToolConstants.ATTR_REFRESH_SCOPE, (String)null); - } catch (CoreException ce) { - ExternalToolsPlugin.getDefault().log(ExternalToolsLaunchConfigurationMessages.getString("ExternalToolsRefreshTab.Exception_reading_launch_configuration_3"), ce); //$NON-NLS-1$ - } - refreshField.setSelection(scope != null); - updateEnabledState(); - } - - /** - * @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) - */ - public void performApply(ILaunchConfigurationWorkingCopy configuration) { - - if (refreshField.getSelection()) { - configuration.setAttribute(IExternalToolConstants.ATTR_REFRESH_SCOPE, variableForm.getSelectedVariable()); - } else { - configuration.setAttribute(IExternalToolConstants.ATTR_REFRESH_SCOPE, (String)null); - } - - setAttribute(IExternalToolConstants.ATTR_REFRESH_RECURSIVE, configuration, recursiveField.getSelection(), false); - } - - /** - * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName() - */ - public String getName() { - return ExternalToolsLaunchConfigurationMessages.getString("ExternalToolsRefreshTab.Refres&h_6"); //$NON-NLS-1$ - } - - /** - * Updates the enablement state of the fields. - */ - protected void updateEnabledState() { - if (refreshField != null) { - if (recursiveField != null) { - recursiveField.setEnabled(refreshField.getSelection()); - } - if (variableForm != null) { - variableForm.setEnabled(refreshField.getSelection()); - } - } - } - /** - * @see net.sourceforge.phpdt.externaltools.group.IGroupDialogPage#convertHeightHint(int) - */ - public int convertHeightHint(int chars) { - return 0; - } - - /** - * @see net.sourceforge.phpdt.externaltools.group.IGroupDialogPage#setButtonGridData(org.eclipse.swt.widgets.Button) - */ - public GridData setButtonGridData(Button button) { - return null; - } - - /** - * @see net.sourceforge.phpdt.externaltools.group.IGroupDialogPage#setMessage(java.lang.String, int) - */ - public void setMessage(String newMessage, int newType) { - setMessage(newMessage); - } - - /** - * @see net.sourceforge.phpdt.externaltools.group.IGroupDialogPage#updateValidState() - */ - public void updateValidState() { - updateLaunchConfigurationDialog(); - } - - /** - * @see org.eclipse.jface.dialogs.IMessageProvider#getMessageType() - */ - public int getMessageType() { - if (getErrorMessage() != null) { - return IMessageProvider.ERROR; - } else if (getMessage() != null) { - return IMessageProvider.WARNING; - } - return IMessageProvider.NONE; - } - /** - * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getImage() - */ - public Image getImage() { - return ExternalToolsImages.getImage(IExternalToolConstants.IMG_ACTION_REFRESH); - } - -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/launchConfigurations/ExternalToolsUtil.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/launchConfigurations/ExternalToolsUtil.java deleted file mode 100644 index 576c6f4..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/launchConfigurations/ExternalToolsUtil.java +++ /dev/null @@ -1,363 +0,0 @@ -package net.sourceforge.phpdt.externaltools.launchConfigurations; - -/********************************************************************** - Copyright (c) 2002 IBM Corp. and others. All rights reserved. - This file is 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: - **********************************************************************/ - -import java.io.File; -import java.text.MessageFormat; -import java.util.Map; - -import net.sourceforge.phpdt.externaltools.internal.model.ExternalToolsModelMessages; -import net.sourceforge.phpdt.externaltools.internal.model.ExternalToolsPlugin; -import net.sourceforge.phpdt.externaltools.internal.model.VariableContextManager; -import net.sourceforge.phpdt.externaltools.internal.registry.ExternalToolMigration; -import net.sourceforge.phpdt.externaltools.internal.registry.RefreshScopeVariable; -import net.sourceforge.phpdt.externaltools.internal.registry.RefreshScopeVariableRegistry; -import net.sourceforge.phpdt.externaltools.model.IExternalToolConstants; -import net.sourceforge.phpdt.externaltools.model.ToolUtil; -import net.sourceforge.phpdt.externaltools.variable.ExpandVariableContext; - -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.MultiStatus; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Status; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.ILaunchConfigurationType; -import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; -import org.eclipse.debug.core.ILaunchManager; - -/** - * Utilities for external tool launch configurations. - *

- * This class it not intended to be instantiated. - *

- */ -public class ExternalToolsUtil { - - private static final String LAUNCH_CONFIG_HANDLE = "LaunchConfigHandle"; //$NON-NLS-1$ - - /** - * Not to be instantiated. - */ - private ExternalToolsUtil() { - }; - - /** - * Throws a core exception with an error status object built from the given message, lower level exception, and error code. - * - * @param message - * the status message - * @param exception - * lower level exception associated with the error, or null if none - * @param code - * error code - */ - protected static void abort(String message, Throwable exception, int code) throws CoreException { - throw new CoreException(new Status(IStatus.ERROR, IExternalToolConstants.PLUGIN_ID, code, message, exception)); - } - - /** - * Returns active variable context. The active variable context is used to expand variable expressions. If the workspace is - * currently being built, the context is associated with the project being built. Otherwise, the context is associated with the - * selected resource. - * - * @return active variable context - */ - public static ExpandVariableContext getVariableContext() { - return VariableContextManager.getDefault().getVariableContext(); - } - - /** - * Expands and returns the location attribute of the given launch configuration, based on the given variable context. The location - * is verified to point to an existing file, in the local file system. - * - * @param configuration - * launch configuration - * @param context - * context used to expand variables - * @return an absolute path to a file in the local file system - * @throws CoreException - * if unable to retrieve the associated launch configuration attribute, if unable to resolve any variables, or if the - * resolved location does not point to an existing file in the local file system - */ - public static IPath getLocation(ILaunchConfiguration configuration, ExpandVariableContext context) throws CoreException { - String location = configuration.getAttribute(IExternalToolConstants.ATTR_LOCATION, (String) null); - if (location == null) { - abort(MessageFormat.format(ExternalToolsLaunchConfigurationMessages - .getString("ExternalToolsUtil.Location_not_specified_by_{0}_1"), new String[] { configuration.getName() }), null, 0); //$NON-NLS-1$ - } else { - MultiStatus status = new MultiStatus(IExternalToolConstants.PLUGIN_ID, 0, ExternalToolsModelMessages - .getString("RunExternalToolAction.runProblem"), null); //$NON-NLS-1$; - String expandedLocation = ToolUtil.expandFileLocation(location, context, status); - if (status.isOK()) { - if (expandedLocation == null || expandedLocation.length() == 0) { - String msg = ExternalToolsModelMessages.format( - "DefaultRunnerContext.invalidLocation", new Object[] { configuration.getName() }); //$NON-NLS-1$ - abort(msg, null, 0); - } else { - File file = new File(expandedLocation); - if (file.isFile()) { - return new Path(expandedLocation); - } else { - String msg = ExternalToolsModelMessages.format( - "DefaultRunnerContext.invalidLocation", new Object[] { configuration.getName() }); //$NON-NLS-1$ - abort(msg, null, 0); - } - } - } else { - throw new CoreException(status); - } - } - // execution will not reach here - return null; - } - - /** - * Expands and returns the working directory attribute of the given launch configuration, based on the given variable context. - * Returns null if a working directory is not specified. If specified, the working is verified to point to an - * existing directory in the local file system. - * - * @param configuration - * launch configuration - * @param context - * context used to expand variables - * @return an absolute path to a direcoty in the local file system, or null if unspecified - * @throws CoreException - * if unable to retrieve the associated launch configuration attribute, if unable to resolve any variables, or if the - * resolved location does not point to an existing directory in the local file system - */ - public static IPath getWorkingDirectory(ILaunchConfiguration configuration, ExpandVariableContext context) throws CoreException { - String location = configuration.getAttribute(IExternalToolConstants.ATTR_WORKING_DIRECTORY, (String) null); - if (location != null) { - MultiStatus status = new MultiStatus(IExternalToolConstants.PLUGIN_ID, 0, ExternalToolsModelMessages - .getString("RunExternalToolAction.runProblem"), null); //$NON-NLS-1$; - String expandedLocation = ToolUtil.expandDirectoryLocation(location, context, status); - if (status.isOK()) { - if (expandedLocation != null && expandedLocation.length() > 0) { - File path = new File(expandedLocation); - if (path.isDirectory()) { - return new Path(expandedLocation); - } else { - String msg = ExternalToolsModelMessages.format( - "DefaultRunnerContext.invalidDirectory", new Object[] { configuration.getName() }); //$NON-NLS-1$ - abort(msg, null, 0); - } - } - } else { - throw new CoreException(status); - } - } - return null; - } - - /** - * Expands and returns the arguments attribute of the given launch configuration, based on the given variable context. Returns - * null if arguments are not specified. - * - * @param configuration - * launch configuration - * @param context - * context used to expand variables - * @return an array of resolved arguments, or null if unspecified - * @throws CoreException - * if unable to retrieve the associated launch configuration attribute, or if unable to resolve any variables - */ - public static String[] getArguments(ILaunchConfiguration configuration, ExpandVariableContext context) throws CoreException { - String args = configuration.getAttribute(IExternalToolConstants.ATTR_TOOL_ARGUMENTS, (String) null); - if (args != null) { - MultiStatus status = new MultiStatus(IExternalToolConstants.PLUGIN_ID, 0, ExternalToolsModelMessages - .getString("RunExternalToolAction.runProblem"), null); //$NON-NLS-1$; - String[] expandedArgs = ToolUtil.expandArguments(args, context, status); - if (status.isOK()) { - return expandedArgs; - } else { - throw new CoreException(status); - } - } - return null; - } - - /** - * Returns the refresh scope specified by the given launch configuration or null if none. - * - * @param configuration - * @return refresh scope - * @throws CoreException - * if unable to access the associated attribute - */ - public static String getRefreshScope(ILaunchConfiguration configuration) throws CoreException { - return configuration.getAttribute(IExternalToolConstants.ATTR_REFRESH_SCOPE, (String) null); - } - - /** - * Returns whether the refresh scope specified by the given launch configuration is recursive. - * - * @param configuration - * @return whether the refresh scope is recursive - * @throws CoreException - * if unable to access the associated attribute - */ - public static boolean isRefreshRecursive(ILaunchConfiguration configuration) throws CoreException { - return configuration.getAttribute(IExternalToolConstants.ATTR_REFRESH_RECURSIVE, false); - } - - /** - * Refreshes the resources as specified by the given launch configuration. - * - * @param configuration - * launch configuration - * @param context - * context used to expand variables - * @param monitor - * progress monitor - * @throws CoreException - * if an exception occurrs while refreshing resources - */ - public static void refreshResources(ILaunchConfiguration configuration, ExpandVariableContext context, IProgressMonitor monitor) - throws CoreException { - String scope = getRefreshScope(configuration); - if (scope == null) - return; - - ToolUtil.VariableDefinition varDef = ToolUtil.extractVariableTag(scope, 0); - if (varDef.start == -1 || varDef.end == -1 || varDef.name == null) { - String msg = ExternalToolsModelMessages.format( - "DefaultRunnerContext.invalidRefreshVarFormat", new Object[] { configuration.getName() }); //$NON-NLS-1$ - abort(msg, null, 0); - } - - RefreshScopeVariableRegistry registry = ExternalToolsPlugin.getDefault().getRefreshVariableRegistry(); - RefreshScopeVariable variable = registry.getRefreshVariable(varDef.name); - if (variable == null) { - String msg = ExternalToolsModelMessages.format( - "DefaultRunnerContext.noRefreshVarNamed", new Object[] { configuration.getName(), varDef.name }); //$NON-NLS-1$ - abort(msg, null, 0); - } - - int depth = IResource.DEPTH_ZERO; - if (isRefreshRecursive(configuration)) - depth = IResource.DEPTH_INFINITE; - - if (monitor.isCanceled()) - return; - - IResource[] resources = variable.getExpander().getResources(varDef.name, varDef.argument, context); - if (resources == null || resources.length == 0) - return; - - monitor.beginTask(ExternalToolsModelMessages.getString("DefaultRunnerContext.refreshResources"), //$NON-NLS-1$ - resources.length); - - MultiStatus status = new MultiStatus(IExternalToolConstants.PLUGIN_ID, 0, ExternalToolsLaunchConfigurationMessages - .getString("ExternalToolsUtil.Exception(s)_occurred_during_refresh._2"), null); //$NON-NLS-1$ - for (int i = 0; i < resources.length; i++) { - if (monitor.isCanceled()) - break; - if (resources[i] != null && resources[i].isAccessible()) { - try { - resources[i].refreshLocal(depth, null); - } catch (CoreException e) { - status.merge(e.getStatus()); - } - } - monitor.worked(1); - } - - monitor.done(); - if (!status.isOK()) { - throw new CoreException(status); - } - } - - /** - * Returns whether this tool is to be run in the background.. - * - * @param configuration - * @return whether this tool is to be run in the background - * @throws CoreException - * if unable to access the associated attribute - */ - public static boolean isBackground(ILaunchConfiguration configuration) throws CoreException { - return configuration.getAttribute(IExternalToolConstants.ATTR_RUN_IN_BACKGROUND, false); - } - - /** - * Returns a launch configuration from the given ICommand arguments. If the given arguments are from an old-style external tool, - * an unsaved working copy will be created from the arguments and returned. - * - * @param commandArgs - * the builder ICommand arguments - * @param newName - * a new name for the config if the one in the command is invalid - * @return a launch configuration, a launch configuration working copy, or null if not possible. - */ - public static ILaunchConfiguration configFromBuildCommandArgs(Map commandArgs) { - String configHandle = (String) commandArgs.get(LAUNCH_CONFIG_HANDLE); - if (configHandle == null) { - // Probably an old-style external tool. Try to migrate. - return ExternalToolMigration.configFromArgumentMap(commandArgs); - } - try { - return DebugPlugin.getDefault().getLaunchManager().getLaunchConfiguration(configHandle); - } catch (CoreException e) { - return null; - } - } - - /** - * Executes an external progam and saves the LaunchConfiguration under external tools - * - * @param command - * external tools command name - * @param executable - * executable path i.e.c:\apache\apache.exe - * @param arguments - * arguments for this configuration - * @param background - * run this configuration in background mode - */ - public static void execute(String command, String executable, String arguments, boolean background) { - execute(command, executable, null, arguments, background); - } - - - public static void execute(String command, String executable, String workingDirectory, String arguments, boolean background) { - ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager(); - ILaunchConfigurationType type = manager.getLaunchConfigurationType(IExternalToolConstants.ID_PROGRAM_LAUNCH_CONFIGURATION_TYPE); - - ILaunchConfigurationWorkingCopy wc = null; - try { - wc = type.newInstance(null, command); - } catch (CoreException e) { - //some exception handling - } - wc.setAttribute(IExternalToolConstants.ATTR_LOCATION, executable); - if (workingDirectory != null) { - wc.setAttribute(IExternalToolConstants.ATTR_WORKING_DIRECTORY, workingDirectory); - } - if (arguments != null) { - wc.setAttribute(IExternalToolConstants.ATTR_TOOL_ARGUMENTS, arguments); - } - wc.setAttribute(IExternalToolConstants.ATTR_RUN_IN_BACKGROUND, background); - - // saving will add the configuration to the external tools configurations - ILaunchConfiguration config; - try { - config = wc.doSave(); - config.launch(ILaunchManager.RUN_MODE, null); - } catch (CoreException e) { - } - - } -} \ No newline at end of file diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/model/IExternalToolConstants.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/model/IExternalToolConstants.java deleted file mode 100644 index 399f237..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/model/IExternalToolConstants.java +++ /dev/null @@ -1,384 +0,0 @@ -package net.sourceforge.phpdt.externaltools.model; - -/********************************************************************** -Copyright (c) 2002 IBM Corp. and others. All rights reserved. -This file is 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: -**********************************************************************/ - -/** - * Defines the constants available for client use. - *

- * This interface is not intended to be extended or implemented by clients. - *

- */ -public interface IExternalToolConstants { - /** - * Plugin identifier for external tools (value org.eclipse.ui.externaltools). - */ - public static final String PLUGIN_ID = "net.sourceforge.phpeclipse"; //$NON-NLS-1$; - - // ------- Extensions Points ------- - /** - * Extension point to declare the launch configuration type that should be - * created when duplicating an existing configuration as a project builder. - */ - public static final String EXTENSION_POINT_CONFIGURATION_DUPLICATION_MAPS = "configurationDuplicationMaps"; //$NON-NLS-1$ - /** - * Extension point to declare argument variables - * (value argumentVariables). - */ - public static final String EXTENSION_POINT_ARGUMENT_VARIABLES = "argumentVariables"; //$NON-NLS-1$ - - /** - * Extension point to declare file variables - * (value fileVariables). - */ - public static final String EXTENSION_POINT_FILE_VARIABLES = "fileVariables"; //$NON-NLS-1$ - - /** - * Extension point to declare directory variables - * (value directoryVariables). - */ - public static final String EXTENSION_POINT_DIRECTORY_VARIABLES = "directoryVariables"; //$NON-NLS-1$ - - /** - * Extension point to declare refresh scope variables - * (value refreshVariables). - */ - public static final String EXTENSION_POINT_REFRESH_VARIABLES = "refreshVariables"; //$NON-NLS-1$ - - // ------- Views ------- - - /** - * Ant View identifier (value org.eclipse.ui.externaltools.AntView). - */ - //public static final String ANT_VIEW_ID = PLUGIN_ID + ".AntView"; //$NON-NLS-1$ - - // ------- Tool Types ------- - /** - * External tool type for programs such as executables, batch files, - * shell scripts, etc (value programType). - */ - public static final String TOOL_TYPE_PROGRAM = "programType"; //$NON-NLS-1$; - - /** - * External tool type for Ant build files (value antBuildType). - */ - //public static final String TOOL_TYPE_ANT_BUILD = "antBuildType"; //$NON-NLS-1$; - - // ------- Variables ------- - - /** - * Variable that expands to the absolute path on the system's hard drive - * to the workspace directory (value workspace_loc). - */ - public static final String VAR_WORKSPACE_LOC = "workspace_loc"; //$NON-NLS-1$ - - /** - * Variable that expands to the absolute path on the system's hard drive - * to a project's directory (value project_loc). - */ - public static final String VAR_PROJECT_LOC = "project_loc"; //$NON-NLS-1$ - - /** - * Variable that expands to the full path, relative to the workspace root, - * of a project (value project_path). - */ - public static final String VAR_PROJECT_PATH = "project_path"; //$NON-NLS-1$ - - /** - * Variable that expands to the name of a project (value project_name). - */ - public static final String VAR_PROJECT_NAME = "project_name"; //$NON-NLS-1$ - - /** - * Variable that expands to the absolute path on the system's hard drive - * to a resource's location (value resource_loc). - */ - public static final String VAR_RESOURCE_LOC = "resource_loc"; //$NON-NLS-1$ - - /** - * Variable that expands to the full path, relative to the workspace root, - * of a resource (value resource_path). - */ - public static final String VAR_RESOURCE_PATH = "resource_path"; //$NON-NLS-1$ - - /** - * Variable that expands to the name of a resource (value resource_name). - */ - public static final String VAR_RESOURCE_NAME = "resource_name"; //$NON-NLS-1$ - - /** - * Variable that expands to the absolute path on the system's hard drive - * to a resource's containing directory (value container_loc). - */ - public static final String VAR_CONTAINER_LOC = "container_loc"; //$NON-NLS-1$ - - /** - * Variable that expands to the full path, relative to the workspace root, - * of a resource's parent (value container_path). - */ - public static final String VAR_CONTAINER_PATH = "container_path"; //$NON-NLS-1$ - - /** - * Variable that expands to the name of a resource's parent (value container_name). - */ - public static final String VAR_CONTAINER_NAME = "container_name"; //$NON-NLS-1$ - - /** - * Variable that expands to the type of build (value build_type). See - * BUILD_TYPE_* constants for possible values. - */ - public static final String VAR_BUILD_TYPE = "build_type"; //$NON-NLS-1$ - - /** - * Variable that expands to the current editor cursor column (value editor_cur_col). - */ - public static final String VAR_EDITOR_CUR_COL = "editor_cur_col"; //$NON-NLS-1$ - - /** - * Variable that expands to the current editor cursor line (value editor_cur_line). - */ - public static final String VAR_EDITOR_CUR_LINE = "editor_cur_line"; //$NON-NLS-1$ - - /** - * Variable that expands to the current editor selected text (value editor_sel_text). - */ - public static final String VAR_EDITOR_SEL_TEXT = "editor_sel_text"; //$NON-NLS-1$ - - // ------- Refresh Variables ------- - /** - * Variable that expands to the workspace root object (value workspace). - */ - public static final String VAR_WORKSPACE = "workspace"; //$NON-NLS-1$ - - /** - * Variable that expands to the project resource (value project). - */ - public static final String VAR_PROJECT = "project"; //$NON-NLS-1$ - - /** - * Variable that expands to the container resource (value container). - */ - public static final String VAR_CONTAINER = "container"; //$NON-NLS-1$ - - /** - * Variable that expands to a resource (value resource). - */ - public static final String VAR_RESOURCE = "resource"; //$NON-NLS-1$ - - /** - * Variable that expands to the working set object (value working_set). - */ - public static final String VAR_WORKING_SET = "working_set"; //$NON-NLS-1$ - - // ------- Build Types ------- - /** - * Build type indicating an incremental project build request for - * the external tool running as a builder (value incremental). - */ - public static final String BUILD_TYPE_INCREMENTAL = "incremental"; //$NON-NLS-1$ - - /** - * Build type indicating a full project build request for - * the external tool running as a builder (value full). - */ - public static final String BUILD_TYPE_FULL = "full"; //$NON-NLS-1$ - - /** - * Build type indicating an automatic project build request for - * the external tool running as a builder (value incremental). - */ - public static final String BUILD_TYPE_AUTO = "auto"; //$NON-NLS-1$ - - /** - * Build type indicating an no project build request for - * the external tool running as a builder (value none). - */ - public static final String BUILD_TYPE_NONE = "none"; //$NON-NLS-1$ - - // ------- Images ------- - /** - * External tools wizard banner image - */ - public static final String IMG_WIZBAN_EXTERNAL_TOOLS = PLUGIN_ID + ".IMG_WIZBAN_EXTERNAL_TOOLS"; //$NON-NLS-1$ - - /** - * Refresh action image - */ - public static final String IMG_ACTION_REFRESH = PLUGIN_ID + ".IMG_ACTION_REFRESH"; //$NON-NLS-1$ - - /** - * Main tab image. - */ - public static final String IMG_TAB_MAIN = PLUGIN_ID + ".IMG_TAB_MAIN"; //$NON-NLS-1$ - - /** - * Options tab image. - */ - public static final String IMG_TAB_OPTIONS = PLUGIN_ID + ".IMG_TAB_OPTIONS"; //$NON-NLS-1$ - - /** - * Ant Targets tab image. - */ - public static final String IMG_TAB_ANT_TARGETS = PLUGIN_ID + ".IMG_TAB_ANT_TARGETS"; //$NON-NLS-1$ - - // ------- Launch configuration types -------- - /** - * Ant launch configuration type identifier. - */ -// public static final String ID_ANT_LAUNCH_CONFIGURATION_TYPE = "org.eclipse.ant.AntLaunchConfigurationType"; //$NON-NLS-1$ - - /** - * Ant builder launch configuration type identifier. Ant project builders - * are of this type. - */ -// public static final String ID_ANT_BUILDER_LAUNCH_CONFIGURATION_TYPE = "org.eclipse.ant.AntBuilderLaunchConfigurationType"; //$NON-NLS-1$ - - /** - * Program launch configuration type identifier. - */ - public static final String ID_PROGRAM_LAUNCH_CONFIGURATION_TYPE = "net.sourceforge.phpdt.externaltools.ProgramLaunchConfigurationType"; //$NON-NLS-1$ - - /** - * Program builder launch configuration type identifier. Program project - * builders are of this type. - */ - public static final String ID_PROGRAM_BUILDER_LAUNCH_CONFIGURATION_TYPE = "net.sourceforge.phpdt.externaltools.ProgramBuilderLaunchConfigurationType"; //$NON-NLS-1$ - - // ------- Launch configuration category -------- - /** - * Identifier for external tools launch configuration category. Launch - * configuration types for external tools that appear in the external tools - * launch configuration dialog should belong to this category. - */ - public static final String ID_EXTERNAL_TOOLS_LAUNCH_CATEGORY = "net.sourceforge.phpdt.externaltools"; //$NON-NLS-1$ - /** - * Identifier for external tools launch configuration builders category. - * Launch configuration types that can be added as project builders should - * belong to this category. - */ - public static final String ID_EXTERNAL_TOOLS_BUILDER_LAUNCH_CATEGORY = "net.sourceforge.phpdt.externaltools.builder"; //$NON-NLS-1$ - - // ------- Launch configuration groups -------- - /** - * Identifier for external tools launch configuration group. The external - * tools launch configuration group corresponds to the external tools - * category in run mode. - */ - //public static final String ID_EXTERNAL_TOOLS_LAUNCH_GROUP = "net.sourceforge.phpdt.externaltools.launchGroup"; //$NON-NLS-1$ - /** - * Identifier for external tools launch configuration group - */ - //public static final String ID_EXTERNAL_TOOLS_BUILDER_LAUNCH_GROUP = "net.sourceforge.phpdt.externaltools.launchGroup.builder"; //$NON-NLS-1$ - - // ------- Common External Tool Launch Configuration Attributes ------- - - /** - * Boolean attribute indicating if external tool output should be captured. - * Default value is false. - */ - public static final String ATTR_CAPTURE_OUTPUT = PLUGIN_ID + ".ATTR_CAPTURE_OUTPUT"; //$NON-NLS-1$ - /** - * String attribute identifying the location of an external. Default value - * is null. Encoding is tool specific. - */ - public static final String ATTR_LOCATION = PLUGIN_ID + ".ATTR_LOCATION"; //$NON-NLS-1$ - - /** - * Boolean attribute indicating if the user should be prompted for - * arguments before running a tool. Default value is false. - */ - public static final String ATTR_PROMPT_FOR_ARGUMENTS = PLUGIN_ID + ".ATTR_PROMPT_FOR_ARGUMENTS"; //$NON-NLS-1$ - - /** - * Boolean attribute indicating if a refresh scope is recursive. Default - * value is false. - */ - public static final String ATTR_REFRESH_RECURSIVE = PLUGIN_ID + ".ATTR_REFRESH_RECURSIVE"; //$NON-NLS-1$ - - /** - * String attribute identifying the scope of resources that should be - * refreshed after an external tool is run. Default value is - * null, indicating no refresh. Format is ??? - */ - public static final String ATTR_REFRESH_SCOPE = PLUGIN_ID + ".ATTR_REFRESH_SCOPE"; //$NON-NLS-1$ - - /** - * String attribute containing an array of build kinds for which an - * external tool builder should be run. - */ - public static final String ATTR_RUN_BUILD_KINDS = PLUGIN_ID + ".ATTR_RUN_BUILD_KINDS"; //$NON-NLS-1$ - - /** - * Boolean attribute indicating if an external tool should be run in the - * background. Default value is false. - */ - public static final String ATTR_RUN_IN_BACKGROUND = PLUGIN_ID + ".ATTR_RUN_IN_BACKGROUND"; //$NON-NLS-1$ - - /** - * Boolean attribute indicating if the console should be shown on external - * tool output. Default value is false. - */ - public static final String ATTR_SHOW_CONSOLE = PLUGIN_ID + ".ATTR_SHOW_CONSOLE"; //$NON-NLS-1$ - - /** - * String attribute containing the arguments that should be passed to the - * tool. Default value is null, and encoding is tool specific. - */ - public static final String ATTR_TOOL_ARGUMENTS = PLUGIN_ID + ".ATTR_TOOL_ARGUMENTS"; //$NON-NLS-1$ - - /** - * String attribute identifying the working directory of an external tool. - * Default value is null, which indicates a default working - * directory, which is tool specific. - */ - public static final String ATTR_WORKING_DIRECTORY = PLUGIN_ID + ".ATTR_WORKING_DIRECTORY"; //$NON-NLS-1$ - - // ------- Common Ant Launch Configuration Attributes ------- - /** - * String attribute indicating the Ant targets to execute. Default value is - * null which indicates that the default target is to be - * executed. Format is a comma separated listing of targets. - */ - public static final String ATTR_ANT_TARGETS = PLUGIN_ID + ".ATTR_ANT_TARGETS"; //$NON-NLS-1$ - - /** - * Map attribute indicating the Ant properties to be defined during the - * build. Default value is null which indicates no additional - * properties will be defined. - */ - public static final String ATTR_ANT_PROPERTIES = PLUGIN_ID + ".ATTR_ANT_PROPERTIES"; //$NON-NLS-1$ - - /** - * String attribute indicating the Ant targets to execute. Default value is - * null which indicates that no additional property files - * will be defined. Format is a comma separated listing of property files. - */ - //public static final String ATTR_ANT_PROPERTY_FILES = PLUGIN_ID + ".ATTR_ANT_PROPERTY_FILES"; //$NON-NLS-1$ - - /** - * String attribute indicating the custom runtime classpath to use for an Ant - * build. Default value is null which indicates that the global - * classpath is to be used. Format is a comma separated listing of URLs. - */ - //public static final String ATTR_ANT_CUSTOM_CLASSPATH = PLUGIN_ID + ".ATTR_ANT_CUSTOM_CLASSPATH"; //$NON-NLS-1$ - - /** - * String attribute indicating the custom Ant home to use for an Ant build. - * Default value is null which indicates that no Ant homeis to - * be set - */ - //public static final String ATTR_ANT_HOME = PLUGIN_ID + ".ATTR_ANT_HOME"; //$NON-NLS-1$ - - /** - * Identifier for ant processes (value ant). This identifier is - * set as the value for the IProcess.ATTR_PROCESS_TYPE - * attribute in processes create by the ant launch delegate. - */ - //public static final String ID_ANT_PROCESS_TYPE = "ant"; //$NON-NLS-1$ -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/model/IRunnerLog.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/model/IRunnerLog.java deleted file mode 100644 index 5172569..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/model/IRunnerLog.java +++ /dev/null @@ -1,43 +0,0 @@ -package net.sourceforge.phpdt.externaltools.model; - -/********************************************************************** -Copyright (c) 2002 IBM Corp. and others. All rights reserved. -This file is 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: -**********************************************************************/ - -/** - * Provides an API for IExternalToolRunner implementors - * to log messages captured from the running tool's output. - *

- * This interface is not be extended nor implemented by clients. - *

- */ -public interface IRunnerLog { - public static final int LEVEL_ERROR = 0; - public static final int LEVEL_WARNING = 10; - public static final int LEVEL_INFO = 20; - public static final int LEVEL_VERBOSE = 30; - public static final int LEVEL_DEBUG = 40; - - /** - * Places the specified message text into the log. Ignored - * if the specified message level is higher than the - * current filter level. - * - * @param message the text to add to the log - * @param level the message priority - */ - public void append(String message, int level); - - /** - * Returns the current level used for filtering - * messages. Any calls to append with - * a level greater than this filter value will be - * ignored. - */ - public int getFilterLevel(); -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/model/StringMatcher.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/model/StringMatcher.java deleted file mode 100644 index e4c530b..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/model/StringMatcher.java +++ /dev/null @@ -1,388 +0,0 @@ -package net.sourceforge.phpdt.externaltools.model; -/********************************************************************** -Copyright (c) 2000, 2002 IBM Corp. All rights reserved. -This file is 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 -**********************************************************************/ - -import java.util.Vector; - -/** - * Copied from net.sourceforge.phpdt.internal.ui.util.StringMatcher - * - * A string pattern matcher, suppporting * and ? wildcards. - */ -public class StringMatcher { - protected String fPattern; - protected int fLength; // pattern length - protected boolean fIgnoreWildCards; - protected boolean fIgnoreCase; - protected boolean fHasLeadingStar; - protected boolean fHasTrailingStar; - protected String fSegments[]; //the given pattern is split into * separated segments - - /* boundary value beyond which we don't need to search in the text */ - protected int fBound= 0; - - - protected static final char fSingleWildCard= '\u0000'; - - public static class Position { - int start; //inclusive - int end; //exclusive - public Position(int start, int end) { - this.start= start; - this.end= end; - } - public int getStart() { - return start; - } - public int getEnd() { - return end; - } - } - /** - * StringMatcher constructor takes in a String object that is a simple - * pattern which may contain �*� for 0 and many characters and - * �?� for exactly one character. - * - * Literal '*' and '?' characters must be escaped in the pattern - * e.g., "\*" means literal "*", etc. - * - * Escaping any other character (including the escape character itself), - * just results in that character in the pattern. - * e.g., "\a" means "a" and "\\" means "\" - * - * If invoking the StringMatcher with string literals in Java, don't forget - * escape characters are represented by "\\". - * - * @param pattern the pattern to match text against - * @param ignoreCase if true, case is ignored - * @param ignoreWildCards if true, wild cards and their escape sequences are ignored - * (everything is taken literally). - */ - public StringMatcher(String pattern, boolean ignoreCase, boolean ignoreWildCards) { - if (pattern == null) - throw new IllegalArgumentException(); - fIgnoreCase= ignoreCase; - fIgnoreWildCards= ignoreWildCards; - fPattern= pattern; - fLength= pattern.length(); - - if (fIgnoreWildCards) { - parseNoWildCards(); - } else { - parseWildCards(); - } - } - /** - * Find the first occurrence of the pattern between startend(exclusive). - * @param text, the String object to search in - * @param start, the starting index of the search range, inclusive - * @param end, the ending index of the search range, exclusive - * @return an StringMatcher.Position object that keeps the starting - * (inclusive) and ending positions (exclusive) of the first occurrence of the - * pattern in the specified range of the text; return null if not found or subtext - * is empty (start==end). A pair of zeros is returned if pattern is empty string - * Note that for pattern like "*abc*" with leading and trailing stars, position of "abc" - * is returned. For a pattern like"*??*" in text "abcdf", (1,3) is returned - */ - public StringMatcher.Position find(String text, int start, int end) { - if (text == null) - throw new IllegalArgumentException(); - - int tlen= text.length(); - if (start < 0) - start= 0; - if (end > tlen) - end= tlen; - if (end < 0 ||start >= end ) - return null; - if (fLength == 0) - return new Position(start, start); - if (fIgnoreWildCards) { - int x= posIn(text, start, end); - if (x < 0) - return null; - return new Position(x, x+fLength); - } - - int segCount= fSegments.length; - if (segCount == 0)//pattern contains only '*'(s) - return new Position (start, end); - - int curPos= start; - int matchStart= -1; - int i; - for (i= 0; i < segCount && curPos < end; ++i) { - String current= fSegments[i]; - int nextMatch= regExpPosIn(text, curPos, end, current); - if (nextMatch < 0 ) - return null; - if(i == 0) - matchStart= nextMatch; - curPos= nextMatch + current.length(); - } - if (i < segCount) - return null; - return new Position(matchStart, curPos); - } - /** - * match the given text with the pattern - * @return true if matched eitherwise false - * @param text, a String object - */ - public boolean match(String text) { - return match(text, 0, text.length()); - } - /** - * Given the starting (inclusive) and the ending (exclusive) positions in the - * text, determine if the given substring matches with aPattern - * @return true if the specified portion of the text matches the pattern - * @param String text, a String object that contains the substring to match - * @param int start marks the starting position (inclusive) of the substring - * @param int end marks the ending index (exclusive) of the substring - */ - public boolean match(String text, int start, int end) { - if (null == text) - throw new IllegalArgumentException(); - - if (start > end) - return false; - - if (fIgnoreWildCards) - return (end - start == fLength) && fPattern.regionMatches(fIgnoreCase, 0, text, start, fLength); - int segCount= fSegments.length; - if (segCount == 0 && (fHasLeadingStar || fHasTrailingStar)) // pattern contains only '*'(s) - return true; - if (start == end) - return fLength == 0; - if (fLength == 0) - return start == end; - - int tlen= text.length(); - if (start < 0) - start= 0; - if (end > tlen) - end= tlen; - - int tCurPos= start; - int bound= end - fBound; - if ( bound < 0) - return false; - int i=0; - String current= fSegments[i]; - int segLength= current.length(); - - /* process first segment */ - if (!fHasLeadingStar){ - if(!regExpRegionMatches(text, start, current, 0, segLength)) { - return false; - } else { - ++i; - tCurPos= tCurPos + segLength; - } - } - - /* process middle segments */ - while (i < segCount) { - current= fSegments[i]; - int currentMatch; - int k= current.indexOf(fSingleWildCard); - if (k < 0) { - currentMatch= textPosIn(text, tCurPos, end, current); - if (currentMatch < 0) - return false; - } else { - currentMatch= regExpPosIn(text, tCurPos, end, current); - if (currentMatch < 0) - return false; - } - tCurPos= currentMatch + current.length(); - i++; - } - - /* process final segment */ - if (!fHasTrailingStar && tCurPos != end) { - int clen= current.length(); - return regExpRegionMatches(text, end - clen, current, 0, clen); - } - return i == segCount ; - } - /** - * This method parses the given pattern into segments seperated by wildcard '*' characters. - * Since wildcards are not being used in this case, the pattern consists of a single segment. - */ - private void parseNoWildCards() { - fSegments= new String[1]; - fSegments[0]= fPattern; - fBound= fLength; - } - /** - * Parses the given pattern into segments seperated by wildcard '*' characters. - * @param p, a String object that is a simple regular expression with �*� and/or �?� - */ - private void parseWildCards() { - if(fPattern.startsWith("*"))//$NON-NLS-1$ - fHasLeadingStar= true; - if(fPattern.endsWith("*")) {//$NON-NLS-1$ - /* make sure it's not an escaped wildcard */ - if (fLength > 1 && fPattern.charAt(fLength - 2) != '\\') { - fHasTrailingStar= true; - } - } - - Vector temp= new Vector(); - - int pos= 0; - StringBuffer buf= new StringBuffer(); - while (pos < fLength) { - char c= fPattern.charAt(pos++); - switch (c) { - case '\\': - if (pos >= fLength) { - buf.append(c); - } else { - char next= fPattern.charAt(pos++); - /* if it's an escape sequence */ - if (next == '*' || next == '?' || next == '\\') { - buf.append(next); - } else { - /* not an escape sequence, just insert literally */ - buf.append(c); - buf.append(next); - } - } - break; - case '*': - if (buf.length() > 0) { - /* new segment */ - temp.addElement(buf.toString()); - fBound += buf.length(); - buf.setLength(0); - } - break; - case '?': - /* append special character representing single match wildcard */ - buf.append(fSingleWildCard); - break; - default: - buf.append(c); - } - } - - /* add last buffer to segment list */ - if (buf.length() > 0) { - temp.addElement(buf.toString()); - fBound += buf.length(); - } - - fSegments= new String[temp.size()]; - temp.copyInto(fSegments); - } - /** - * @param text, a string which contains no wildcard - * @param start, the starting index in the text for search, inclusive - * @param end, the stopping point of search, exclusive - * @return the starting index in the text of the pattern , or -1 if not found - */ - protected int posIn(String text, int start, int end) {//no wild card in pattern - int max= end - fLength; - - if (!fIgnoreCase) { - int i= text.indexOf(fPattern, start); - if (i == -1 || i > max) - return -1; - return i; - } - - for (int i= start; i <= max; ++i) { - if (text.regionMatches(true, i, fPattern, 0, fLength)) - return i; - } - - return -1; - } - /** - * @param text, a simple regular expression that may only contain '?'(s) - * @param start, the starting index in the text for search, inclusive - * @param end, the stopping point of search, exclusive - * @param p, a simple regular expression that may contains '?' - * @param caseIgnored, wether the pattern is not casesensitive - * @return the starting index in the text of the pattern , or -1 if not found - */ - protected int regExpPosIn(String text, int start, int end, String p) { - int plen= p.length(); - - int max= end - plen; - for (int i= start; i <= max; ++i) { - if (regExpRegionMatches(text, i, p, 0, plen)) - return i; - } - return -1; - } - /** - * - * @return boolean - * @param text, a String to match - * @param start, int that indicates the starting index of match, inclusive - * @param end int that indicates the ending index of match, exclusive - * @param p, String, String, a simple regular expression that may contain '?' - * @param ignoreCase, boolean indicating wether code>p is case sensitive - */ - protected boolean regExpRegionMatches(String text, int tStart, String p, int pStart, int plen) { - while (plen-- > 0) { - char tchar= text.charAt(tStart++); - char pchar= p.charAt(pStart++); - - /* process wild cards */ - if (!fIgnoreWildCards) { - /* skip single wild cards */ - if (pchar == fSingleWildCard) { - continue; - } - } - if (pchar == tchar) - continue; - if (fIgnoreCase) { - if (Character.toUpperCase(tchar) == Character.toUpperCase(pchar)) - continue; - // comparing after converting to upper case doesn't handle all cases; - // also compare after converting to lower case - if (Character.toLowerCase(tchar) == Character.toLowerCase(pchar)) - continue; - } - return false; - } - return true; - } - /** - * @param text, the string to match - * @param start, the starting index in the text for search, inclusive - * @param end, the stopping point of search, exclusive - * @param code>p, a string that has no wildcard - * @param ignoreCase, boolean indicating wether code>p is case sensitive - * @return the starting index in the text of the pattern , or -1 if not found - */ - protected int textPosIn(String text, int start, int end, String p) { - - int plen= p.length(); - int max= end - plen; - - if (!fIgnoreCase) { - int i= text.indexOf(p, start); - if (i == -1 || i > max) - return -1; - return i; - } - - for (int i= start; i <= max; ++i) { - if (text.regionMatches(true, i, p, 0, plen)) - return i; - } - - return -1; - } -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/model/ToolUtil.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/model/ToolUtil.java deleted file mode 100644 index 01f505a..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/model/ToolUtil.java +++ /dev/null @@ -1,451 +0,0 @@ -package net.sourceforge.phpdt.externaltools.model; - -/********************************************************************** -Copyright (c) 2002 IBM Corp. and others. All rights reserved. -This file is 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: -**********************************************************************/ - -import java.util.ArrayList; - -import net.sourceforge.phpdt.externaltools.internal.model.ExternalToolsModelMessages; -import net.sourceforge.phpdt.externaltools.internal.model.ExternalToolsPlugin; -import net.sourceforge.phpdt.externaltools.internal.registry.ArgumentVariable; -import net.sourceforge.phpdt.externaltools.internal.registry.ArgumentVariableRegistry; -import net.sourceforge.phpdt.externaltools.internal.registry.PathLocationVariable; -import net.sourceforge.phpdt.externaltools.internal.registry.PathLocationVariableRegistry; -import net.sourceforge.phpdt.externaltools.variable.ExpandVariableContext; - -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.MultiStatus; - -/** - * General utility class dealing with external tools - */ -public final class ToolUtil { - /** - * Argument parsing constants - */ - private static final char ARG_DELIMITER = ' '; //$NON-NLS-1$ - private static final char ARG_DBL_QUOTE = '"'; //$NON-NLS-1$ - - /** - * Variable tag indentifiers - */ - private static final char VAR_TAG_START_CHAR1 = '$'; //$NON-NLS-1$ - private static final char VAR_TAG_START_CHAR2 = '{'; //$NON-NLS-1$ - private static final char VAR_TAG_END_CHAR1 = '}'; //$NON-NLS-1$ - private static final String VAR_TAG_START = "${"; //$NON-NLS-1$ - private static final String VAR_TAG_END = "}"; //$NON-NLS-1$ - private static final String VAR_TAG_SEP = ":"; //$NON-NLS-1$ - - /** - * No instances allowed - */ - private ToolUtil() { - super(); - } - - /** - * Builds a variable tag that will be auto-expanded before - * the tool is run. - * - * @param varName the name of a known variable (one of the VAR_* constants for instance) - * @param varArgument an optional argument for the variable, null if none - */ - public static String buildVariableTag(String varName, String varArgument) { - StringBuffer buf = new StringBuffer(); - buildVariableTag(varName,varArgument, buf); - return buf.toString(); - } - - /** - * Builds a variable tag that will be auto-expanded before - * the tool is run. - * - * @param varName the name of a known variable (one of the VAR_* constants for instance) - * @param varArgument an optional argument for the variable, null if none - * @param buffer the buffer to write the constructed variable tag - */ - public static void buildVariableTag(String varName, String varArgument, StringBuffer buffer) { - buffer.append(VAR_TAG_START); - buffer.append(varName); - if (varArgument != null && varArgument.length() > 0) { - buffer.append(VAR_TAG_SEP); - buffer.append(varArgument); - } - buffer.append(VAR_TAG_END); - } - - /** - * Expands all the variables found in an individual - * argument text. - * - * @param argument one of the argument text in the list of arguments - * @param context the context to use for expanding variables - * @param status multi status to report any problems expanding variables - * @return the argument text with all variables expanded, or null if not possible - */ - public static String expandArgument(String argument, ExpandVariableContext context, MultiStatus status) { - StringBuffer buffer = new StringBuffer(); - - int start = 0; - while (true) { - VariableDefinition varDef = extractVariableTag(argument, start); - - // No more variables found... - if (varDef.start == -1) { - if (start == 0) - buffer.append(argument); - else - buffer.append(argument.substring(start)); - break; - } - - // Invalid variable format - if (varDef.end == -1 || varDef.name == null || varDef.name.length() == 0) { - String msg = ExternalToolsModelMessages.getString("ToolUtil.argumentVarFormatWrong"); //$NON-NLS-1$ - status.merge(ExternalToolsPlugin.newErrorStatus(msg, null)); - return null; - } - - // Copy text between start and variable. - if (varDef.start > start) - buffer.append(argument.substring(start, varDef.start)); - start = varDef.end; - - // Lookup the variable if it exist - ArgumentVariableRegistry registry; - registry = ExternalToolsPlugin.getDefault().getArgumentVariableRegistry(); - ArgumentVariable variable = registry.getArgumentVariable(varDef.name); - if (variable == null) { - String msg = ExternalToolsModelMessages.format("ToolUtil.argumentVarMissing", new Object[] {varDef.name}); //$NON-NLS-1$ - status.merge(ExternalToolsPlugin.newErrorStatus(msg, null)); - return null; - } - - // Expand the variable as text if possible - String text = variable.getExpander().getText(varDef.name, varDef.argument, context); - if (text == null) { - String msg = ExternalToolsModelMessages.format("ToolUtil.argumentVarExpandFailed", new Object[] {varDef.name}); //$NON-NLS-1$ - status.merge(ExternalToolsPlugin.newErrorStatus(msg, null)); - return null; - } - buffer.append(text); - } - - return buffer.toString(); - } - - /** - * Returns a list of individual arguments where all - * variables have been expanded. - * - * @param arguments the arguments with leading and trailing - * spaces already removed. - * @param context the context used to expand the variable(s) - * @param status multi status to report any problems expanding variables - * @return the list of individual arguments where some elements in the - * list maybe null if problems expanding variable(s). - */ - public static String[] expandArguments(String arguments, ExpandVariableContext context, MultiStatus status) { - if (arguments == null || arguments.length() == 0) - return new String[0]; - - String[] argList = parseArgumentsIntoList(arguments); - for (int i = 0; i < argList.length; i++) - argList[i] = expandArgument(argList[i], context, status); - - return argList; - } - - /** - * Returns the expanded directory location if represented by a - * directory variable. Otherwise, the directory location given is - * return unless an unknown variable was detected. - * - * @param dirLocation a directory location either as a path or a variable - * with leading and trailing spaces already removed. - * @param context the context used to expand the variable - * @param status multi status to report any problems expanding variables - * @return the directory location as a string or null if not possible - */ - public static String expandDirectoryLocation(String dirLocation, ExpandVariableContext context, MultiStatus status) { - if (dirLocation == null || dirLocation.length() == 0) - return ""; //$NON-NLS-1$ - - VariableDefinition varDef = extractVariableTag(dirLocation, 0); - // Return if no variable found - if (varDef.start < 0) - return dirLocation; - - // Disallow text before/after variable - if (varDef.start != 0 || (varDef.end < dirLocation.length() && varDef.end != -1)) { - String msg = ExternalToolsModelMessages.getString("ToolUtil.dirLocVarBetweenText"); //$NON-NLS-1$ - status.merge(ExternalToolsPlugin.newErrorStatus(msg, null)); - return null; - } - - // Invalid variable format - if (varDef.name == null || varDef.name.length() == 0 || varDef.end == -1) { - String msg = ExternalToolsModelMessages.getString("ToolUtil.dirLocVarFormatWrong"); //$NON-NLS-1$ - status.merge(ExternalToolsPlugin.newErrorStatus(msg, null)); - return null; - } - - // Lookup the variable if it exist - PathLocationVariableRegistry registry; - registry = ExternalToolsPlugin.getDefault().getDirectoryLocationVariableRegistry(); - PathLocationVariable variable = registry.getPathLocationVariable(varDef.name); - if (variable == null) { - String msg = ExternalToolsModelMessages.format("ToolUtil.dirLocVarMissing", new Object[] {varDef.name}); //$NON-NLS-1$ - status.merge(ExternalToolsPlugin.newErrorStatus(msg, null)); - return null; - } - - // Expand the variable into a IPath if possible - IPath path = variable.getExpander().getPath(varDef.name, varDef.argument, context); - if (path == null) { - String msg = ExternalToolsModelMessages.format("ToolUtil.dirLocVarExpandFailed", new Object[] {varDef.name}); //$NON-NLS-1$ - status.merge(ExternalToolsPlugin.newErrorStatus(msg, null)); - return null; - } - - return path.toOSString(); - } - - /** - * Returns the expanded file location if represented by a - * file variable. Otherwise, the file location given is - * return unless an unknown variable was detected. - * - * @param fileLocation a file location either as a path or a variable - * with leading and trailing spaces already removed. - * @param context the context used to expand the variable - * @param status multi status to report any problems expanding variables - * @return the file location as a string or null if not possible - */ - public static String expandFileLocation(String fileLocation, ExpandVariableContext context, MultiStatus status) { - if (fileLocation == null || fileLocation.length() == 0) - return ""; //$NON-NLS-1$ - - VariableDefinition varDef = extractVariableTag(fileLocation, 0); - // Return if no variable found - if (varDef.start < 0) - return fileLocation; - - // Disallow text before/after variable - if (varDef.start != 0 || (varDef.end < fileLocation.length() && varDef.end != -1)) { - String msg = ExternalToolsModelMessages.getString("ToolUtil.fileLocVarBetweenText"); //$NON-NLS-1$ - status.merge(ExternalToolsPlugin.newErrorStatus(msg, null)); - return null; - } - - // Invalid variable format - if (varDef.name == null || varDef.name.length() == 0 || varDef.end == -1) { - String msg = ExternalToolsModelMessages.getString("ToolUtil.fileLocVarFormatWrong"); //$NON-NLS-1$ - status.merge(ExternalToolsPlugin.newErrorStatus(msg, null)); - return null; - } - - // Lookup the variable if it exist - PathLocationVariableRegistry registry; - registry = ExternalToolsPlugin.getDefault().getFileLocationVariableRegistry(); - PathLocationVariable variable = registry.getPathLocationVariable(varDef.name); - if (variable == null) { - String msg = ExternalToolsModelMessages.format("ToolUtil.fileLocVarMissing", new Object[] {varDef.name}); //$NON-NLS-1$ - status.merge(ExternalToolsPlugin.newErrorStatus(msg, null)); - return null; - } - - // Expand the variable into a IPath if possible - IPath path = variable.getExpander().getPath(varDef.name, varDef.argument, context); - if (path == null) { - String msg = ExternalToolsModelMessages.format("The variable {0} with argument {1} could not be expanded to a valid path.", new Object[] {varDef.name, varDef.argument}); - status.merge(ExternalToolsPlugin.newErrorStatus(msg, null)); - return null; - } - - return path.toString(); - } - - /** - * Extracts from the source text the variable tag's name - * and argument. - * - * @param text the source text to parse for a variable tag - * @param start the index in the string to start the search - * @return the variable definition - */ - public static VariableDefinition extractVariableTag(String text, int start) { - VariableDefinition varDef = new VariableDefinition(); - - varDef.start = text.indexOf(VAR_TAG_START, start); - if (varDef.start < 0) - return varDef; - start = varDef.start + VAR_TAG_START.length(); - - int end = text.indexOf(VAR_TAG_END, start); - if (end < 0) - return varDef; - varDef.end = end + VAR_TAG_END.length(); - if (end == start) - return varDef; - - int mid = text.indexOf(VAR_TAG_SEP, start); - if (mid < 0 || mid > end) { - varDef.name = text.substring(start, end); - } else { - if (mid > start) - varDef.name = text.substring(start, mid); - mid = mid + VAR_TAG_SEP.length(); - if (mid < end) - varDef.argument = text.substring(mid, end); - } - - return varDef; - } - - /** - * Parses the argument text into an array of individual - * arguments using the space character as the delimiter. - * An individual argument containing spaces must have a - * double quote (") at the start and end. Two double - * quotes together is taken to mean an embedded double - * quote in the argument text. Variables are treated as - * a single unit and therefore spaces and double quotes - * inside a variable are copied as is and not parsed. - * - * @param arguments the arguments as one string - * @return the array of arguments - */ - public static String[] parseArgumentsIntoList(String arguments) { - if (arguments == null || arguments.length() == 0) - return new String[0]; - - ArrayList list = new ArrayList(10); - boolean inQuotes = false; - boolean inVar = false; - int start = 0; - int end = arguments.length(); - StringBuffer buffer = new StringBuffer(end); - - while (start < end) { - char ch = arguments.charAt(start); - start++; - - switch (ch) { - case ARG_DELIMITER : - if (inQuotes || inVar) { - buffer.append(ch); - } else { - if (buffer.length() > 0) { - list.add(buffer.toString()); - buffer.setLength(0); - } - } - break; - - case ARG_DBL_QUOTE : - if (inVar) { - buffer.append(ch); - } else { - if (start < end) { - if (arguments.charAt(start) == ARG_DBL_QUOTE) { - // Two quotes together represents one quote - buffer.append(ch); - start++; - } else { - inQuotes = !inQuotes; - } - } else { - // A lone quote at the end, just drop it. - inQuotes = false; - } - } - break; - - case VAR_TAG_START_CHAR1 : - buffer.append(ch); - if (!inVar && start < end) { - if (arguments.charAt(start) == VAR_TAG_START_CHAR2) { - buffer.append(VAR_TAG_START_CHAR2); - inVar = true; - start++; - } - } - break; - - case VAR_TAG_END_CHAR1 : - buffer.append(ch); - inVar = false; - break; - - default : - buffer.append(ch); - break; - } - - } - - if (buffer.length() > 0) - list.add(buffer.toString()); - - String[] results = new String[list.size()]; - list.toArray(results); - return results; - } - - - /** - * Structure to represent a variable definition within a - * source string. - */ - public static final class VariableDefinition { - /** - * Index in the source text where the variable started - * or -1 if no valid variable start tag - * identifier found. - */ - public int start = -1; - - /** - * Index in the source text of the character following - * the end of the variable or -1 if no - * valid variable end tag found. - */ - public int end = -1; - - /** - * The variable's name found in the source text, or - * null if no valid variable found. - */ - public String name = null; - - /** - * The variable's argument found in the source text, or - * null if no valid variable found or if - * the variable did not specify an argument - */ - public String argument = null; - - /** - * Create an initialized variable definition. - */ - private VariableDefinition() { - super(); - } - - /** - * Create an initialized variable definition. - */ - private VariableDefinition(int start, int end) { - super(); - this.start = start; - this.end = end; - } - } -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/BuildTypeExpander.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/BuildTypeExpander.java deleted file mode 100644 index 306d459..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/BuildTypeExpander.java +++ /dev/null @@ -1,9 +0,0 @@ -package net.sourceforge.phpdt.externaltools.variable; - -public class BuildTypeExpander implements IVariableTextExpander { - - public String getText(String varTag, String varValue, ExpandVariableContext context) { - return context.getBuildType(); - } - -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/ExpandVariableContext.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/ExpandVariableContext.java deleted file mode 100644 index b5eeb46..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/ExpandVariableContext.java +++ /dev/null @@ -1,102 +0,0 @@ -package net.sourceforge.phpdt.externaltools.variable; - -/********************************************************************** -Copyright (c) 2002 IBM Corp. and others. All rights reserved. -This file is 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: -**********************************************************************/ - -import net.sourceforge.phpdt.externaltools.model.IExternalToolConstants; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IncrementalProjectBuilder; - -/** - * Represents the context the external tool is running in - * that a variable uses to expand itself. - */ -public final class ExpandVariableContext { - public static final ExpandVariableContext EMPTY_CONTEXT = new ExpandVariableContext(null); - - private IProject project = null; - private IResource selectedResource = null; - private String buildType = IExternalToolConstants.BUILD_TYPE_NONE; - - /** - * Create a context for an external tool running - * as a builder on the given project. - * - * @param project the IProject being built. - * @param buildKind the kind of build being performed - * (see IncrementalProjectBuilder). - */ - public ExpandVariableContext(IProject project, int buildKind) { - super(); - this.project = project; - switch (buildKind) { - case IncrementalProjectBuilder.INCREMENTAL_BUILD : - this.buildType = IExternalToolConstants.BUILD_TYPE_INCREMENTAL; - break; - case IncrementalProjectBuilder.FULL_BUILD : - this.buildType = IExternalToolConstants.BUILD_TYPE_FULL; - break; - case IncrementalProjectBuilder.AUTO_BUILD : - this.buildType = IExternalToolConstants.BUILD_TYPE_AUTO; - break; - default : - this.buildType = IExternalToolConstants.BUILD_TYPE_NONE; - break; - } - } - - /** - * Create a context for an external tool running - * with the given resource selected. - * - * @param selectedResource the IResource selected - * or null if none. - */ - public ExpandVariableContext(IResource selectedResource) { - super(); - if (selectedResource != null) { - this.selectedResource = selectedResource; - this.project = selectedResource.getProject(); - } - } - - /** - * Returns the build type being performed if the - * external tool is being run as a project builder. - * - * @return one of the IExternalToolConstants.BUILD_TYPE_* constants. - */ - public String getBuildType() { - return buildType; - } - - /** - * Returns the project which the variable can use. This - * will the the project being built if the tool is being - * run as a builder. Otherwise, it is the project of the - * selected resource, or null if none. - * - * @return the IProject or null if none - */ - public IProject getProject() { - return project; - } - - /** - * Returns the resource selected at the time the tool - * is run, or null if none selected. - * - * @return the IResource selected, or null if none - */ - public IResource getSelectedResource() { - return selectedResource; - } -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/FileExpander.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/FileExpander.java deleted file mode 100644 index 17779cb..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/FileExpander.java +++ /dev/null @@ -1,34 +0,0 @@ -package net.sourceforge.phpdt.externaltools.variable; - -import org.eclipse.core.runtime.IPath; - -/** - * Expands a variable into the last opened PHP file - *

- * This class is not intended to be extended by clients. - *

- */ -public class FileExpander extends ResourceExpander { //implements IVariableTextExpander { - - /** - * Create an instance - */ - public FileExpander() { - super(); - } - - /** - * Returns a string representation of the path to a file or directory - * for the given variable tag and value or null. - * - * @see IVariableTextExpander#getText(String, String, ExpandVariableContext) - */ - public String getText(String varTag, String varValue, ExpandVariableContext context) { - IPath path = getPath(varTag, varValue, context); - if (path != null) { - return path.toString(); - } - return ""; - } - -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/IVariableComponent.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/IVariableComponent.java deleted file mode 100644 index 722ffb2..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/IVariableComponent.java +++ /dev/null @@ -1,77 +0,0 @@ -package net.sourceforge.phpdt.externaltools.variable; - -/********************************************************************** -Copyright (c) 2002 IBM Corp. and others. All rights reserved. -This file is 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: -**********************************************************************/ - -import net.sourceforge.phpdt.externaltools.group.IGroupDialogPage; - -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; - -/** - * Represents the API for a client extending one of the - * variable extension points to provide visual editing - * of the variable. - *

- * This interface is not to be extended by clients. Clients - * may implement this interface. - *

- */ -public interface IVariableComponent { - /** - * Returns the control to edit the variable - * value, otherwise null if no editing - * supported or if createContents has - * not been called yet - * - * @return the main control for the variable component - * or null if none - */ - public Control getControl(); - - /** - * Creates the control to edit the variable. Does nothing - * if no editing supported. - * - * @param parent the composite to parent all controls to - * @param varTag the variable tag name to create the controls for - * @param page the dialog page this visual component will be part of - */ - public void createContents(Composite parent, String varTag, IGroupDialogPage page); - - /** - * Returns the variable value as specified by - * the user thru the visual component. - * - * @return the variable value as indicated by the visual component - */ - public String getVariableValue(); - - /** - * Returns whether the variable's visual component has an - * acceptable value. - * - * @return true if all value acceptable, or false otherwise - */ - public boolean isValid(); - - /** - * Sets the visual component to represent the - * given variable value. - * - * @param varValue the variable value the visual component should indicate - */ - public void setVariableValue(String varValue); - - /** - * Validates visual component current values entered by the - * user and updates it's valid state if needed - */ - public void validate(); -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/IVariableLocationExpander.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/IVariableLocationExpander.java deleted file mode 100644 index 0a79960..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/IVariableLocationExpander.java +++ /dev/null @@ -1,39 +0,0 @@ -package net.sourceforge.phpdt.externaltools.variable; - -/********************************************************************** -Copyright (c) 2002 IBM Corp. and others. All rights reserved. -This file is 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: -**********************************************************************/ - -import org.eclipse.core.runtime.IPath; - -/** - * Responsible for expanding a variable into the location - * path of a file or directory. - *

- * Implementation of this interface will be treated like - * a singleton. That is, only one instance will be created - * per variable extension. - *

- * This interface is not to be extended by clients. Clients - * may implement this interface. - *

- */ -public interface IVariableLocationExpander { - /** - * Returns the path location to a file or directory - * for the given variable tag and value. The path does - * not need to exist. - * - * @param varTag the variable tag name - * @param varValue the value for the variable - * @param context the context the variable should use to expand itself - * @return the IPath to a file/directory - * or null if not possible - */ - public IPath getPath(String varTag, String varValue, ExpandVariableContext context); -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/IVariableResourceExpander.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/IVariableResourceExpander.java deleted file mode 100644 index a1aac20..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/IVariableResourceExpander.java +++ /dev/null @@ -1,38 +0,0 @@ -package net.sourceforge.phpdt.externaltools.variable; - -/********************************************************************** -Copyright (c) 2002 IBM Corp. and others. All rights reserved. -This file is 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: -**********************************************************************/ - -import org.eclipse.core.resources.IResource; - -/** - * Responsible for expanding a variable into a list of - * IResource. - *

- * Implementation of this interface will be treated like - * a singleton. That is, only one instance will be created - * per variable extension. - *

- * This interface is not to be extended by clients. Clients - * may implement this interface. - *

- */ -public interface IVariableResourceExpander { - /** - * Returns the IResource list - * for the given variable tag and value. - * - * @param varTag the variable tag name - * @param varValue the value for the variable - * @param context the context the variable should use to expand itself - * @return the list of IResource or null if not - * possible (note, elements of the list can be null) - */ - public IResource[] getResources(String varTag, String varValue, ExpandVariableContext context); -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/IVariableTextExpander.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/IVariableTextExpander.java deleted file mode 100644 index 16ee242..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/IVariableTextExpander.java +++ /dev/null @@ -1,35 +0,0 @@ -package net.sourceforge.phpdt.externaltools.variable; - -/********************************************************************** -Copyright (c) 2002 IBM Corp. and others. All rights reserved. -This file is 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: -**********************************************************************/ - -/** - * Responsible for expanding a variable into text format. - *

- * Implementation of this interface will be treated like - * a singleton. That is, only one instance will be created - * per variable extension. - *

- * This interface is not to be extended by clients. Clients - * may implement this interface. - *

- */ -public interface IVariableTextExpander { - /** - * Returns the expanded text for the given variable - * tag and value. - * - * @param varTag the variable tag name - * @param varValue the value for the variable - * @param context the context the variable should use to expand itself - * @return the text of the expanded variable - * or null if not possible - */ - public String getText(String varTag, String varValue, ExpandVariableContext context); -} 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 deleted file mode 100644 index 2966aaf..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/LocalhostExpander.java +++ /dev/null @@ -1,21 +0,0 @@ -package net.sourceforge.phpdt.externaltools.variable; - -import net.sourceforge.phpeclipse.PHPeclipsePlugin; -import net.sourceforge.phpeclipse.ui.WebUI; - -import org.eclipse.jface.preference.IPreferenceStore; - -/** - * Expands a variable into the predefined localhost. - *

- * This class is not intended to be extended by clients. - *

- */ -public class LocalhostExpander implements IVariableTextExpander { - - public String getText(String varTag, String varValue, ExpandVariableContext context) { - IPreferenceStore store = PHPeclipsePlugin.getDefault().getPreferenceStore(); - return store.getString(WebUI.PHP_LOCALHOST_PREF); - } - -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/ProjectNameExpander.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/ProjectNameExpander.java deleted file mode 100644 index 11fe671..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/ProjectNameExpander.java +++ /dev/null @@ -1,22 +0,0 @@ -package net.sourceforge.phpdt.externaltools.variable; - -import org.eclipse.core.resources.IProject; - -/** - * Extracts the project name from a variable context - */ -public class ProjectNameExpander implements IVariableTextExpander { - - /** - * Returns the name of the project in the given context or - * null if there is no project in the context. - */ - public String getText(String varTag, String varValue, ExpandVariableContext context) { - IProject project= context.getProject(); - if (project != null) { - return project.getName(); - } - return null; - } - -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/ResourceComponent.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/ResourceComponent.java deleted file mode 100644 index 143a6e6..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/ResourceComponent.java +++ /dev/null @@ -1,265 +0,0 @@ -package net.sourceforge.phpdt.externaltools.variable; - -/********************************************************************** -Copyright (c) 2002 IBM Corp. and others. All rights reserved. -This file is 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: -**********************************************************************/ - -import net.sourceforge.phpdt.externaltools.group.IGroupDialogPage; -import net.sourceforge.phpdt.externaltools.internal.model.ExternalToolsModelMessages; -import net.sourceforge.phpdt.externaltools.model.ToolUtil; - -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.jface.dialogs.IMessageProvider; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.viewers.TreeViewer; -import org.eclipse.swt.SWT; -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.Group; -import org.eclipse.swt.widgets.Tree; -import org.eclipse.ui.model.WorkbenchContentProvider; -import org.eclipse.ui.model.WorkbenchLabelProvider; - -/** - * Visual component to edit the resource type variable - * value. - *

- * This class is not intended to be extended by clients. - *

- */ -public class ResourceComponent implements IVariableComponent { - private IGroupDialogPage page; - private boolean isValid = true; - - protected Group mainGroup; - protected Button selectedResourceButton; - protected Button specificResourceButton; - protected TreeViewer resourceList; - private IResource selectedResource; - - /** - * Creates the component - */ - public ResourceComponent() { - super(); - } - - /* (non-Javadoc) - * Method declared on IVariableComponent. - */ - public void createContents(Composite parent, String varTag, IGroupDialogPage page) { - this.page = page; - - // main composite - mainGroup = new Group(parent, SWT.NONE); - GridLayout layout = new GridLayout(); - layout.marginWidth = 0; - layout.marginHeight = 0; - layout.numColumns = 1; - GridData gridData = new GridData(GridData.FILL_BOTH); - mainGroup.setLayout(layout); - mainGroup.setLayoutData(gridData); - mainGroup.setFont(parent.getFont()); - mainGroup.setText(ToolUtil.buildVariableTag(varTag, null)); - - createSelectedResourceOption(); - createSpecificResourceOption(); - createResourceList(); - - updateResourceListEnablement(); - } - - /** - * Creates the list of resources. - */ - protected void createResourceList() { - Tree tree = new Tree(mainGroup, SWT.SINGLE | SWT.BORDER); - GridData data = new GridData(GridData.FILL_BOTH); - data.heightHint = tree.getItemHeight() * getInitialVisibleItemCount(); - tree.setLayoutData(data); - tree.setFont(mainGroup.getFont()); - - resourceList = new TreeViewer(tree); - resourceList.addSelectionChangedListener(new ISelectionChangedListener() { - public void selectionChanged(SelectionChangedEvent event) { - validateResourceListSelection(); - selectedResource= (IResource) ((IStructuredSelection)event.getSelection()).getFirstElement(); - } - }); - resourceList.setContentProvider(new WorkbenchContentProvider()); - resourceList.setLabelProvider(new WorkbenchLabelProvider()); - resourceList.setInput(ResourcesPlugin.getWorkspace().getRoot()); - } - - /** - * Creates the option button for using the selected - * resource. - */ - protected void createSelectedResourceOption() { - selectedResourceButton = new Button(mainGroup, SWT.RADIO); - selectedResourceButton.setText(ExternalToolsModelMessages.getString("ResourceComponent.selectedResLabel")); //$NON-NLS-1$ - GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL); - selectedResourceButton.setLayoutData(data); - selectedResourceButton.setFont(mainGroup.getFont()); - selectedResourceButton.setSelection(true); - } - - /** - * Creates the option button for using a specific - * resource. - */ - protected void createSpecificResourceOption() { - specificResourceButton = new Button(mainGroup, SWT.RADIO); - specificResourceButton.setText(ExternalToolsModelMessages.getString("ResourceComponent.specificResLabel")); //$NON-NLS-1$ - GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL); - specificResourceButton.setLayoutData(data); - specificResourceButton.setFont(mainGroup.getFont()); - specificResourceButton.setSelection(false); - - specificResourceButton.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - updateResourceListEnablement(); - } - }); - } - - /* (non-Javadoc) - * Method declared on IVariableComponent. - */ - public Control getControl() { - return mainGroup; - } - - /** - * Returns the dialog page this component is part of - */ - protected final IGroupDialogPage getPage() { - return page; - } - - /* (non-Javadoc) - * Method declared on IVariableComponent. - */ - public String getVariableValue() { - if (selectedResourceButton != null && selectedResourceButton.getSelection()) - return null; - - if (resourceList != null) { - if (selectedResource != null) - return selectedResource.getFullPath().toString(); - } - - return null; - } - - /** - * Returns the number of items to be visible in the - * resource list. This will determine the initial height. - */ - protected int getInitialVisibleItemCount() { - return 10; - } - - /* (non-Javadoc) - * Method declared on IVariableComponent. - */ - public boolean isValid() { - return isValid; - } - - /** - * Sets whether the component's values are all valid. - * Updates the components's page valid state. No action - * taken if new valid state same as current one. - * - * @param isValid true if all values valid, - * false otherwise - */ - protected final void setIsValid(boolean isValid) { - if (this.isValid != isValid) { - this.isValid = isValid; - this.page.updateValidState(); - } - } - - /** - * Updates the enablement of the resource list if needed - */ - protected void updateResourceListEnablement() { - if (specificResourceButton != null && resourceList != null) - resourceList.getTree().setEnabled(specificResourceButton.getSelection()); - } - - /* (non-Javadoc) - * Method declared on IVariableComponent. - */ - public void setVariableValue(String varValue) { - if (varValue == null || varValue.length() == 0) { - if (selectedResourceButton != null) - selectedResourceButton.setSelection(true); - if (specificResourceButton != null) - specificResourceButton.setSelection(false); - if (resourceList != null) - resourceList.getTree().setEnabled(false); - } else { - if (selectedResourceButton != null) - selectedResourceButton.setSelection(false); - if (specificResourceButton != null) - specificResourceButton.setSelection(true); - if (resourceList != null) { - resourceList.getTree().setEnabled(true); - IResource member = ResourcesPlugin.getWorkspace().getRoot().findMember(varValue); - if (member != null) - resourceList.setSelection(new StructuredSelection(member), true); - else - resourceList.setSelection(StructuredSelection.EMPTY); - } - } - } - - /* (non-Javadoc) - * Method declared on IVariableComponent. - */ - public void validate() { - if (specificResourceButton != null && specificResourceButton.getSelection()) { - validateResourceListSelection(); - } - - getPage().setMessage(null, IMessageProvider.NONE); - setIsValid(true); - } - - /** - * Returns whether that the resource list selection is valid. - * If the list was not created, returns true. - * - * @return true to continue validating other - * fields, false to stop. - */ - protected boolean validateResourceListSelection() { - if (resourceList == null) - return true; - - if (resourceList.getSelection().isEmpty()) { - getPage().setMessage(ExternalToolsModelMessages.getString("ResourceComponent.selectionRequired"), IMessageProvider.WARNING); //$NON-NLS-1$ - setIsValid(false); - return false; - } - - return true; - } -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/ResourceContainerExpander.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/ResourceContainerExpander.java deleted file mode 100644 index 5e8bf04..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/ResourceContainerExpander.java +++ /dev/null @@ -1,40 +0,0 @@ -package net.sourceforge.phpdt.externaltools.variable; - -/********************************************************************** -Copyright (c) 2002 IBM Corp. and others. All rights reserved. -This file is 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: -**********************************************************************/ - -import org.eclipse.core.resources.IResource; - -/** - * Expands a resource's container type variable into the desired - * result format. - *

- * This class is not intended to be extended by clients. - *

- */ -public class ResourceContainerExpander extends ResourceExpander { - - /** - * Create an instance - */ - public ResourceContainerExpander() { - super(); - } - - /* (non-Javadoc) - * Method declared on ResourceExpander. - */ - /*package*/ IResource expand(String varValue, ExpandVariableContext context) { - IResource resource = super.expand(varValue, context); - if (resource != null) - return resource.getParent(); - else - return null; - } -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/ResourceExpander.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/ResourceExpander.java deleted file mode 100644 index fe5cfa8..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/ResourceExpander.java +++ /dev/null @@ -1,124 +0,0 @@ -package net.sourceforge.phpdt.externaltools.variable; - -/********************************************************************** -Copyright (c) 2002 IBM Corp. and others. All rights reserved. -This file is 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: -**********************************************************************/ - -import net.sourceforge.phpdt.externaltools.model.IExternalToolConstants; - -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.IPath; - -/** - * Expands a resource type variable into the desired - * result format. - *

- * This class is not intended to be extended by clients. - *

- */ -public class ResourceExpander implements IVariableLocationExpander, IVariableResourceExpander, IVariableTextExpander { - - /** - * Create an instance - */ - public ResourceExpander() { - super(); - } - - /** - * Expands the variable to a resource. - */ - /*package*/ IResource expand(String varValue, ExpandVariableContext context) { - if (varValue != null && varValue.length() > 0) { - return expandToMember(varValue); - } else { - return expandUsingContext(context); - } - } - - /** - * Expands using the current context information. - * By default, return the selected resource of the - * context. - */ - /*package*/ IResource expandUsingContext(ExpandVariableContext context) { - return context.getSelectedResource(); - } - - /** - * Expands the variable value to a resource. The value - * will not be null nor empty. By default, - * lookup the member from the workspace root. - */ - /*package*/ IResource expandToMember(String varValue) { - return getWorkspaceRoot().findMember(varValue); - } - - /* (non-Javadoc) - * Method declared on IVariableLocationExpander. - */ - public IPath getPath(String varTag, String varValue, ExpandVariableContext context) { - IResource resource = expand(varValue, context); - if (resource != null) { - if (isPathVariable(varTag)) { - return resource.getFullPath(); - } else { - return resource.getLocation(); - } - } else { - return null; - } - } - - /** - * Returns whether the given variable tag is a known path - * variable tag. Path variable tags represent variables that - * expand to paths relative to the workspace root. - */ - private boolean isPathVariable(String varTag) { - return varTag.equals(IExternalToolConstants.VAR_CONTAINER_PATH) || - varTag.equals(IExternalToolConstants.VAR_PROJECT_PATH) || - varTag.equals(IExternalToolConstants.VAR_RESOURCE_PATH); - } - - /* (non-Javadoc) - * Method declared on IVariableResourceExpander. - */ - public IResource[] getResources(String varTag, String varValue, ExpandVariableContext context) { - IResource resource = expand(varValue, context); - if (resource != null) { - return new IResource[] {resource}; - } else { - return null; - } - } - - /** - * Returns the workspace root resource. - */ - protected final IWorkspaceRoot getWorkspaceRoot() { - return ResourcesPlugin.getWorkspace().getRoot(); - } - - /** - * Returns a string representation of the path to a file or directory - * for the given variable tag and value or null. - * - * @see IVariableTextExpander#getText(String, String, ExpandVariableContext) - */ - public String getText(String varTag, String varValue, ExpandVariableContext context) { - IPath path= getPath(varTag, varValue, context); - if (path != null) { - return path.toString(); - } - return null; - } - -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/ResourceProjectExpander.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/ResourceProjectExpander.java deleted file mode 100644 index 9df7758..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/ResourceProjectExpander.java +++ /dev/null @@ -1,47 +0,0 @@ -package net.sourceforge.phpdt.externaltools.variable; - -/********************************************************************** -Copyright (c) 2002 IBM Corp. and others. All rights reserved. -This file is 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: -**********************************************************************/ - -import org.eclipse.core.resources.IResource; - -/** - * Expands a resource's project type variable into the desired - * result format. - *

- * This class is not intended to be extended by clients. - *

- */ -public class ResourceProjectExpander extends ResourceExpander { - - /** - * Create an instance - */ - public ResourceProjectExpander() { - super(); - } - - /* (non-Javadoc) - * Method declared on ResourceExpander. - */ - /*package*/ IResource expandUsingContext(ExpandVariableContext context) { - return context.getProject(); - } - - /* (non-Javadoc) - * Method declared on ResourceExpander. - */ - /*package*/ IResource expandToMember(String varValue) { - IResource member = super.expandToMember(varValue); - if (member != null) - return member.getProject(); - else - return null; - } -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/SpecificFileResourceComponent.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/SpecificFileResourceComponent.java deleted file mode 100644 index cdeb292..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/SpecificFileResourceComponent.java +++ /dev/null @@ -1,73 +0,0 @@ -package net.sourceforge.phpdt.externaltools.variable; - -/********************************************************************** -Copyright (c) 2002 IBM Corp. and others. All rights reserved. -This file is 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: -**********************************************************************/ - -import net.sourceforge.phpdt.externaltools.internal.model.ExternalToolsModelMessages; - -import org.eclipse.core.resources.IResource; -import org.eclipse.jface.dialogs.IMessageProvider; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Label; - -/** - * Visual component to edit the resource type variable - * value for the file location. Variable is limited to a specific - * IFile resource. - *

- * This class is not intended to be extended by clients. - *

- */ -public class SpecificFileResourceComponent extends ResourceComponent { - - /** - * Creates an instance - */ - public SpecificFileResourceComponent() { - super(); - } - - /* (non-Javadoc) - * Method declared on ResourceComponent. - */ - protected void createSelectedResourceOption() { - // Do not present this option... - } - - /* (non-Javadoc) - * Method declared on ResourceComponent. - */ - protected void createSpecificResourceOption() { - Label label = new Label(mainGroup, SWT.NONE); - GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL); - label.setLayoutData(data); - label.setFont(mainGroup.getFont()); - label.setText(ExternalToolsModelMessages.getString("ResourceComponent.specificResLabel")); //$NON-NLS-1$ - } - - /* (non-Javadoc) - * Method declared on ResourceComponent. - */ - protected boolean validateResourceListSelection() { - if (resourceList == null) - return true; - - IStructuredSelection sel = (IStructuredSelection) resourceList.getSelection(); - IResource resource = (IResource) sel.getFirstElement(); - if (resource == null || resource.getType() != IResource.FILE) { - getPage().setMessage(ExternalToolsModelMessages.getString("ResourceComponent.selectionRequired"), IMessageProvider.WARNING); //$NON-NLS-1$ - setIsValid(false); - return false; - } - - return true; - } -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/SpecificFolderResourceComponent.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/SpecificFolderResourceComponent.java deleted file mode 100644 index e0b4aa7..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/SpecificFolderResourceComponent.java +++ /dev/null @@ -1,111 +0,0 @@ -package net.sourceforge.phpdt.externaltools.variable; - -/********************************************************************** -Copyright (c) 2002 IBM Corp. and others. All rights reserved. -This file is 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: -**********************************************************************/ - -import net.sourceforge.phpdt.externaltools.internal.model.ExternalToolsModelMessages; - -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.jface.dialogs.IMessageProvider; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.jface.viewers.ViewerFilter; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Label; - -/** - * Visual component to edit the resource type variable - * value for the working directory. Variable is limited to a specific - * IContainer resource. - *

- * This class is not intended to be extended by clients. - *

- */ -public class SpecificFolderResourceComponent extends ResourceComponent { - - /** - * Creates an instance - */ - public SpecificFolderResourceComponent() { - super(); - } - - /* (non-Javadoc) - * Method declared on ResourceComponent. - */ - protected void createSelectedResourceOption() { - // Do not present this option... - } - - /* (non-Javadoc) - * Method declared on ResourceComponent. - */ - protected void createResourceList() { - super.createResourceList(); - if (resourceList != null) - resourceList.addFilter(new FileFilter()); - } - - /* (non-Javadoc) - * Method declared on ResourceComponent. - */ - protected void createSpecificResourceOption() { - Label label = new Label(mainGroup, SWT.NONE); - GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL); - label.setLayoutData(data); - label.setFont(mainGroup.getFont()); - label.setText(ExternalToolsModelMessages.getString("ResourceComponent.specificResLabel")); //$NON-NLS-1$ - } - - /* (non-Javadoc) - * Method declared on ResourceComponent. - */ - protected boolean validateResourceListSelection() { - if (resourceList == null) - return true; - - IStructuredSelection sel = (IStructuredSelection) resourceList.getSelection(); - IResource resource = (IResource) sel.getFirstElement(); - if (resource == null || resource.getType() == IResource.FILE) { - getPage().setMessage(ExternalToolsModelMessages.getString("ResourceComponent.selectionRequired"), IMessageProvider.WARNING); //$NON-NLS-1$ - setIsValid(false); - return false; - } - - return true; - } - - - /** - * Filter to remove any IFile resources. - */ - private static final class FileFilter extends ViewerFilter { - /* (non-Javadoc) - * Method declared on ViewerFilter. - */ - public boolean select(Viewer viewer, Object parentElement, Object element) { - IResource resource = null; - if (element instanceof IResource) { - resource = (IResource) element; - } else { - if (element instanceof IAdaptable) { - IAdaptable adaptable = (IAdaptable) element; - resource = (IResource) adaptable.getAdapter(IResource.class); - } - } - - if (resource != null) - return resource.getType() != IResource.FILE; - else - return false; - } - } -} 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 deleted file mode 100644 index 17cbdf5..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/UrlExpander.java +++ /dev/null @@ -1,49 +0,0 @@ -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; - -/** - * Expands a variable into a localhost/documentRoot URL string - *

- * This class is not intended to be extended by clients. - *

- */ -public class UrlExpander extends ResourceExpander { //implements IVariableTextExpander { - - /** - * Create an instance - */ - public UrlExpander() { - super(); - } - - /** - * Returns a string representation to a localhost/documentRoot URL - * for the given variable tag and value or null. - * - * @see IVariableTextExpander#getText(String, String, ExpandVariableContext) - */ - public String getText(String varTag, String varValue, ExpandVariableContext context) { - IPath path = getPath(varTag, varValue, context); - if (path != null) { - IPreferenceStore store = PHPeclipsePlugin.getDefault().getPreferenceStore(); - String localhostURL = path.toString(); - String lowerCaseFileName = localhostURL.toLowerCase(); - 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(WebUI.PHP_LOCALHOST_PREF)+ localhostURL; - } - return localhostURL; - } - return ""; - } - -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/WorkingSetExpander.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/WorkingSetExpander.java deleted file mode 100644 index 73474d0..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/WorkingSetExpander.java +++ /dev/null @@ -1,56 +0,0 @@ -package net.sourceforge.phpdt.externaltools.variable; - -/********************************************************************** -Copyright (c) 2002 IBM Corp. and others. All rights reserved. -This file is 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: -**********************************************************************/ - -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.ui.IWorkingSet; -import org.eclipse.ui.PlatformUI; - -/** - * Expands a working set type variable into the desired - * result format. - *

- * This class is not intended to be extended by clients. - *

- */ -public class WorkingSetExpander implements IVariableResourceExpander { - - /** - * Create an instance - */ - public WorkingSetExpander() { - super(); - } - - /* (non-Javadoc) - * Method declared on IVariableResourceExpander. - */ - public IResource[] getResources(String varTag, String varValue, ExpandVariableContext context) { - if (varValue == null || varValue.length() == 0) - return null; - - IWorkingSet set = PlatformUI.getWorkbench().getWorkingSetManager().getWorkingSet(varValue); - if (set == null) - return null; - - IAdaptable[] elements = set.getElements(); - IResource[] resources = new IResource[elements.length]; - for (int i = 0; i < elements.length; i++) { - IAdaptable adaptable = elements[i]; - if (adaptable instanceof IResource) - resources[i] = (IResource) adaptable; - else - resources[i] = (IResource) adaptable.getAdapter(IResource.class); - } - - return resources; - } -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/WorkspaceExpander.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/WorkspaceExpander.java deleted file mode 100644 index cf2ab3c..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/WorkspaceExpander.java +++ /dev/null @@ -1,36 +0,0 @@ -package net.sourceforge.phpdt.externaltools.variable; - -/********************************************************************** -Copyright (c) 2002 IBM Corp. and others. All rights reserved. -This file is 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: -**********************************************************************/ - -import org.eclipse.core.resources.IResource; - -/** - * Expands a workspace variable into the desired - * result format. - *

- * This class is not intended to be extended by clients. - *

- */ -public class WorkspaceExpander extends ResourceExpander { - - /** - * Create an instance - */ - public WorkspaceExpander() { - super(); - } - - /* (non-Javadoc) - * Method declared on ResourceExpander. - */ - /*package*/ IResource expandUsingContext(ExpandVariableContext context) { - return getWorkspaceRoot(); - } -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/IPreferenceConstants.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/IPreferenceConstants.java index 5c67cd6..2f85249 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/IPreferenceConstants.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/IPreferenceConstants.java @@ -67,7 +67,7 @@ public interface IPreferenceConstants { public static final String EXTERNAL_PARSER_PREF = "_external_parser"; public static final String PHP_EXTENSION_PREFS = "_php_parser_extensions"; - + public static final String PHP_PARSER_DEFAULT = "_php_parser_default"; // public static final String PHP_INTERNAL_PARSER = "_php_internal_parser"; diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPEclipseBasePreferencePage.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPEclipseBasePreferencePage.java deleted file mode 100644 index dcc1599..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPEclipseBasePreferencePage.java +++ /dev/null @@ -1,241 +0,0 @@ -package net.sourceforge.phpeclipse; - -import net.sourceforge.phpdt.internal.ui.util.PHPFileUtil; -import net.sourceforge.phpeclipse.preferences.PHPPreferencesMessages; - -import org.eclipse.jface.preference.BooleanFieldEditor; -import org.eclipse.jface.preference.FileFieldEditor; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.preference.PreferencePage; -import org.eclipse.jface.preference.StringFieldEditor; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Label; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPreferencePage; - -public class PHPEclipseBasePreferencePage extends PreferencePage implements IWorkbenchPreferencePage { - - StringFieldEditor phpParserExtensionsSFE; - FileFieldEditor xamppStartSFE; - FileFieldEditor xamppStopSFE; - StringFieldEditor apacheStartSFE; - - StringFieldEditor apacheStopSFE; - - StringFieldEditor apacheRestartSFE; - - StringFieldEditor mySQLCommandSFE; - - FileFieldEditor apacheRunFFE; - - FileFieldEditor httpdConfFFE; - - FileFieldEditor etcHostsFFE; - - FileFieldEditor mysqlRunFFE; - - FileFieldEditor phpRunFFE; - - BooleanFieldEditor apacheStartBFE; - - BooleanFieldEditor apacheStopBFE; - - BooleanFieldEditor apacheRestartBFE; - - BooleanFieldEditor mysqlStartBFE; - - public PHPEclipseBasePreferencePage() { - super(); - setPreferenceStore(PHPeclipsePlugin.getDefault().getPreferenceStore()); - setDescription(PHPPreferencesMessages.getString("PHPBasePreferencePage.description")); //$NON-NLS-1$ - } - - public void init(IWorkbench workbench) { - } - - protected void performDefaults() { - phpParserExtensionsSFE.loadDefault(); - xamppStartSFE.loadDefault(); - xamppStopSFE.loadDefault(); - apacheStartSFE.loadDefault(); - apacheStopSFE.loadDefault(); - apacheRestartSFE.loadDefault(); - mySQLCommandSFE.loadDefault(); - phpRunFFE.loadDefault(); - apacheRunFFE.loadDefault(); - httpdConfFFE.loadDefault(); - etcHostsFFE.loadDefault(); - mysqlRunFFE.loadDefault(); - apacheStartBFE.loadDefault(); - apacheStopBFE.loadDefault(); - apacheRestartBFE.loadDefault(); - mysqlStartBFE.loadDefault(); - super.performDefaults(); - } - - public boolean performOk() { - PHPFileUtil.setExtensions(null); - phpParserExtensionsSFE.store(); - xamppStartSFE.store(); - xamppStopSFE.store(); - apacheStartSFE.store(); - apacheStopSFE.store(); - apacheRestartSFE.store(); - mySQLCommandSFE.store(); - phpRunFFE.store(); - apacheRunFFE.store(); - httpdConfFFE.store(); - etcHostsFFE.store(); - mysqlRunFFE.store(); - - apacheStartBFE.store(); - apacheStopBFE.store(); - apacheRestartBFE.store(); - mysqlStartBFE.store(); - return super.performOk(); - } - - protected Control createContents(Composite parent) { - initializeDialogUnits(parent); - final IPreferenceStore store = PHPeclipsePlugin.getDefault().getPreferenceStore(); - Composite composite = new Composite(parent, SWT.LEFT); - composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - composite.setLayout(new GridLayout()); - - // allowed PHP file extensions for parsing - Composite phpParserExtensionsComposite = new Composite(composite, SWT.NULL); - phpParserExtensionsComposite.setLayout(new GridLayout()); - phpParserExtensionsComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - phpParserExtensionsSFE = new StringFieldEditor(IPreferenceConstants.PHP_EXTENSION_PREFS, PHPPreferencesMessages - .getString("PHPBasePreferencePage.phpExtensionPrefs"), phpParserExtensionsComposite); - phpParserExtensionsSFE.setPreferencePage(this); - phpParserExtensionsSFE.setPreferenceStore(getPreferenceStore()); - phpParserExtensionsSFE.load(); - - //Create apache - Composite apacheSettingsComposite = new Composite(composite, SWT.NULL); - apacheSettingsComposite.setLayout(new GridLayout()); - apacheSettingsComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - Group apacheSettingsGroup = new Group(apacheSettingsComposite, SWT.NONE); - apacheSettingsGroup.setText(PHPPreferencesMessages.getString("PHPBasePreferencePage.apacheGroup")); - apacheSettingsGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - apacheSettingsGroup.setLayout(new GridLayout()); - - xamppStartSFE = new FileFieldEditor(IPreferenceConstants.XAMPP_START_PREF, PHPPreferencesMessages - .getString("PHPBasePreferencePage.apacheGroup.xampp_start"), apacheSettingsGroup); - xamppStartSFE.setPreferencePage(this); - xamppStartSFE.setPreferenceStore(getPreferenceStore()); - xamppStartSFE.load(); - - xamppStopSFE = new FileFieldEditor(IPreferenceConstants.XAMPP_STOP_PREF, PHPPreferencesMessages - .getString("PHPBasePreferencePage.apacheGroup.xampp_stop"), apacheSettingsGroup); - xamppStopSFE.setPreferencePage(this); - xamppStopSFE.setPreferenceStore(getPreferenceStore()); - xamppStopSFE.load(); - - apacheStartBFE = new BooleanFieldEditor(PHPeclipsePlugin.APACHE_START_BACKGROUND, PHPPreferencesMessages - .getString("PHPBasePreferencePage.apacheGroup.start_background"), apacheSettingsGroup); - apacheStartBFE.setPreferencePage(this); - apacheStartBFE.setPreferenceStore(getPreferenceStore()); - apacheStartBFE.load(); - - new Label(apacheSettingsGroup, SWT.NONE); - new Label(apacheSettingsGroup, SWT.NONE); - apacheStartSFE = new StringFieldEditor(IPreferenceConstants.APACHE_START_PREF, PHPPreferencesMessages - .getString("PHPBasePreferencePage.apacheGroup.start"), apacheSettingsGroup); - apacheStartSFE.setPreferencePage(this); - apacheStartSFE.setPreferenceStore(getPreferenceStore()); - apacheStartSFE.load(); - new Label(apacheSettingsGroup, SWT.NONE); - - apacheStopBFE = new BooleanFieldEditor(PHPeclipsePlugin.APACHE_STOP_BACKGROUND, PHPPreferencesMessages - .getString("PHPBasePreferencePage.apacheGroup.stop_background"), apacheSettingsGroup); - apacheStopBFE.setPreferencePage(this); - apacheStopBFE.setPreferenceStore(getPreferenceStore()); - apacheStopBFE.load(); - new Label(apacheSettingsGroup, SWT.NONE); - new Label(apacheSettingsGroup, SWT.NONE); - apacheStopSFE = new StringFieldEditor(IPreferenceConstants.APACHE_STOP_PREF, PHPPreferencesMessages - .getString("PHPBasePreferencePage.apacheGroup.stop"), apacheSettingsGroup); - apacheStopSFE.setPreferencePage(this); - apacheStopSFE.setPreferenceStore(getPreferenceStore()); - apacheStopSFE.load(); - new Label(apacheSettingsGroup, SWT.NONE); - - apacheRestartBFE = new BooleanFieldEditor(PHPeclipsePlugin.APACHE_RESTART_BACKGROUND, PHPPreferencesMessages - .getString("PHPBasePreferencePage.apacheGroup.restart_background"), apacheSettingsGroup); - apacheRestartBFE.setPreferencePage(this); - apacheRestartBFE.setPreferenceStore(getPreferenceStore()); - apacheRestartBFE.load(); - new Label(apacheSettingsGroup, SWT.NONE); - new Label(apacheSettingsGroup, SWT.NONE); - apacheRestartSFE = new StringFieldEditor(IPreferenceConstants.APACHE_RESTART_PREF, PHPPreferencesMessages - .getString("PHPBasePreferencePage.apacheGroup.restart"), apacheSettingsGroup); - apacheRestartSFE.setPreferencePage(this); - apacheRestartSFE.setPreferenceStore(getPreferenceStore()); - apacheRestartSFE.load(); - new Label(apacheSettingsGroup, SWT.NONE); - - apacheRunFFE = new FileFieldEditor(IPreferenceConstants.APACHE_RUN_PREF, PHPPreferencesMessages - .getString("PHPBasePreferencePage.apacheGroup.run"), apacheSettingsGroup); - apacheRunFFE.setPreferencePage(this); - apacheRunFFE.setPreferenceStore(getPreferenceStore()); - apacheRunFFE.load(); - - httpdConfFFE = new FileFieldEditor(IPreferenceConstants.HTTPD_CONF_PATH_PREF, PHPPreferencesMessages - .getString("PHPBasePreferencePage.apacheGroup.httpdconf"), apacheSettingsGroup); - httpdConfFFE.setPreferencePage(this); - httpdConfFFE.setPreferenceStore(getPreferenceStore()); - httpdConfFFE.load(); - - etcHostsFFE = new FileFieldEditor(IPreferenceConstants.ETC_HOSTS_PATH_PREF, PHPPreferencesMessages - .getString("PHPBasePreferencePage.apacheGroup.etchosts"), apacheSettingsGroup); - etcHostsFFE.setPreferencePage(this); - etcHostsFFE.setPreferenceStore(getPreferenceStore()); - etcHostsFFE.load(); - - phpRunFFE = new FileFieldEditor(IPreferenceConstants.PHP_RUN_PREF, PHPPreferencesMessages - .getString("PHPBasePreferencePage.console.php"), apacheSettingsGroup); - phpRunFFE.setPreferencePage(this); - phpRunFFE.setPreferenceStore(getPreferenceStore()); - phpRunFFE.load(); - - //Create mySQL - Composite mySQLSettingsComposite = new Composite(composite, SWT.NULL); - mySQLSettingsComposite.setLayout(new GridLayout()); - mySQLSettingsComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - - Group mySQLSettingsGroup = new Group(mySQLSettingsComposite, SWT.NONE); - mySQLSettingsGroup.setText(PHPPreferencesMessages.getString("PHPBasePreferencePage.mySQLGroup")); - mySQLSettingsGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - mySQLSettingsGroup.setLayout(new GridLayout()); - - mysqlStartBFE = new BooleanFieldEditor(PHPeclipsePlugin.MYSQL_START_BACKGROUND, PHPPreferencesMessages - .getString("PHPBasePreferencePage.mySQLGroup.start_background"), mySQLSettingsGroup); - mysqlStartBFE.setPreferencePage(this); - mysqlStartBFE.setPreferenceStore(getPreferenceStore()); - mysqlStartBFE.load(); - new Label(mySQLSettingsGroup, SWT.NONE); - new Label(mySQLSettingsGroup, SWT.NONE); - - mySQLCommandSFE = new StringFieldEditor(IPreferenceConstants.MYSQL_PREF, PHPPreferencesMessages - .getString("PHPBasePreferencePage.mySQLGroup.command"), mySQLSettingsGroup); - mySQLCommandSFE.setPreferencePage(this); - mySQLCommandSFE.setPreferenceStore(getPreferenceStore()); - mySQLCommandSFE.load(); - new Label(mySQLSettingsGroup, SWT.NONE); - - mysqlRunFFE = new FileFieldEditor(IPreferenceConstants.MYSQL_RUN_PREF, PHPPreferencesMessages - .getString("PHPBasePreferencePage.mySQLGroup.run"), mySQLSettingsGroup); - mysqlRunFFE.setPreferencePage(this); - mysqlRunFFE.setPreferenceStore(getPreferenceStore()); - mysqlRunFFE.load(); - - return composite; - } -} \ No newline at end of file diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPeclipsePlugin.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPeclipsePlugin.java index 74845aa..c98d0dc 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPeclipsePlugin.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPeclipsePlugin.java @@ -28,7 +28,6 @@ import net.sourceforge.phpdt.core.IJavaElement; import net.sourceforge.phpdt.core.JavaCore; import net.sourceforge.phpdt.core.WorkingCopyOwner; import net.sourceforge.phpdt.externaltools.internal.model.ColorManager; -import net.sourceforge.phpdt.externaltools.internal.model.ExternalToolsPlugin; import net.sourceforge.phpdt.internal.core.BatchOperation; import net.sourceforge.phpdt.internal.core.JavaModelManager; import net.sourceforge.phpdt.internal.core.util.Util; @@ -171,7 +170,7 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements IPreferenceCon */ // private static final String CODE_TEMPLATES_MIGRATION_KEY= "net.sourceforge.phpdt.ui.text.code_templates_migrated"; // //$NON-NLS-1$ - private static ExternalToolsPlugin externalTools; +// private static ExternalToolsPlugin externalTools; /** * The Java virtual machine that we are running on. @@ -303,7 +302,7 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements IPreferenceCon public PHPeclipsePlugin(IPluginDescriptor descriptor) { super(descriptor); plugin = this; - externalTools = new ExternalToolsPlugin(); +// externalTools = new ExternalToolsPlugin(); // try { // resourceBundle = @@ -832,7 +831,7 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements IPreferenceCon new PHPSyntaxRdr(); JavaCore.initializeDefaultPluginPreferences(); PreferenceConstants.initializeDefaultValues(store); - externalTools.initializeDefaultPreferences(store); +// externalTools.initializeDefaultPreferences(store); MarkerAnnotationPreferences.initializeDefaultValues(store); } -- 1.7.1 From f67875134e7043e4819acf6f9d7d3c591b4b4eca Mon Sep 17 00:00:00 2001 From: axelcl Date: Tue, 14 Jun 2005 05:05:44 +0000 Subject: [PATCH 06/16] Created a separated 'externaltools' plugin --- net.sourceforge.phpeclipse.debug.ui/plugin.xml | 2 +- .../phpeclipse/ui/text/rules/ViewNode.java | 4 +- .../prefs/default_win32.properties | 14 ----- .../phpeclipse/IPreferenceConstants.java | 54 ++++++++++---------- .../sourceforge/phpeclipse/PHPeclipsePlugin.java | 40 +++++++------- 5 files changed, 50 insertions(+), 64 deletions(-) diff --git a/net.sourceforge.phpeclipse.debug.ui/plugin.xml b/net.sourceforge.phpeclipse.debug.ui/plugin.xml index 981002c..4e62e25 100644 --- a/net.sourceforge.phpeclipse.debug.ui/plugin.xml +++ b/net.sourceforge.phpeclipse.debug.ui/plugin.xml @@ -34,7 +34,7 @@ point="org.eclipse.ui.preferencePages"> diff --git a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/ui/text/rules/ViewNode.java b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/ui/text/rules/ViewNode.java index ef5ab0e..2b37763 100644 --- a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/ui/text/rules/ViewNode.java +++ b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/ui/text/rules/ViewNode.java @@ -8,13 +8,13 @@ * Contributors: * Igor Malinin - initial contribution * - * $Id: ViewNode.java,v 1.1 2004-09-02 18:26:29 jsurfer Exp $ + * $Id: ViewNode.java,v 1.2 2005-06-14 05:04:09 axelcl Exp $ */ package net.sourceforge.phpeclipse.ui.text.rules; /** - * @author Igor Malinin + * @author Igor Malinin */ public class ViewNode extends FlatNode { diff --git a/net.sourceforge.phpeclipse/prefs/default_win32.properties b/net.sourceforge.phpeclipse/prefs/default_win32.properties index 8ee625d..d9ce7c7 100644 --- a/net.sourceforge.phpeclipse/prefs/default_win32.properties +++ b/net.sourceforge.phpeclipse/prefs/default_win32.properties @@ -1,16 +1,2 @@ -_php_run_pref=c:\\xampp\\php\\php.exe -_external_parser=c:\\xampp\\php\\php.exe -l -f {0} -_mysql_run_pref=c:\\xampp\\mysql\\bin\\mysqld-nt.exe -_apache_run_pref=c:\\xampp\\apache\\bin\\apache.exe -_xampp_start_pref=c:\\xampp\\xampp_start.exe -_xampp_stop_pref=c:\\xampp\\xampp_stop.exe -__mysql_start=--standalone -__apache_start=-c \"DocumentRoot \"{0}\"\" -__apache_stop=-k shutdown -__apache_restart=-k restart -_mysql_start_background=true -_apache_start_background=true -_apache_stop_background=true -_apache_restart_background=true __httpd_conf_path=c:\\xampp\\apache\\conf\\httpd.conf __etc_hosts_path=c:\\windows\\system32\\drivers\\etc\\hosts \ No newline at end of file diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/IPreferenceConstants.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/IPreferenceConstants.java index 2f85249..793bec6 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/IPreferenceConstants.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/IPreferenceConstants.java @@ -32,29 +32,29 @@ public interface IPreferenceConstants { // public static final String LOCALHOST_PREF = "_localhost"; // public static final String DOCUMENTROOT_PREF = "_documentroot"; - public static final String XAMPP_START_PREF = "_xampp_start_pref"; - - public static final String XAMPP_STOP_PREF = "_xampp_stop_pref"; - - public static final String MYSQL_RUN_PREF = "_mysql_run_pref"; - - public static final String MYSQL_START_BACKGROUND = "_mysql_start_background"; - - public static final String MYSQL_PREF = "__mysql_start"; - - public static final String APACHE_RUN_PREF = "_apache_run_pref"; - - public static final String APACHE_START_BACKGROUND = "_apache_start_background"; - - public static final String APACHE_START_PREF = "__apache_start"; - - public static final String APACHE_STOP_BACKGROUND = "_apache_stop_background"; - - public static final String APACHE_STOP_PREF = "__apache_stop"; - - public static final String APACHE_RESTART_BACKGROUND = "_apache_restart_background"; - - public static final String APACHE_RESTART_PREF = "__apache_restart"; +// public static final String XAMPP_START_PREF = "_xampp_start_pref"; +// +// public static final String XAMPP_STOP_PREF = "_xampp_stop_pref"; +// +// public static final String MYSQL_RUN_PREF = "_mysql_run_pref"; +// +// public static final String MYSQL_START_BACKGROUND = "_mysql_start_background"; +// +// public static final String MYSQL_PREF = "__mysql_start"; +// +// public static final String APACHE_RUN_PREF = "_apache_run_pref"; +// +// public static final String APACHE_START_BACKGROUND = "_apache_start_background"; +// +// public static final String APACHE_START_PREF = "__apache_start"; +// +// public static final String APACHE_STOP_BACKGROUND = "_apache_stop_background"; +// +// public static final String APACHE_STOP_PREF = "__apache_stop"; +// +// public static final String APACHE_RESTART_BACKGROUND = "_apache_restart_background"; +// +// public static final String APACHE_RESTART_PREF = "__apache_restart"; public static final String HTTPD_CONF_PATH_PREF = "__httpd_conf_path"; @@ -62,13 +62,13 @@ public interface IPreferenceConstants { public static final String SHOW_OUTPUT_IN_CONSOLE = "_show_output_in_console"; - public static final String PHP_RUN_PREF = "_php_run_pref"; - - public static final String EXTERNAL_PARSER_PREF = "_external_parser"; +// public static final String PHP_RUN_PREF = "_php_run_pref"; +// +// public static final String EXTERNAL_PARSER_PREF = "_external_parser"; public static final String PHP_EXTENSION_PREFS = "_php_parser_extensions"; - public static final String PHP_PARSER_DEFAULT = "_php_parser_default"; +// public static final String PHP_PARSER_DEFAULT = "_php_parser_default"; // public static final String PHP_INTERNAL_PARSER = "_php_internal_parser"; // public static final String PHP_EXTERNAL_PARSER = "_php_external_parser"; diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPeclipsePlugin.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPeclipsePlugin.java index c98d0dc..97def0e 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPeclipsePlugin.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPeclipsePlugin.java @@ -707,30 +707,30 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements IPreferenceCon } catch (Exception e) { // no default properties found if (operatingSystem.equals(Platform.OS_WIN32)) { - store.setDefault(PHP_RUN_PREF, "c:\\apache\\php\\php.exe"); - store.setDefault(EXTERNAL_PARSER_PREF, "c:\\apache\\php\\php -l -f {0}"); - store.setDefault(MYSQL_RUN_PREF, "c:\\apache\\mysql\\bin\\mysqld-nt.exe"); - store.setDefault(APACHE_RUN_PREF, "c:\\apache\\apache.exe"); - store.setDefault(XAMPP_START_PREF, "c:\\xampp\\xampp_start.exe"); - store.setDefault(XAMPP_STOP_PREF, "c:\\xampp\\xampp_stop.exe"); +// store.setDefault(PHP_RUN_PREF, "c:\\apache\\php\\php.exe"); +// store.setDefault(EXTERNAL_PARSER_PREF, "c:\\apache\\php\\php -l -f {0}"); +// store.setDefault(MYSQL_RUN_PREF, "c:\\apache\\mysql\\bin\\mysqld-nt.exe"); +// store.setDefault(APACHE_RUN_PREF, "c:\\apache\\apache.exe"); +// store.setDefault(XAMPP_START_PREF, "c:\\xampp\\xampp_start.exe"); +// store.setDefault(XAMPP_STOP_PREF, "c:\\xampp\\xampp_stop.exe"); store.setDefault( ETC_HOSTS_PATH_PREF, "c:\\windows\\system32\\drivers\\etc\\hosts"); } else { - store.setDefault(PHP_RUN_PREF, "/apache/php/php"); - store.setDefault(EXTERNAL_PARSER_PREF, "/apache/php/php -l -f {0}"); - store.setDefault(MYSQL_RUN_PREF, "/apache/mysql/bin/mysqld"); - store.setDefault(APACHE_RUN_PREF, "/apache/apache"); - store.setDefault(XAMPP_START_PREF, "xamp/xampp_start"); - store.setDefault(XAMPP_STOP_PREF, "xampp/xampp_stop"); +// store.setDefault(PHP_RUN_PREF, "/apache/php/php"); +// store.setDefault(EXTERNAL_PARSER_PREF, "/apache/php/php -l -f {0}"); +// store.setDefault(MYSQL_RUN_PREF, "/apache/mysql/bin/mysqld"); +// store.setDefault(APACHE_RUN_PREF, "/apache/apache"); +// store.setDefault(XAMPP_START_PREF, "xamp/xampp_start"); +// store.setDefault(XAMPP_STOP_PREF, "xampp/xampp_stop"); } - store.setDefault(MYSQL_PREF, "--standalone"); - store.setDefault(APACHE_START_PREF, "-c \"DocumentRoot \"{0}\"\""); - store.setDefault(APACHE_STOP_PREF, "-k shutdown"); - store.setDefault(APACHE_RESTART_PREF, "-k restart"); - store.setDefault(MYSQL_START_BACKGROUND, "true"); - store.setDefault(APACHE_START_BACKGROUND, "true"); - store.setDefault(APACHE_STOP_BACKGROUND, "true"); - store.setDefault(APACHE_RESTART_BACKGROUND, "true"); +// store.setDefault(MYSQL_PREF, "--standalone"); +// store.setDefault(APACHE_START_PREF, "-c \"DocumentRoot \"{0}\"\""); +// store.setDefault(APACHE_STOP_PREF, "-k shutdown"); +// store.setDefault(APACHE_RESTART_PREF, "-k restart"); +// store.setDefault(MYSQL_START_BACKGROUND, "true"); +// store.setDefault(APACHE_START_BACKGROUND, "true"); +// store.setDefault(APACHE_STOP_BACKGROUND, "true"); +// store.setDefault(APACHE_RESTART_BACKGROUND, "true"); } store.setDefault(SHOW_OUTPUT_IN_CONSOLE, "true"); -- 1.7.1 From 2cadb187324f9fbedc1950564e9006fad3b6f0a8 Mon Sep 17 00:00:00 2001 From: stefanbjarni Date: Fri, 17 Jun 2005 01:17:06 +0000 Subject: [PATCH 07/16] Added a discovery directive next to the update directive. --- net.sourceforge.phpeclipse.feature/feature.xml | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/net.sourceforge.phpeclipse.feature/feature.xml b/net.sourceforge.phpeclipse.feature/feature.xml index e7bf59e..40ee063 100644 --- a/net.sourceforge.phpeclipse.feature/feature.xml +++ b/net.sourceforge.phpeclipse.feature/feature.xml @@ -179,6 +179,7 @@ b) in the case of each subsequent Contributor:</FONT></UL> + -- 1.7.1 From 350d1275c09abeb595690a3ccaed1ed3a6fa5ffa Mon Sep 17 00:00:00 2001 From: axelcl Date: Sat, 18 Jun 2005 22:26:30 +0000 Subject: [PATCH 08/16] Added externaltools plugin --- net.sourceforge.phpeclipse.feature/feature.xml | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/net.sourceforge.phpeclipse.feature/feature.xml b/net.sourceforge.phpeclipse.feature/feature.xml index 40ee063..71bcbf1 100644 --- a/net.sourceforge.phpeclipse.feature/feature.xml +++ b/net.sourceforge.phpeclipse.feature/feature.xml @@ -251,6 +251,12 @@ b) in the case of each subsequent Contributor:</FONT></UL> version="1.1.5"/> + + Date: Sat, 18 Jun 2005 22:28:32 +0000 Subject: [PATCH 09/16] Added changes for externaltools plugin --- net.sourceforge.phpeclipse.phphelp/plugin.xml | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/net.sourceforge.phpeclipse.phphelp/plugin.xml b/net.sourceforge.phpeclipse.phphelp/plugin.xml index 52fe6b4..3be6d02 100644 --- a/net.sourceforge.phpeclipse.phphelp/plugin.xml +++ b/net.sourceforge.phpeclipse.phphelp/plugin.xml @@ -95,7 +95,7 @@ point="org.eclipse.ui.preferencePages"> -- 1.7.1 From af268cb1437dbf4a7f0582c8885ae5b5077348e0 Mon Sep 17 00:00:00 2001 From: axelcl Date: Sat, 18 Jun 2005 23:00:56 +0000 Subject: [PATCH 10/16] Moved ETC_HOSTS_PATH_PREF to externaltools --- .../externaltools/ExternalToolsPlugin.java | 4 ++++ .../phpeclipse/IPreferenceConstants.java | 6 +++--- .../sourceforge/phpeclipse/PHPeclipsePlugin.java | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpeclipse/externaltools/ExternalToolsPlugin.java b/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpeclipse/externaltools/ExternalToolsPlugin.java index 0a2219a..71aa940 100644 --- a/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpeclipse/externaltools/ExternalToolsPlugin.java +++ b/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpeclipse/externaltools/ExternalToolsPlugin.java @@ -69,6 +69,9 @@ public final class ExternalToolsPlugin extends AbstractUIPlugin { public static final String APACHE_RESTART_PREF = "__apache_restart"; + public static final String HTTPD_CONF_PATH_PREF = "__httpd_conf_path"; + + public static final String ETC_HOSTS_PATH_PREF = "__etc_hosts_path"; // public static final String SHOW_OUTPUT_IN_CONSOLE = "_show_output_in_console"; public static final String PHP_RUN_PREF = "_php_run_pref"; @@ -213,6 +216,7 @@ public final class ExternalToolsPlugin extends AbstractUIPlugin { store.setDefault(APACHE_RUN_PREF, "c:\\apache\\apache.exe"); store.setDefault(XAMPP_START_PREF, "c:\\xampp\\xampp_start.exe"); store.setDefault(XAMPP_STOP_PREF, "c:\\xampp\\xampp_stop.exe"); + store.setDefault(ETC_HOSTS_PATH_PREF, "c:\\windows\\system32\\drivers\\etc\\hosts"); } else { store.setDefault(PHP_RUN_PREF, "/apache/php/php"); store.setDefault(EXTERNAL_PARSER_PREF, "/apache/php/php -l -f {0}"); diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/IPreferenceConstants.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/IPreferenceConstants.java index 793bec6..f6b7cef 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/IPreferenceConstants.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/IPreferenceConstants.java @@ -56,9 +56,9 @@ public interface IPreferenceConstants { // // public static final String APACHE_RESTART_PREF = "__apache_restart"; - public static final String HTTPD_CONF_PATH_PREF = "__httpd_conf_path"; - - public static final String ETC_HOSTS_PATH_PREF = "__etc_hosts_path"; +// public static final String HTTPD_CONF_PATH_PREF = "__httpd_conf_path"; +// +// public static final String ETC_HOSTS_PATH_PREF = "__etc_hosts_path"; public static final String SHOW_OUTPUT_IN_CONSOLE = "_show_output_in_console"; diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPeclipsePlugin.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPeclipsePlugin.java index 97def0e..1574650 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPeclipsePlugin.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPeclipsePlugin.java @@ -713,8 +713,8 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements IPreferenceCon // store.setDefault(APACHE_RUN_PREF, "c:\\apache\\apache.exe"); // store.setDefault(XAMPP_START_PREF, "c:\\xampp\\xampp_start.exe"); // store.setDefault(XAMPP_STOP_PREF, "c:\\xampp\\xampp_stop.exe"); - store.setDefault( - ETC_HOSTS_PATH_PREF, "c:\\windows\\system32\\drivers\\etc\\hosts"); +// store.setDefault( +// ETC_HOSTS_PATH_PREF, "c:\\windows\\system32\\drivers\\etc\\hosts"); } else { // store.setDefault(PHP_RUN_PREF, "/apache/php/php"); // store.setDefault(EXTERNAL_PARSER_PREF, "/apache/php/php -l -f {0}"); -- 1.7.1 From 46c0a6f6eec1267b458f5afc25caa65a93685d35 Mon Sep 17 00:00:00 2001 From: axelcl Date: Sat, 18 Jun 2005 23:02:52 +0000 Subject: [PATCH 11/16] Removed some internal constants --- .../phpeclipse/IPreferenceConstants.java | 4 ++-- .../sourceforge/phpeclipse/PHPeclipsePlugin.java | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/IPreferenceConstants.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/IPreferenceConstants.java index f6b7cef..657bda0 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/IPreferenceConstants.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/IPreferenceConstants.java @@ -60,7 +60,7 @@ public interface IPreferenceConstants { // // public static final String ETC_HOSTS_PATH_PREF = "__etc_hosts_path"; - public static final String SHOW_OUTPUT_IN_CONSOLE = "_show_output_in_console"; +// public static final String SHOW_OUTPUT_IN_CONSOLE = "_show_output_in_console"; // public static final String PHP_RUN_PREF = "_php_run_pref"; // @@ -340,7 +340,7 @@ 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_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"; diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPeclipsePlugin.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPeclipsePlugin.java index 1574650..6996224 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPeclipsePlugin.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPeclipsePlugin.java @@ -733,18 +733,18 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements IPreferenceCon // 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(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"); +// } 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"); +// } 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"); -- 1.7.1 From e6c124feef4a785a7352f1fededdb766c87e18e3 Mon Sep 17 00:00:00 2001 From: axelcl Date: Fri, 24 Jun 2005 21:09:55 +0000 Subject: [PATCH 12/16] Fixed syntaxhiglighting for single line comments. Example:

This is an example.

--- .../internal/ui/text/FastJavaPartitionScanner.java | 22 ++++++++++++++++++- 1 files changed, 20 insertions(+), 2 deletions(-) diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/text/FastJavaPartitionScanner.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/text/FastJavaPartitionScanner.java index 663757f..f902c59 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/text/FastJavaPartitionScanner.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/text/FastJavaPartitionScanner.java @@ -79,8 +79,13 @@ public class FastJavaPartitionScanner implements IPartitionTokenScanner, IPHPPar private int fJavaLength; - private final IToken[] fTokens = new IToken[] { new Token(null), new Token(PHP_SINGLELINE_COMMENT), - new Token(PHP_MULTILINE_COMMENT), new Token(PHP_PHPDOC_COMMENT), new Token(PHP_STRING_DQ), new Token(PHP_STRING_SQ) }; + private final IToken[] fTokens = new IToken[] { + new Token(null), + new Token(PHP_SINGLELINE_COMMENT), + new Token(PHP_MULTILINE_COMMENT), + new Token(PHP_PHPDOC_COMMENT), + new Token(PHP_STRING_DQ), + new Token(PHP_STRING_SQ) }; public FastJavaPartitionScanner(boolean emulate) { fEmulate = emulate; @@ -180,6 +185,19 @@ public class FastJavaPartitionScanner implements IPartitionTokenScanner, IPHPPar continue; } + case '?': + if (fState == SINGLE_LINE_COMMENT) { + int nextch = fScanner.read(); + if (nextch == '>') { + //

This is an example.

+ fTokenLength--; + fScanner.unread(); + fScanner.unread(); + return postFix(fState); + } + fScanner.unread(); + } + default: if (!fEmulate && fLast == CARRIAGE_RETURN) { switch (fState) { -- 1.7.1 From 3e03708ddcce45dafdd5a36e9c3361ae65aaaec9 Mon Sep 17 00:00:00 2001 From: axelcl Date: Fri, 24 Jun 2005 21:10:50 +0000 Subject: [PATCH 13/16] misc --- .../phpdt/internal/compiler/parser/Scanner.java | 1 + 1 files changed, 1 insertions(+), 0 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 751e8c0..6b1e495 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 @@ -1612,6 +1612,7 @@ public class Scanner implements IScanner, ITerminalSymbols { this.lastCommentLinePosition = this.currentPosition; if (currentCharacter == '?') { if (getNextChar('>')) { + // ?> breaks line comments startPosition = currentPosition - 2; phpMode = false; return TokenNameINLINE_HTML; -- 1.7.1 From 6c4c53696a02ca9a917c3f6d7c1ce4d1e57b6252 Mon Sep 17 00:00:00 2001 From: axelcl Date: Fri, 24 Jun 2005 21:13:52 +0000 Subject: [PATCH 14/16] Deleted unnecessary syntax highlighting rules --- .../phpeclipse/phpeditor/php/PHPCodeScanner.java | 95 +++----------------- 1 files changed, 12 insertions(+), 83 deletions(-) diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PHPCodeScanner.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PHPCodeScanner.java index 8a50ffd..be00721 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PHPCodeScanner.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PHPCodeScanner.java @@ -37,7 +37,7 @@ import org.eclipse.jface.text.rules.WordRule; * PHP Code Scanner */ public class PHPCodeScanner extends AbstractJavaScanner { - + /** * Rule to detect java operators. * @@ -161,42 +161,7 @@ public class PHPCodeScanner extends AbstractJavaScanner { } } - protected class SingleQuoteStringRule implements IRule { - - /** Token to return for this rule */ - private final IToken fToken; - - public SingleQuoteStringRule(IToken token) { - fToken = token; - - } - - /* - * @see org.eclipse.jface.text.rules.IRule#evaluate(org.eclipse.jface.text.rules.ICharacterScanner) - */ - public IToken evaluate(ICharacterScanner scanner) { - - int character = scanner.read(); - if (character=='\'') { - - while (true) { - character = scanner.read(); - if (character == '\\') { - character = scanner.read(); - } else if (character == '\'') { - return fToken; - } - } - - } else { - scanner.unread(); - return Token.UNDEFINED; - } - } - - } - protected class AccentStringRule implements IRule { /** Token to return for this rule */ @@ -214,8 +179,8 @@ public class PHPCodeScanner extends AbstractJavaScanner { int character = scanner.read(); - if (character=='`') { - + if (character == '`') { + while (true) { character = scanner.read(); if (character == '\\') { @@ -223,44 +188,8 @@ public class PHPCodeScanner extends AbstractJavaScanner { } else if (character == '`') { return fToken; } - } - - } else { - scanner.unread(); - return Token.UNDEFINED; - } - } - - } - - protected class DoubleQuoteStringRule implements IRule { - - /** Token to return for this rule */ - private final IToken fToken; - - public DoubleQuoteStringRule(IToken token) { - fToken = token; - - } - - /* - * @see org.eclipse.jface.text.rules.IRule#evaluate(org.eclipse.jface.text.rules.ICharacterScanner) - */ - public IToken evaluate(ICharacterScanner scanner) { - - int character = scanner.read(); + } - if (character=='"') { - - while (true) { - character = scanner.read(); - if (character == '\\') { - character = scanner.read(); - } else if (character == '"') { - return fToken; - } - } - } else { scanner.unread(); return Token.UNDEFINED; @@ -268,7 +197,7 @@ public class PHPCodeScanner extends AbstractJavaScanner { } } - + private class PHPWordRule extends WordRule { private StringBuffer fBuffer = new StringBuffer(); @@ -291,7 +220,7 @@ public class PHPCodeScanner extends AbstractJavaScanner { return Token.UNDEFINED; } else { c = scanner.read(); - if (c == '=') { // Date: Fri, 24 Jun 2005 21:18:26 +0000 Subject: [PATCH 15/16] Tried to implement ConsoleLineTracker (see plugin.xml) for PHP stack traces in the console Doesn't work at the moment. --- .../debug/ui/launcher/PHPEnvironmentTab.java | 21 +- .../ui/preferences/EditInterpreterDialog.java | 167 -------- .../preferences/PHPInterpreterLabelProvider.java | 9 +- .../preferences/PHPInterpreterPreferencePage.java | 396 +++++++++++--------- net.sourceforge.phpeclipse.launching/plugin.xml | 13 +- .../internal/launching/ConsoleLineTracker.java | 144 +++++++ .../internal/launching/InterpreterRunner.java | 5 +- .../phpdt/internal/launching/PHPInterpreter.java | 143 +++++--- .../launching/PHPLaunchConfigurationAttribute.java | 1 + .../phpdt/internal/launching/PHPRuntime.java | 17 +- 10 files changed, 495 insertions(+), 421 deletions(-) delete mode 100644 net.sourceforge.phpeclipse.debug.ui/src/net/sourceforge/phpdt/internal/debug/ui/preferences/EditInterpreterDialog.java create mode 100644 net.sourceforge.phpeclipse.launching/src/net/sourceforge/phpdt/internal/launching/ConsoleLineTracker.java diff --git a/net.sourceforge.phpeclipse.debug.ui/src/net/sourceforge/phpdt/internal/debug/ui/launcher/PHPEnvironmentTab.java b/net.sourceforge.phpeclipse.debug.ui/src/net/sourceforge/phpdt/internal/debug/ui/launcher/PHPEnvironmentTab.java index a705d70..a40d0c0 100644 --- a/net.sourceforge.phpeclipse.debug.ui/src/net/sourceforge/phpdt/internal/debug/ui/launcher/PHPEnvironmentTab.java +++ b/net.sourceforge.phpeclipse.debug.ui/src/net/sourceforge/phpdt/internal/debug/ui/launcher/PHPEnvironmentTab.java @@ -1,5 +1,6 @@ package net.sourceforge.phpdt.internal.debug.ui.launcher; +import java.io.File; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; @@ -7,8 +8,8 @@ import java.util.Map; import net.sourceforge.phpdt.internal.debug.ui.PHPDebugUiMessages; import net.sourceforge.phpdt.internal.debug.ui.PHPDebugUiPlugin; -import net.sourceforge.phpdt.internal.debug.ui.preferences.EditInterpreterDialog; import net.sourceforge.phpdt.internal.debug.ui.preferences.EditPathMapDialog; +import net.sourceforge.phpdt.internal.debug.ui.preferences.PHPInterpreterPreferencePage; import net.sourceforge.phpdt.internal.launching.PHPInterpreter; import net.sourceforge.phpdt.internal.launching.PHPLaunchConfigurationAttribute; import net.sourceforge.phpdt.internal.launching.PHPRuntime; @@ -412,15 +413,13 @@ public class PHPEnvironmentTab extends AbstractLaunchConfigurationTab { interpreterAddButton.setText(PHPDebugUiMessages.getString("LaunchConfigurationTab.PHPEnvironment.interpreterAddButton.label")); interpreterAddButton.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent evt) { - PHPInterpreter newInterpreter = new PHPInterpreter(null, null); - EditInterpreterDialog editor = new EditInterpreterDialog(getShell(), PHPDebugUiMessages - .getString("LaunchConfigurationTab.PHPEnvironment.editInterpreterDialog.title")); - editor.create(); - editor.setInterpreterToEdit(newInterpreter); - if (EditInterpreterDialog.OK == editor.open()) { + PHPInterpreter newInterpreter = new PHPInterpreter(null); + File phpRuntime = PHPInterpreterPreferencePage.getFile(getShell(), null); + if (phpRuntime != null) { + newInterpreter.setInstallLocation(phpRuntime); PHPRuntime.getDefault().addInstalledInterpreter(newInterpreter); - interpreterCombo.add(newInterpreter.getName()); - interpreterCombo.select(interpreterCombo.indexOf(newInterpreter.getName())); + interpreterCombo.add(newInterpreter.getInstallLocation().toString()); + interpreterCombo.select(interpreterCombo.indexOf(newInterpreter.getInstallLocation().toString())); } } }); @@ -559,13 +558,13 @@ public class PHPEnvironmentTab extends AbstractLaunchConfigurationTab { String[] interpreterNames = new String[installedInterpretersWorkingCopy.size()]; for (int interpreterIndex = 0; interpreterIndex < installedInterpretersWorkingCopy.size(); interpreterIndex++) { PHPInterpreter interpreter = (PHPInterpreter) installedInterpretersWorkingCopy.get(interpreterIndex); - interpreterNames[interpreterIndex] = interpreter.getName(); + interpreterNames[interpreterIndex] = interpreter.getInstallLocation().toString(); } interpreterCombo.setItems(interpreterNames); PHPInterpreter selectedInterpreter = PHPRuntime.getDefault().getSelectedInterpreter(); if (selectedInterpreter != null) - interpreterCombo.select(interpreterCombo.indexOf(selectedInterpreter.getName())); + interpreterCombo.select(interpreterCombo.indexOf(selectedInterpreter.getInstallLocation().toString())); } public void performApply(ILaunchConfigurationWorkingCopy configuration) { diff --git a/net.sourceforge.phpeclipse.debug.ui/src/net/sourceforge/phpdt/internal/debug/ui/preferences/EditInterpreterDialog.java b/net.sourceforge.phpeclipse.debug.ui/src/net/sourceforge/phpdt/internal/debug/ui/preferences/EditInterpreterDialog.java deleted file mode 100644 index bb41fa3..0000000 --- a/net.sourceforge.phpeclipse.debug.ui/src/net/sourceforge/phpdt/internal/debug/ui/preferences/EditInterpreterDialog.java +++ /dev/null @@ -1,167 +0,0 @@ -package net.sourceforge.phpdt.internal.debug.ui.preferences; - -import java.io.File; - -import net.sourceforge.phpdt.internal.debug.ui.PHPDebugUiMessages; -import net.sourceforge.phpdt.internal.debug.ui.PHPDebugUiPlugin; -import net.sourceforge.phpdt.internal.launching.PHPInterpreter; -import net.sourceforge.phpdt.internal.ui.dialogs.StatusDialog; - -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Status; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -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.layout.RowData; -import org.eclipse.swt.layout.RowLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.DirectoryDialog; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; - -public class EditInterpreterDialog extends StatusDialog { - protected PHPInterpreter interpreterToEdit; - protected Text interpreterNameText, interpreterLocationText; - protected IStatus[] allStatus = new IStatus[2]; - - public EditInterpreterDialog(Shell parentShell, String aDialogTitle) { - super(parentShell); - setTitle(aDialogTitle); - } - - public void setInterpreterToEdit(PHPInterpreter anInterpreter) { - interpreterToEdit = anInterpreter; - - String interpreterName = interpreterToEdit.getName(); - interpreterNameText.setText(interpreterName != null ? interpreterName : ""); //$NON-NLS-1$ - - IPath installLocation = interpreterToEdit.getInstallLocation(); - interpreterLocationText.setText(installLocation != null ? installLocation.toOSString() : ""); //$NON-NLS-1$ - } - - protected void createLocationEntryField(Composite composite) { - new Label(composite, SWT.NONE).setText(PHPDebugUiMessages.getString("EditInterpreterDialog.PHPInterpreter.path.label")); //$NON-NLS-1$ - - Composite locationComposite = new Composite(composite, SWT.NONE); - RowLayout locationLayout = new RowLayout(); - locationLayout.marginLeft = 0; - locationComposite.setLayout(locationLayout); - - interpreterLocationText = new Text(locationComposite, SWT.SINGLE | SWT.BORDER); - interpreterLocationText.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e) { - allStatus[1] = validateInterpreterLocationText(); - updateStatusLine(); - } - }); - interpreterLocationText.setLayoutData(new RowData(120, SWT.DEFAULT)); - - Button browseButton = new Button(composite, SWT.PUSH); - browseButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END)); - browseButton.setText(PHPDebugUiMessages.getString("EditInterpreterDialog.PHPInterpreter.path.browse.button.label")); //$NON-NLS-1$ - browseButton.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - browseForInstallDir(); - } - }); - } - - protected void updateStatusLine() { - updateStatus(getMostSevereStatus()); - } - - protected IStatus getMostSevereStatus() { - IStatus max = new Status(0, PHPDebugUiPlugin.PLUGIN_ID, IStatus.OK, "", null); //$NON-NLS-1$ - for (int i = 0; i < allStatus.length; i++) { - IStatus curr = allStatus[i]; - if (curr != null) { - if (curr.matches(IStatus.ERROR)) { - return curr; - } - if (max == null || curr.getSeverity() > max.getSeverity()) { - max = curr; - } - } - } - return max; - } - - protected IStatus validateInterpreterLocationText() { - File path = new File(interpreterLocationText.getText()); - if (path.exists()) { - File unix_php = new File(path, "php"); //$NON-NLS-1$ //$NON-NLS-2$ - File windows_php_exe = new File(path, "php.exe"); //$NON-NLS-1$ //$NON-NLS-2$ - if (unix_php.isFile() || windows_php_exe.isFile()) - return new Status(IStatus.OK, PHPDebugUiPlugin.PLUGIN_ID, 0, "", null); //$NON-NLS-1$ - } - - return new Status(IStatus.ERROR, PHPDebugUiPlugin.PLUGIN_ID, 1, PHPDebugUiMessages.getString("EditInterpreterDialog.PHPInterpreter.path.error"), null); //$NON-NLS-1$ - } - - protected void createNameEntryField(Composite composite) { - new Label(composite, SWT.NONE).setText(PHPDebugUiMessages.getString("EditInterpreterDialog.PHPInterpreter.name")); //$NON-NLS-1$ - - GridData gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL); - gridData.horizontalSpan = 2; - - interpreterNameText = new Text(composite, SWT.SINGLE | SWT.BORDER); - interpreterNameText.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e) { - allStatus[0] = validateInterpreterNameText(); - updateStatusLine(); - } - }); - interpreterNameText.setLayoutData(gridData); - } - - protected IStatus validateInterpreterNameText() { - int status = IStatus.OK; - String message = ""; //$NON-NLS-1$ - - if (interpreterNameText.getText() == null || interpreterNameText.getText().length() <= 0) { - status = IStatus.ERROR; - message = PHPDebugUiMessages.getString("EditInterpreterDialog.PHPInterpreter.name.error"); //$NON-NLS-1$ - } - - return new Status(status, PHPDebugUiPlugin.PLUGIN_ID, 0, message, null); - } - - protected void browseForInstallDir() { - DirectoryDialog dialog = new DirectoryDialog(getShell()); - dialog.setFilterPath(interpreterLocationText.getText()); - dialog.setMessage(PHPDebugUiMessages.getString("EditInterpreterDialog.PHPInterpreter.path.browse.message")); //$NON-NLS-1$ - String newPath = dialog.open(); - if (newPath != null) - interpreterLocationText.setText(newPath); - } - - protected void okPressed() { - if (interpreterToEdit == null) - interpreterToEdit = new PHPInterpreter(null, null); - - interpreterToEdit.setName(interpreterNameText.getText()); - interpreterToEdit.setInstallLocation(new Path(interpreterLocationText.getText())); - super.okPressed(); - } - protected Control createDialogArea(Composite parent) { - Composite composite = (Composite) super.createDialogArea(parent); - GridLayout layout = new GridLayout(); - layout.numColumns = 3; - composite.setLayout(layout); - - createNameEntryField(composite); - createLocationEntryField(composite); - - return composite; - } - -} \ No newline at end of file diff --git a/net.sourceforge.phpeclipse.debug.ui/src/net/sourceforge/phpdt/internal/debug/ui/preferences/PHPInterpreterLabelProvider.java b/net.sourceforge.phpeclipse.debug.ui/src/net/sourceforge/phpdt/internal/debug/ui/preferences/PHPInterpreterLabelProvider.java index 83131e7..84b52f9 100644 --- a/net.sourceforge.phpeclipse.debug.ui/src/net/sourceforge/phpdt/internal/debug/ui/preferences/PHPInterpreterLabelProvider.java +++ b/net.sourceforge.phpeclipse.debug.ui/src/net/sourceforge/phpdt/internal/debug/ui/preferences/PHPInterpreterLabelProvider.java @@ -2,7 +2,6 @@ package net.sourceforge.phpdt.internal.debug.ui.preferences; import net.sourceforge.phpdt.internal.launching.PHPInterpreter; -import org.eclipse.core.runtime.IPath; import org.eclipse.jface.viewers.ILabelProviderListener; import org.eclipse.jface.viewers.ITableLabelProvider; import org.eclipse.swt.graphics.Image; @@ -21,10 +20,10 @@ public class PHPInterpreterLabelProvider implements ITableLabelProvider { PHPInterpreter interpreter = (PHPInterpreter) element; switch (columnIndex) { case 0 : - return interpreter.getName(); - case 1 : - IPath installLocation = interpreter.getInstallLocation(); - return installLocation != null ? installLocation.toOSString() : "In user path"; + return interpreter.getInstallLocation().toString(); +// case 1 : +// IPath installLocation = interpreter.getInstallLocation(); +// return installLocation != null ? installLocation.toOSString() : "In user path"; default : return "Unknown Column Index"; } diff --git a/net.sourceforge.phpeclipse.debug.ui/src/net/sourceforge/phpdt/internal/debug/ui/preferences/PHPInterpreterPreferencePage.java b/net.sourceforge.phpeclipse.debug.ui/src/net/sourceforge/phpdt/internal/debug/ui/preferences/PHPInterpreterPreferencePage.java index 3cfe475..689b864 100644 --- a/net.sourceforge.phpeclipse.debug.ui/src/net/sourceforge/phpdt/internal/debug/ui/preferences/PHPInterpreterPreferencePage.java +++ b/net.sourceforge.phpeclipse.debug.ui/src/net/sourceforge/phpdt/internal/debug/ui/preferences/PHPInterpreterPreferencePage.java @@ -1,5 +1,6 @@ package net.sourceforge.phpdt.internal.debug.ui.preferences; +import java.io.File; import java.util.ArrayList; import java.util.List; @@ -7,6 +8,7 @@ import net.sourceforge.phpdt.internal.debug.ui.PHPDebugUiMessages; import net.sourceforge.phpdt.internal.launching.PHPInterpreter; import net.sourceforge.phpdt.internal.launching.PHPRuntime; +import org.eclipse.core.runtime.Platform; import org.eclipse.jface.preference.PreferencePage; import org.eclipse.jface.viewers.CheckStateChangedEvent; import org.eclipse.jface.viewers.CheckboxTableViewer; @@ -23,7 +25,9 @@ import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Event; +import org.eclipse.swt.widgets.FileDialog; import org.eclipse.swt.widgets.Listener; +import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.TableColumn; import org.eclipse.swt.widgets.TableItem; @@ -31,182 +35,218 @@ import org.eclipse.ui.IWorkbench; import org.eclipse.ui.IWorkbenchPreferencePage; public class PHPInterpreterPreferencePage extends PreferencePage implements IWorkbenchPreferencePage { - protected CheckboxTableViewer tableViewer; - protected Button addButton, editButton, removeButton; - - public PHPInterpreterPreferencePage() { - super(); - } - - public void init(IWorkbench workbench) {} - - protected Control createContents(Composite parent) { - noDefaultAndApplyButton(); - - Composite composite = createPageRoot(parent); - Table table = createInstalledInterpretersTable(composite); - createInstalledInterpretersTableViewer(table); - createButtonGroup(composite); - - tableViewer.setInput(PHPRuntime.getDefault().getInstalledInterpreters()); - PHPInterpreter selectedInterpreter = PHPRuntime.getDefault().getSelectedInterpreter(); - if (selectedInterpreter != null) - tableViewer.setChecked(selectedInterpreter, true); - - enableButtons(); - - return composite; - } - - protected void createButtonGroup(Composite composite) { - Composite buttons = new Composite(composite, SWT.NULL); - buttons.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING)); - GridLayout layout = new GridLayout(); - layout.marginHeight = 0; - layout.marginWidth = 0; - buttons.setLayout(layout); - - addButton = new Button(buttons, SWT.PUSH); - addButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - addButton.setText(PHPDebugUiMessages.getString("PHPInterpreterPreferencePage.addButton.label")); //$NON-NLS-1$ - addButton.addListener(SWT.Selection, new Listener() { - public void handleEvent(Event evt) { - addInterpreter(); - } - }); - - editButton = new Button(buttons, SWT.PUSH); - editButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - editButton.setText(PHPDebugUiMessages.getString("PHPInterpreterPreferencePage.editButton.label")); //$NON-NLS-1$ - editButton.addListener(SWT.Selection, new Listener() { - public void handleEvent(Event evt) { - editInterpreter(); - } - }); - - removeButton = new Button(buttons, SWT.PUSH); - removeButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - removeButton.setText(PHPDebugUiMessages.getString("PHPInterpreterPreferencePage.removeButton.label")); //$NON-NLS-1$ - removeButton.addListener(SWT.Selection, new Listener() { - public void handleEvent(Event evt) { - removeInterpreter(); - } - }); - } - - protected void createInstalledInterpretersTableViewer(Table table) { - tableViewer = new CheckboxTableViewer(table); - - tableViewer.setLabelProvider(new PHPInterpreterLabelProvider()); - tableViewer.setContentProvider(new PHPInterpreterContentProvider()); - - tableViewer.addSelectionChangedListener(new ISelectionChangedListener() { - public void selectionChanged(SelectionChangedEvent evt) { - enableButtons(); - } - }); - - tableViewer.addCheckStateListener(new ICheckStateListener() { - public void checkStateChanged(CheckStateChangedEvent event) { - updateSelectedInterpreter(event.getElement()); - } - }); - - tableViewer.addDoubleClickListener(new IDoubleClickListener() { - public void doubleClick(DoubleClickEvent e) { - editInterpreter(); - } - }); - } - - protected Table createInstalledInterpretersTable(Composite composite) { - Table table = new Table(composite, SWT.CHECK | SWT.BORDER | SWT.FULL_SELECTION); - - GridData data = new GridData(GridData.FILL_BOTH); - data.widthHint = convertWidthInCharsToPixels(80); - data.heightHint = convertHeightInCharsToPixels(10); - table.setLayoutData(data); - table.setHeaderVisible(true); - table.setLinesVisible(false); - - TableColumn column = new TableColumn(table, SWT.NULL); - column.setText(PHPDebugUiMessages.getString("PHPInterpreterPreferencePage.PHPInterpreterTable.interpreterName")); //$NON-NLS-1$ - column.setWidth(125); - - column = new TableColumn(table, SWT.NULL); - column.setText(PHPDebugUiMessages.getString("PHPInterpreterPreferencePage.PHPInterpreterTable.interpreterPath")); //$NON-NLS-1$ - column.setWidth(350); - - return table; - } - - protected Composite createPageRoot(Composite parent) { - Composite composite = new Composite(parent, SWT.NULL); - GridLayout layout = new GridLayout(); - layout.numColumns = 2; - composite.setLayout(layout); - return composite; - } - - protected void addInterpreter() { - PHPInterpreter newInterpreter = new PHPInterpreter(null, null); - EditInterpreterDialog editor = new EditInterpreterDialog(getShell(), PHPDebugUiMessages.getString("PHPInterpreterPreferencePage.EditInterpreterDialog.addInterpreter.title")); //$NON-NLS-1$ - editor.create(); - editor.setInterpreterToEdit(newInterpreter); - if (EditInterpreterDialog.OK == editor.open()) - tableViewer.add(newInterpreter); - } - - protected void removeInterpreter() { - tableViewer.remove(getSelectedInterpreter()); - } - - protected void enableButtons() { - if (getSelectedInterpreter() != null) { - editButton.setEnabled(true); - removeButton.setEnabled(true); - } else { - editButton.setEnabled(false); - removeButton.setEnabled(false); - } - } - - protected void updateSelectedInterpreter(Object interpreter) { - Object[] checkedElements = tableViewer.getCheckedElements(); - for (int i = 0; i < checkedElements.length; i++) { - tableViewer.setChecked(checkedElements[i], false); - } - - tableViewer.setChecked(interpreter, true); - } - - protected void editInterpreter() { - EditInterpreterDialog editor = new EditInterpreterDialog(getShell(), PHPDebugUiMessages.getString("PHPInterpreterPreferencePage.EditInterpreterDialog.editInterpreter.title")); //$NON-NLS-1$ - editor.create(); - - PHPInterpreter anInterpreter = getSelectedInterpreter(); - editor.setInterpreterToEdit(anInterpreter); - if (EditInterpreterDialog.OK == editor.open()) - tableViewer.update(anInterpreter, null); - } - - protected PHPInterpreter getSelectedInterpreter() { - IStructuredSelection selection = (IStructuredSelection) tableViewer.getSelection(); - return (PHPInterpreter) selection.getFirstElement(); - } - - public boolean performOk() { - TableItem[] tableItems = tableViewer.getTable().getItems(); - List installedInterpreters = new ArrayList(tableItems.length); - for (int i = 0; i < tableItems.length; i++) - installedInterpreters.add(tableItems[i].getData()); - PHPRuntime.getDefault().setInstalledInterpreters(installedInterpreters); - - Object[] checkedElements = tableViewer.getCheckedElements(); - if (checkedElements.length > 0) - PHPRuntime.getDefault().setSelectedInterpreter((PHPInterpreter) checkedElements[0]); - - return super.performOk(); - } - + protected CheckboxTableViewer tableViewer; + + protected Button addButton, editButton, removeButton; + + public PHPInterpreterPreferencePage() { + super(); + } + + public void init(IWorkbench workbench) { + } + + protected Control createContents(Composite parent) { + noDefaultAndApplyButton(); + + Composite composite = createPageRoot(parent); + Table table = createInstalledInterpretersTable(composite); + createInstalledInterpretersTableViewer(table); + createButtonGroup(composite); + + tableViewer.setInput(PHPRuntime.getDefault().getInstalledInterpreters()); + PHPInterpreter selectedInterpreter = PHPRuntime.getDefault().getSelectedInterpreter(); + if (selectedInterpreter != null) + tableViewer.setChecked(selectedInterpreter, true); + + enableButtons(); + + return composite; + } + + protected void createButtonGroup(Composite composite) { + Composite buttons = new Composite(composite, SWT.NULL); + buttons.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING)); + GridLayout layout = new GridLayout(); + layout.marginHeight = 0; + layout.marginWidth = 0; + buttons.setLayout(layout); + + addButton = new Button(buttons, SWT.PUSH); + addButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + addButton.setText(PHPDebugUiMessages.getString("PHPInterpreterPreferencePage.addButton.label")); //$NON-NLS-1$ + addButton.addListener(SWT.Selection, new Listener() { + public void handleEvent(Event evt) { + addInterpreter(); + } + }); + + editButton = new Button(buttons, SWT.PUSH); + editButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + editButton.setText(PHPDebugUiMessages.getString("PHPInterpreterPreferencePage.editButton.label")); //$NON-NLS-1$ + editButton.addListener(SWT.Selection, new Listener() { + public void handleEvent(Event evt) { + editInterpreter(); + } + }); + + removeButton = new Button(buttons, SWT.PUSH); + removeButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + removeButton.setText(PHPDebugUiMessages.getString("PHPInterpreterPreferencePage.removeButton.label")); //$NON-NLS-1$ + removeButton.addListener(SWT.Selection, new Listener() { + public void handleEvent(Event evt) { + removeInterpreter(); + } + }); + } + + protected void createInstalledInterpretersTableViewer(Table table) { + tableViewer = new CheckboxTableViewer(table); + + tableViewer.setLabelProvider(new PHPInterpreterLabelProvider()); + tableViewer.setContentProvider(new PHPInterpreterContentProvider()); + + tableViewer.addSelectionChangedListener(new ISelectionChangedListener() { + public void selectionChanged(SelectionChangedEvent evt) { + enableButtons(); + } + }); + + tableViewer.addCheckStateListener(new ICheckStateListener() { + public void checkStateChanged(CheckStateChangedEvent event) { + updateSelectedInterpreter(event.getElement()); + } + }); + + tableViewer.addDoubleClickListener(new IDoubleClickListener() { + public void doubleClick(DoubleClickEvent e) { + editInterpreter(); + } + }); + } + + protected Table createInstalledInterpretersTable(Composite composite) { + Table table = new Table(composite, SWT.CHECK | SWT.BORDER | SWT.FULL_SELECTION); + + GridData data = new GridData(GridData.FILL_BOTH); + data.widthHint = convertWidthInCharsToPixels(80); + data.heightHint = convertHeightInCharsToPixels(10); + table.setLayoutData(data); + table.setHeaderVisible(true); + table.setLinesVisible(false); + + TableColumn column = new TableColumn(table, SWT.NULL); + column.setText(PHPDebugUiMessages.getString("PHPInterpreterPreferencePage.PHPInterpreterTable.interpreterPath")); //$NON-NLS-1$ + column.setWidth(400); + + // column = new TableColumn(table, SWT.NULL); + // column.setText(PHPDebugUiMessages.getString("PHPInterpreterPreferencePage.PHPInterpreterTable.interpreterPath")); + // //$NON-NLS-1$ + // column.setWidth(350); + + return table; + } + + protected Composite createPageRoot(Composite parent) { + Composite composite = new Composite(parent, SWT.NULL); + GridLayout layout = new GridLayout(); + layout.numColumns = 2; + composite.setLayout(layout); + return composite; + } + + protected void addInterpreter() { + PHPInterpreter newInterpreter = new PHPInterpreter(null); + File phpRuntime = getFile(getShell(), null); + if (phpRuntime != null) { + newInterpreter.setInstallLocation(phpRuntime); + tableViewer.add(newInterpreter); + } + } + + protected void removeInterpreter() { + tableViewer.remove(getSelectedInterpreter()); + } + + protected void enableButtons() { + if (getSelectedInterpreter() != null) { + editButton.setEnabled(true); + removeButton.setEnabled(true); + } else { + editButton.setEnabled(false); + removeButton.setEnabled(false); + } + } + + protected void updateSelectedInterpreter(Object interpreter) { + Object[] checkedElements = tableViewer.getCheckedElements(); + for (int i = 0; i < checkedElements.length; i++) { + tableViewer.setChecked(checkedElements[i], false); + } + + tableViewer.setChecked(interpreter, true); + } + + protected void editInterpreter() { + PHPInterpreter anInterpreter = getSelectedInterpreter(); + File phpRuntime = anInterpreter.getInstallLocation(); + if (phpRuntime != null) { + File parent = phpRuntime.getParentFile(); + phpRuntime = getFile(getShell(), parent); + } else { + phpRuntime = getFile(getShell(), null); + } + if (phpRuntime != null) { + anInterpreter.setInstallLocation(phpRuntime); + tableViewer.update(anInterpreter, null); + } + + } + + protected PHPInterpreter getSelectedInterpreter() { + IStructuredSelection selection = (IStructuredSelection) tableViewer.getSelection(); + return (PHPInterpreter) selection.getFirstElement(); + } + + public boolean performOk() { + TableItem[] tableItems = tableViewer.getTable().getItems(); + List installedInterpreters = new ArrayList(tableItems.length); + for (int i = 0; i < tableItems.length; i++) + installedInterpreters.add(tableItems[i].getData()); + PHPRuntime.getDefault().setInstalledInterpreters(installedInterpreters); + + Object[] checkedElements = tableViewer.getCheckedElements(); + if (checkedElements.length > 0) + PHPRuntime.getDefault().setSelectedInterpreter((PHPInterpreter) checkedElements[0]); + + return super.performOk(); + } + + /** + * Helper to open the file chooser dialog. + * + * @param startingDirectory + * the directory to open the dialog on. + * @return File The File the user selected or null if they do not. + */ + public static File getFile(Shell shell, File startingDirectory) { + + FileDialog dialog = new FileDialog(shell, SWT.OPEN); + if (startingDirectory != null) { + dialog.setFileName(startingDirectory.getPath()); + } + String operatingSystem = Platform.getOS(); + if (operatingSystem.equals(Platform.OS_WIN32)) { + String[] extensions = { "*.exe" }; + dialog.setFilterExtensions(extensions); + } + String file = dialog.open(); + if (file != null) { + file = file.trim(); + if (file.length() > 0) + return new File(file); + } + + return null; + } } \ No newline at end of file diff --git a/net.sourceforge.phpeclipse.launching/plugin.xml b/net.sourceforge.phpeclipse.launching/plugin.xml index 9a5b6ad..900019a 100644 --- a/net.sourceforge.phpeclipse.launching/plugin.xml +++ b/net.sourceforge.phpeclipse.launching/plugin.xml @@ -19,6 +19,8 @@ + + @@ -60,5 +62,14 @@
- + + + + + + \ No newline at end of file diff --git a/net.sourceforge.phpeclipse.launching/src/net/sourceforge/phpdt/internal/launching/ConsoleLineTracker.java b/net.sourceforge.phpeclipse.launching/src/net/sourceforge/phpdt/internal/launching/ConsoleLineTracker.java new file mode 100644 index 0000000..e1cf774 --- /dev/null +++ b/net.sourceforge.phpeclipse.launching/src/net/sourceforge/phpdt/internal/launching/ConsoleLineTracker.java @@ -0,0 +1,144 @@ +package net.sourceforge.phpdt.internal.launching; + +import net.sourceforge.phpdt.core.JavaModelException; +import net.sourceforge.phpeclipse.phpeditor.EditorUtility; + +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.Path; +import org.eclipse.debug.ui.console.IConsole; +import org.eclipse.debug.ui.console.IConsoleHyperlink; +import org.eclipse.debug.ui.console.IConsoleLineTracker; +import org.eclipse.jface.text.BadLocationException; +import org.eclipse.jface.text.IDocument; +import org.eclipse.jface.text.IRegion; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.texteditor.ITextEditor; + + +public class ConsoleLineTracker implements IConsoleLineTracker { + + private static class JavadocConsoleHyperLink implements IConsoleHyperlink { + + private IPath fExternalPath; + private int fLineNumber; + + public JavadocConsoleHyperLink(IPath externalPath, int lineNumber) { + fExternalPath= externalPath; + fLineNumber= lineNumber; + } + + /* (non-Javadoc) + * @see org.eclipse.debug.ui.console.IConsoleHyperlink#linkEntered() + */ + public void linkEntered() { + } + + /* (non-Javadoc) + * @see org.eclipse.debug.ui.console.IConsoleHyperlink#linkExited() + */ + public void linkExited() { + } + + /* (non-Javadoc) + * @see org.eclipse.debug.ui.console.IConsoleHyperlink#linkActivated() + */ + public void linkActivated() { + try { + IFile[] files= ResourcesPlugin.getWorkspace().getRoot().findFilesForLocation(fExternalPath); + if (files.length > 0) { + for (int i = 0; i < files.length; i++) { + IFile curr= files[0]; + IEditorPart part= EditorUtility.openInEditor(curr, true); + if (part != null) { + if (part instanceof ITextEditor) { + revealLine((ITextEditor) part, fLineNumber); + } + return; + } + } + } + } catch (BadLocationException e) { + PHPLaunchingPlugin.log(e); + } catch (PartInitException e) { + PHPLaunchingPlugin.log(e); + } catch (JavaModelException e) { + PHPLaunchingPlugin.log(e); + } + } + + private void revealLine(ITextEditor editor, int lineNumber) throws BadLocationException { + IDocument document= editor.getDocumentProvider().getDocument(editor.getEditorInput()); + IRegion region= document.getLineInformation(lineNumber - 1); + editor.selectAndReveal(region.getOffset(), 0); + } + + } + + + private IConsole fConsole; + + public ConsoleLineTracker() { + super(); + } + + /* (non-Javadoc) + * @see org.eclipse.debug.ui.console.IConsoleLineTracker#init(org.eclipse.debug.ui.console.IConsole) + */ + public void init(IConsole console) { + fConsole= console; + } + + /* (non-Javadoc) + * @see org.eclipse.debug.ui.console.IConsoleLineTracker#lineAppended(org.eclipse.jface.text.IRegion) + */ + public void lineAppended(IRegion line) { + try { + int offset = line.getOffset(); + int length = line.getLength(); + String text = fConsole.getDocument().get(offset, length); + + int index1= text.indexOf(':'); + if (index1 == -1) { + return; + } + + int lineNumber= -1; + IPath path= null; + int index2= text.indexOf(':', index1 + 1); + while ((index2 != -1) && (path == null)) { + if (index1 < index2) { + try { + String substr= text.substring(index1 + 1, index2); + lineNumber= Integer.parseInt(substr); + path= new Path(text.substring(0, index1)); + } catch (NumberFormatException e) { + // ignore + } + } + index1= index2; + index2= text.indexOf(':', index1 + 1); + } + + if (lineNumber != -1) { + JavadocConsoleHyperLink link= new JavadocConsoleHyperLink(path, lineNumber); + fConsole.addLink(link, line.getOffset(), index1); + + } + } catch (BadLocationException e) { + // ignore + } + } + + + + /* (non-Javadoc) + * @see org.eclipse.debug.ui.console.IConsoleLineTracker#dispose() + */ + public void dispose() { + fConsole = null; + } + +} diff --git a/net.sourceforge.phpeclipse.launching/src/net/sourceforge/phpdt/internal/launching/InterpreterRunner.java b/net.sourceforge.phpeclipse.launching/src/net/sourceforge/phpdt/internal/launching/InterpreterRunner.java index a3be7fa..ee56530 100644 --- a/net.sourceforge.phpeclipse.launching/src/net/sourceforge/phpdt/internal/launching/InterpreterRunner.java +++ b/net.sourceforge.phpeclipse.launching/src/net/sourceforge/phpdt/internal/launching/InterpreterRunner.java @@ -13,6 +13,8 @@ import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Platform; import org.eclipse.debug.core.DebugPlugin; import org.eclipse.debug.core.ILaunch; +import org.eclipse.debug.core.ILaunchManager; +import org.eclipse.debug.core.Launch; import org.eclipse.debug.core.model.IProcess; public class InterpreterRunner { @@ -35,7 +37,8 @@ public class InterpreterRunner { IProcess process = DebugPlugin.newProcess(launch, nativePHPProcess, renderLabel(configuration)); process.setAttribute(PHPLaunchingPlugin.PLUGIN_ID + ".launcher.cmdline", commandLine); - + process.setAttribute(IProcess.ATTR_PROCESS_TYPE, PHPLaunchConfigurationAttribute.PHP_LAUNCH_PROCESS_TYPE); + return process ; } diff --git a/net.sourceforge.phpeclipse.launching/src/net/sourceforge/phpdt/internal/launching/PHPInterpreter.java b/net.sourceforge.phpeclipse.launching/src/net/sourceforge/phpdt/internal/launching/PHPInterpreter.java index 151d5f0..f8b5ac1 100644 --- a/net.sourceforge.phpeclipse.launching/src/net/sourceforge/phpdt/internal/launching/PHPInterpreter.java +++ b/net.sourceforge.phpeclipse.launching/src/net/sourceforge/phpdt/internal/launching/PHPInterpreter.java @@ -1,59 +1,98 @@ package net.sourceforge.phpdt.internal.launching; import java.io.File; +import java.io.FileWriter; import java.io.IOException; +import java.util.ArrayList; -import org.eclipse.core.runtime.IPath; +import net.sourceforge.phpdt.internal.ui.phpdocexport.JavadocExportMessages; +import net.sourceforge.phpdt.internal.ui.util.ExceptionHandler; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.debug.core.DebugPlugin; +import org.eclipse.debug.core.IDebugEventSetListener; +import org.eclipse.debug.core.ILaunch; +import org.eclipse.debug.core.ILaunchConfigurationType; +import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; +import org.eclipse.debug.core.ILaunchManager; +import org.eclipse.debug.core.Launch; +import org.eclipse.debug.core.model.IProcess; +import org.eclipse.debug.ui.IDebugUIConstants; public class PHPInterpreter { - //public final String endOfOptionsDelimeter = " -- "; - - protected IPath installLocation; - protected String name; - - public PHPInterpreter(String aName, IPath validInstallLocation) { - name = aName; - installLocation = validInstallLocation; - } - - public IPath getInstallLocation() { - return installLocation; - } - - public void setInstallLocation(IPath validInstallLocation) { - installLocation = validInstallLocation; - } - - public String getName() { - return name; - } - - public void setName(String newName) { - name = newName; - } - - public String getCommand() { - String directory = installLocation.toOSString() + File.separator; - if (new File(directory + "php.exe").isFile()) - return directory + "php.exe"; - - if (new File(directory, "php").isFile()) - return directory + "php"; - - return null; - } - - public Process exec(String arguments, File workingDirectory, String[] env) throws IOException { - return Runtime.getRuntime().exec(this.getCommand() + " " + arguments, env, workingDirectory); - } - - public boolean equals(Object other) { - if (other instanceof PHPInterpreter) { - PHPInterpreter otherInterpreter = (PHPInterpreter) other; - if (name.equals(otherInterpreter.getName())) - return installLocation.equals(otherInterpreter.getInstallLocation()); - } - - return false; - } -} + + protected File installLocation; + + public PHPInterpreter(File interpreter) { + installLocation = interpreter; + } + + public File getInstallLocation() { + return installLocation; + } + + public void setInstallLocation(File interpreter) { + installLocation = interpreter; + } + + public String getCommand() { + return installLocation.toString(); + } + + private boolean executePHPProcess(String arguments, File workingDirectory, String[] env) { + Process process = null; + try { + StringBuffer buf = new StringBuffer(); + buf.append(getCommand() + " " + arguments); + process = Runtime.getRuntime().exec(buf.toString(), env, workingDirectory); + if (process != null) { + // construct a formatted command line for the process properties + + // for (int i= 0; i < args.length; i++) { + // buf.append(args[i]); + // buf.append(' '); + // } + + ILaunchConfigurationWorkingCopy wc = null; + try { + ILaunchConfigurationType lcType = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationType( + PHPLaunchConfigurationAttribute.PHP_LAUNCH_CONFIGURATION_TYPE); + String name = "PHP Launcher"; //$NON-NLS-1$ + wc = lcType.newInstance(null, name); + wc.setAttribute(IDebugUIConstants.ATTR_FAVORITE_GROUPS, true); + + ILaunch newLaunch = new Launch(wc, ILaunchManager.RUN_MODE, null); + IProcess iprocess = DebugPlugin.newProcess(newLaunch, process, "PHP Process"); //$NON-NLS-1$ + iprocess.setAttribute(IProcess.ATTR_CMDLINE, buf.toString()); + iprocess.setAttribute(IProcess.ATTR_PROCESS_TYPE, PHPLaunchConfigurationAttribute.PHP_LAUNCH_PROCESS_TYPE); + + DebugPlugin.getDefault().getLaunchManager().addLaunch(newLaunch); + + } catch (CoreException e) { + } + + return true; + + } + } catch (IOException e) { + return false; + } + return false; + + } + + public Process exec(String arguments, File workingDirectory, String[] env) throws IOException { + return Runtime.getRuntime().exec(getCommand() + " " + arguments, env, workingDirectory); + // executePHPProcess(arguments, workingDirectory, env); + } + + public boolean equals(Object other) { + if (other instanceof PHPInterpreter) { + PHPInterpreter otherInterpreter = (PHPInterpreter) other; + return installLocation.equals(otherInterpreter.getInstallLocation()); + } + return false; + } +} \ No newline at end of file diff --git a/net.sourceforge.phpeclipse.launching/src/net/sourceforge/phpdt/internal/launching/PHPLaunchConfigurationAttribute.java b/net.sourceforge.phpeclipse.launching/src/net/sourceforge/phpdt/internal/launching/PHPLaunchConfigurationAttribute.java index cd05cf3..5cc70dc 100644 --- a/net.sourceforge.phpeclipse.launching/src/net/sourceforge/phpdt/internal/launching/PHPLaunchConfigurationAttribute.java +++ b/net.sourceforge.phpeclipse.launching/src/net/sourceforge/phpdt/internal/launching/PHPLaunchConfigurationAttribute.java @@ -4,6 +4,7 @@ package net.sourceforge.phpdt.internal.launching; public interface PHPLaunchConfigurationAttribute { static final String PHP_LAUNCH_CONFIGURATION_TYPE = "net.sourceforge.phpdt.launching.LaunchConfigurationTypePHPApplication"; + static final String PHP_LAUNCH_PROCESS_TYPE = "net.sourceforge.phpdt.launching.processType"; static final String CUSTOM_LOAD_PATH = PHPLaunchingPlugin.PLUGIN_ID + ".CUSTOM_LOAD_PATH"; static final String FILE_NAME = PHPLaunchingPlugin.PLUGIN_ID + ".FILE_NAME"; diff --git a/net.sourceforge.phpeclipse.launching/src/net/sourceforge/phpdt/internal/launching/PHPRuntime.java b/net.sourceforge.phpeclipse.launching/src/net/sourceforge/phpdt/internal/launching/PHPRuntime.java index f454e62..0613535 100644 --- a/net.sourceforge.phpeclipse.launching/src/net/sourceforge/phpdt/internal/launching/PHPRuntime.java +++ b/net.sourceforge.phpeclipse.launching/src/net/sourceforge/phpdt/internal/launching/PHPRuntime.java @@ -49,11 +49,11 @@ public class PHPRuntime { return selectedInterpreter; } - public PHPInterpreter getInterpreter(String name) { + public PHPInterpreter getInterpreter(String installLocation) { Iterator interpreters = getInstalledInterpreters().iterator(); while(interpreters.hasNext()) { PHPInterpreter each = (PHPInterpreter) interpreters.next(); - if (each.getName().equals(name)) + if (each.getInstallLocation().toString().equals(installLocation)) return each; } @@ -129,7 +129,7 @@ public class PHPRuntime { writer.write(" Date: Fri, 24 Jun 2005 21:23:49 +0000 Subject: [PATCH 16/16] Tried to implement ConsoleLineTracker (see plugin.xml) for PHP stack traces in the console Doesn't work at the moment. --- .../phpdt/internal/launching/PHPInterpreter.java | 82 ++++++++++---------- 1 files changed, 41 insertions(+), 41 deletions(-) diff --git a/net.sourceforge.phpeclipse.launching/src/net/sourceforge/phpdt/internal/launching/PHPInterpreter.java b/net.sourceforge.phpeclipse.launching/src/net/sourceforge/phpdt/internal/launching/PHPInterpreter.java index f8b5ac1..acbbf91 100644 --- a/net.sourceforge.phpeclipse.launching/src/net/sourceforge/phpdt/internal/launching/PHPInterpreter.java +++ b/net.sourceforge.phpeclipse.launching/src/net/sourceforge/phpdt/internal/launching/PHPInterpreter.java @@ -41,47 +41,47 @@ public class PHPInterpreter { return installLocation.toString(); } - private boolean executePHPProcess(String arguments, File workingDirectory, String[] env) { - Process process = null; - try { - StringBuffer buf = new StringBuffer(); - buf.append(getCommand() + " " + arguments); - process = Runtime.getRuntime().exec(buf.toString(), env, workingDirectory); - if (process != null) { - // construct a formatted command line for the process properties - - // for (int i= 0; i < args.length; i++) { - // buf.append(args[i]); - // buf.append(' '); - // } - - ILaunchConfigurationWorkingCopy wc = null; - try { - ILaunchConfigurationType lcType = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationType( - PHPLaunchConfigurationAttribute.PHP_LAUNCH_CONFIGURATION_TYPE); - String name = "PHP Launcher"; //$NON-NLS-1$ - wc = lcType.newInstance(null, name); - wc.setAttribute(IDebugUIConstants.ATTR_FAVORITE_GROUPS, true); - - ILaunch newLaunch = new Launch(wc, ILaunchManager.RUN_MODE, null); - IProcess iprocess = DebugPlugin.newProcess(newLaunch, process, "PHP Process"); //$NON-NLS-1$ - iprocess.setAttribute(IProcess.ATTR_CMDLINE, buf.toString()); - iprocess.setAttribute(IProcess.ATTR_PROCESS_TYPE, PHPLaunchConfigurationAttribute.PHP_LAUNCH_PROCESS_TYPE); - - DebugPlugin.getDefault().getLaunchManager().addLaunch(newLaunch); - - } catch (CoreException e) { - } - - return true; - - } - } catch (IOException e) { - return false; - } - return false; - - } +// private boolean executePHPProcess(String arguments, File workingDirectory, String[] env) { +// Process process = null; +// try { +// StringBuffer buf = new StringBuffer(); +// buf.append(getCommand() + " " + arguments); +// process = Runtime.getRuntime().exec(buf.toString(), env, workingDirectory); +// if (process != null) { +// // construct a formatted command line for the process properties +// +// // for (int i= 0; i < args.length; i++) { +// // buf.append(args[i]); +// // buf.append(' '); +// // } +// +// ILaunchConfigurationWorkingCopy wc = null; +// try { +// ILaunchConfigurationType lcType = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationType( +// PHPLaunchConfigurationAttribute.PHP_LAUNCH_CONFIGURATION_TYPE); +// String name = "PHP Launcher"; //$NON-NLS-1$ +// wc = lcType.newInstance(null, name); +// wc.setAttribute(IDebugUIConstants.ATTR_FAVORITE_GROUPS, true); +// +// ILaunch newLaunch = new Launch(wc, ILaunchManager.RUN_MODE, null); +// IProcess iprocess = DebugPlugin.newProcess(newLaunch, process, "PHP Process"); //$NON-NLS-1$ +// iprocess.setAttribute(IProcess.ATTR_CMDLINE, buf.toString()); +// iprocess.setAttribute(IProcess.ATTR_PROCESS_TYPE, PHPLaunchConfigurationAttribute.PHP_LAUNCH_PROCESS_TYPE); +// +// DebugPlugin.getDefault().getLaunchManager().addLaunch(newLaunch); +// +// } catch (CoreException e) { +// } +// +// return true; +// +// } +// } catch (IOException e) { +// return false; +// } +// return false; +// +// } public Process exec(String arguments, File workingDirectory, String[] env) throws IOException { return Runtime.getRuntime().exec(getCommand() + " " + arguments, env, workingDirectory); -- 1.7.1