Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [gef-dev] Adding an action button to activate an editor

Hi,
 
May I know how to create an EditorInput class?  I am facing the same problem as Madiou Bah. I am extending the Shapes example of GEF, and I need to open a specific .shape file with the click of an action button.
 
My GraphicalEditor which extends EditorPart contains an EditorInput which is FileEditorInput. Do I still have to create a corresponding Editor input class? No right? How do I link a specific file(IFile) with the FileEditorInput? My problem is do not know how to create get an IFile, given the abc.shapes file which I have saved earlier. Maybe there is some straightforward method to do this?? Very new to Eclipse. :(
 
Please advice!! Thanks alot!
 
 
public class FileEditorInput implements IFileEditorInput, IPathEditorInput ,IPersistableElement {
private IFile file;
public FileEditorInput(IFile file) {
 
        if (file == null) {
 
            throw new IllegalArgumentException();
 
        }
 
        this.file = file;
}
.......
 
 
 
 


 


On 8/11/06, Narang, Anu <anu.narang@xxxxxxxxx> wrote:

In the action of the button you need to open the editor by passing in the  editor id.
     */
    public void run ()
    {
        IWorkbenchPage page = window.getActivePage();

            try
            {
                // opens the editor with the Editor ID and an instance of child
                // model.
               page.openEditor(new xxxEditorInput(new xxxtModel()),xxxEditor.ID);
            
            }
            catch (PartInitException e)
            {
                e.printStackTrace();
            }
        }

    }
You need to create a corresponding Editor input class.

-----Original Message-----
From: gef-dev-bounces@xxxxxxxxxxx [mailto:gef-dev-bounces@xxxxxxxxxxx] On Behalf Of Thierno Madiou Bah
Sent: Wednesday, August 02, 2006 7:11 PM
To: gef-dev@xxxxxxxxxxx
Subject: [gef-dev] Adding an action button to activate an editor

Hi,
I am testing gef, i have developpe an editor with it. I would like to 
add an action button on the toolbar to activate my editor.
Can you please help me.
Thanks.

       

       
               
___________________________________________________________________________
Découvrez un nouveau moyen de poser toutes vos questions quelque soit le sujet !
Yahoo! Questions/Réponses pour partager vos connaissances, vos opinions et vos expériences.
http://fr.answers.yahoo.com

_______________________________________________
gef-dev mailing list
gef-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/gef-dev
- - - - - - - DISCLAIMER- - - - - - - -
Unless indicated otherwise, the information contained in this message is privileged and confidential, and is intended only for the use of the addressee(s) named above and others who have been specifically authorized to receive it. If you are not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message and/or attachments is strictly prohibited. The company accepts no liability for any damage caused by any virus transmitted by this email. Furthermore, the company does not warrant a proper and complete transmission of this information, nor does it accept liability for any delays. If you have received this message in error, please contact the sender and delete the message. Thank you.


_______________________________________________
gef-dev mailing list
gef-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/gef-dev




Back to the top