Skip to main content

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

A new structure bridge is only needed if you want to support a new kind of
element.  Mylar currently has bridges for generic resources (projects, files
and directories), java elements, and plugin.xml/build.xml XML nodes.  Is
your view showing these elements, or something different?

If at possible you should be using the standard InterestFilter.  The
MarkerInterestFilter is different because it needs to adapt markers to their
corresponding elements (e.g. a sourceline to a Java Element).  So it's not a
good example.  So I'm wondering if your special interest rules can be
expressed in terms of updating the interest model rather than with the
isImplicitlyInteresting stuff which can be a problematic if it results in
inconsistency between views.  What are the rules?

Mik

> -----Original Message-----
> From: mylar-dev-bounces@xxxxxxxxxxx [mailto:mylar-dev-bounces@xxxxxxxxxxx]
> On Behalf Of Raphael Ackermann
> Sent: Thursday, June 15, 2006 3:14 AM
> To: mylar-dev@xxxxxxxxxxx
> Subject: [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().getFileEx
> tension())
> 					.getHandleForOffsetInObject(marker,
0);
> 			if (handle == null) {
> 				return false;
> 			} else {
> 				return super.select(viewer, parent,
> MylarPlugin.getContextManager().getElement(handle));
> 			}
> 		}
> 
> 	}
> 
> 
> Raphael
> _______________________________________________
> mylar-dev mailing list
> mylar-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/mylar-dev



Back to the top