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

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


   */
  private void addPHPexe() {
    Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
        .getShell();
    NullProgressMonitor monitor = new NullProgressMonitor();
    PHPexeItem phpExeItem = null;
    PHPExeWizard wizard = new PHPExeWizard(phpExes.getAllItems());
    ClosableWizardDialog dialog = new ClosableWizardDialog(shell, wizard);
    if (dialog.open() == Window.CANCEL) {
      monitor.setCanceled(true);
      return;
View Full Code Here


    fSetDefaultButton = createPushButton(buttons,
        PHPDebugUIMessages.InstalledPHPsBlock_setDefault);
    fSetDefaultButton.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        PHPexeItem defaultItem = (PHPexeItem) ((IStructuredSelection) fPHPExeList
            .getSelection()).getFirstElement();
        phpExes.setDefaultItem(defaultItem);
        commitChanges();
        setPHPs(phpExes.getAllItems());
        // Preferences prefs =
View Full Code Here

  }

  private void editPHPexe() {
    final IStructuredSelection selection = (IStructuredSelection) fPHPExeList
        .getSelection();
    final PHPexeItem phpExe = (PHPexeItem) selection.getFirstElement();
    if (phpExe == null) {
      return;
    }
    PHPexeItem phpExeToEdit = new PHPexeItem(phpExe.getName(),
        phpExe.getExecutable(), phpExe.getINILocation(),
        phpExe.getDebuggerID(), phpExe.isEditable());
    // phpExeToEdit.setLoadDefaultINI(phpExe.isLoadDefaultINI());
    phpExeToEdit.setSapiType(phpExe.getSapiType());
    phpExeToEdit.setLoadDefaultINI(phpExe.isLoadDefaultINI());
    PHPExeEditDialog dialog = new PHPExeEditDialog(getShell(),
        phpExeToEdit, phpExes.getAllItems());
    dialog.setTitle(PHPDebugUIMessages.InstalledPHPsBlock_8);
    if (dialog.open() != Window.OK) {
      return;
    }
    phpExe.setName(phpExeToEdit.getName());
    phpExe.setExecutable(phpExeToEdit.getExecutable());
    phpExe.setINILocation(phpExeToEdit.getINILocation());
    phpExe.setDebuggerID(phpExeToEdit.getDebuggerID());
    phpExe.setSapiType(phpExeToEdit.getSapiType());
    phpExe.setLoadDefaultINI(phpExeToEdit.isLoadDefaultINI());

    fPHPExeList.refresh();
    commitChanges();
  }
View Full Code Here

    IStructuredSelection selection = (IStructuredSelection) fPHPExeList
        .getSelection();
    Object[] elements = selection.toArray();
    boolean canRemoveOrEdit = true;
    for (int i = 0; canRemoveOrEdit && i < elements.length; i++) {
      PHPexeItem item = (PHPexeItem) elements[i];
      canRemoveOrEdit &= item.isEditable();
    }
    final int selectionCount = selection.size();
    fRemoveButton.setEnabled(canRemoveOrEdit && selectionCount > 0);
    PHPexeItem selectedItem = (PHPexeItem) ((IStructuredSelection) fPHPExeList
        .getSelection()).getFirstElement();
    fSetDefaultButton.setEnabled(selectionCount == 1
        && selectedItem != null && !selectedItem.isDefault());
  }
View Full Code Here

  /**
   * @see IAddPHPexeDialogRequestor#isDuplicateName(String)
   */
  public boolean isDuplicateName(final String name) {
    for (int i = 0; i < fPHPexes.size(); i++) {
      final PHPexeItem phpExe = fPHPexes.get(i);
      if (phpExe.getName().equals(name))
        return true;
    }
    return false;
  }
View Full Code Here

                  new Object[] { path }));
    else {
      Iterator<File> iter2 = locations.iterator();
      while (iter2.hasNext()) {
        File location = iter2.next();
        PHPexeItem phpExe = new PHPexeItem(null, location, null,
            PHPDebuggersRegistry.getDefaultDebuggerId(), true);
        String nameCopy = new String(phpExe.getName());
        int i = 1;
        while (isDuplicateName(nameCopy)) {
          nameCopy = phpExe.getName() + '[' + i++ + ']';
        }
        phpExe.setName(nameCopy);
        // Since the search for PHP exe option does not 'know' the
        // debugger id it should assign to the PHPexeItem,
        // we call for PHPexes.getDefaultDebuggerId() - which can also
        // return null in some cases.
        if (phpExe.getExecutable() != null) {
          fPHPexes.add(phpExe);
          phpExes.addItem(phpExe);
          fPHPExeList.refresh();
        }
      }
View Full Code Here

  private void sortByLocation() {
    fPHPExeList.setSorter(new ViewerSorter() {
      public int compare(final Viewer viewer, final Object e1,
          final Object e2) {
        if (e1 instanceof PHPexeItem && e2 instanceof PHPexeItem) {
          final PHPexeItem left = (PHPexeItem) e1;
          final PHPexeItem right = (PHPexeItem) e2;
          return left
              .getExecutable()
              .getAbsolutePath()
              .compareToIgnoreCase(
                  right.getExecutable().getAbsolutePath());
        }
        return super.compare(viewer, e1, e2);
      }

      public boolean isSorterProperty(final Object element,
View Full Code Here

  private void sortByDebugger() {
    fPHPExeList.setSorter(new ViewerSorter() {
      public int compare(final Viewer viewer, final Object e1,
          final Object e2) {
        if (e1 instanceof PHPexeItem && e2 instanceof PHPexeItem) {
          final PHPexeItem left = (PHPexeItem) e1;
          final PHPexeItem right = (PHPexeItem) e2;
          String leftDebugger = PHPDebuggersRegistry
              .getDebuggerName(left.getDebuggerID());
          String rightDebugger = PHPDebuggersRegistry
              .getDebuggerName(right.getDebuggerID());
          return rightDebugger.compareToIgnoreCase(leftDebugger);
        }
        return super.compare(viewer, e1, e2);
      }
View Full Code Here

  private void sortByName() {
    fPHPExeList.setSorter(new ViewerSorter() {
      public int compare(final Viewer viewer, final Object e1,
          final Object e2) {
        if (e1 instanceof PHPexeItem && e2 instanceof PHPexeItem) {
          final PHPexeItem left = (PHPexeItem) e1;
          final PHPexeItem right = (PHPexeItem) e2;
          return left.getName().compareToIgnoreCase(right.getName());
        }
        return super.compare(viewer, e1, e2);
      }

      public boolean isSorterProperty(final Object element,
View Full Code Here

  private void sortByType() {
    fPHPExeList.setSorter(new ViewerSorter() {
      public int compare(final Viewer viewer, final Object e1,
          final Object e2) {
        if (e1 instanceof PHPexeItem && e2 instanceof PHPexeItem) {
          final PHPexeItem left = (PHPexeItem) e1;
          final PHPexeItem right = (PHPexeItem) e2;
          final String leftType = left.getName();
          final String rightType = right.getName();
          final int res = leftType.compareToIgnoreCase(rightType);
          if (res != 0)
            return res;
          return left.getName().compareToIgnoreCase(right.getName());
        }
        return super.compare(viewer, e1, e2);
      }

      public boolean isSorterProperty(final Object element,
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.