mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-09-10 03:53:21 +02:00
Alphabetical sort added to Variables dialog
This commit is contained in:
parent
3f7444610f
commit
1865957898
1 changed files with 7 additions and 2 deletions
|
@ -10,6 +10,8 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.ui.newui;
|
package org.eclipse.cdt.ui.newui;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
import org.eclipse.core.resources.IContainer;
|
import org.eclipse.core.resources.IContainer;
|
||||||
import org.eclipse.core.resources.IFile;
|
import org.eclipse.core.resources.IFile;
|
||||||
import org.eclipse.core.resources.IProject;
|
import org.eclipse.core.resources.IProject;
|
||||||
|
@ -346,7 +348,11 @@ public abstract class AbstractCPropertyTab implements ICPropertyTab {
|
||||||
|
|
||||||
ListDialog dialog = new ListDialog(shell);
|
ListDialog dialog = new ListDialog(shell);
|
||||||
dialog.setContentProvider(new IStructuredContentProvider() {
|
dialog.setContentProvider(new IStructuredContentProvider() {
|
||||||
public Object[] getElements(Object inputElement) { return (Object[])inputElement; }
|
public Object[] getElements(Object inputElement) {
|
||||||
|
Object[] obs = (Object[])inputElement;
|
||||||
|
Arrays.sort(obs, CDTListComparator.getInstance());
|
||||||
|
return obs;
|
||||||
|
}
|
||||||
public void dispose() {}
|
public void dispose() {}
|
||||||
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
|
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
|
||||||
});
|
});
|
||||||
|
@ -366,7 +372,6 @@ public abstract class AbstractCPropertyTab implements ICPropertyTab {
|
||||||
dialog.setInput(vm.getVariables(cfgd));
|
dialog.setInput(vm.getVariables(cfgd));
|
||||||
dialog.setHeightInChars(10);
|
dialog.setHeightInChars(10);
|
||||||
dialog.setTitle(NewUIMessages.getResourceString("AbstractCPropertyTab.0")); //$NON-NLS-1$
|
dialog.setTitle(NewUIMessages.getResourceString("AbstractCPropertyTab.0")); //$NON-NLS-1$
|
||||||
|
|
||||||
if (dialog.open() == Window.OK) {
|
if (dialog.open() == Window.OK) {
|
||||||
Object[] selected = dialog.getResult();
|
Object[] selected = dialog.getResult();
|
||||||
if (selected.length > 0) {
|
if (selected.length > 0) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue