Results 1 to 5 of 5

Thread: What is Export Methods in Java?

  1. #1
    Join Date
    Jul 2006
    Posts
    339

    What is Export Methods in Java?

    Hi friends,
    I have recently started with the Java, so i am not having enough knowledge about the Java. In a application I want to export data from a component, so I have to use the Export Methods. But I don't know anything about it.!! So please help me by telling what is Export Methods in Java? Any coding related to it would be grateful.!! Thanks In Advance.!!

  2. #2
    Join Date
    Jul 2006
    Posts
    286

    Re: What is Export Methods in Java?

    Many times you need the methods that are helpful for exporting data from a component. The methods that are used for that purpose are invoked for the drag gesture. It can also invoked by the cut or copy action, when the component in question is the source of the operation. The following are TransferHandler methods for exporting data :
    • getSourceActions(JComponent)
    • createTransferable(JComponent)
    • exportDone(JComponent, Transferable, int)
    IF you hate me, please don't mention it. I know who hates me and who doesn't. You really do not have to make fun of people....

  3. #3
    Join Date
    Aug 2006
    Posts
    227

    Re: What is Export Methods in Java?

    I have tried to explain you the methods of TransferHandler in more detail :
    1. getSourceActions(JComponent) - You can use this method for knowing what actions are supported by the source component. The actions can be Copy, Move, etc. in any combination. Most of examples support both Copy and Move but it is not supported always.
    2. createTransferable(JComponent) - You can use this method for bundle up the data to be exported. You will have to bundle it into Transferable object in preparation for the transfer.
    3. exportDone(JComponent, Transferable, int) - When the export is completed this method is invoked.
    I do to dead flowers what people at morgues do to dead people. Suck all the moisture out, dip them in plastic, paint them up pretty and put them in a nice frame.

  4. #4
    Join Date
    Nov 2008
    Posts
    1,192

    Re: What is Export Methods in Java?

    I know about export method which is used in Oracle, hope that it may help you. The following are the parameters of the export method :
    • ctx - This parameter is used to view the source plug-in context information.
    • source_type - This parameter is used for viewing the type of the external source data.
    • source_location - For seeing the location to which the source data is to be exported, this parameter is used.
    The export( ) method natively supports only sources with a source.srcType value of file. User-defined sources may support the export() method.

  5. #5
    Join Date
    Apr 2008
    Posts
    1,948

    Re: What is Export Methods in Java?

    I have provided you with the sample of coding that can be used for export methods :
    Code:
    int getSourceActions(JComponent jc) {
        return MOVE_OR_COPY;
    }
    
    Transferable createTransferable(JComponent jc) {
        return new StringSelection(jc.getSelection());
    }
    
    void exportDone(JComponent jc, Transferable t, int action) {
        if (action == MOVE) {
            jc.removeSelection();
        }
    }

Similar Threads

  1. Identify active methods in java
    By Maya Angelou in forum Software Development
    Replies: 4
    Last Post: 06-04-2010, 01:53 PM
  2. Explain the difference between == & .equals methods in Java?
    By Harpreet Gaur in forum Software Development
    Replies: 5
    Last Post: 30-01-2010, 11:36 AM
  3. Native methods of java
    By Truster in forum Software Development
    Replies: 5
    Last Post: 22-01-2010, 10:52 AM
  4. join() and isAlive() methods of java
    By Owen Fernandes in forum Software Development
    Replies: 5
    Last Post: 21-01-2010, 08:28 AM
  5. Methods in JAVA
    By Caiden in forum Software Development
    Replies: 3
    Last Post: 18-08-2009, 11:26 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,673,682.67452 seconds with 17 queries