Java Code Examples for org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField#getSelectedElements()
The following examples show how to use
org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField#getSelectedElements() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CategoryFilterActionGroup.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 5 votes |
public void doubleClicked(ListDialogField<String> field) { List<?> selectedElements= field.getSelectedElements(); if (selectedElements.size() == 1) { String selected= (String) selectedElements.get(0); fCategoryList.setChecked(selected, !fCategoryList.isChecked(selected)); } }
Example 2
Source File: AccessRulesDialog.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 5 votes |
private void editEntry(ListDialogField<IAccessRule> field) { List<IAccessRule> selElements= field.getSelectedElements(); if (selElements.size() != 1) { return; } IAccessRule rule= selElements.get(0); AccessRuleEntryDialog dialog= new AccessRuleEntryDialog(getShell(), rule, fCurrElement); if (dialog.open() == Window.OK) { field.replaceElement(rule, dialog.getRule()); } }
Example 3
Source File: ExclusionInclusionDialog.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 5 votes |
private void editEntry(ListDialogField<String> field) { List<String> selElements= field.getSelectedElements(); if (selElements.size() != 1) { return; } List<String> existing= field.getElements(); String entry= selElements.get(0); ExclusionInclusionEntryDialog dialog= new ExclusionInclusionEntryDialog(getShell(), isExclusion(field), entry, existing, fCurrElement); if (dialog.open() == Window.OK) { field.replaceElement(entry, dialog.getExclusionPattern()); } }
Example 4
Source File: BuildPathsBlock.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 5 votes |
public void buildPathCustomButtonPressed(ListDialogField<CPListElement> field, int index) { List<CPListElement> elems= field.getSelectedElements(); field.removeElements(elems); if (index == IDX_BOTTOM) { field.addElements(elems); } else if (index == IDX_TOP) { field.addElements(elems, 0); } }
Example 5
Source File: VariableBlock.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 5 votes |
public void customButtonPressed(ListDialogField<CPVariableElement> field, int index) { switch (index) { case 0: /* add */ editEntries(null); break; case 1: /* edit */ List<CPVariableElement> selected= field.getSelectedElements(); editEntries(selected.get(0)); break; } }
Example 6
Source File: VariableBlock.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 5 votes |
public void doubleClicked(ListDialogField<CPVariableElement> field) { if (fEditOnDoubleclick) { List<CPVariableElement> selected= field.getSelectedElements(); if (canEdit(selected, containsReadOnly(selected))) { editEntries(selected.get(0)); } } }
Example 7
Source File: SetFilterWizardPage.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 5 votes |
private void editEntry(ListDialogField<String> field) { List<String> selElements= field.getSelectedElements(); if (selElements.size() != 1) { return; } List<String> existing= field.getElements(); String entry= selElements.get(0); ExclusionInclusionEntryDialog dialog= new ExclusionInclusionEntryDialog(getShell(), isExclusion(field), entry, existing, fCurrElement); if (dialog.open() == Window.OK) { field.replaceElement(entry, dialog.getExclusionPattern()); } }
Example 8
Source File: CleanUpRefactoringWizard.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 5 votes |
private void openPropertyDialog(ListDialogField<IJavaProject> field) { IJavaProject project= field.getSelectedElements().get(0); PreferencesUtil.createPropertyDialogOn(fShell, project, CleanUpPreferencePage.PROP_ID, null, null).open(); List<?> selectedElements= field.getSelectedElements(); fProvider.reset(); field.refresh(); field.selectElements(new StructuredSelection(selectedElements)); }
Example 9
Source File: TodoTaskConfigurationBlock.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 4 votes |
public void selectionChanged(ListDialogField<TodoTask> field) { List<TodoTask> selectedElements= field.getSelectedElements(); field.enableButton(IDX_EDIT, canEdit(selectedElements)); field.enableButton(IDX_DEFAULT, canSetToDefault(selectedElements)); }
Example 10
Source File: CodeAssistFavoritesConfigurationBlock.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 4 votes |
private boolean canEdit(ListDialogField<String> field) { List<String> selected= field.getSelectedElements(); return selected.size() == 1; }
Example 11
Source File: ImportOrganizeConfigurationBlock.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 4 votes |
private boolean canEdit(ListDialogField<ImportOrderEntry> field) { List<ImportOrderEntry> selected= field.getSelectedElements(); return selected.size() == 1; }
Example 12
Source File: AccessRulesDialog.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 4 votes |
protected void doSelectionChanged(ListDialogField<IAccessRule> field) { List<IAccessRule> selected= field.getSelectedElements(); field.enableButton(IDX_EDIT, canEdit(selected)); }
Example 13
Source File: ExclusionInclusionDialog.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 4 votes |
protected void doSelectionChanged(ListDialogField<String> field) { List<String> selected= field.getSelectedElements(); field.enableButton(IDX_EDIT, canEdit(selected)); }
Example 14
Source File: SetFilterWizardPage.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 4 votes |
protected void doSelectionChanged(ListDialogField<String> field) { List<String> selected= field.getSelectedElements(); field.enableButton(IDX_EDIT, canEdit(selected)); }
Example 15
Source File: ExpandWithConstructorsConfigurationBlock.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 2 votes |
/** * Checks if field can be edited. * * @param field the list dialog field * @return <code>true</code> if it can be edited, <code>false</code> otherwise */ private boolean canEdit(ListDialogField<String> field) { List<String> selected= field.getSelectedElements(); return selected.size() == 1; }
Example 16
Source File: ExpandWithConstructorsConfigurationBlock.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 2 votes |
/** * Checks if the field can be removed. * * @param field the list dialog field * @return <code>true</code> if it can be removed, <code>false</code> otherwise */ private boolean canRemove(ListDialogField<String> field) { List<String> selected= field.getSelectedElements(); return selected.size() != 0; }