API consolidation for org.eclipse.objectteams.otdt.debug
- redefine the line between API and non-API
- add javadoc to API
- removed some unused stuff
Also:
- implemented clearing the TeamView when a launch terminates
- removed redundant sort mode "activation order"
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/views/TeamView.java b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/views/TeamView.java
index 076ab48..5073606 100644
--- a/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/views/TeamView.java
+++ b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/views/TeamView.java
@@ -87,7 +87,7 @@
 	
 	public String getDefaultSortMode()
 	{
-		return IOTDTDebugPreferenceConstants.TEAMS_BY_ACTIVATION_ORDER;
+		return IOTDTDebugPreferenceConstants.TEAMS_BY_ACTIVATION_TIME;
 	}
 
 	@Override // COPY_AND_PASTE from super, edited:
@@ -185,8 +185,21 @@
 	
 	public void launchesTerminated(ILaunch[] launches)
 	{
-		//clear TeamView
-		;
+		for (ILaunch launch : launches) {
+			if (launch.isTerminated()) {
+				OTDebugElementsContainer current = (OTDebugElementsContainer)getViewer().getInput();
+				IDebugTarget currentTarget = current.getContext().getDebugTarget();
+				if (launch.getDebugTarget() == currentTarget) { 
+					current.dispose(); // clear all previous team instances
+					getViewer().getControl().getDisplay().asyncExec(new Runnable() {
+						public void run() {
+							getViewer().setInput(null);							
+						}						
+					});
+					return;
+				}
+			}
+		}
 	}
 
 	public void launchesRemoved(ILaunch[] launches) {}
@@ -224,17 +237,15 @@
 
 	private void createSortActions(IMenuManager viewMenu)
 	{
-		final SortTeamAction sortAction1 = new SortTeamAction(this, IOTDTDebugPreferenceConstants.TEAMS_BY_ACTIVATION_ORDER);
-		final SortTeamAction sortAction2 = new SortTeamAction(this, IOTDTDebugPreferenceConstants.TEAMS_BY_ACTIVATION_TIME);
-		final SortTeamAction sortAction3 = new SortTeamAction(this, IOTDTDebugPreferenceConstants.TEAMS_BY_INSTANTIATION);
-		final SortTeamAction sortAction4 = new SortTeamAction(this, IOTDTDebugPreferenceConstants.TEAMS_BY_NAME);
+		final SortTeamAction sortAction1 = new SortTeamAction(this, IOTDTDebugPreferenceConstants.TEAMS_BY_ACTIVATION_TIME);
+		final SortTeamAction sortAction2 = new SortTeamAction(this, IOTDTDebugPreferenceConstants.TEAMS_BY_INSTANTIATION);
+		final SortTeamAction sortAction3 = new SortTeamAction(this, IOTDTDebugPreferenceConstants.TEAMS_BY_NAME);
 		
 		final MenuManager layoutSubMenu = new MenuManager(TeamViewMessages.TeamView_0);
 		layoutSubMenu.setRemoveAllWhenShown(true);
 		layoutSubMenu.add(sortAction1);
 		layoutSubMenu.add(sortAction2);
 		layoutSubMenu.add(sortAction3);
-		layoutSubMenu.add(sortAction4);
 		viewMenu.add(layoutSubMenu);
 		viewMenu.add(new Separator());
 
@@ -245,7 +256,6 @@
 				layoutSubMenu.add(sortAction1);
 				layoutSubMenu.add(sortAction2);
 				layoutSubMenu.add(sortAction3);
-				layoutSubMenu.add(sortAction4);
 			}
 		});
 	}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/views/TeamViewMessages.java b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/views/TeamViewMessages.java
index 4332777..24d0ab1 100644
--- a/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/views/TeamViewMessages.java
+++ b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/views/TeamViewMessages.java
@@ -29,8 +29,6 @@
 	public static String SortTeamByName_0;

 

 	public static String SortTeamByActivation_0;

-

-	public static String SortTeamByActivation_1;

 	

 	public static String SortTeamByInstantiation_0;

 

diff --git a/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/views/TeamViewMessages.properties b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/views/TeamViewMessages.properties
index 4c3538c..5f0b935 100644
--- a/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/views/TeamViewMessages.properties
+++ b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/views/TeamViewMessages.properties
@@ -23,6 +23,5 @@
 TeamView_1=Team View Only

 SortTeamByName_0=Sort Teams by Name

 SortTeamByActivation_0=Sort Teams by Activation Time

-SortTeamByActivation_1=Sort Teams by Activation Order

 SortTeamByInstantiation_0=Sort Teams by Instantiation Time

-SortTeamDescription_0=By Default Teams are sorted by Activation Order.

+SortTeamDescription_0=By Default Teams are sorted by Activation Time.