How to open a Project content file using Extension SDK

I am writing an extension (Find a resource similar to "Ctrl+Shift+R" in Eclipse, "Ctrl+Shift+N" in IntelliJ) to find and open any type of resource in a project or Workspace.
After getting the File URI, what API should I need to use to open the file.
something like CodeEditor("URL").open?

Once you have got the URL you can use:
oracle.ide.editor.EditorManager.openDefaultEditorInFrame( url );
This will open the file pointed by the url in the default editor registered for that file type. See the javadoc for oracle.ide.editor.EditorManager for other open editor methods.

Similar Messages

  • How to open .drw or .prt file using swing?

    Hi Everyone,
    I am new to java programming n I m facing a problem in swing.I want to open a perticular drawing file using Java program but the condition is,it should open in the same window.Now,I have managed to open normal txt files n .doc files in the same window using JFileChooser and IO programming.But I dont know what it takes to open a .prt or a .drw file using the same program.
    Can you guys plz help me out in this?I think,it is not compatible to open such files...but how to make it compatible then?
    I m posting the code here...plz check it n help me out as soon as possible...Thank you very much......
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    public class FileChooseApp1 extends JFrame
    implements ActionListener
    JMenuItem fMenuOpen = null;
    JTextArea fTextArea;
    File fFile = new File ("default.java");
    FileChooseApp1 (String title) {
    super (title);
    Container cp = getContentPane ();
    // Create a user interface.
    cp.setLayout ( new BorderLayout () );
    fTextArea = new JTextArea ("");
    cp.add ( fTextArea, "Center");
    JMenu m = new JMenu ("File");
    m.add (fMenuOpen = makeMenuItem ("Open"));
    JMenuBar mb = new JMenuBar ();
    mb.add (m);
    setJMenuBar (mb);
    setSize (400,400);
    public void actionPerformed ( ActionEvent e ){
         boolean status = false;
         String command = e.getActionCommand ();
         if (command.equals ("Open")) {
         // Open a file
              status = openFile ();
         private JMenuItem makeMenuItem (String name) {
         JMenuItem m = new JMenuItem (name);
         m.addActionListener (this);
         return m;
         boolean openFile () {
         JFileChooser fc = new JFileChooser ();
         fc.setDialogTitle ("Open File");
         // Choose only files, not directories
         fc.setFileSelectionMode ( JFileChooser.FILES_ONLY);
         // Start in current directory
         fc.setCurrentDirectory (new File ("."));
         // Set filter for Java source files.
         // fc.setFileFilter (fJavaFilter);
         // Now open chooser
         int result = fc.showOpenDialog (this);
         if (result == JFileChooser.CANCEL_OPTION) {
         return true;
         } else if (result == JFileChooser.APPROVE_OPTION) {
         fFile = fc.getSelectedFile ();
         // Invoke the readFile method in this class
         String file_string = readFile (fFile);
         if (file_string != null)
         fTextArea.setText (file_string);
         else
         return false;
         } else {
         return false;
         return true;
         } // openFile
         public String readFile (File file) {
         StringBuffer fileBuffer;
         String fileString=null;
         String line;
         try {
         FileReader in = new FileReader (file);
         BufferedReader dis = new BufferedReader (in);
         fileBuffer = new StringBuffer () ;
         while ((line = dis.readLine ()) != null) {
         fileBuffer.append (line + "\n");
         in.close ();
         fileString = fileBuffer.toString ();
         catch (IOException e ) {
         return null;
         return fileString;
         } // readFile
         public static void main (String [] args) {
         // Can pass frame title in command line arguments
         String title="Frame Test";
         if (args.length != 0) title = args[0];
         FileChooseApp1 f = new FileChooseApp1 (title);
         f.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
         f.setVisible (true);
         } // main
         } 

    well....the issue is,by the above mentioned code,I m able to open all text files like .txt or .doc....but I want to open a file having an extension .eprt or .easm.....these are all drawing related files....how to do that?
    what exactly happens when a text file is opened in java...do I need to register these drawing related files somewhere?if yes,wher should I register them?
    Thanks a lot.....

  • How to open a stored text file using java???

    Respected Sir / Madam
    I have a JList containing absolute path of files stored in my operating system in String format....I have added a ListSelectionListener...Now when i select an absolute path in the JList, the file should open ....I don't know how to do that....Hope you got my problem....Can any one pls help me out???
    Thank you[                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    thats ok buddy! best of luck
    U need to import
    import javax.swing.*;
    import javax.swing.event.*;
    import java.awt.*;
    import java.awt.event.*;
    public void valueChanged(ListSelectionEvent e)
    if (!e.getValueIsAdjusting()) {
            String fileName=
              optionList.getSelectedValue().toString();
    final JFrame dialog = new JFrame(fileName);
              JEditorPane viewer = new JEditorPane();
              viewer.setEditable(false);
              JScrollPane jsp = new JScrollPane(viewer);
              try {
                   viewer.setPage("file:/" + fileName);
              } catch (Exception e) {
                   viewer.setText("Error opening " + fileName + ": " + e);
              dialog.getContentPane().add(jsp, BorderLayout.CENTER);
            JButton closeButton = new JButton("Close");
            closeButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    dialog.setVisible(false);
                    dialog.dispose();
              dialog.getContentPane().add(closeButton, BorderLayout.SOUTH);
              dialog.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
              //dialog.pack();
              dialog.setSize(600, 600);
              dialog.show();
    }

  • How to open Aptus II 5 files using Photoshop or lightroom?

    My version of Photoshop and Lightroom (most recently downloaded from Creative Cloud) does not open the Aptus II 5 files although the camera is listed as being supported.  What am I doing incorrectly?  It will not read the .mos files.   Appreciate your assistance.

    It is listed as supported, but with this qualifying note (at the bottom of the page):

  • How do I open a microsoft word file using Teststand 2010?

    Hi All,
    I am currently using Teststand 2010. I need to do a simple task, at least I thought it was simple. I want to open a microsoft word file using Teststand 2010. I thought the using the "Call Executable" would be the first step, but I am not sure how to set it up. Any help would be greatly appreciated.
    Thanks,
    WJ

    Hello,
    You will actually need to use an ActiveX step to use Microsoft Word. I found this forum post with a similar question and an example. I opened the example and saved it to TestStand 2010 to reattach here.
    Note: you will probably need to modify the "Open Document" step to make sure the FileName of the Word document matches the real file location.
    Taylor B.
    National Instruments
    Attachments:
    TestStand MS Word.zip ‏13 KB

  • In Premiere Elements 11 how do I delete projects & associated files & folders?

    How do I delete projects & associated files & folders once I've finished with the project in Premiere Elements 11. There is information available for Premiere Elements 7 but not for 11

    For PrE 7 (I think that it is still in print), Amazon has Steve's Muvipix Guide to Premiere Elements: http://astore.amazon.com/chuckengelsco-20/detail/0615248993/104-3709942-5611121
    If you are planning on moving to PrE 11, he has written the definitive guide to that version: http://www.amazon.com/dp/1479311200/ref=as_li_qf_sp_asin_til?tag=chuckengelsco-20&camp=145 73&creative=327641&linkCode=as1&creativeASIN=1479311200&adid=0N87W21KS3SSK1YA3MZW&&ref-ref URL=http%3A%2F%2Fwww.muvipix.com%2FFORMgallery1.php
    For one Project folder scheme, see this article: http://forums.adobe.com/message/3998053#3998053 Note: this is how I set up my Projects, but can be used as a guide.
    Good luck,
    Hunt

  • Opening a template indd file using java API

    How do I open a template indd file using java API and use it for laying out graphics and text ?
    Thanks in advance

    Sample code:
    VariableType vtDocument = myApp.open(VariableTypeUtils.createFile("c:\\myfile.indd"));
    myDocument = DocumentHelper.narrow(vtDocument.asObject());
    Thanks
    -arun

  • How to open automatically a downloaded file in Firefox?

    I don't want to double click the downloaded file in that open window. I want that the downloaded file to open automacally when download is completed.

    Hi Angelo_Monteiro,
    Please let us know if any of these articles help:
    * [[Change what Firefox does when you click on or download a file]]
    * [[Set how Firefox handles different types of files]]
    * [[Use the Downloads window to manage downloaded files]]
    Thank you

  • Adf11g how to open pdf or html files from  webservice

    hi all,
    adf11g how to open pdf or html files from webservice .

    Hi,
    This is standard functionality, that you can read more about in the OLM User Manual. You can upload the files to an OLM content server or to any other content server that can be accessed with a URL.
    Regards Anders Northeved

  • Firefox4 always cannot remember how to open these types of file

    When I download certain types of file, for example, .rar file, firefox4 always cannot remember how to open these types of file next time. The check box “automatically use the same method to handle the file” in the download popup window looks grey and cannot be checked. Also, these types never appear in the list of option-application. I check previously installed firefox 3.6, these types are all called (application/***). What’s more, when I want to turn off computer, as long as firefox 4 is opened, it will lose response and prevent Windows from turning off. Whatever I do, reinstalling firefox, deleting profile and even reinstall Windows, I cannot get rid of those issues. I think these are bugs of firefox4. I hope they will be fixed as soon as possible.

    Purchase a legal copy of Windows instead of attempting to pirate it. You will then have the installation disks you'll need and won't have to worry about opening Torrent files.

  • I accidentally quit my CC on my Macbook pro and now the cloud icon is grayed out and every time I hover over it with the mouse I get the spinning beach ball of death on the icon. I have no idea how to open it because when I use spotlight search to open it

    I accidentally quit my CC on my Macbook pro and now the cloud icon is grayed out and every time I hover over it with the mouse I get the spinning beach ball of death on the icon. I have no idea how to open it because when I use spotlight search to open it it gives me a message saying "Creative Cloud is not open anymore" help!

    Since you didn't include any pertinent info such as the Mac model and OS version you are running, here is some general information:
    Mac OS X: Gray screen appears during startup
    Depending on which OS yours came with originally - and which OS you are now running - you would either need your original install disks - you can call Apple for replacements by giving them your serial number. Or you may be able to reinstall the OS by using recovery (again, depends on which model/which OS).

  • How do I edit a PDF file using Acrobat 9 - Version 9.4.0

    My company - [name deleted by host] purchased Acrobat 9 - Version 9.4.0. for me
    How do I edit a PDF file using Acrobat 9 - Version 9.4.0
    I need to edit - copy, extract text, add text, etc. from existing PDF files to SAVE my changes,
    or create a new PDF file from an existing file.
    This is very important for me to be able to do my job effectively.
    I spent over 2 hrs the last few days, and another hour today, still can't do it.
    PLEASE respond ASAP with a solution.
    Thanks in advance,
    - Daulton West
    [signature deleted by host]

    PDF is an end destination format - although Acrobat is capable of making minor changes to a file (e.g. to correct typos) it is not a word processor or DTP application. Major changes must be done in the original document, and the PDF file re-exported.
    You can copy text from a file by selecting it and right-clicking, or you can save the file as plain or formatted text. To make small changes to the text on a page, use the touchup tool - see the help file for more info.

  • How do I produce an excel file using java code

    How do i produce an excel file using java code.
    If it is possible would ne one have ne source code as an example.
    I have tried looking up information on outputing the information to a *.csv file but unfortunality i have had no luck in finding any information. To be exact ne source code.
    Thanks
    Lee

    That's what I use and I'd be the first to admit that it's very messy. But it works. Go use Google and see what else you can find.

  • How do I generate the pdf file using the name of a field.  How can I help

    how do I generate the pdf file using the name of a field.  How can I help

    Hi,
    here's a sample.
    LiveCycle Blog: Formulare in bestimmte Verzeichnisse speichern und nach Inhalt aus Formularfeld benennen //Save forms to…

  • How to write data to text file using external tables

    can anybody tell how to write data to text file using external tables concept?

    Hi,
    Using external table u can load the data in your local table in database,
    then using your local db table and UTL_FILE pacakge u can wrrite data to text file
    external table
    ~~~~~~~~~~~
    http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_7002.htm#i2153251
    UTL_FILE
    ~~~~~~~~~
    http://download-east.oracle.com/docs/cd/B19306_01/appdev.102/b14258/u_file.htm#sthref14093
    Message was edited by:
    Nicloei W
    Message was edited by:
    Nicloei W

Maybe you are looking for