mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 17:56:01 +02:00
Bug 109449: Sort globals in "Add Globals" dialog.
This commit is contained in:
parent
37c5d87fec
commit
32cc65f7c0
2 changed files with 25 additions and 2 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
2006-05-12 Mikhail Khodjaiants
|
||||||
|
Bug 109449: Sort globals in "Add Globals" dialog.
|
||||||
|
* AddGlobalsActionDelegate.java
|
||||||
|
|
||||||
2006-04-17 Mikhail Khodjaiants
|
2006-04-17 Mikhail Khodjaiants
|
||||||
Added the "AddWatchpoint" action to the breakpoints view.
|
Added the "AddWatchpoint" action to the breakpoints view.
|
||||||
* AddWatchpointActionDelegate.java
|
* AddWatchpointActionDelegate.java
|
||||||
|
|
|
@ -23,15 +23,20 @@ import org.eclipse.debug.core.model.IDebugElement;
|
||||||
import org.eclipse.debug.ui.DebugUITools;
|
import org.eclipse.debug.ui.DebugUITools;
|
||||||
import org.eclipse.debug.ui.IDebugUIConstants;
|
import org.eclipse.debug.ui.IDebugUIConstants;
|
||||||
import org.eclipse.jface.action.IAction;
|
import org.eclipse.jface.action.IAction;
|
||||||
|
import org.eclipse.jface.viewers.ILabelProvider;
|
||||||
import org.eclipse.jface.viewers.ISelection;
|
import org.eclipse.jface.viewers.ISelection;
|
||||||
import org.eclipse.jface.viewers.IStructuredContentProvider;
|
import org.eclipse.jface.viewers.IStructuredContentProvider;
|
||||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||||
import org.eclipse.jface.viewers.LabelProvider;
|
import org.eclipse.jface.viewers.LabelProvider;
|
||||||
import org.eclipse.jface.viewers.StructuredSelection;
|
import org.eclipse.jface.viewers.StructuredSelection;
|
||||||
import org.eclipse.jface.viewers.Viewer;
|
import org.eclipse.jface.viewers.Viewer;
|
||||||
|
import org.eclipse.jface.viewers.ViewerSorter;
|
||||||
import org.eclipse.jface.window.Window;
|
import org.eclipse.jface.window.Window;
|
||||||
import org.eclipse.swt.custom.BusyIndicator;
|
import org.eclipse.swt.custom.BusyIndicator;
|
||||||
|
import org.eclipse.swt.widgets.Composite;
|
||||||
|
import org.eclipse.swt.widgets.Control;
|
||||||
import org.eclipse.swt.widgets.Display;
|
import org.eclipse.swt.widgets.Display;
|
||||||
|
import org.eclipse.swt.widgets.Shell;
|
||||||
import org.eclipse.ui.IPartListener;
|
import org.eclipse.ui.IPartListener;
|
||||||
import org.eclipse.ui.ISelectionListener;
|
import org.eclipse.ui.ISelectionListener;
|
||||||
import org.eclipse.ui.IViewActionDelegate;
|
import org.eclipse.ui.IViewActionDelegate;
|
||||||
|
@ -46,6 +51,20 @@ import org.eclipse.ui.dialogs.ListSelectionDialog;
|
||||||
*/
|
*/
|
||||||
public class AddGlobalsActionDelegate extends ActionDelegate implements IViewActionDelegate, ISelectionListener, IPartListener {
|
public class AddGlobalsActionDelegate extends ActionDelegate implements IViewActionDelegate, ISelectionListener, IPartListener {
|
||||||
|
|
||||||
|
|
||||||
|
class SortedListSelectionDialog extends ListSelectionDialog {
|
||||||
|
|
||||||
|
public SortedListSelectionDialog( Shell parentShell, Object input, IStructuredContentProvider contentProvider, ILabelProvider labelProvider, String message ) {
|
||||||
|
super( parentShell, input, contentProvider, labelProvider, message );
|
||||||
|
}
|
||||||
|
|
||||||
|
protected Control createDialogArea( Composite parent ) {
|
||||||
|
Control da = super.createDialogArea( parent );
|
||||||
|
getViewer().setSorter( new ViewerSorter() );
|
||||||
|
return da;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private IGlobalVariableDescriptor[] fGlobals;
|
private IGlobalVariableDescriptor[] fGlobals;
|
||||||
|
|
||||||
private IViewPart fView = null;
|
private IViewPart fView = null;
|
||||||
|
@ -220,8 +239,8 @@ public class AddGlobalsActionDelegate extends ActionDelegate implements IViewAct
|
||||||
return (element != null && element instanceof IDebugElement && ((IDebugElement)element).getDebugTarget().getAdapter( IExecFileInfo.class ) != null);
|
return (element != null && element instanceof IDebugElement && ((IDebugElement)element).getDebugTarget().getAdapter( IExecFileInfo.class ) != null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private ListSelectionDialog createDialog() {
|
private SortedListSelectionDialog createDialog() {
|
||||||
return new ListSelectionDialog( getView().getSite().getShell(), fGlobals, new IStructuredContentProvider() {
|
return new SortedListSelectionDialog( getView().getSite().getShell(), fGlobals, new IStructuredContentProvider() {
|
||||||
|
|
||||||
public void inputChanged( Viewer viewer, Object oldInput, Object newInput ) {
|
public void inputChanged( Viewer viewer, Object oldInput, Object newInput ) {
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue