[archstudio-commits] svn commit: r7081 - in /archstudio4/branches/traceability/edu.uci.isr.archstudio4.comp.tracelink/src/edu/uci/isr/archstudio4/comp/tracelink: controllers/ views/ views/layouts/

archstudio-commits-owner at uci.edu archstudio-commits-owner at uci.edu
Sun May 4 17:15:35 PDT 2008


Author: dpurpura
Date: Sun May  4 17:15:35 2008
New Revision: 7081

Log: (empty)

Modified:
    archstudio4/branches/traceability/edu.uci.isr.archstudio4.comp.tracelin=
k/src/edu/uci/isr/archstudio4/comp/tracelink/controllers/ITracelinkControll=
er.java
    archstudio4/branches/traceability/edu.uci.isr.archstudio4.comp.tracelin=
k/src/edu/uci/isr/archstudio4/comp/tracelink/controllers/LinksController.ja=
va
    archstudio4/branches/traceability/edu.uci.isr.archstudio4.comp.tracelin=
k/src/edu/uci/isr/archstudio4/comp/tracelink/controllers/SimpleTracelinkCon=
troller.java
    archstudio4/branches/traceability/edu.uci.isr.archstudio4.comp.tracelin=
k/src/edu/uci/isr/archstudio4/comp/tracelink/controllers/XADLFacade.java
    archstudio4/branches/traceability/edu.uci.isr.archstudio4.comp.tracelin=
k/src/edu/uci/isr/archstudio4/comp/tracelink/views/LinkTableView.java
    archstudio4/branches/traceability/edu.uci.isr.archstudio4.comp.tracelin=
k/src/edu/uci/isr/archstudio4/comp/tracelink/views/layouts/TracelinkSidebar=
ViewPart.java

Modified: archstudio4/branches/traceability/edu.uci.isr.archstudio4.comp.tr=
acelink/src/edu/uci/isr/archstudio4/comp/tracelink/controllers/ITracelinkCo=
ntroller.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- archstudio4/branches/traceability/edu.uci.isr.archstudio4.comp.tracelin=
k/src/edu/uci/isr/archstudio4/comp/tracelink/controllers/ITracelinkControll=
er.java (original)
+++ archstudio4/branches/traceability/edu.uci.isr.archstudio4.comp.tracelin=
k/src/edu/uci/isr/archstudio4/comp/tracelink/controllers/ITracelinkControll=
er.java Sun May  4 17:15:35 2008
@@ -14,7 +14,9 @@
 import edu.uci.isr.archstudio4.comp.tracelink.models.ITableElement;
 import edu.uci.isr.archstudio4.comp.tracelink.views.IWidget;
 import edu.uci.isr.myx.fw.AbstractMyxSimpleBrick;
+import edu.uci.isr.xarchflat.ObjRef;
 import edu.uci.isr.xarchflat.XArchFileListener;
