Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[mylar-dev] Applying Mylar to a view and IMylarStructureBridge

Hi,

I am writing a call graph view for Eclipse and am trying to add
support for applying Mylar to it.

what is the best way to do so? I am extending AbstractApplyMylarAction
and InterestFilter

public class ApplyMylarToCallGraphAction extends AbstractApplyMylarAction
public class CallGraphInterestFilter extends InterestFilter

I am extending InterestFilter similar to MarkerInterestFilter as I've
got my own isImplicitlyInteresting rules. looking at the
MarkerInterestFilter code I saw the use of structure bridges. What is
the purpose of these? Do I need to use structure bridges for anything
or is it enough to implement the abstract methods of
AbstractApplyMylarAction to get going?

when calling super.select(viewer, parent, object); in the
CallGraphInterestFilter, does the object need to be a handle and how
do I would I get such a handle.

see code below for the MarkerInterstFilter.

private boolean isInteresting(ConcreteMarker marker, Viewer viewer,
Object parent) {
		if (isImplicitlyInteresting(marker)) {
			return true;
		} else {
			String handle =
MylarPlugin.getDefault().getStructureBridge(marker.getResource().getFileExtension())
					.getHandleForOffsetInObject(marker, 0);
			if (handle == null) {
				return false;
			} else {
				return super.select(viewer, parent,
MylarPlugin.getContextManager().getElement(handle));
			}
		}

	}


Raphael


Back to the top