Bug 15753 - Need public access to JDT actions
Summary: Need public access to JDT actions
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Erich Gamma CLA
QA Contact:
URL:
Whiteboard:
Keywords: api
Depends on:
Blocks:
 
Reported: 2002-05-10 11:39 EDT by Peter Burka CLA
Modified: 2002-05-13 10:00 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Burka CLA 2002-05-10 11:39:20 EDT
Build M5

I'm trying to build a text editor which provides a (large) subset of the 
behaviour available in the CompilationUnitEditor.

This editor will be used to edit 'snippets' of Java code which control the 
behaviour of a flow, drawn in a diagram adjacent to the text editor.

I've had quite a bit of success subclassing AbstractTextEditor and using a 
JavaSourceViewerConfiguration to configure it.

However I've had to reach into jdt.internal packages for a couple of things. I 
would like these to be promoted to public classes.

They are:

org.eclipse.jdt.internal.ui.javaeditor.AddImportOnSelectionAction
org.eclipse.jdt.internal.ui.javaeditor.OrganizeImportsAction

I also use
org.eclipse.jdt.internal.ui.javaeditor.JavaEditorMessages.
so that I can use the same labels for my actions as the CU editor uses.

And I use
org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionSourceViewer
so that I can get the CORRECTIONASSIST_PROPOSALS constant. (I'm not 100% 
certain that I need this one.)

I also need to provide a correctly typed IDocumentProvider to make content 
assist work properly. The only way that I've found to do this is:

setDocumentProvider((IDocumentProvider)JavaUI.getWorkingCopyManager());

This isn't really safe, since I'm relying on private knowledge that the 
working copy manager is also a dcument provider. I would like JavaUI to expose 
an API to access the CompilationUnitDocumentProvider (e.g. 
JavaUI.getDocumentProvider()).
Comment 1 Peter Burka CLA 2002-05-10 11:44:58 EDT
I'd also like access to the following classes to perform structured selection:

org.eclipse.jdt.internal.ui.actions.CompositeActionGroup

org.eclipse.jdt.internal.ui.javaeditor.structureselection.
  SelectionHistory;
  StructureSelectEnclosingAction
  StructureSelectHistoryAction
  StructureSelectNextAction
  StructureSelectPreviousAction
  StructureSelectionAction
Comment 2 Erich Gamma CLA 2002-05-11 03:55:18 EDT
OrganizeImport/AddImport
    see org.eclipse.jdt.ui.actions. 

org.eclipse.jdt.internal.ui.actions.CompositeActionGroup
    this isn't a Java specific class and should be promoted as 
    API at the Workbench/JFace level (carboned Nick)

CompilationUnitDocumentProvider 
    added to JavaUI

structureselection support
    cannot surface as API for 2.0

JavaEditorMessages API 
    we will not surface this class as API

Comment 3 Nick Edgar CLA 2002-05-13 10:00:36 EDT
Will not push down CompositeActionGroup for 2.0.
Please file an API request if you really want this for 3.0.