Bug 21197 - Don't hard code the editor id names for the ManageBreakpointRulerActionDelegate
Summary: Don't hard code the editor id names for the ManageBreakpointRulerActionDelegate
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.0.1   Edit
Assignee: Jared Burns CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-07-03 05:42 EDT by Joe Winchester CLA
Modified: 2002-08-05 10:36 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joe Winchester CLA 2002-07-03 05:42:14 EDT
We have an editor that wrappers the CompilationUnitEditor and presents it on a 
split pane initializing it through its API of createPartControl and 
init(IEditorSite,IEditorInput).  Everything works great except for a few places. 
 One of these is the class ManageBreakpointRulerActionDelegate that expects a 
specific ID only to be present.  Could this be changed to not hard code the id 
of the editor part ?  Either remove the check entirely ( which I don't see why 
it is actually necessary ) or else use some method that other edit parts could 
implement such as a marker interface.   The method that does a hard coded check 
is shown below.

public void setActiveEditor(IAction callerAction, IEditorPart targetEditor) {
		
		// only care about compilation unit and class file editors
		if (targetEditor != null) {
			String id= targetEditor.getSite().getId();
			if (!id.equals(JavaUI.ID_CU_EDITOR) && 
!id.equals(JavaUI.ID_CF_EDITOR))
				targetEditor= null;
		}
		
		super.setActiveEditor(callerAction, targetEditor);
	}
Comment 1 Joe Winchester CLA 2002-07-03 06:34:52 EDT
The actions EnableDisableBreakpointRulerActionDelegate and 
JavaBreakpointPropertiesRulerActionDelegate both work without checking the 
editor ID so to be consistent it would appear that it is safe for  
ManageBreakpointRulerActionDelegate to let any editor through.
Comment 2 Darin Swanson CLA 2002-07-09 12:49:52 EDT
I agree that it appears to be an unneccesary as the XML specifies the targetID 
and that should be the only restriction.

Removed hard coded restriction.

Please verify (Jared).
Comment 3 Darin Wright CLA 2002-07-23 13:42:06 EDT
Placed fix in 2.0.1 branch
Comment 4 Jared Burns CLA 2002-08-05 10:36:57 EDT
Verified.