Common Navigator Framework linking with editor and adding popup menu [message #543761] |
Wed, 30 June 2010 13:12 |
Julien Messages: 15 Registered: July 2009 |
Junior Member |
|
|
Hi all,
I have two issues about the Common Navigator Framework (CNF) of RCP.
I have to implement the CNF on my project without the Common Navigator
Explorer. In other words, I have to implement the CNF only with a
CommonViewer Object on my "ViewPart" explorer view.
In this situation, I try to implement the linkHelper without any success...
In the same way, I try to implement some popup menu without any success
too...
============================================================ ================================
ABOUT LINK HELPER
Here my code (id of my commonViewer:
"prototype.view.explorerView.navigator" ):
<extension point="org.eclipse.ui.navigator.viewer">
<viewerContentBinding viewerId="prototype.view.explorerView.navigator">
<includes>
<contentExtension
isRoot="true"
pattern="prototype.navigatorContent.MyContent">
</contentExtension>
<contentExtension
isRoot="true"
pattern="prototype.view.explorerView.LinkHelper">
</contentExtension>
</includes>
</viewerContentBinding>
</extension>
<extension point="org.eclipse.ui.navigator.linkHelper">
<linkHelper
class="prototype.helpers.MyLinkHelper"
id="prototype.view.explorerView.LinkHelper">
<editorInputEnablement>
<instanceof value="org.eclipse.ui.IFileEditorInput"></instanceof>
</editorInputEnablement>
<selectionEnablement>
<instanceof value="org.eclipse.core.resources.IFile"></instanceof>
</selectionEnablement>
</linkHelper>
</extension>
---
//Viewer creation:
viewer = new CommonViewer("prototype.view.explorerView.navigator",
composite, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
viewer.setInput(...)
---
//Opening of editor:
IWorkbenchPage page =
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage();
IFile fileToOpen = (IFile)
Platform.getAdapterManager().getAdapter(myObject, IFile.class);
try {
IDE.openEditor(page, fileToOpen);
} catch (PartInitException e) {
e.printStackTrace();
}
===
Nothing happens about the link between editors and explorer, program
never use the class prototype.helpers.MyLinkHelper.
I think I must force the enablement of linkHelper on my explorer (as the
function "setLinkingEnabled" on CommonNavigator) directly on the
CommonViewer but I don't know how I can do this and if it's possible...
============================================================ ================================
ABOUT POPUP MENUS
Here my code (id of my commonViewer:
"prototype.view.explorerView.navigator"; id of my explorer:
"prototype.view.explorerView" ):
<extension point="org.eclipse.ui.navigator.viewer">
<viewer viewerId="prototype.view.explorerView.navigator">
<popupMenu id="prototype.view.explorerView.navigator.popup">
<insertionPoint
name="group.new"
separator="false">
</insertionPoint>
<insertionPoint
name="group.open"
separator="false">
</insertionPoint>
<insertionPoint
name="group.edit"
separator="true">
</insertionPoint>
</popupMenu>
</viewer>
</extension>
<extension point="org.eclipse.ui.menus">
<menuContribution
locationURI="popup:prototype.view.explorerView?after=group.edit ">
<command
commandId="org.eclipse.ui.edit.delete"
id="cnf.popupmenu.delete"
label="Delete"
mnemonic="D"
style="push">
</command>
<command
commandId="org.eclipse.ui.edit.rename"
id="cnf.popupmenu.rename"
label="Rename"
mnemonic="R"
style="push">
</command>
</menuContribution>
</extension>
Have you some ideas ?
Thanks for the help.
Best regards,
Julien
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02573 seconds