Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Default actions in Common Navigator
Default actions in Common Navigator [message #336463] Mon, 15 June 2009 15:20 Go to next message
Christoph Höger is currently offline Christoph HögerFriend
Messages: 40
Registered: July 2009
Member
Hi,

I hope somebody can help me on this:

I am using the common navigator framework to add my own model (packages,
libraries etc.), from studying jdt I can see that I have to implement
common actions (copy, paste etc.) for those objects by myself, which
makes sense as those actions have special semantics on those non-resources.

But how do I tell the Common navigator to at least show the common
actions (new, refresh etc.)?

Do I have to make my classes adaptable to IResource for that?

thanks in advance

christoph
Re: Default actions in Common Navigator [message #336473 is a reply to message #336463] Tue, 16 June 2009 08:21 Go to previous message
Christoph Höger is currently offline Christoph HögerFriend
Messages: 40
Registered: July 2009
Member
I have hacked around this, but I cannot see why it does not work:

If I add my own version of

org.eclipse.ui.navigator.resources.internal.actions.NewActio nProvider

(simply by copying that class into my sources) as an ActionProvider to my
content, I _do have_ that action.

But when I do simply that:

<extension
point="org.eclipse.ui.navigator.navigatorContent">
<navigatorContent
activeByDefault="true"

contentProvider="de.tuberlin.uebb.emodelica.model.ModelTreeContentProvider "
id="de.tuberlin.uebb.emodelica.navigatorContent"

labelProvider="de.tuberlin.uebb.emodelica.model.ModelLabelProvider "
name="eModelica Navigator content">
<triggerPoints>
<or>
<and>
<instanceof
value="org.eclipse.core.resources.IResource">
</instanceof>
<test
forcePluginActivation="true"
property="org.eclipse.core.resources.extension"
value="mo">
</test>
</and>
<instanceof
value="de.tuberlin.uebb.emodelica.model.dom.DOMNode">
</instanceof>
</or>
</triggerPoints>
<possibleChildren>
<instanceof
value="de.tuberlin.uebb.emodelica.model.dom.DOMNode">
</instanceof>
</possibleChildren>
</navigatorContent>
<navigatorContent
activeByDefault="true"

contentProvider=" de.tuberlin.uebb.emodelica.model.project.impl.MosilabProject ContentProvider "
id="de.tuberlin.uebb.emodelica.projectContent"

labelProvider=" de.tuberlin.uebb.emodelica.model.project.impl.MosilabProject LabelProvider "
name="eModelica Project content"
priority="high">
<possibleChildren>
<or>
<instanceof

value="de.tuberlin.uebb.emodelica.model.project.IModelicaResource ">
</instanceof>
</or></possibleChildren>
<triggerPoints>
<or>
<adapt
type="org.eclipse.core.resources.IProject">
<test
forcePluginActivation="true"
property="org.eclipse.core.resources.projectNature"
value="de.tuberlin.uebb.emodelica.nature">
</test>
</adapt>
<instanceof

value="de.tuberlin.uebb.emodelica.model.project.IModelicaResource ">
</instanceof>
</or>
</triggerPoints>
<actionProvider

class="de.tuberlin.uebb.emodelica.ui.navigator.ActionProvider "
id="de.tuberlin.uebb.emodelica.actions.StandardActions"

overrides="org.eclipse.ui.navigator.resources.actions.EditActions "
priority="higher">
</actionProvider>
<actionProvider

class=" org.eclipse.ui.navigator.resources.internal.actions.NewActio nProvider "
id="org.eclipse.ui.navigator.resources.NewActions"
priority="highest">
<enablement>
<or>
<instanceof

value="de.tuberlin.uebb.emodelica.model.project.IMosilabSource ">
</instanceof>
</or>
</enablement>
</actionProvider>
</navigatorContent>


Nothing seems to happen. Is that because NewActionProvider resides in an
internal package? If yes shouldn't it be visible by default? How come it
is not, even if my Model is adaptable to IResource?

I gues the same goes for all those ActionProviders in
org.eclipse.ui.navigator.resources.internal.actions
Previous Topic:Was "Delete project contents on disk (cannot be undone)" selected
Next Topic:How to update the checked state of a command per window?
Goto Forum:
  


Current Time: Fri Mar 29 15:59:38 GMT 2024

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

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

Back to the top