Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » How to create projection support with contributor class MultiPageEditorContributor
How to create projection support with contributor class MultiPageEditorContributor [message #1768486] Wed, 19 July 2017 11:45
kozhaev Vladimir is currently offline kozhaev VladimirFriend
Messages: 64
Registered: July 2009
Member
I need to implement code folding on client project. And I have done the prototype https://github.com/vladimirkozhaev/simpleeditor.

Problem is that in my prototype I use TextEditorActionContributor

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
 <extension
         point="org.eclipse.ui.editors">
      <editor
            class="org.newlanguageservice.editor.MinimalEditor"
            contributorClass="org.eclipse.ui.editors.text.TextEditorActionContributor"
            extensions="min"
            icon="icons/sample.gif"
            id="org.eclipse.faq.examples.editor.MinimalEditor"
            name="Minimal Editor">
   </editor>
   </extension>

</plugin>


But in the project I use MultiPageEditorContributor

<extension
         point="org.eclipse.ui.editors">
      <editor
            name="Omega Editor"
            extensions="txt"
            contributorClass="com.idc.eclipseplugin.editors.MultiPageEditorContributor"
            class="com.idc.eclipseplugin.editors.OmegaMultiPageEditor"
            id="com.idc.eclipseplugin.editors.OmegaMultiPageEditor">
      </editor>
   </extension>


That's why in the code I have class cast exception.

@Override public void createPartControl(Composite pParent) {
    super.createPartControl(pParent);
    ........
    ProjectionViewer viewer = (ProjectionViewer) getSourceViewer();

    mProjectionSupport = new ProjectionSupport(viewer, getAnnotationAccess(), getSharedColors());
    mProjectionSupport.install();

    // turn projection mode on
    viewer.doOperation(ProjectionViewer.TOGGLE);

    mAnnotationModel = viewer.getProjectionAnnotationModel();
}


method getSourceViewer return instance of the SourceViewer class instead of ProjectionViewer.

So, my question is: how to create projection viewer?
Previous Topic:INamedHandleStateIds.NAME does not work
Next Topic:RCP 3 Fragment does not resolve classes in the host
Goto Forum:
  


Current Time: Wed Sep 26 12:16:48 GMT 2018

Powered by FUDForum. Page generated in 0.02428 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top