Package org.eclipse.php.internal.debug.core.preferences

Examples of org.eclipse.php.internal.debug.core.preferences.PHPexeItem


   *            <code>false</code>, it becomes last)
   */
  public NewPHPsComboBlock() {
    fDefaultDescriptor = new PHPexeDescriptor() {
      public String getDescription() {
        final PHPexeItem def = PHPDebugPlugin.getPHPexeItem(project);
        return getDisplayName(def, true);
      }
    };
    setDefaultPHPexeDescriptor(fDefaultDescriptor);
  }
View Full Code Here


   *            pref page id
   * @param page
   *            pref page
   */
  private void showPrefPage(String id/* , IPreferencePage page */) {
    PHPexeItem prevPHP = getPHPexe();
    PHPVersion prevEnv = getEnvironment();
    PreferencesUtil.createPreferenceDialogOn(getShell(), id,
        new String[] { id }, null).open();
    // PHPDebugUIPlugin.showPreferencePage(id);
    fillWithWorkspacePHPexes();
View Full Code Here

      return null;
    }
    if (fSpecificButton.getSelection()) {
      int index = fExecutablesCombo.getSelectionIndex();
      if (index >= 0) {
        PHPexeItem vm = phpExecutables.get(index);
        return PHPRuntime.newPHPContainerPath(vm);
      }
      return null;
    }
    return PHPRuntime.newDefaultPHPContainerPath();
View Full Code Here

          setError(MessageFormat.format(
              PHPDebugUIMessages.PHPexesComboBlock_7,
              new String[] { version.getAlias() }));
        }
      } else {
        PHPexeItem install = PHPRuntime.getPHPexeItem(containerPath);
        if (install == null) {
          selectPHP(install);
          fErrorPath = containerPath;
          // String installTypeId = PHPRuntime
          // .getVMInstallTypeId(containerPath);
          // if (installTypeId == null) {
          setError(PHPDebugUIMessages.PHPexesComboBlock_8);
          // } else {
          // IVMInstallType installType = PHPRuntime
          // .getVMInstallType(installTypeId);
          // if (installType == null) {
          // setError(MessageFormat.format(
          // PHPDebugUIMessages.PHPexesComboBlock_9,
          // new String[] { installTypeId }));
          // } else {
          // String installName = PHPRuntime
          // .getVMInstallName(containerPath);
          // if (installName == null) {
          // setError(MessageFormat
          // .format(
          // PHPDebugUIMessages.PHPexesComboBlock_10,
          // new String[] { installType
          // .getName() }));
          // } else {
          // setError(MessageFormat
          // .format(
          // PHPDebugUIMessages.PHPexesComboBlock_11,
          // new String[] { installName,
          // installType.getName() }));
          // }
          // }
          // }
        } else {
          selectPHP(install);
          File location = install.getExecutable();
          if (location == null) {
            setError(PHPDebugUIMessages.PHPexesComboBlock_12);
          } else if (!location.exists()) {
            setError(PHPDebugUIMessages.PHPexesComboBlock_13);
          }
View Full Code Here

    // fill with PHPexes
    final List<PHPexeItem> standins = new ArrayList<PHPexeItem>();
    PHPexeItem[] phpItems = exes.getAllItems();
    if (phpItems != null) {
      for (int i = 0; i < phpItems.length; i++) {
        final PHPexeItem type = phpItems[i];
        standins.add(type);
      }
    }
    setPHPexes(standins);
  }
View Full Code Here

    // now make an array of names
    String[] names = new String[phpExecutables.size()];
    final Iterator<PHPexeItem> iter = phpExecutables.iterator();
    int i = 0;
    while (iter.hasNext()) {
      final PHPexeItem item = iter.next();
      names[i] = getDisplayName(item, false);
      i++;
    }
    if (names.length == 0) {
      names = new String[] { PHPDebugUIMessages.PhpDebugPreferencePage_noExeDefined };
    }
    fExecutablesCombo.setItems(names);
    PHPexeItem defaultExe = exes.getDefaultItem(getSelectedDebuggerId());
    if (defaultExe != null) {
      String defaultName = defaultExe.getName()
          + " (" + defaultExe.getExecutable().toString() + ")"; //$NON-NLS-1$ //$NON-NLS-2$
      fExecutablesCombo.select(fExecutablesCombo.indexOf(defaultName));
    } else {
      fExecutablesCombo.select(0);
    }
  }
