mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-25 18:05:33 +02:00
Patch for Devin Steffler.
Add <CLEAR> button to DOM AST View.
This commit is contained in:
parent
460f23dca9
commit
b7bc33758c
3 changed files with 19 additions and 2 deletions
BIN
core/org.eclipse.cdt.ui.tests/icons/used/clear.gif
Normal file
BIN
core/org.eclipse.cdt.ui.tests/icons/used/clear.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 851 B |
|
@ -109,7 +109,8 @@ import org.eclipse.ui.part.ViewPart;
|
|||
*/
|
||||
|
||||
public class DOMAST extends ViewPart {
|
||||
private static final String DOMAST_FILTER_GROUP_ID = "org.eclipse.cdt.ui.tests.DOMAST.DOMASTFilterGroup"; //$NON-NLS-1$
|
||||
private static final String CLEAR = "Clear"; //$NON-NLS-1$
|
||||
private static final String DOMAST_FILTER_GROUP_ID = "org.eclipse.cdt.ui.tests.DOMAST.DOMASTFilterGroup"; //$NON-NLS-1$
|
||||
private static final String EXTENSION_CXX = "CXX"; //$NON-NLS-1$
|
||||
private static final String EXTENSION_CPP = "CPP"; //$NON-NLS-1$
|
||||
private static final String EXTENSION_CC = "CC"; //$NON-NLS-1$
|
||||
|
@ -132,6 +133,7 @@ public class DOMAST extends ViewPart {
|
|||
private Action refreshAction;
|
||||
private Action expandAllAction;
|
||||
private Action collapseAllAction;
|
||||
private Action clearAction;
|
||||
private IFile file = null;
|
||||
private IEditorPart part = null;
|
||||
private ParserLanguage lang = null;
|
||||
|
@ -408,8 +410,11 @@ public class DOMAST extends ViewPart {
|
|||
private void fillLocalToolBar(IToolBarManager manager) {
|
||||
manager.add(expandAllAction);
|
||||
manager.add(collapseAllAction);
|
||||
manager.add(new Separator());
|
||||
manager.add(refreshAction);
|
||||
manager.add(loadActiveEditorAction);
|
||||
manager.add(new Separator());
|
||||
manager.add(clearAction);
|
||||
manager.add(new Separator());
|
||||
drillDownAdapter.addNavigationActions(manager);
|
||||
}
|
||||
|
@ -522,7 +527,17 @@ public class DOMAST extends ViewPart {
|
|||
collapseAllAction.setText(COLLAPSE_ALL);
|
||||
collapseAllAction.setToolTipText(COLLAPSE_ALL);
|
||||
collapseAllAction.setImageDescriptor(DOMASTPluginImages.DESC_COLLAPSE_ALL);
|
||||
|
||||
|
||||
clearAction = new Action() {
|
||||
public void run() {
|
||||
viewer.setContentProvider(new ViewContentProvider(null));
|
||||
viewer.refresh();
|
||||
}
|
||||
};
|
||||
clearAction.setText(CLEAR);
|
||||
clearAction.setToolTipText(CLEAR);
|
||||
clearAction.setImageDescriptor(DOMASTPluginImages.DESC_CLEAR);
|
||||
|
||||
openDeclarationsAction = new DisplayDeclarationsAction();
|
||||
openDeclarationsAction.setText(OPEN_DECLARATIONS);
|
||||
openDeclarationsAction.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages()
|
||||
|
|
|
@ -74,6 +74,7 @@ public class DOMASTPluginImages {
|
|||
public static final String IMG_DEFAULT = NAME_PREFIX + "brkpd_obj.gif"; //$NON-NLS-1$
|
||||
public static final String IMG_EXPAND_ALL = NAME_PREFIX + "expandall.gif"; //$NON-NLS-1$
|
||||
public static final String IMG_COLLAPSE_ALL = NAME_PREFIX + "collapseall.gif"; //$NON-NLS-1$
|
||||
public static final String IMG_CLEAR = NAME_PREFIX + "clear.gif"; //$NON-NLS-1$
|
||||
|
||||
public static final ImageDescriptor DESC_IASTArrayModifier= createManaged(ICON_PREFIX, IMG_IASTArrayModifier);
|
||||
public static final ImageDescriptor DESC_IASTDeclaration= createManaged(ICON_PREFIX, IMG_IASTDeclaration);
|
||||
|
@ -97,6 +98,7 @@ public class DOMASTPluginImages {
|
|||
public static final ImageDescriptor DESC_DEFAULT= createManaged(ICON_PREFIX, IMG_DEFAULT);
|
||||
public static final ImageDescriptor DESC_EXPAND_ALL= createManaged(ICON_PREFIX, IMG_EXPAND_ALL);
|
||||
public static final ImageDescriptor DESC_COLLAPSE_ALL= createManaged(ICON_PREFIX, IMG_COLLAPSE_ALL);
|
||||
public static final ImageDescriptor DESC_CLEAR= createManaged(ICON_PREFIX, IMG_CLEAR);
|
||||
|
||||
private static ImageDescriptor createManaged(String prefix, String name) {
|
||||
return createManaged(imageRegistry, prefix, name);
|
||||
|
|
Loading…
Add table
Reference in a new issue