Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Adding an Action to the Navigator View
Adding an Action to the Navigator View [message #466236] Thu, 05 January 2006 09:58 Go to next message
NiS is currently offline NiSFriend
Messages: 58
Registered: July 2009
Member
I made a "org.eclipse.ui.popupMenus extension" to the Navigator view.
The item menu appears well, and the action is executed on the chosen IFile
of the view.

BUT: i can't get the absolute java.io.file from it using the usual way: the
device is missing at the beginning.

Any hep appreciated,
merci

nicolas.

public class Execute implements org.eclipse.ui.IObjectActionDelegate {
IAction fAction;
private IWorkbenchPart fView;
ISelection fSelection;

public void setActivePart(IAction action, IWorkbenchPart targetPart) {
fAction = action;
fView = targetPart;
}

public void run(IAction action) {
Object selection = ((IStructuredSelection) fSelection).getFirstElement();
if(selection instanceof IFile) {
IFile is = (IFile)selection;
File s = new File(is.getFullPath().makeAbsolute().toOSString());


**** Here, s is \myPlugin\build\GenerateBuildFiles.lsp
instead of
E:\myPlugin\build\GenerateBuildFiles.lsp
....
}

public void selectionChanged(IAction action, ISelection selection) {
fAction = action;
fSelection = selection;
}

}



<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<plugin>

<extension point="org.eclipse.ui.popupMenus">
<objectContribution
id="com.digitalairways.ilisp.plugin.Execute"
objectClass="org.eclipse.core.resources.IFile"
nameFilter="*.lsp">
<action
id="com.digitalairways.ilisp.plugin.Execute"
class="com.digitalairways.ilisp.plugin.Execute"
label="Execute with iLisp"
icon="icons/exec.gif"
menubarPath="additions"
>
</action>
</objectContribution>
</extension>

</plugin>
Re: Adding an Action to the Navigator View [message #466250 is a reply to message #466236] Thu, 05 January 2006 14:22 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

This is an eclipse question, you should probably ask it in eclipse.platform.

Later,
PW


Re: Adding an Action to the Navigator View [message #466261 is a reply to message #466250] Thu, 05 January 2006 15:15 Go to previous message
NiS is currently offline NiSFriend
Messages: 58
Registered: July 2009
Member
believed it was a view pb!

"Paul Webster" <pwebster@ca.ibm.com> a
Previous Topic:UI Thread question
Next Topic:max value
Goto Forum:
  


Current Time: Thu Sep 19 09:40:04 GMT 2019

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

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

Back to the top