Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Objectteams » OT/Equinox Adaption of OT/Equinox powered plugins and Teams?
OT/Equinox Adaption of OT/Equinox powered plugins and Teams? [message #642839] Thu, 02 December 2010 21:37 Go to next message
Jan Marc Hoffmann is currently offline Jan Marc HoffmannFriend
Messages: 32
Registered: July 2009
Member
Check out the following source from the OT svn:

http:// dev.eclipse.org/viewcvs/viewvc.cgi/branches/maintenance/Ecli pse_3.6_OTDT_0.7/plugins/org.eclipse.objectteams.otdt.jdt.ui /src/org/eclipse/objectteams/otdt/internal/ui/javaeditor/Jav aEditorAdaptor.java?view=markup&revision=794&root=TO OLS_OBJECTTEAMS&sortby=file

The JavaSourceViewerConfiguration role is a nice Adaption of the JavaSourceViewerConfiguration. It adds the OT keywords to the existing Java Keywords.

I would like to do about the same. Adding additional keywords to the existing Java and OT Keywords. So I thought i may reuse this Role from my own ui plugin and add my language specific keywords.

So I tried the following:

@SuppressWarnings("restriction")
public team class GOTJavaEditorAdaptor extends JavaEditorAdaptor {
	protected team class JavaSourceViewerConfiguration {
		protected class WordMatcher {
			@SuppressWarnings("basecall")
			callin void addWord(String word, IToken token) {
				System.out.println("no more OT keywords... ;=)");
			}
		}
	}
}


Manifest:
org.eclipse.objectteams.otdt.jdt.ui;bundle-version="0.7.1"

Plugin.xml:
      <aspectBinding
            icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/calloutbinding_obj.gif">
         <basePlugin
               icon="platform:/plugin/org.eclipse.pde.ui/icons/obj16/plugin_obj.gif"
               id="org.eclipse.objectteams.otdt.jdt.ui">
         </basePlugin>
         <team
               activation="NONE"
               class="org.objectteams.gotdt.internal.ui.javaeditor.GOTJavaEditorAdaptor"
               icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif"
               superclass="org.eclipse.objectteams.otdt.internal.ui.javaeditor.JavaEditorAdaptor">
         </team>
      </aspectBinding>


But how do I make it work with OT/Equinox? What about the superclass field in the aspectBinding dialog? Can I add a base plugin team there?

And should I activate my Team?

Is the inheritance correct?

thanks

greetings

Jan Marc

Re: OT/Equinox Adaption of OT/Equinox powered plugins and Teams? [message #642846 is a reply to message #642839] Thu, 02 December 2010 22:35 Go to previous message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1853
Registered: July 2009
Senior Member
Mh, that's cool idea but ... there's a few things to consider.
Most importantly: if your plugin installs a sub-team of
the JavaEditorAdaptor you'll end up with two team instances
at runtime, both trying to adapt the same base object.
This wouldn't be a problem if the other plugin gave you
an API for deactivating its team. But it doesn't Rolling Eyes

But I can show you the master switch: Look at
http://dev.eclipse.org/viewcvs/viewvc.cgi/branches/maintenan ce/Eclipse_3.6_OTDT_0.7/plugins/org.eclipse.objectteams.ecli pse.monitor/src/org/eclipse/objectteams/eclipse/monitor/Moni torView.java?view=markup&root=TOOLS_OBJECTTEAMS&sort by=file

and search method readTeams().
Do you see what I mean? Cool

A word on the superclass field: this is only a necessary
advice for OT/Equinox to ensure proper order of reading
team classes. However, team inheritance across
plugin boarders is indeed uncharted waters.
From looking at the code, chances for success might
even be better without setting the superclass field.
For that matter I'd like to ask you to just try both
versions. However, the base plugin is not correct in
your snippet, you should say "org.eclipse.jdt.ui" here.

I'll also think about an alternative solution
(involving roles-of-roles and that kind of stuff).
I'll come back to you if that works for this particular setting.

best,
Stephan
Previous Topic:E4 efforts for harmonizing jdt
Next Topic:When it gets bigger... Teamactivation or base when or nothing?
Goto Forum:
  


Current Time: Thu Apr 25 14:53:24 GMT 2024

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

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

Back to the top