/**
   * Handles the button pressed event on the filter criteria. Move the items between the lists based
   * on the selection and but button pressed.
   */
  private void buttonPressed(int buttonId) {
    String[] items = {};
    switch (buttonId) {
      case ADD_TO_ID:
        items = filterList.getSelection();
        for (int i = 0; i < items.length; i++) {
          filters.add(items[i]);
          filterList.remove(items[i]);
        }
        addTo.setEnabled(false);
        break;
      case REMOVE_FROM_ID:
        items = filters.getSelection();
        for (int i = 0; i < items.length; i++) {
          filterList.add(items[i]);
          filters.remove(items[i]);
        }
        removeFrom.setEnabled(false);
        break;
      case ADD_ALL_TO_ID:
        items = filterList.getItems();
        for (int i = 0; i < items.length; i++) {
          filters.add(items[i]);
          filterList.remove(items[i]);
        }
        break;
      case REMOVE_ALL_FROM_ID:
        items = filters.getItems();
        for (int i = 0; i < items.length; i++) {
          filters.remove(items[i]);
          filterList.add(items[i]);
        }
        break;
    }
    updateFilteringKeysFromControls();
    if (pageType == CHILD_PAGE) {
      refreshList();
    } else if (pageType == ROOT_PAGE) {
      PreferenceManager preferenceManager =
          ((SortFilterDialog) getContainer()).getPreferenceManager();
      Iterator nodes = preferenceManager.getElements(PreferenceManager.PRE_ORDER).iterator();
      while (nodes.hasNext()) {
        PreferenceNode node = (PreferenceNode) nodes.next();
        SortFilterPage page = (SortFilterPage) node.getPage();
        if (page == this) {
          continue;
        }

        if (Arrays.equals(filterStrings, page.getFilterList())) {
          page._filteringKeys = new ArrayList(_filteringKeys.size());
          page._filteringKeys.addAll(_filteringKeys);
          page._filtering = _filtering;
          page.populateFilterLists();
          page.refreshList();
          page.updateApplyButton();
        }
      }
    }
    updateApplyButton();
  }
  protected void onDeleteClicked() {
    if (selectedConfigsList.getSelectionCount() == 0) {
      return;
    }
    String[] selection = selectedConfigsList.getSelection();
    StringBuilder b = new StringBuilder();
    for (String item : selection) {
      if (b.length() > 0) {
        b.append(", ");
      }
      b.append(item);
    }
    int response =
        ask(
            "Are you shure you want to remove [" + b.toString() + "]?",
            "Removing launch configuration");
    if (response != SWT.YES) {
      return;
    }

    selectedConfigsList.remove(selectedConfigsList.getSelectionIndices());
    for (String item : selection) {
      if (allConfigNames.contains((String) item)) {
        availableConfigsCombo.add(item);
      }
    }
    updateButtonsState();
    updateLaunchConfigurationDialog();
  }
Beispiel #3
0
  public void widgetSelected(SelectionEvent e) {
    traceList.remove(traceList.getItemCount() - 1);

    for (IUndoListener listener : observer) {
      listener.notifyUndo();
    }
  }
 public void addCurrentCourse(List list, String course) {
   if (list.getItem(0).equals("No Courses Selected")) {
     list.remove(0);
     list.add(course);
   } else {
     list.add(course);
   }
 }
 /** Notifies that the Remove button has been pressed. */
 private void removePressed() {
   setPresentsDefaultValue(false);
   int index = list.getSelectionIndex();
   if (index >= 0) {
     list.remove(index);
     selectionChanged();
   }
 }
 private void doRemove() {
   setPresentsDefaultValue(false);
   int index = list.getSelectionIndex();
   if (index >= 0) {
     list.remove(index);
     elements.remove(index);
     index = list.getItemCount() <= index ? list.getItemCount() - 1 : index;
     selectionChanged(index);
   }
 }
  /**
   * Moves the currently selected item up or down.
   *
   * @param up <code>true</code> if the item should move up, and <code>false</code> if it should
   *     move down
   */
  private void swap(boolean up) {
    setPresentsDefaultValue(false);
    int index = list.getSelectionIndex();
    int target = up ? index - 1 : index + 1;

    if (index >= 0) {
      String[] selection = list.getSelection();
      Assert.isTrue(selection.length == 1);
      list.remove(index);
      list.add(selection[0], target);
      list.setSelection(target);
    }
    selectionChanged();
  }
 /**
  * 删除保存在首选项中的所有与指定条件相关的数据
  *
  * @param key 条件名
  */
 private void deletePreference(String[] key) {
   if (key == null || key.length == 0) {
     return;
   }
   for (int i = 0; i < key.length; i++) {
     customFilters.remove(key[i]);
     customFiltersAddtion.remove(key[i]);
     customFiltersIndex.remove(key[i]);
     customFilterList.remove(key[i]);
   }
   PreferenceStore.saveMap(IPreferenceConstants.MATCH_CONDITION, customFilters);
   PreferenceStore.saveCustomCondition(
       IPreferenceConstants.MATCH_CONDITION_ADDITION, customFiltersAddtion);
   PreferenceStore.saveCustomCondition(
       IPreferenceConstants.MATCH_CONDITION_INDEX, customFiltersIndex);
 }
 public void removeCurrentCourse(List list, String Course) {
   list.remove(Course);
   if (list.getItemCount() == 0) list.add("No Courses Selected");
 }
Beispiel #10
0
 /**
  * Searches the receiver's list starting at the first item until an item is found that is equal to
  * the argument, and removes that item from the list.
  *
  * @param string the item to remove
  * @exception IllegalArgumentException
  *     <ul>
  *       <li>ERROR_NULL_ARGUMENT - if the string is null
  *       <li>ERROR_INVALID_ARGUMENT - if the string is not found in the list
  *     </ul>
  *
  * @exception SWTException
  *     <ul>
  *       <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  *       <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
  *     </ul>
  */
 public void remove(String string) {
   checkWidget();
   if (string == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
   list.remove(string);
 }
Beispiel #11
0
 /**
  * Removes the items from the receiver's list which are between the given zero-relative start and
  * end indices (inclusive).
  *
  * @param start the start of the range
  * @param end the end of the range
  * @exception IllegalArgumentException
  *     <ul>
  *       <li>ERROR_INVALID_RANGE - if either the start or end are not between 0 and the number of
  *           elements in the list minus 1 (inclusive)
  *     </ul>
  *
  * @exception SWTException
  *     <ul>
  *       <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  *       <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
  *     </ul>
  */
 public void remove(int start, int end) {
   checkWidget();
   list.remove(start, end);
 }
Beispiel #12
0
 /**
  * Removes the item from the receiver's list at the given zero-relative index.
  *
  * @param index the index for the item
  * @exception IllegalArgumentException
  *     <ul>
  *       <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the
  *           list minus 1 (inclusive)
  *     </ul>
  *
  * @exception SWTException
  *     <ul>
  *       <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  *       <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
  *     </ul>
  */
 public void remove(int index) {
   checkWidget();
   list.remove(index);
 }
 public void remove(int selIndex) {
   listIntermediary.remove(selIndex);
   nodes.remove(selIndex);
 }
 @Override
 protected void listRemove(int index) {
   list.remove(index);
 }
Beispiel #15
0
 public void removeUser(String UserName) {
   GlobalUsersList.remove(UserName);
 }
 private void handleIgnoreRemoveButtonPressed() {
   int[] selections = ignoreRangesList.getSelectionIndices();
   ignoreRangesList.remove(selections);
 }