public String getText(String varTag, String varValue, ExpandVariableContext context) {
IPreferenceStore store = PHPeclipsePlugin.getDefault().getPreferenceStore();
- return store.getString(PHPeclipsePlugin.LOCALHOST_PREF);
+ return store.getString(PHPeclipsePlugin.PHP_LOCALHOST_PREF);
}
}
IPreferenceStore store = PHPeclipsePlugin.getDefault().getPreferenceStore();
String localhostURL = path.toString();
String lowerCaseFileName = localhostURL.toLowerCase();
- String documentRoot = store.getString(PHPeclipsePlugin.DOCUMENTROOT_PREF);
+ String documentRoot = store.getString(PHPeclipsePlugin.PHP_DOCUMENTROOT_PREF);
documentRoot = documentRoot.replace('\\', '/');
documentRoot = documentRoot.toLowerCase();
if (lowerCaseFileName.startsWith(documentRoot)) {
localhostURL = localhostURL.substring(documentRoot.length());
- localhostURL = store.getString(PHPeclipsePlugin.LOCALHOST_PREF)+ localhostURL;
+ localhostURL = store.getString(PHPeclipsePlugin.PHP_LOCALHOST_PREF)+ localhostURL;
}
return localhostURL;
}
*/
public static final String EDITOR_ITALIC_SUFFIX= "_italic"; //$NON-NLS-1$
- public static final String LOCALHOST_PREF = "_localhost";
- public static final String DOCUMENTROOT_PREF = "_documentroot";
+// public static final String LOCALHOST_PREF = "_localhost";
+// public static final String DOCUMENTROOT_PREF = "_documentroot";
public static final String USE_EXTERNAL_BROWSER_PREF = "_use_external_browser";
// public static final String SHOW_EXTERNAL_PREVIEW_PREF = "_show_external_preview";
public static final String EXTERNAL_BROWSER_PREF = "_external_browser";
public static final String PHP_OBFUSCATOR_DEFAULT = "_php_obfuscator_default";
public static final String PHP_BOOKMARK_DEFAULT = "_php_bookmark_default";
+ public static final String PHP_LOCALHOST_PREF = "_php_localhost";
+ public static final String PHP_DOCUMENTROOT_PREF = "_php_documentroot";
public static final String PHP_AUTO_PREVIEW_DEFAULT = "_auto_preview";
public static final String PHP_BRING_TO_TOP_PREVIEW_DEFAULT = "_bring_to_top_preview";
// private ArrayList TextBoxes = new ArrayList();
// private ArrayList RadioButtons = new ArrayList();
- StringFieldEditor localHostSFE;
- DirectoryFieldEditor documentRootDFE;
+// StringFieldEditor localHostSFE;
+// DirectoryFieldEditor documentRootDFE;
// BooleanFieldEditor showExternalPreviewBFE;
BooleanFieldEditor externalBrowserBFE;
StringFieldEditor externalBrowserSFE;
public void init(IWorkbench workbench) {
}
protected void performDefaults() {
- localHostSFE.loadDefault();
- documentRootDFE.loadDefault();
+// localHostSFE.loadDefault();
+// documentRootDFE.loadDefault();
// showExternalPreviewBFE.loadDefault();
externalBrowserBFE.loadDefault();
externalBrowserSFE.loadDefault();
}
public boolean performOk() {
- localHostSFE.store();
- documentRootDFE.store();
+// localHostSFE.store();
+// documentRootDFE.store();
// showExternalPreviewBFE.store();
externalBrowserBFE.store();
externalBrowserSFE.store();
externalBrowserSFE.load();
new Label(webSettingsGroup, SWT.NONE);
- localHostSFE =
- new StringFieldEditor(
- IPreferenceConstants.LOCALHOST_PREF,
- PHPPreferencesMessages.getString("PHPBasePreferencePage.websettingsGroup.localhost"),
- webSettingsGroup);
- localHostSFE.setPreferencePage(this);
- localHostSFE.setPreferenceStore(getPreferenceStore());
- localHostSFE.load();
+// localHostSFE =
+// new StringFieldEditor(
+// IPreferenceConstants.LOCALHOST_PREF,
+// PHPPreferencesMessages.getString("PHPBasePreferencePage.websettingsGroup.localhost"),
+// webSettingsGroup);
+// localHostSFE.setPreferencePage(this);
+// localHostSFE.setPreferenceStore(getPreferenceStore());
+// localHostSFE.load();
new Label(webSettingsGroup, SWT.NONE);
- documentRootDFE =
- new DirectoryFieldEditor(
- IPreferenceConstants.DOCUMENTROOT_PREF,
- PHPPreferencesMessages.getString("PHPBasePreferencePage.websettingsGroup.docroot"),
- webSettingsGroup);
- documentRootDFE.setPreferencePage(this);
- documentRootDFE.setPreferenceStore(getPreferenceStore());
- documentRootDFE.load();
+// documentRootDFE =
+// new DirectoryFieldEditor(
+// IPreferenceConstants.DOCUMENTROOT_PREF,
+// PHPPreferencesMessages.getString("PHPBasePreferencePage.websettingsGroup.docroot"),
+// webSettingsGroup);
+// documentRootDFE.setPreferencePage(this);
+// documentRootDFE.setPreferenceStore(getPreferenceStore());
+// documentRootDFE.load();
//Create apache
Composite apacheSettingsComposite = new Composite(composite, SWT.NULL);
apacheSettingsComposite.setLayout(new GridLayout());
// }
protected void initializeDefaultPreferences(IPreferenceStore store) {
// windows preferences:
- store.setDefault(LOCALHOST_PREF, "http://localhost");
+// store.setDefault(LOCALHOST_PREF, "http://localhost");
+// store.setDefault(DOCUMENTROOT_PREF, getWorkspace().getRoot().getLocation().toString());
+ store.setDefault(PHP_LOCALHOST_PREF, "http://localhost");
+ store.setDefault(PHP_DOCUMENTROOT_PREF, getWorkspace().getRoot().getLocation().toString());
+
// store.setDefault(SHOW_EXTERNAL_PREVIEW_PREF, "true");
store.setDefault(USE_EXTERNAL_BROWSER_PREF, "false");
store.setDefault(SHOW_OUTPUT_IN_CONSOLE, "true");
store.setDefault(PHP_OBFUSCATOR_DEFAULT, "/tmp");
store.setDefault(EXTERNAL_BROWSER_PREF, "netscape {0}");
}
- store.setDefault(DOCUMENTROOT_PREF, getWorkspace().getRoot().getLocation()
- .toString());
// if ((jvm == WINDOWS_9x) || (jvm == WINDOWS_NT)) {
//
if (windowsSystem.equals(Platform.WS_WIN32)) {
// private final PHPOpenAllIncludesEditorAction fOpenAllIncludesAction;
private IProject fProject;
private IFileEditorInput fEditorInput;
- HashSet fSet;
+ private HashSet fSet;
public IncludesScanner(IProject project, IFileEditorInput editorInput) {
fProject = project;
// fOpenAllIncludesAction = action;
try {
if (fileToParse.exists()) {
- addInputStream(new BufferedInputStream(fileToParse.getContents()), fileToParse.getFullPath().toString());
+ addInputStream(new BufferedInputStream(fileToParse.getContents()), fileToParse.getProjectRelativePath().toString());
}
} catch (CoreException e1) {
e1.printStackTrace();
import java.net.URL;
import java.text.MessageFormat;
import java.util.Iterator;
+
+import net.sourceforge.phpeclipse.IPreferenceConstants;
import net.sourceforge.phpeclipse.PHPeclipsePlugin;
+import net.sourceforge.phpeclipse.overlaypages.Util;
import net.sourceforge.phpeclipse.views.PHPConsole;
import net.sourceforge.phpeclipse.views.browser.BrowserView;
import org.eclipse.core.resources.IFile;
// IPath path = file.getFullPath();
String localhostURL = file.getLocation().toString();
String lowerCaseFileName = localhostURL.toLowerCase();
- String documentRoot = store.getString(PHPeclipsePlugin.DOCUMENTROOT_PREF);
+ // String documentRoot = store.getString(PHPeclipsePlugin.DOCUMENTROOT_PREF);
+ String documentRoot = Util.getMiscProjectsPreferenceValue(
+ file.getProject(), IPreferenceConstants.PHP_DOCUMENTROOT_PREF);
+
documentRoot = documentRoot.replace('\\', '/');
documentRoot = documentRoot.toLowerCase();
+
if (lowerCaseFileName.startsWith(documentRoot)) {
localhostURL = localhostURL.substring(documentRoot.length());
} else {
- return null;
+ return null;
}
- return store.getString(PHPeclipsePlugin.LOCALHOST_PREF) + localhostURL;
+// return store.getString(PHPeclipsePlugin.LOCALHOST_PREF) + localhostURL;
+ return Util.getMiscProjectsPreferenceValue(file.getProject(), IPreferenceConstants.PHP_LOCALHOST_PREF) + localhostURL;
}
public static void open(final URL url, final Shell shell,
******************************************************************************/
package net.sourceforge.phpeclipse.actions;
+import java.io.File;
import java.util.List;
import net.sourceforge.phpeclipse.PHPeclipsePlugin;
List list = fIncludesScanner.getList();
if (list != null && list.size() > 0) {
- String workspaceLocation = PHPeclipsePlugin.getWorkspace().getRoot().getLocation().toString();
-
+// String workspaceLocation = PHPeclipsePlugin.getWorkspace().getRoot().getLocation().toString();
+ String workspaceLocation = fProject.getLocation().toString()+File.separatorChar;
+
ListSelectionDialog listSelectionDialog = new ListSelectionDialog(PHPeclipsePlugin.getDefault().getWorkbench()
.getActiveWorkbenchWindow().getShell(), list, new ListContentProvider(), new LabelProvider(),
"Select the includes to open.");
******************************************************************************/
package net.sourceforge.phpeclipse.actions;
+import java.io.File;
import java.util.List;
import net.sourceforge.phpeclipse.PHPeclipsePlugin;
IdentifierIndexManager indexManager = PHPeclipsePlugin.getDefault().getIndexManager(fProject);
// filename = StringUtil.replaceRegExChars(filename);
List list = indexManager.getFileList(filename);
- if (list != null && list.size() > 0) {
- String workspaceLocation = PHPeclipsePlugin.getWorkspace().getRoot().getLocation().toString();
-
+ if (list != null && list.size() > 0) {
+ //String workspaceLocation = PHPeclipsePlugin.getWorkspace().getRoot().getLocation().toString();
+ String workspaceLocation = fProject.getLocation().toString()+File.separatorChar;
+
ListSelectionDialog listSelectionDialog = new ListSelectionDialog(PHPeclipsePlugin.getDefault().getWorkbench()
.getActiveWorkbenchWindow().getShell(), list, new ListContentProvider(), new LabelProvider(),
"Select the includes to open.");
public void run(IAction action) {
final IPreferenceStore store =
PHPeclipsePlugin.getDefault().getPreferenceStore();
- String documentRoot = store.getString(PHPeclipsePlugin.DOCUMENTROOT_PREF);
+ String documentRoot = store.getString(PHPeclipsePlugin.PHP_DOCUMENTROOT_PREF);
// replace backslash with slash in the DocumentRoot under Windows
documentRoot = documentRoot.replace('\\', '/');
String[] arguments = { documentRoot };
protected String getPageId() {
return PREF_ID;
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
- */
+
protected void createFieldEditors() {
Composite composite = getFieldEditorParent();
+
+ addField(new StringFieldEditor(IPreferenceConstants.PHP_LOCALHOST_PREF,
+ PHPPreferencesMessages.getString("PHPMiscProjectPreferences.localhost"),
+ composite));
+ addField(new StringFieldEditor(IPreferenceConstants.PHP_DOCUMENTROOT_PREF,
+ PHPPreferencesMessages.getString("PHPMiscProjectPreferences.documentroot"),
+ composite));
addField(new StringFieldEditor(IPreferenceConstants.PHP_BOOKMARK_DEFAULT,
PHPPreferencesMessages.getString("PHPMiscProjectPreferences.bookmark"),
composite));
-
//if (!isPropertyPage)) {
//
//}
#########################################
-# PHPProjectLibraryPage
+# PHPProjectLibraryPage
#########################################
PHPProjectLibraryPage.elementNotIProject=ERROR: Element not IProject
PHPProjectPropertyPage.performOkExceptionDialogTitle=Unable to save
PHPProjectPropertyPage.performOkExceptionDialogMessage=ERROR: Unable to save project properties.
+PHPMiscProjectPreferences.localhost=Localhost
+PHPMiscProjectPreferences.documentroot=DocumentRoot
PHPMiscProjectPreferences.bookmark=SQL default bookmark:
+
PHPMiscProjectPreferences.obfuscator=Obfuscator directory:
PHPPreviewProjectPreferences.auto_preview=Refresh PHP browser view when opening editor