+import edu.uci.isr.xarchflat.XArchFlatInterface;
 import edu.uci.isr.xarchflat.XArchFlatListener;
 =

 /**
@@ -97,4 +99,8 @@
 	=

 	public void setSortCriteria(String attribute);
 	=

+	=

+	public void setXArchRef(ObjRef xArchFlat);
+	public ObjRef getXArchRef();
+	=

 }
\ No newline at end of file

Modified: archstudio4/branches/traceability/edu.uci.isr.archstudio4.comp.tr=
acelink/src/edu/uci/isr/archstudio4/comp/tracelink/controllers/LinksControl=
ler.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- archstudio4/branches/traceability/edu.uci.isr.archstudio4.comp.tracelin=
k/src/edu/uci/isr/archstudio4/comp/tracelink/controllers/LinksController.ja=
va (original)
+++ archstudio4/branches/traceability/edu.uci.isr.archstudio4.comp.tracelin=
k/src/edu/uci/isr/archstudio4/comp/tracelink/controllers/LinksController.ja=
va Sun May  4 17:15:35 2008
@@ -17,6 +17,7 @@
 import edu.uci.isr.archstudio4.comp.tracelink.models.SimpleTracelinkConten=
tProvider;
 import edu.uci.isr.archstudio4.comp.tracelink.models.SimpleTracelinkLabelP=
rovider;
 import edu.uci.isr.archstudio4.comp.tracelink.views.IWidget;
+import edu.uci.isr.xarchflat.ObjRef;
 import edu.uci.isr.xarchflat.XArchFileEvent;
 import edu.uci.isr.xarchflat.XArchFlatEvent;
 =

@@ -262,4 +263,16 @@
 		// TODO Auto-generated method stub
 		=

 	}
+
+	@Override
+	public ObjRef getXArchRef() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public void setXArchRef(ObjRef archFlat) {
+		// TODO Auto-generated method stub
+		=

+	}
 }

Modified: archstudio4/branches/traceability/edu.uci.isr.archstudio4.comp.tr=
acelink/src/edu/uci/isr/archstudio4/comp/tracelink/controllers/SimpleTracel=
inkController.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- archstudio4/branches/traceability/edu.uci.isr.archstudio4.comp.tracelin=
k/src/edu/uci/isr/archstudio4/comp/tracelink/controllers/SimpleTracelinkCon=
troller.java (original)
+++ archstudio4/branches/traceability/edu.uci.isr.archstudio4.comp.tracelin=
k/src/edu/uci/isr/archstudio4/comp/tracelink/controllers/SimpleTracelinkCon=
troller.java Sun May  4 17:15:35 2008
@@ -15,6 +15,7 @@
 import org.eclipse.jface.viewers.ITableLabelProvider;
 import org.eclipse.swt.widgets.Table;
 =

+import edu.uci.isr.archstudio4.comp.tracelink.TracelinkViewMyxComponent;
 import edu.uci.isr.archstudio4.comp.tracelink.models.ITableElement;
 import edu.uci.isr.archstudio4.comp.tracelink.models.SimpleTracelinkCellMo=
difier;
 import edu.uci.isr.archstudio4.comp.tracelink.models.SimpleTracelinkConten=
tProvider;
@@ -28,6 +29,7 @@
 import edu.uci.isr.xarch.tracelink.IArchTraceLinks;
 import edu.uci.isr.xarch.tracelink.ITraceEndpoint;
 import edu.uci.isr.xarch.tracelink.ITraceLink;
+import edu.uci.isr.xarchflat.ObjRef;
 import edu.uci.isr.xarchflat.XArchFileEvent;
 import edu.uci.isr.xarchflat.XArchFileListener;
 import edu.uci.isr.xarchflat.XArchFlatEvent;
@@ -40,6 +42,8 @@
  */
 public class SimpleTracelinkController extends AbstractMyxSimpleBrick impl=
