Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Dynamic Languages Toolkit (DLTK) » How make ScriptEditor extended class the default comparison editor ?
How make ScriptEditor extended class the default comparison editor ? [message #557919] Thu, 09 September 2010 12:22 Go to next message
David Largeteau is currently offline David Largeteau
Messages: 35
Registered: July 2009
Location: Bordeaux - France
Member
Hi DLTK team,

I have a problem with compare editor.
I compare two files and make changes from one to the other one in
compare editor, and on save action, I would like to go to my doSave()
method in my ScriptEditor extended class. But I couldn't achieve it. I
have already extend ScriptMergeViewer.
Is there a way to make extended ScriptEditor class default editor for
comparison ? (and then have all editor features such as text hover,
completion, ...)

Thanks in advance,


David
Re: How make ScriptEditor extended class the default comparison editor ? [message #559301 is a reply to message #557919] Thu, 16 September 2010 10:21 Go to previous messageGo to next message
Alex Panchenko is currently offline Alex Panchenko
Messages: 342
Registered: July 2009
Senior Member
Hi David,

Something like the following:

   <extension point="org.eclipse.compare.contentMergeViewers">
      <viewer
            extensions="tcl,exp,test,xotcl,itcl"
            class="org.eclipse.dltk.tcl.internal.ui.compare.TclMergeViewerCreator"
            id="org.eclipse.dltk.tcl.internal.ui.compare.TclMergeViewer">
      </viewer>
      <contentTypeBinding
			contentTypeId="org.eclipse.dltk.tclContentType"
            contentMergeViewerId="org.eclipse.dltk.tcl.internal.ui.compare.TclMergeViewer">
	  </contentTypeBinding>
   </extension>


public class TclMergeViewerCreator implements IViewerCreator {
	public Viewer createViewer(Composite parent, CompareConfiguration cfg) {
		return new TclMergeViewer(parent, cfg);
	}
}


public class TclMergeViewer extends ScriptMergeViewer {
	public TclMergeViewer(Composite parent, CompareConfiguration configuration) {
		super(parent, configuration);
	}
	protected ScriptTextTools getTextTools() {
		return TclUI.getDefault().getTextTools();
	}
	protected IPreferenceStore getPreferenceStore() {
		return TclUI.getDefault().getPreferenceStore();
	}
	public String getTitle() {
		return Messages.CompareTitle;
	}
}


Regards,
Alex
Re: How make ScriptEditor extended class the default comparison editor ? [message #559326 is a reply to message #559301] Thu, 16 September 2010 11:44 Go to previous message
David Largeteau is currently offline David Largeteau
Messages: 35
Registered: July 2009
Location: Bordeaux - France
Member
Alex Panchenko a écrit :
> Hi David,
>
> Something like the following:
>
> <extension point="org.eclipse.compare.contentMergeViewers">
> <viewer
> extensions="tcl,exp,test,xotcl,itcl"
>
> class=" org.eclipse.dltk.tcl.internal.ui.compare.TclMergeViewerCreat or "
> id="org.eclipse.dltk.tcl.internal.ui.compare.TclMergeViewer ">
> </viewer>
> <contentTypeBinding
> contentTypeId="org.eclipse.dltk.tclContentType"
>
> contentMergeViewerId="org.eclipse.dltk.tcl.internal.ui.compare.TclMergeViewer ">
>
> </contentTypeBinding>
> </extension>
>
> public class TclMergeViewerCreator implements IViewerCreator {
> public Viewer createViewer(Composite parent, CompareConfiguration
> cfg) {
> return new TclMergeViewer(parent, cfg);
> }
> }
>
> public class TclMergeViewer extends ScriptMergeViewer {
> public TclMergeViewer(Composite parent, CompareConfiguration
> configuration) {
> super(parent, configuration);
> }
> protected ScriptTextTools getTextTools() {
> return TclUI.getDefault().getTextTools();
> }
> protected IPreferenceStore getPreferenceStore() {
> return TclUI.getDefault().getPreferenceStore();
> }
> public String getTitle() {
> return Messages.CompareTitle;
> }
> }
>
>
> Regards,
> Alex

Hi Alex,

That's exactly what I've done. And the only feature that I get is syntax
coloring.
My question was about advanced features : what to do to have all editor
features sur as text hover, completion, edit strategies, ...

Thank you for your reply.

David
Previous Topic:[BUILD] S-2.0.1RC3-201009100629
Next Topic:Triggering full build on buildpath change
Goto Forum:
  


Current Time: Wed Oct 01 20:37:58 GMT 2014

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

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