View Full Code Here

          .getDebuggerID();
    } else if (fEnvironmentsButton.getSelection()) {
      return PHPDebugPlugin.getCurrentDebuggerId(PHPVersion
          .byAlias(fEnvironmentsCombo.getText()));
    } else {
      PHPexeItem defaultItem = PHPDebugPlugin.getPHPexeItem(project);
      if (defaultItem != null) {
        return defaultItem.getDebuggerID();
      }
    }
    return PHPDebugPlugin.getCurrentDebuggerId();
  }
View Full Code Here

   * @param iProject
   *
   * @return The executable's location.
   */
  public String getSelectedExecutablePath() {
    final PHPexeItem item = getPHPexe(project);
    if (item != null)
      return item.getExecutable().toString();
    return ""; //$NON-NLS-1$
  }
View Full Code Here

   * defined.
   *
   * @return The php ini location.
   */
  public String getSelectedIniPath() {
    final PHPexeItem item = getPHPexe();
    if (item != null) {
      if (item.getINILocation() != null) {
        return item.getINILocation().toString();
      }
    }
    return ""; //$NON-NLS-1$
  }
View Full Code Here

    return launchConfigurationDelegate;
  }

  private ILaunchConfiguration updatePHPExeAttributes(
      ILaunchConfiguration configuration) throws CoreException {
    PHPexeItem item = null;
    String path = configuration.getAttribute(PHPRuntime.PHP_CONTAINER,
        (String) null);
    if (path == null) {
      IProject project = null;
      IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace()
          .getRoot();
      String projectName = configuration.getAttribute(
          IPHPDebugConstants.PHP_Project, (String) null);
      if (projectName != null) {
        project = workspaceRoot.getProject(projectName);
      } else {
        String phpScriptString = configuration.getAttribute(
            IPHPDebugConstants.ATTR_FILE, (String) null);
        IPath filePath = new Path(phpScriptString);
        IResource scriptRes = workspaceRoot.findMember(filePath);
        if (scriptRes != null) {
          project = scriptRes.getProject();
        }
      }
      item = PHPDebugPlugin.getPHPexeItem(project);
    } else {
      IPath exePath = Path.fromPortableString(path);
      PHPVersion version = PHPRuntime.getPHPVersion(exePath);
      if (version == null) {
        String exeName = exePath.lastSegment();
        item = PHPexes.getInstance().getItem(exeName);
      } else {
        item = PHPDebugPlugin.getPHPexeItem(version);
      }
    }
    if (item != null) {
      ILaunchConfigurationWorkingCopy wc = configuration.getWorkingCopy();
      wc.setAttribute(IPHPDebugConstants.ATTR_EXECUTABLE_LOCATION, item
          .getExecutable().toString());
      String debuggerId = item.getDebuggerID();
      wc.setAttribute(PHPDebugCorePreferenceNames.PHP_DEBUGGER_ID,
          debuggerId);
      AbstractDebuggerConfiguration debuggerConfiguration = PHPDebuggersRegistry
          .getDebuggerConfiguration(debuggerId);
      wc.setAttribute(
          PHPDebugCorePreferenceNames.CONFIGURATION_DELEGATE_CLASS,
          debuggerConfiguration.getScriptLaunchDelegateClass());
      if (item.getINILocation() != null) {
        wc.setAttribute(IPHPDebugConstants.ATTR_INI_LOCATION, item
            .getINILocation().toString());
      } else {
        wc.setAttribute(IPHPDebugConstants.ATTR_INI_LOCATION,
            (String) null);
      }
View Full Code Here

TOP

Related Classes of org.eclipse.php.internal.debug.core.preferences.PHPexeItem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.