ements ITracelinkController{
 	=

+	protected XADLFacade xadlFacade;
+	=

 	private String filterKey;
 	private String filterProperty;
 	=

@@ -73,19 +77,37 @@
 		MyxUtils.createName("edittracelinks");
 =

 	=

-	MyxRegistry myxr =3D MyxRegistry.getSharedInstance();
-	private XArchFlatInterface xarch;
+	protected MyxRegistry myxr =3D MyxRegistry.getSharedInstance();
+	protected XArchFlatInterface xArchFlat;
 =

 	=

 	public SimpleTracelinkController() {
 		this(new Vector<ITableElement>());
 	}
 	=

+	public SimpleTracelinkController(Vector<ITableElement> elements){
+		filterKey =3D "";
+		filterProperty =3D "";
+		=

+		sorter =3D new TracelinkSorter(this);
+		=

+		this.elements =3D elements;
+		this.filteredElements =3D this.elements;
+		=

+		this.viewers =3D new Vector<IWidget>();
+		=

+		this.endpointHref =3D "";
+	}
+	=

 	=

 	@Override
 	public void begin() {
-		xarch =3D (XArchFlatInterface) MyxUtils.getFirstRequiredServiceObject(
+		System.out.println("BEGIN TRACELINK_CONTROLLER!!");
+		=

+		xArchFlat =3D (XArchFlatInterface) MyxUtils.getFirstRequiredServiceObjec=
t(
 				this, INTERFACE_NAME_OUT_XARCH);
+		xadlFacade =3D new XADLFacade(xArchFlat);
+		=

 		//xarch =3D =

 		//	(XArchFlatInterface) MyxUtils.getFirstRequiredServiceObject(this, INT=
ERFACE_NAME_OUT_XARCH);
 		//tracelink =3D new TraceLinkImpl(xarch);
@@ -117,7 +139,7 @@
 			return null;
 	}
 =

-	//@Override
+	@Override
 	public void handleXArchFileEvent(XArchFileEvent evt){
 		for(Object o: myxr.getObjects(this).clone()){
 			if(o instanceof XArchFileListener){
@@ -126,7 +148,7 @@
 		}
 	}
 =

-	//@Override
+	@Override
 	public void handleXArchFlatEvent(XArchFlatEvent evt){
 		for(Object o: myxr.getObjects(this).clone()){
 			if(o instanceof XArchFlatListener){
@@ -135,19 +157,7 @@
 		}
 	}
 =

-	public SimpleTracelinkController(Vector<ITableElement> elements){
-		filterKey =3D "";
-		filterProperty =3D "";
-		=

-		sorter =3D new TracelinkSorter(this);
-		=

-		this.elements =3D elements;
-		this.filteredElements =3D this.elements;
-		=

-		this.viewers =3D new Vector<IWidget>();
-		=

-		this.endpointHref =3D "";
-	}
+
 	=

 	=

 	@Override
@@ -277,11 +287,8 @@
 	public void updateViews() {
 		System.err.println("Updating Views");
 		=

-		if (XADLFacade.isAvailable()) {
-			IArchTraceLinks tracelinks =3D =

-				XADLFacade.getInstance().getArchTracelinks();
-			setLinks(getRelatedLinks(tracelinks, endpointHref));
-		}
+		IArchTraceLinks tracelinks =3D xadlFacade.getArchTracelinks();
+		setLinks(getRelatedLinks(tracelinks, endpointHref));
 		=

 		filteredElements =3D filter(elements, filterKey, filterProperty);
 		sort(filteredElements);
@@ -398,7 +405,13 @@
 		=

 	}
 =

+	@Override
+	public ObjRef getXArchRef() {
+		return xadlFacade.getXArchRef();
+	}
 =

-	=

-	=

+	@Override
+	public void setXArchRef(ObjRef xArchRef) {
+		xadlFacade.setXArchRef(xArchRef);
+	}
 }

Modified: archstudio4/branches/traceability/edu.uci.isr.archstudio4.comp.tr=
acelink/src/edu/uci/isr/archstudio4/comp/tracelink/controllers/XADLFacade.j=
ava
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- archstudio4/branches/traceability/edu.uci.isr.archstudio4.comp.tracelin=
k/src/edu/uci/isr/archstudio4/comp/tracelink/controllers/XADLFacade.java (o=
riginal)
+++ archstudio4/branches/traceability/edu.uci.isr.archstudio4.comp.tracelin=
k/src/edu/uci/isr/archstudio4/comp/tracelink/controllers/XADLFacade.java Su=
n May  4 17:15:35 2008
@@ -21,7 +21,6 @@
  */
 public class XADLFacade {
 	=

-	private static XADLFacade instance;
 	protected static XArchFlatInterface xArchFlat;
 	=

 	protected ObjRef xArchRef;
@@ -29,53 +28,30 @@
 	protected IXArchImplementation xArchImplementation;
 	protected IXArch xArch;
 	=

-	protected IInstanceContext instanceContext;
-	protected ITypesContext typesContext;
+	//protected IInstanceContext instanceContext;
+	//protected ITypesContext typesContext;
 	=

 	=

-	protected XADLFacade() throws NullPointerException{
+	public XADLFacade(XArchFlatInterface xArchFlat) {
 		xArchImplementation =3D =

 			XArchFlatProxyUtils.getXArchImplementation(xArchFlat);
 		xArch =3D xArchImplementation.createXArch();
 		=

-		instanceContext =3D =

-			(IInstanceContext) xArchImplementation.createContext(xArch, "instance");
-		typesContext =3D =

-			(ITypesContext) xArchImplementation.createContext(xArch, "types");
+		//instanceContext =3D =

+		//	(IInstanceContext) xArchImplementation.createContext(xArch, "instance=
");
+		//typesContext =3D =

+		//	(ITypesContext) xArchImplementation.createContext(xArch, "types");
 		=

 	}
 	=

-	/**
-	 * @return the XADLFacade instance if myx framework has been loaded; othe=
rwise returns null
-	 */
-	public static XADLFacade getInstance() {
-		if ((instance =3D=3D null) && (xArchFlat !=3D null)) {
-			try{
-				instance =3D new XADLFacade();
-			}
-			catch(NullPointerException e) {
-				instance =3D null;
-			}
-		}
-		return instance;
-	}
-	=

-	/**
-	 * @return the XADLFacade instance if myx framework has been loaded; othe=
rwise returns null
-	 */
-	public static XADLFacade getInstance(XArchFlatInterface xArchFlat) {
-		setXArchFlat(xArchFlat);
-		return getInstance();
-	}
-	=

-	public static boolean isAvailable() {
-		return XADLFacade.getInstance() !=3D null;
-	}
-	=

 	public void setXArchRef(ObjRef xArchRef) {
 		this.xArchRef =3D xArchRef;
 	}
 	=

+	public ObjRef getXArchRef() {
+		return this.xArchRef;
+	}
+	=

 	public static void setXArchFlat(XArchFlatInterface xArchFlat) {
 		XADLFacade.xArchFlat =3D xArchFlat;
 	}

Modified: archstudio4/branches/traceability/edu.uci.isr.archstudio4.comp.tr=
acelink/src/edu/uci/isr/archstudio4/comp/tracelink/views/LinkTableView.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- archstudio4/branches/traceability/edu.uci.isr.archstudio4.comp.tracelin=
k/src/edu/uci/isr/archstudio4/comp/tracelink/views/LinkTableView.java (orig=
inal)
+++ archstudio4/branches/traceability/edu.uci.isr.archstudio4.comp.tracelin=
k/src/edu/uci/isr/archstudio4/comp/tracelink/views/LinkTableView.java Sun M=
ay  4 17:15:35 2008
@@ -92,7 +92,6 @@
 		TableColumn column;
 		for (int i=3D0; i<columnNames.length; i++) {
 			column =3D new TableColumn(table, SWT.LEFT, i);
-			=

 			column.setText(columnNames[i]);
 			column.setWidth(100);
 			column.addSelectionListener(

Modified: archstudio4/branches/traceability/edu.uci.isr.archstudio4.comp.tr=
acelink/src/edu/uci/isr/archstudio4/comp/tracelink/views/layouts/TracelinkS=
idebarViewPart.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- archstudio4/branches/traceability/edu.uci.isr.archstudio4.comp.tracelin=
k/src/edu/uci/isr/archstudio4/comp/tracelink/views/layouts/TracelinkSidebar=
ViewPart.java (original)
+++ archstudio4/branches/traceability/edu.uci.isr.archstudio4.comp.tracelin=
k/src/edu/uci/isr/archstudio4/comp/tracelink/views/layouts/TracelinkSidebar=
ViewPart.java Sun May  4 17:15:35 2008
@@ -85,10 +85,7 @@
 	protected TableViewer tableviewer;
 	protected PageBook pagebook;
 	=

-	protected ObjRef xArchRef;
-	=

 	protected ITracelinkController controller;
-	protected XADLPrinter printer;
 	=

 	//H
 	private Boolean recordOn;
@@ -106,29 +103,11 @@
 		=

 		ignoreEventsLock =3D new Object();
 		myxMapped =3D new ArrayList<Object>();
-		xArchRef =3D null;
 		=

 		controller =3D new SimpleTracelinkController();
 	}
 	=

 =

-	/**
-	 * @return the xArchRef
-	 */
-	public ObjRef getXArchRef() {
-		return xArchRef;
-	}
-	=

-	/**
-	 * @param archRef the xArchRef to set
-	 */
-	public void setXArchRef(ObjRef xArchRef) {
-		if (xArchRef !=3D null)
-			this.xArchRef =3D xArchRef;
-	}
-	=

-	=

-	=

 	protected void myxMap(Object o){
 		if(o !=3D null){
 			myxMapped.add(o);
@@ -265,6 +244,21 @@
 		item2.setControl(bottomPanel);
 =

 		=

+		// =3D=3D EXPAND ITEM 3 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
+		Composite buttons =3D new Composite(parent, SWT.None);
+		layout =3D new GridLayout ();
+		layout.marginLeft =3D layout.marginTop =3D layout.marginRight =3D layout=
.marginBottom =3D 10;
+		layout.verticalSpacing =3D 10;
+		buttons.setLayout(layout);
+		=

+		displayLocationButtons(buttons, style, layoutStyle);
+		=

+		ExpandItem item3 =3D new ExpandItem((ExpandBar)parent, SWT.NONE, 3);
+		item3.setText("Find Endpoint Location");
+		item3.setHeight(buttons.computeSize(SWT.DEFAULT, SWT.DEFAULT).y);
+		item3.setControl(buttons);
+		=

+		=

 		// buttons testing GUI functionality
 		/*Button button1 =3D new Button(parent, SWT.None);
 		button1.setText("LinksModel1");
@@ -296,27 +290,10 @@
 		item0.setExpanded(true);
 		item1.setExpanded(true);
 		item2.setExpanded(true);
+		item3.setExpanded(true);
 	=

 	}
 =

-
-
-	/**
-	 * =

-	 */
-	private void loadTracelinks() {
-		loadTracelinks(printer.getTracelinks());
-	}
-	=

-	private void loadTracelinks(Collection<ITraceLink> tlinks) {
-		Vector<ITableElement> links =3D new Vector<ITableElement>();
-		for (ITraceLink link : tlinks) {
-			links.add(new TracelinkModel(link));
-		}
-		=

-		 controller.setLinks(links);
-	}
-	=

 	/**
 	 * @param parent
 	 * @param style
@@ -363,7 +340,32 @@
 		extractLinksButton
 		.addSelectionListener(new ExtractLinksButtonSelectionAdapter());
 		=

-		=

+	}
+	=

+	/**
+	 * @param style
+	 * @param parent
+	 */
+	private void displayLocationButtons(Composite parent, final int style, in=
t layoutStyle) {
+		Composite composite =3D new Composite(parent, style);
+		composite.setLayoutData(new GridData(layoutStyle));
+		=

+		FillLayout layout =3D new FillLayout();
+		composite.setLayout(layout);
+		=

+		Vector<ITableElement> endpoints =3D controller.getFilteredElements();
+		Button button;
+		for (int i=3D0; i<endpoints.size(); i++) {
+			button =3D new Button(parent, style);
+			button.setText(new Integer(i).toString());
+			=

+			//button.addSelectionListener(new SelectionListener());
+			/*
+			 * Hazel, you will want to uncomment and add your selection
+			 * listener above =

+			 */
+			=

+		}
 		=

 	}
 	=

@@ -389,7 +391,7 @@
 			}
 			*/
 			//TODO: find a better place for this
-			tr =3D new TraceRecorder(xArchFlat, xArchRef);
+			tr =3D new TraceRecorder(xArchFlat, controller.getXArchRef());
 			if (recordButton.getText().compareTo("Record START") =3D=3D 0) { =

 				recordOn =3D true;
 				setContentDescription("Recording Trace Links");
@@ -460,243 +462,44 @@
 		}
 	}
 	=

-	private class XADLPrinter extends SelectionAdapter {
-		=

-		ObjRef archStructureRef;
-		=

-		// Create an XArchFlatProxy-based IXArchImplementation
-		IXArchImplementation xArchImplementation =3D =

-			XArchFlatProxyUtils.getXArchImplementation(xArchFlat);
-		=

-		// Create a new xArch element (i.e. a xADL 2.0 document)
-		IXArch xArch =3D xArchImplementation.createXArch();
-		=

-		// Create types and instance contexts
-		IInstanceContext instance =3D =

-			(IInstanceContext) xArchImplementation.createContext(xArch, "instance");
-		ITypesContext types =3D =

-			(ITypesContext) xArchImplementation.createContext(xArch, "types");
 		=

-		=

-		public Vector<ITraceLink> getTracelinks() {
-			IComponent component =3D types.createComponent();
-			component.setId("TracelinkView");
-			=

-			Vector<ITraceLink> tracelinks =3D new Vector<ITraceLink>();
-			=

-			if (xArchRef !=3D null)
-			{
-				System.err.println("Walking trees in file: " + xArchFlat.getXArchURI(x=
ArchRef));
-				=

-				ObjRef tracelinkContextRef =3D xArchFlat.createContext(xArchRef, "trac=
elink");
-				ObjRef archTraceLinksRef =3D xArchFlat.getElement(tracelinkContextRef,=
 ArchTraceLinksImpl.XSD_TYPE_NAME, xArchRef);
-				=

-				if(archTraceLinksRef =3D=3D null){
-					System.err.println("This file does not use tracelinks");
-					return null;
-				}
-				=

-				System.err.println("Tracelinks found... continuing");
-				=

-				IArchTraceLinks links =3D
-					(IArchTraceLinks) XArchFlatProxyUtils.proxy(xArchFlat, archTraceLinks=
Ref);
-				=

-				if (links =3D=3D null)
-					System.err.println("no tracelinks in TracelinkContext");
-				else
-				{
-					System.err.println("printing tracelinks...");
-					Collection<ITraceLink> tlinks =3D links.getAllTraceLinks();
-					=

-					//loadTracelinks(tlinks);
-					=

-					for (ITraceLink link : tlinks)
-					{
-						tracelinks.add(link);
-					}
-				}
-			}
-			=

-			=

-			return tracelinks;
-		}
-		=

-		=

-		public void widgetSelected(SelectionEvent event) {
-			// Create a component and description
-			IComponent component =3D types.createComponent();
-			component.setId("TracelinkView");
-			=

-			/*
-			 * make a myx component
-			 * =

-			 * changesetmyx component
-			 */
-			if (xArchRef !=3D null)
-			{
-				//ObjRef componentRef =3D xArchFlat.getByID(xArchRef,
-				//	"example_component_id");
-				//ObjRef descriptionRef =3D xArchFlat.get(componentRef, "Description");
-				///----------------------
-				=

-				System.err.println("Walking trees in file: " + xArchFlat.getXArchURI(x=
ArchRef));
-				=

-				/*
-				String[] refs =3D xarch.getContextTypes();
-				for (String ref : refs)
-					System.out.println(ref);
-				*/
-				=

-				// get the tracelink context =

-				// H: this seems to correspond to the namespace
-				//    Yes, context is the abbreviated package name
-				ObjRef tracelinkContextRef =3D xArchFlat.createContext(xArchRef, "trac=
elink");
-				=

-				=

-				=

-				// get the archchangesets element for the file
-				// there should only be one of these per file
-				// H: this seems to be the main container of the tracelink nodes
-				ObjRef archTraceLinksRef =3D xArchFlat.getElement(tracelinkContextRef,=
 ArchTraceLinksImpl.XSD_TYPE_NAME, xArchRef);
-				if(archTraceLinksRef =3D=3D null){
-					System.err.println("This file does not use tracelinks");
-				//xarch.add(base, types)
-					//xarch.getAll(tracelinkContextRef, )
-					return;
-				}
-				System.err.println("Tracelinks found... continuing");
-				// get the list of trace links for the file
-				// note that these will be in a random order, not the order of the cha=
nge set viewer -- but that's okay
-				// H: get all the traceLink nodes
-				ObjRef[] traceLinksRefs =3D xArchFlat.getAll(archTraceLinksRef, TraceL=
inkImpl.XSD_TYPE_NAME);
-				=

-				// process each trace link
-				for(ObjRef traceLinksRef: traceLinksRefs){
-					System.out.println("Walking trace link: " + XadlUtils.getDescription(=
xArchFlat, traceLinksRef));
-					//ObjRef traceDescriptionRef =3D xarch.get(traceLinksRef, TraceLinkIm=
pl.DESCRIPTION_ELT_NAME, traceLinksRef.getUID());
-					//if the following does not work, try changing "value" to all lowerca=
se
-					//System.out.println(xarch.get(traceDescriptionRef, "Value"));		 =

-					=

-					// get the traceLinkRelationship node
-					ObjRef traceLinkRelationshipRef =3D (ObjRef)xArchFlat.get(traceLinksR=
ef, TraceLinkRelationshipImpl.XSD_TYPE_NAME);
-					System.out.println("RelationshipRef: " + traceLinkRelationshipRef);
-					=

-					=

-					//go through another loop to get all the endpoints
-					ObjRef[] endpointRefs =3D xArchFlat.getAll(traceLinksRef, TraceEndpoi=
ntImpl.XSD_TYPE_NAME);
-					for(ObjRef endpointRef: endpointRefs) {
-						ObjRef locationRef =3D (ObjRef)xArchFlat.get(endpointRef, TraceEndpo=
intImpl.LOCATION_ELT_NAME);
-						System.out.println("LocationRef: " + locationRef.toString());
-					}
-				}
-				=

-			=

-				=

-				//IArchTraceLinks links =3D tracelink.getArchTraceLinks(xArch);
-				IArchTraceLinks links =3D
-					(IArchTraceLinks) XArchFlatProxyUtils.proxy(xArchFlat, archTraceLinks=
Ref);
-				=

-				if (links =3D=3D null)
-					System.err.println("no tracelinks in TracelinkContext");
-				else
-				{
-					System.err.println("printing tracelinks...");
-					=

-					Collection<ITraceLink> tlinks =3D links.getAllTraceLinks();
-					=

-					for (ITraceLink link : tlinks)
-					{
-						System.err.println( "[" + link.getTraceLinkID() + "] "
-								+ link.getDescription() + "\n"
-								+ link.getTraceLinkRelationship().getClassification().getValue());
-						=

-						Collection<ITraceEndpoint> endpoints =3D link.getAllTraceEndpoints();
-						=

-						for (ITraceEndpoint ep : endpoints) {
-							//System.err.println("\t[" + ep.getTraceEndpointID() + "] "
-							//		+ ep.getAuthor().getUsername());
-							System.err.println("\t[" + ep.getTraceEndpointID() + "] ");
-									//+ ep.getAuthor().getUsername());
-						}
-					}
-				}
-			=

-					=

-				=

-				=

-				=

-				/*----------------
-					 //Proxy just the description and change it through XArchFlatProxy
-					 IDescription desc =3D (IDescription)
-					 	XArchFlatFactory.proxy(xArchFlat, descriptionRef);
-					 desc.setValue("Changed Component Description");
-					=

-					 //Print the description through XArchFlatInterface
-					 System.err.println(xArchFlat.get(descriptionRef, "Value"));
-				=

-					/*
-					 ObjRef[] componentRefs =3D xArchFlat.getAll(archStructureRef,
-					 "ArchTraceLinks");
-					 =

-					for (ObjRef compRef : componentRefs) {
-						System.out.println(compRef.toString());
-					}
-				=

-				 */
-			}
-		}
-	}
-	=

-
-	=

-	////@override
+	@Override
 	public void partActivated(IWorkbenchPart part) {
 		if(part instanceof IEditorPart){
 			IEditorPart editorPart =3D (IEditorPart)part;
 			if(editorPart.getEditorInput() instanceof IFileEditorInput){
 				IFileEditorInput fileEditorInput =3D (IFileEditorInput)editorPart.getE=
ditorInput();
 				=

-				XADLFacade.getInstance(xArchFlat).setXArchRef(xArchFlat.getOpenXArch(f=
ileEditorInput.getFile().getFullPath().makeAbsolute().toString()));
-				=

-				setXArchRef(xArchFlat.getOpenXArch(fileEditorInput.getFile().getFullPa=
th().makeAbsolute().toString()));
-				=

-				=

+				controller.setXArchRef(xArchFlat.getOpenXArch(fileEditorInput.getFile(=
).getFullPath().makeAbsolute().toString()));
 				controller.updateViews();
 			}
 		}
 	}
 	=

-	//@override
+	@Override
 	public void partBroughtToTop(IWorkbenchPart part) {
 		// TODO Auto-generated method stub
 		=

 	}
 	=

-	//@override
+	@Override
 	public void partClosed(IWorkbenchPart part) {
 		// TODO Auto-generated method stub
 		=

 	}
 	=

-	//@override
+	@Override
 	public void partDeactivated(IWorkbenchPart part) {
 		// TODO Auto-generated method stub
 		=

 	}
 	=

-	//@override
+	@Override
 	public void partOpened(IWorkbenchPart part) {
 		// TODO Auto-generated method stub
 		=

 	}
 	=

-	//@override
-	public void selectionChanged(SelectionChangedEvent event) {
-		// TODO Auto-generated method stub
-		=

-	}
-	=

-	=

 	/*
 	 * H: The code below deals with listening and capturing selection events
 	 */




More information about the archstudio-commits mailing list