Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
AW: [tools-dev] Need help for Plugin (beginner)

Hi,
I've solved the Problem.
The Action Class implements the Interface IObjectActionDelegate, so it
has the Method 
"public void selectionChanged(IAction action, ISelection selection)".
"selection" is from 
Type "  <objectContribution
objectClass="org.eclipse.jdt.core.ICompilationUnit"" so i've
The Java File that i need. 

Now teher is my next Problem. 
<objectContribution objectClass="org.eclipse.jdt.core.ICompilationUnit""
objectClass 
should be a type from a existing 3rd Party Library. If i put this Class
in the objectClass
Eclipse tells me:

Referenced class 'de.xyz.XYZBean' in attribute 'objectClass' cannot be
found.	plugin.xml	xyz 1	line 45

And my Popup Entry is never shown. ;-(

Thank you very much
Fredy



-----Ursprüngliche Nachricht-----
Von: tools-dev-admin@xxxxxxxxxxx [mailto:tools-dev-admin@xxxxxxxxxxx] Im
Auftrag von Balasubramaniyan K
Gesendet: Montag, 8. Dezember 2003 10:17
An: tools-dev@xxxxxxxxxxx
Betreff: RE: [tools-dev] Need help for Plugin (beginner)


NachrichtHi,

    I have not understood your requirement properly.

    Having said this , I am trying to solve your problem
    In case you know the filename, these are the two solution I could
think of:

    Solution 1:
    =======
        IPath path = project.getFullPath().append(fileName);
        IFile file = project.getWorkspace().getRoot().getFile(path);

    Solution 2:
    ========

        IFile f = getNewProject().getFile(name);

Thanks & Regards,
Balasubramaniyan K
Phone: 2051460 (Direct Line)

  -----Original Message-----
  From: tools-dev-admin@xxxxxxxxxxx
[mailto:tools-dev-admin@xxxxxxxxxxx]On
Behalf Of Fredy
  Sent: Sunday, December 07, 2003 2:33 PM
  To: tools-dev@xxxxxxxxxxx
  Subject: [tools-dev] Need help for Plugin (beginner)


  Hey all,
  i hope i'm in the right newsgroup.

  I want to develop my first plugin. I have read a lot about developing
plugins for eclipse, but cannot find anything to this problem:

  Extension Point:

  <extensionpoint="org.eclipse.ui.popupMenus">
  <objectContributionobjectClass="org.eclipse.jdt.core.ICompilationUnit"
  nameFilter="*.java"
  id="de.hauschel.jbf.generatorl">
  <action label="Fredy&apos;s VO Generator"
  icon="icons/ctool16/openbrwsr.gif"
 
helpContextId="org.eclipse.ui.examples.readmetool.open_browser_action_co
ntext"
  class="de.hauschel.jbf.generator.Test"
  menubarPath="additions"
  enablesFor="1"
  id="de.hauschel.jbf.generator.actionid1">
  </action>
  </objectContribution>
  ...

  public class Test implements IObjectActionDelegate {
  private IWorkbenchPart part;

  public void run(IAction action)
  {
      MessageDialog.openInformation(
      this.part.getSite().getShell(),
      "PlugIn Plug-in",
      "Fredys New Action was executed. ");
  }

  How can i get the IFile Instance that calls this Action ?

  Thanks Fredy






Back to the top