mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-10 17:55:39 +02:00
Type Hierarchy: support for working-sets
This commit is contained in:
parent
b2b9d11098
commit
7bbaad75fa
12 changed files with 162 additions and 77 deletions
BIN
core/org.eclipse.cdt.ui/icons/obj16/classfo_obj.gif
Normal file
BIN
core/org.eclipse.cdt.ui/icons/obj16/classfo_obj.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 260 B |
BIN
core/org.eclipse.cdt.ui/icons/obj16/enumfo_obj.gif
Normal file
BIN
core/org.eclipse.cdt.ui/icons/obj16/enumfo_obj.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 250 B |
BIN
core/org.eclipse.cdt.ui/icons/obj16/structfo_obj.GIF
Normal file
BIN
core/org.eclipse.cdt.ui/icons/obj16/structfo_obj.GIF
Normal file
Binary file not shown.
After Width: | Height: | Size: 959 B |
BIN
core/org.eclipse.cdt.ui/icons/obj16/typedeffo_obj.gif
Normal file
BIN
core/org.eclipse.cdt.ui/icons/obj16/typedeffo_obj.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 947 B |
BIN
core/org.eclipse.cdt.ui/icons/obj16/unionfo_obj.gif
Normal file
BIN
core/org.eclipse.cdt.ui/icons/obj16/unionfo_obj.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 957 B |
|
@ -53,12 +53,17 @@ public class CPluginImages {
|
|||
public static final String IMG_OBJS_VARIABLE= NAME_PREFIX + "variable_obj.gif"; //$NON-NLS-1$
|
||||
public static final String IMG_OBJS_LOCAL_VARIABLE= NAME_PREFIX + "variable_local_obj.gif"; //$NON-NLS-1$
|
||||
public static final String IMG_OBJS_CLASS= NAME_PREFIX + "class_obj.gif"; //$NON-NLS-1$
|
||||
public static final String IMG_OBJS_CLASS_ALT= NAME_PREFIX + "classfo_obj.gif"; //$NON-NLS-1$
|
||||
public static final String IMG_OBJS_NAMESPACE= NAME_PREFIX + "namespace_obj.gif"; //$NON-NLS-1$
|
||||
public static final String IMG_OBJS_USING= NAME_PREFIX + "using_obj.gif"; //$NON-NLS-1$
|
||||
public static final String IMG_OBJS_STRUCT= NAME_PREFIX + "struct_obj.gif"; //$NON-NLS-1$
|
||||
public static final String IMG_OBJS_STRUCT_ALT= NAME_PREFIX + "structfo_obj.gif"; //$NON-NLS-1$
|
||||
public static final String IMG_OBJS_UNION= NAME_PREFIX + "union_obj.gif"; //$NON-NLS-1$
|
||||
public static final String IMG_OBJS_UNION_ALT= NAME_PREFIX + "unionfo_obj.gif"; //$NON-NLS-1$
|
||||
public static final String IMG_OBJS_TYPEDEF= NAME_PREFIX + "typedef_obj.gif"; //$NON-NLS-1$
|
||||
public static final String IMG_OBJS_TYPEDEF_ALT= NAME_PREFIX + "typedeffo_obj.gif"; //$NON-NLS-1$
|
||||
public static final String IMG_OBJS_ENUMERATION= NAME_PREFIX + "enum_obj.gif"; //$NON-NLS-1$
|
||||
public static final String IMG_OBJS_ENUMERATION_ALT= NAME_PREFIX + "enumfo_obj.gif"; //$NON-NLS-1$
|
||||
public static final String IMG_OBJS_UNKNOWN_TYPE= NAME_PREFIX + "unknown_type_obj.gif"; //$NON-NLS-1$
|
||||
public static final String IMG_OBJS_ENUMERATOR= NAME_PREFIX + "enumerator_obj.gif"; //$NON-NLS-1$
|
||||
public static final String IMG_OBJS_FUNCTION= NAME_PREFIX + "function_obj.gif"; //$NON-NLS-1$
|
||||
|
@ -140,6 +145,12 @@ public class CPluginImages {
|
|||
public static final ImageDescriptor DESC_OBJS_PRIVATE_FIELD= createManaged(T_OBJ, IMG_OBJS_PRIVATE_FIELD);
|
||||
public static final ImageDescriptor DESC_OBJS_KEYWORD= createManaged(T_OBJ, IMG_OBJS_KEYWORD);
|
||||
|
||||
public static final ImageDescriptor DESC_OBJS_CLASS_ALT= createManaged(T_OBJ, IMG_OBJS_CLASS_ALT);
|
||||
public static final ImageDescriptor DESC_OBJS_STRUCT_ALT= createManaged(T_OBJ, IMG_OBJS_STRUCT_ALT);
|
||||
public static final ImageDescriptor DESC_OBJS_UNION_ALT= createManaged(T_OBJ, IMG_OBJS_UNION_ALT);
|
||||
public static final ImageDescriptor DESC_OBJS_TYPEDEF_ALT= createManaged(T_OBJ, IMG_OBJS_TYPEDEF_ALT);
|
||||
public static final ImageDescriptor DESC_OBJS_ENUMERATION_ALT= createManaged(T_OBJ, IMG_OBJS_ENUMERATION_ALT);
|
||||
|
||||
public static final ImageDescriptor DESC_OBJS_DECLARARION= createManaged(T_OBJ, IMG_OBJS_DECLARATION);
|
||||
public static final ImageDescriptor DESC_OBJS_VAR_DECLARARION= createManaged(T_OBJ, IMG_OBJS_VAR_DECLARATION);
|
||||
public static final ImageDescriptor DESC_OBJS_INCLUDE= createManaged(T_OBJ, IMG_OBJS_INCLUDE);
|
||||
|
|
|
@ -168,8 +168,8 @@ class THGraph {
|
|||
IName name= base.getBaseClassSpecifierName();
|
||||
IBinding basecl= name != null ? index.findBinding(name) : base.getBaseClass();
|
||||
ICElementHandle[] baseElems= IndexUI.findRepresentative(index, basecl);
|
||||
if (baseElems.length > 0) {
|
||||
ICElementHandle baseElem= baseElems[0];
|
||||
for (int j = 0; j < baseElems.length; j++) {
|
||||
ICElementHandle baseElem = baseElems[j];
|
||||
THGraphNode baseGraphNode= addNode(baseElem);
|
||||
addMembers(index, baseGraphNode, basecl);
|
||||
addEdge(graphNode, baseGraphNode);
|
||||
|
|
|
@ -33,6 +33,8 @@ import org.eclipse.cdt.core.model.ICElement;
|
|||
import org.eclipse.cdt.core.model.ICProject;
|
||||
import org.eclipse.cdt.ui.CUIPlugin;
|
||||
|
||||
import org.eclipse.cdt.internal.ui.viewsupport.WorkingSetFilterUI;
|
||||
|
||||
class THHierarchyModel {
|
||||
public class BackgroundJob extends Job {
|
||||
public BackgroundJob() {
|
||||
|
@ -67,6 +69,7 @@ class THHierarchyModel {
|
|||
private Job fJob;
|
||||
private Display fDisplay;
|
||||
private THViewPart fView;
|
||||
private WorkingSetFilterUI fFilter;
|
||||
|
||||
public THHierarchyModel(THViewPart view, Display display) {
|
||||
fDisplay= display;
|
||||
|
@ -103,9 +106,10 @@ class THHierarchyModel {
|
|||
return fRootNodes;
|
||||
}
|
||||
|
||||
// public void setWorkingSetFilter(WorkingSetFilterUI filterUI) {
|
||||
//
|
||||
// }
|
||||
public void setWorkingSetFilter(WorkingSetFilterUI filterUI) {
|
||||
fFilter= filterUI;
|
||||
computeNodes();
|
||||
}
|
||||
|
||||
synchronized public void setInput(ICElement input, ICElement member) {
|
||||
stopGraphComputation();
|
||||
|
@ -178,10 +182,11 @@ class THHierarchyModel {
|
|||
boolean fwd= fHierarchyKind == SUPER_TYPE_HIERARCHY;
|
||||
ArrayList stack= new ArrayList();
|
||||
ArrayList roots= new ArrayList();
|
||||
ArrayList leaves= new ArrayList();
|
||||
ArrayList leafs= new ArrayList();
|
||||
|
||||
THNode[] newSelection= new THNode[2];
|
||||
THGraphNode inputNode= fGraph.getInputNode();
|
||||
Collection groots;
|
||||
|
||||
if (fHierarchyKind == TYPE_HIERARCHY) {
|
||||
groots= fGraph.getLeaveNodes();
|
||||
}
|
||||
|
@ -197,7 +202,7 @@ class THHierarchyModel {
|
|||
|
||||
for (Iterator iterator = groots.iterator(); iterator.hasNext();) {
|
||||
THGraphNode gnode = (THGraphNode) iterator.next();
|
||||
THNode node = createNode(newSelection, null, gnode);
|
||||
THNode node = createNode(null, gnode, inputNode);
|
||||
roots.add(node);
|
||||
stack.add(node);
|
||||
}
|
||||
|
@ -207,31 +212,68 @@ class THHierarchyModel {
|
|||
THGraphNode gnode= fGraph.getNode(node.getElement());
|
||||
List edges= fwd ? gnode.getOutgoing() : gnode.getIncoming();
|
||||
if (edges.isEmpty()) {
|
||||
leaves.add(node);
|
||||
leafs.add(node);
|
||||
}
|
||||
else {
|
||||
for (Iterator iterator = edges.iterator(); iterator.hasNext();) {
|
||||
THGraphEdge edge = (THGraphEdge) iterator.next();
|
||||
THGraphNode gchildNode= fwd ? edge.getEndNode() : edge.getStartNode();
|
||||
THNode childNode= createNode(newSelection, node, gchildNode);
|
||||
THNode childNode= createNode(node, gchildNode, inputNode);
|
||||
node.addChild(childNode);
|
||||
stack.add(childNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
fSelectedTypeNode= newSelection[0];
|
||||
if (fSelectedTypeNode == null) {
|
||||
fSelectedTypeNode= newSelection[1];
|
||||
}
|
||||
fRootNodes= (THNode[]) roots.toArray(new THNode[roots.size()]);
|
||||
removeFilteredLeafs(fRootNodes);
|
||||
fSelectedTypeNode= findSelection(fRootNodes);
|
||||
if (fSelectedTypeNode != null) {
|
||||
fTypeToSelect= fSelectedTypeNode.getElement();
|
||||
updateSelectedMember();
|
||||
}
|
||||
|
||||
fRootNodes= (THNode[]) roots.toArray(new THNode[roots.size()]);
|
||||
updateImplementors();
|
||||
}
|
||||
|
||||
private void removeFilteredLeafs(THNode[] rootNodes) {
|
||||
for (int i = 0; i < rootNodes.length; i++) {
|
||||
THNode node = rootNodes[i];
|
||||
node.removeFilteredLeafs();
|
||||
}
|
||||
}
|
||||
|
||||
private THNode findSelection(THNode[] searchme) {
|
||||
THNode[] result= new THNode[2];
|
||||
findSelection(searchme, result);
|
||||
if (result[0] != null) {
|
||||
return result[0];
|
||||
}
|
||||
return result[1];
|
||||
}
|
||||
|
||||
private void findSelection(THNode[] seachme, THNode[] result) {
|
||||
for (int i = 0; i < seachme.length; i++) {
|
||||
findSelection(seachme[i], result);
|
||||
if (result[0] != null) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void findSelection(THNode node, THNode[] result) {
|
||||
if (node.equals(fSelectedTypeNode)) {
|
||||
result[0]= node;
|
||||
return;
|
||||
}
|
||||
else if (result[1] == null) {
|
||||
if (node.getElement().equals(fTypeToSelect)) {
|
||||
result[1]= node;
|
||||
}
|
||||
}
|
||||
THNode[] children= node.getChildren();
|
||||
findSelection(children, result);
|
||||
}
|
||||
|
||||
private void updateSelectedMember() {
|
||||
ICElement oldSelection= fSelectedMember;
|
||||
fSelectedMember= null;
|
||||
|
@ -257,18 +299,11 @@ class THHierarchyModel {
|
|||
}
|
||||
}
|
||||
|
||||
private THNode createNode(THNode[] newSelection, THNode parent, THGraphNode gnode) {
|
||||
private THNode createNode(THNode parent, THGraphNode gnode, THGraphNode inputNode) {
|
||||
ICElement element = gnode.getElement();
|
||||
THNode node= new THNode(parent, element);
|
||||
if (newSelection[0] == null) {
|
||||
if (node.equals(fSelectedTypeNode)) {
|
||||
newSelection[0]= node;
|
||||
}
|
||||
else if (newSelection[1] == null) {
|
||||
if (element.equals(fTypeToSelect)) {
|
||||
newSelection[1]= node;
|
||||
}
|
||||
}
|
||||
if (gnode != inputNode && fFilter != null && !fFilter.isPartOfWorkingSet(element)) {
|
||||
node.setIsFiltered(true);
|
||||
}
|
||||
return node;
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@ import org.eclipse.swt.widgets.Display;
|
|||
import org.eclipse.cdt.core.model.ICElement;
|
||||
import org.eclipse.cdt.ui.CElementImageDescriptor;
|
||||
|
||||
import org.eclipse.cdt.internal.ui.viewsupport.CElementImageProvider;
|
||||
import org.eclipse.cdt.internal.ui.viewsupport.CElementLabels;
|
||||
import org.eclipse.cdt.internal.ui.viewsupport.CUILabelProvider;
|
||||
import org.eclipse.cdt.internal.ui.viewsupport.ImageImageDescriptor;
|
||||
|
@ -45,11 +46,15 @@ public class THLabelProvider extends LabelProvider implements IColorProvider {
|
|||
}
|
||||
|
||||
public Image getImage(Object element) {
|
||||
if (element instanceof THNode) {
|
||||
if (element instanceof THNode) {
|
||||
THNode node= (THNode) element;
|
||||
ICElement decl= node.getElement();
|
||||
if (decl != null) {
|
||||
if (node.isFiltered()) {
|
||||
fCLabelProvider.setImageFlags(CElementImageProvider.LIGHT_TYPE_ICONS);
|
||||
}
|
||||
Image image= fCLabelProvider.getImage(decl);
|
||||
fCLabelProvider.setImageFlags(0);
|
||||
if (image != null) {
|
||||
return decorateImage(image, node);
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ package org.eclipse.cdt.internal.ui.typehierarchy;
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.core.runtime.IAdaptable;
|
||||
|
@ -124,5 +125,15 @@ public class THNode implements IAdaptable {
|
|||
public boolean isImplementor() {
|
||||
return fIsImplementor;
|
||||
}
|
||||
|
||||
public void removeFilteredLeafs() {
|
||||
for (Iterator iterator = fChildren.iterator(); iterator.hasNext();) {
|
||||
THNode child = (THNode) iterator.next();
|
||||
child.removeFilteredLeafs();
|
||||
if (child.isFiltered() && !child.hasChildren()) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -89,6 +89,7 @@ import org.eclipse.cdt.internal.ui.viewsupport.CElementLabels;
|
|||
import org.eclipse.cdt.internal.ui.viewsupport.CUILabelProvider;
|
||||
import org.eclipse.cdt.internal.ui.viewsupport.EditorOpener;
|
||||
import org.eclipse.cdt.internal.ui.viewsupport.SelectionProviderMediator;
|
||||
import org.eclipse.cdt.internal.ui.viewsupport.WorkingSetFilterUI;
|
||||
|
||||
/**
|
||||
* The view part for the include browser.
|
||||
|
@ -96,7 +97,7 @@ import org.eclipse.cdt.internal.ui.viewsupport.SelectionProviderMediator;
|
|||
public class THViewPart extends ViewPart {
|
||||
private static final int MAX_HISTORY_SIZE = 10;
|
||||
private static final String TRUE = String.valueOf(true);
|
||||
// private static final String KEY_WORKING_SET_FILTER = "workingSetFilter"; //$NON-NLS-1$
|
||||
private static final String KEY_WORKING_SET_FILTER = "workingSetFilter"; //$NON-NLS-1$
|
||||
private static final String KEY_SHOW_FILES= "showFilesInLabels"; //$NON-NLS-1$
|
||||
private static final String KEY_SHOW_INHERITED_MEMBERS= "showInheritedMembers"; //$NON-NLS-1$
|
||||
private static final String KEY_FILTER_FIELDS= "filterFields"; //$NON-NLS-1$
|
||||
|
@ -112,16 +113,19 @@ public class THViewPart extends ViewPart {
|
|||
private static final int ORIENTATION_HORIZONTAL = 1;
|
||||
private static final int ORIENTATION_VERTICAL = 2;
|
||||
private static final int ORIENTATION_SINGLE = 3;
|
||||
|
||||
// options for label provider
|
||||
private static final int MEMBER_LABEL_OPTIONS_SIMPLE = CElementLabels.M_PARAMETER_TYPES;
|
||||
private static final int MEMBER_LABEL_OPTIONS_QUALIFIED = MEMBER_LABEL_OPTIONS_SIMPLE | CElementLabels.ALL_POST_QUALIFIED;
|
||||
private static final int MEMBER_ICON_OPTIONS = CElementImageProvider.OVERLAY_ICONS;
|
||||
|
||||
// state information
|
||||
private IMemento fMemento;
|
||||
private boolean fShowsMessage= true;
|
||||
private int fCurrentViewOrientation= -1;
|
||||
private boolean fInComputeOrientation= false;
|
||||
|
||||
private ArrayList fHistoryEntries= new ArrayList(MAX_HISTORY_SIZE);
|
||||
private int fIgnoreSelectionChanges= 0;
|
||||
|
||||
// widgets
|
||||
private PageBook fPagebook;
|
||||
|
@ -132,46 +136,46 @@ public class THViewPart extends ViewPart {
|
|||
private ViewForm fMemberViewForm;
|
||||
private CLabel fMemberLabel;
|
||||
|
||||
// viewers
|
||||
// viewers and helpers
|
||||
private THHierarchyModel fModel;
|
||||
private THLabelProvider fHierarchyLabelProvider;
|
||||
private CUILabelProvider fMemberLabelProvider;
|
||||
private TableViewer fMemberViewer;
|
||||
private TreeViewer fHierarchyTreeViewer;
|
||||
|
||||
// filters, sorter
|
||||
// private WorkingSetFilterUI fWorkingSetFilterUI;
|
||||
// filters
|
||||
private WorkingSetFilterUI fWorkingSetFilterUI;
|
||||
private ViewerFilter fFieldFilter;
|
||||
private ViewerFilter fStaticFilter;
|
||||
private ViewerFilter fNonPublicFilter;
|
||||
|
||||
// actions
|
||||
private ToolBarManager fMemberToolbarManager;
|
||||
private Action fShowSuperTypeHierarchyAction;
|
||||
|
||||
private Action fShowSuperTypeHierarchyAction;
|
||||
private Action fShowSubTypeHierarchyAction;
|
||||
private Action fShowTypeHierarchyAction;
|
||||
private Action fShowInheritedMembersAction;
|
||||
|
||||
private Action fShowFilesInLabelsAction;
|
||||
private Action fRefreshAction;
|
||||
private Action fCancelAction;
|
||||
private Action fHistoryAction;
|
||||
private Action fOpenElement;
|
||||
|
||||
private Action fHorizontalOrientation;
|
||||
private Action fVerticalOrientation;
|
||||
private Action fAutomaticOrientation;
|
||||
private Action fSingleOrientation;
|
||||
|
||||
private Action fShowInheritedMembersAction;
|
||||
private Action fFieldFilterAction;
|
||||
private Action fStaticFilterAction;
|
||||
private Action fNonPublicFilterAction;
|
||||
|
||||
private ViewerFilter fFieldFilter;
|
||||
private ViewerFilter fStaticFilter;
|
||||
private ViewerFilter fNonPublicFilter;
|
||||
|
||||
// action groups
|
||||
private OpenViewActionGroup fOpenViewActionGroup;
|
||||
private SelectionSearchGroup fSelectionSearchGroup;
|
||||
private CRefactoringActionGroup fRefactoringActionGroup;
|
||||
private int fIgnoreSelectionChanges= 0;
|
||||
|
||||
|
||||
public void setFocus() {
|
||||
fPagebook.setFocus();
|
||||
|
@ -239,10 +243,10 @@ public class THViewPart extends ViewPart {
|
|||
fRefactoringActionGroup.dispose();
|
||||
fRefactoringActionGroup= null;
|
||||
}
|
||||
// if (fWorkingSetFilterUI != null) {
|
||||
// fWorkingSetFilterUI.dispose();
|
||||
// fWorkingSetFilterUI= null;
|
||||
// }
|
||||
if (fWorkingSetFilterUI != null) {
|
||||
fWorkingSetFilterUI.dispose();
|
||||
fWorkingSetFilterUI= null;
|
||||
}
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
|
@ -304,9 +308,9 @@ public class THViewPart extends ViewPart {
|
|||
|
||||
|
||||
public void saveState(IMemento memento) {
|
||||
// if (fWorkingSetFilterUI != null) {
|
||||
// fWorkingSetFilterUI.saveState(memento, KEY_WORKING_SET_FILTER);
|
||||
// }
|
||||
if (fWorkingSetFilterUI != null) {
|
||||
fWorkingSetFilterUI.saveState(memento, KEY_WORKING_SET_FILTER);
|
||||
}
|
||||
memento.putString(KEY_SHOW_INHERITED_MEMBERS, String.valueOf(fShowInheritedMembersAction.isChecked()));
|
||||
memento.putString(KEY_SHOW_FILES, String.valueOf(fShowFilesInLabelsAction.isChecked()));
|
||||
memento.putString(KEY_FILTER_FIELDS, String.valueOf(fFieldFilterAction.isChecked()));
|
||||
|
@ -339,7 +343,6 @@ public class THViewPart extends ViewPart {
|
|||
fHierarchyTreeViewer.getControl().setMenu(menu);
|
||||
site.registerContextMenu(CUIPlugin.ID_TYPE_HIERARCHY, manager, fHierarchyTreeViewer);
|
||||
|
||||
|
||||
manager = new MenuManager();
|
||||
manager.setRemoveAllWhenShown(true);
|
||||
manager.addMenuListener(new IMenuListener() {
|
||||
|
@ -517,14 +520,14 @@ public class THViewPart extends ViewPart {
|
|||
fSelectionSearchGroup= new SelectionSearchGroup(getSite());
|
||||
fRefactoringActionGroup= new CRefactoringActionGroup(this);
|
||||
|
||||
// fWorkingSetFilterUI= new WorkingSetFilterUI(this, fMemento, KEY_WORKING_SET_FILTER) {
|
||||
// protected void onWorkingSetChange() {
|
||||
// updateWorkingSetFilter(this);
|
||||
// }
|
||||
// protected void onWorkingSetNameChange() {
|
||||
// updateDescription();
|
||||
// }
|
||||
// };
|
||||
fWorkingSetFilterUI= new WorkingSetFilterUI(this, fMemento, KEY_WORKING_SET_FILTER) {
|
||||
protected void onWorkingSetChange() {
|
||||
updateWorkingSetFilter(this);
|
||||
}
|
||||
protected void onWorkingSetNameChange() {
|
||||
updateDescription();
|
||||
}
|
||||
};
|
||||
|
||||
fHorizontalOrientation= new Action(Messages.THViewPart_HorizontalOrientation, IAction.AS_RADIO_BUTTON) {
|
||||
public void run() {
|
||||
|
@ -728,8 +731,8 @@ public class THViewPart extends ViewPart {
|
|||
// local menu
|
||||
IMenuManager mm = actionBars.getMenuManager();
|
||||
|
||||
// fWorkingSetFilterUI.fillActionBars(actionBars);
|
||||
// mm.add(new Separator(IContextMenuConstants.GROUP_SHOW));
|
||||
fWorkingSetFilterUI.fillActionBars(actionBars);
|
||||
mm.add(new Separator(IContextMenuConstants.GROUP_SHOW));
|
||||
mm.add(fShowTypeHierarchyAction);
|
||||
mm.add(fShowSuperTypeHierarchyAction);
|
||||
mm.add(fShowSubTypeHierarchyAction);
|
||||
|
@ -805,8 +808,7 @@ public class THViewPart extends ViewPart {
|
|||
label= CElementLabels.getElementLabel(elem, 0);
|
||||
|
||||
// scope
|
||||
IWorkingSet workingSet= null;
|
||||
// workingSet= fWorkingSetFilterUI.getWorkingSet();
|
||||
IWorkingSet workingSet= fWorkingSetFilterUI.getWorkingSet();
|
||||
if (workingSet == null) {
|
||||
message= label;
|
||||
}
|
||||
|
@ -841,10 +843,10 @@ public class THViewPart extends ViewPart {
|
|||
fShowTypeHierarchyAction.setEnabled(!fShowsMessage);
|
||||
}
|
||||
|
||||
// private void updateWorkingSetFilter(WorkingSetFilterUI filterUI) {
|
||||
// fModel.setWorkingSetFilter(filterUI);
|
||||
// updateView();
|
||||
// }
|
||||
private void updateWorkingSetFilter(WorkingSetFilterUI filterUI) {
|
||||
fModel.setWorkingSetFilter(filterUI);
|
||||
updateView();
|
||||
}
|
||||
|
||||
public void onSetHierarchyKind(int kind) {
|
||||
if (fModel.getHierarchyKind() != kind) {
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
* Contributors:
|
||||
* IBM Corporation - initial API and implementation
|
||||
* QNX Software System
|
||||
* Markus Schorn (Wind River Systems)
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.internal.ui.viewsupport;
|
||||
|
||||
|
@ -331,21 +332,21 @@ public class CElementImageProvider {
|
|||
|
||||
case ICElement.C_STRUCT:
|
||||
case ICElement.C_TEMPLATE_STRUCT:
|
||||
return getStructImageDescriptor();
|
||||
return getStructImageDescriptor((renderFlags & LIGHT_TYPE_ICONS) != 0);
|
||||
|
||||
case ICElement.C_CLASS:
|
||||
case ICElement.C_TEMPLATE_CLASS:
|
||||
return getClassImageDescriptor();
|
||||
return getClassImageDescriptor((renderFlags & LIGHT_TYPE_ICONS) != 0);
|
||||
|
||||
case ICElement.C_UNION:
|
||||
case ICElement.C_TEMPLATE_UNION:
|
||||
return getUnionImageDescriptor();
|
||||
return getUnionImageDescriptor((renderFlags & LIGHT_TYPE_ICONS) != 0);
|
||||
|
||||
case ICElement.C_TYPEDEF:
|
||||
return getTypedefImageDescriptor();
|
||||
return getTypedefImageDescriptor((renderFlags & LIGHT_TYPE_ICONS) != 0);
|
||||
|
||||
case ICElement.C_ENUMERATION:
|
||||
return getEnumerationImageDescriptor();
|
||||
return getEnumerationImageDescriptor((renderFlags & LIGHT_TYPE_ICONS) != 0);
|
||||
|
||||
case ICElement.C_ENUMERATOR:
|
||||
return getEnumeratorImageDescriptor();
|
||||
|
@ -457,23 +458,43 @@ public class CElementImageProvider {
|
|||
}
|
||||
|
||||
public static ImageDescriptor getStructImageDescriptor(){
|
||||
return CPluginImages.DESC_OBJS_STRUCT;
|
||||
return getStructImageDescriptor(false);
|
||||
}
|
||||
|
||||
public static ImageDescriptor getStructImageDescriptor(boolean alt){
|
||||
return alt ? CPluginImages.DESC_OBJS_STRUCT_ALT : CPluginImages.DESC_OBJS_STRUCT;
|
||||
}
|
||||
|
||||
public static ImageDescriptor getClassImageDescriptor(){
|
||||
return CPluginImages.DESC_OBJS_CLASS;
|
||||
return getClassImageDescriptor(false);
|
||||
}
|
||||
|
||||
public static ImageDescriptor getClassImageDescriptor(boolean alt){
|
||||
return alt ? CPluginImages.DESC_OBJS_CLASS_ALT : CPluginImages.DESC_OBJS_CLASS;
|
||||
}
|
||||
|
||||
public static ImageDescriptor getUnionImageDescriptor(){
|
||||
return CPluginImages.DESC_OBJS_UNION;
|
||||
return getUnionImageDescriptor(false);
|
||||
}
|
||||
|
||||
public static ImageDescriptor getUnionImageDescriptor(boolean alt){
|
||||
return alt ? CPluginImages.DESC_OBJS_UNION_ALT : CPluginImages.DESC_OBJS_UNION;
|
||||
}
|
||||
|
||||
public static ImageDescriptor getTypedefImageDescriptor(){
|
||||
return CPluginImages.DESC_OBJS_TYPEDEF;
|
||||
return getTypedefImageDescriptor(false);
|
||||
}
|
||||
|
||||
public static ImageDescriptor getTypedefImageDescriptor(boolean alt){
|
||||
return alt ? CPluginImages.DESC_OBJS_TYPEDEF_ALT : CPluginImages.DESC_OBJS_TYPEDEF;
|
||||
}
|
||||
|
||||
public static ImageDescriptor getEnumerationImageDescriptor(){
|
||||
return CPluginImages.DESC_OBJS_ENUMERATION;
|
||||
return getEnumerationImageDescriptor(false);
|
||||
}
|
||||
|
||||
public static ImageDescriptor getEnumerationImageDescriptor(boolean alt){
|
||||
return alt ? CPluginImages.DESC_OBJS_ENUMERATION_ALT : CPluginImages.DESC_OBJS_ENUMERATION;
|
||||
}
|
||||
|
||||
public static ImageDescriptor getEnumeratorImageDescriptor(){
|
||||
|
|
Loading…
Add table
Reference in a new issue