JTable: double clicking triggers some action

Hi there,
A double click on a row of a JTable makes usually the underlying cell editable. This is the default behaviour of a JTable.
In my application, the JTable only shows data, without giving users editing rights. Beside that, I'd like that a double click on a row, triggers other actions, like for example copying the selected row to the clipboard or sending it per mail....
How do I have to configure the JTable for these purposes? Do I have to override the default ListSelectionListener? Did anybody make experiences with that?
Thanks for your help,
Best regards,
edar

like for example copying the selected row to the clipboardCtrl-C is the default KeyStroke combination for this.
Beside that, I'd like that a double click on a row, triggers other actions...Then you need to add a MouseListener to the table. Then use:
rowAtPoint(...);
columnAtPoint(...);to determine which cell was clicked

Similar Messages

  • HT2500 How do I not display the preview pane in mail until I open it with a double click? Some mail I do not wish to open-just delete it.

    How do I not display the preview pane in mail until I open it with a double click? Some mail I do not wish to open-just delete it. New macbook pro with LION OS

    Just drag the divider line between the preview pane and the message list all the way to the edge so the preview is completely closed. Selected messages will open in a new window with a double-click or the return key.

  • I have iPhoto 09 version 8.1.2 when I double click on some of the pictures, I see exclamation mark.

    Hello,
    I have iPhoto 09 version 8.1.2, when I double click on some of the pictures I see exclamation mark instead of my pictures.
    Thank you
    Fereydoun

    The ! turns up when iPhoto loses the connection between the thumbnail in the iPhoto Window and the file it represents.
    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Rebuild iPhoto Library Database from automatic backup.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one. .
    Regards
    TD

  • Detecting double-click in the action of a JButton

    I have a similar problem to the poster of http://forum.java.sun.com/thread.jsp?forum=52&thread=93004 and I'm wondering if anyone has a better solution.
    A fuller description of my problem.
    My JButtons represents certain pallette items. Clicking a pallete item puts the button in a selected state (changes its border to show it's selected). The action on this button sets a mode state on the canvas to indicate what was selected. I then click on a canvas workspace to place an instance of that item onto the canvas based on the current mode.
    The selected JButton then pops up and the user needs to select a new pallette icon.
    What I want as an option so that if a pallette button is double-clicked it remains selected even after the item has been placed on the canvas allowing the user to place several copies around the canvas before selecting another item.
    I'd like if possible to determine this from the buttons action rather than registering a listener to the button because parts of the framework I am using pass just the actions around.
    I could do this by looking at the time between actions being triggered but this seems like a messy solution (can I pickup the operating system settings for double-click delay).
    Any other ideas?

    thebobster,
    This doesn't answer your original question, so if you're determined to use d-clicks on a JButton, don't bother reading further.
    I've always found double-clicking on a JButton non-intuitive, not to mention messy to implement. I prefer CTRL-click, etc, to indicate a sticky click.
    Perhaps you could use an image to indicate your palette button: you'll need just 2 images--up-state and down-state--and d-clicks will be easy to implement.
    --A                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • I'm editing a lot of wedding photos.  For some reason, I have to double click on some of the photos to actually see my changes.  It is not the case for all the photos in the folder.... only some of them.  How can I make all the edited versions show?

    I am editing a bunch of wedding photos.  Everything has been fine until today..... I opened up the folder, and for some of the edited photos, I have to double click in order to see the edited version.  So, when I look at all the photos in the browser, some of then show my changes..... others don't.  I'm worried, because I will have to post them for the bride, and I am concerned about why this is happening.  I still have the images on the memory card and also have a duplicate of all the photos in iphoto..... but I've spent hours editing these photos...... and I really don't want to start all over again.

    I am editing a bunch of wedding photos.  Everything has been fine until today..... I opened up the folder, and for some of the edited photos, I have to double click in order to see the edited version.  So, when I look at all the photos in the browser, some of then show my changes..... others don't.  I'm worried, because I will have to post them for the bride, and I am concerned about why this is happening.  I still have the images on the memory card and also have a duplicate of all the photos in iphoto..... but I've spent hours editing these photos...... and I really don't want to start all over again.

  • Double Click In Some Programs/Clear Suggestion Bar

    Hi,
    Does anyone else have a issue where your Mac will click twice in some programs, such a Launchpad or Dashboard? Also the suggestion bar is transparent on Safari. These happened to me after i upgraded to Yosemite. Do you have a solution? I reported it to Apple. Thanks.

    Hi Tamara-
    Interesting. Thanks for sharing.
    Odd that triple-clicking anywhere in the title didn't work.
    Luck-
    -DaddyPaycheck

  • Reaction on a double click in a JTable

    Hello guys,
    I need to react on a double click on some row in a JTable. I know it must be simple, but I can't find a way to do it!
    Any help will be appreciated.

    Here is a code snipplet out of an application of mine.
    The purpose is to do the same action on double click that would be done by pushing the OK button.
            // Take selected order item on double click.
            this.table.addMouseListener(new MouseAdapter() {
                public void mouseClicked(final MouseEvent e) {
                    if (e.getClickCount() == 2) {
                        Point origin = e.getPoint();
                        int row = OrderSearchDlg.this.table.rowAtPoint(origin);
                        if (row > -1) {
                            okActionPerformed();
            });

  • Double click on menu = exception : managed bean problem ?

    Hello,
    I am a beginner with JSF and I have to work on an existing project.
    In my Web application, my problem is that if the user doubles click on some navigation links, then an exception is raised.
    Technically, I think that 2 consecutive HTTP requests sent to the server enter in competition and thus the state of certain variables becomes inconsistent. This problem appears when the 2nd click is sent to the server before the server answered the treatment of the 1st click.
    My current assumption is directed towards the managed beans used in the application (I am not (yet ;) ) a master on the subject). In fact, the main menu is �attached� to managed bean which are all of type �session�. At the time of the creation of the bean, a certain quantity of treatment is done to prepare information to be posted on the page. Other treatments are obviously done during the treatment of page JSF (Java code called by JSF of the).
    I think that at the time of the first call, the managed bean is possibly initialized. At the time of the 2nd click on the page, this bean re-initialized or is simply removed if the user has clicked on another menu (which refers to another bean).
    Would you have an idea of the veracity of my assumption?
    Would you have an idea how to solve the problem?
    I am currently looking for a JavaScript which allows me to disable all buttons on the page before the complete response of the server (that in order to prevent the user from clicking on an action before its preceding action is not treated).
    Thank you in advance for your help and all your ideas !

    mharelick wrote:
    the trash can icon is still having crashes.
    Launch the Terminal utility and type this command, each followed by the "return" key:
    ls -lad .Trash
    ls -la .Trash
    The "l" in those commands is the lower-case letter "L".
    The first command shows you the ownership and permissions of the .Trash folder. On my system my user "short name" is listed as the owner and group. The permissions are "drwx------".
    The second command shows you any files within the .Trashes folder. (Ignore the entries ending in one and two periods.) You should be the owner of anything in it. The permissions on anything there should start with "-rw" or "drw".
    If you see anything different, describe what you see and someone will be able to give you instructions for repairing it.

  • BCALV_TREE_DEMO - handle double click event

    Hi everyone,
    I'm trying to do something close to BCALV_TREE_DEMO but I can't have a double click triggering anything. I have exactly the same code (except that I uncommented the PERFORM register_events) so I don't need to post here anything else.
    Can u help plz?
    Regards,
    André Costa
    Message was edited by:
            Andr Costa
    I also add the following line in the FORM register_events:
      set handler l_event_receiver->handle_item_double_click                                                        for tree1.

    Hi Umesh,
    Thanks for your reply , but af:ClientListener cannot be child of Hierarchy Viewer Component.
    Please suggest some other solution.
    Thanks,
    Jinali

  • Turn Off Double-Click to Close?

    Is there any way to turn off the 'Double-Click to Close' functionality for creating selections (such as a Polygon selection)?
    I am making complex selections and accidentally double-clicking with my Wacom pen and it closes the selection when I don't want it to.  I have tried setting the Wacom pen preferences for Photoshop but have been unable to affect this issue there.  Obviously, I can continue to add to selections, but the premature closing frequently ends up with wacked shaped selection which I must do more work to cleanup.  If I could turn off the PS double-click to close functionality it would fix this problem.
    Thanks!
    Mike

    Thanks for the ideas folks.  I guess it's a wish for the future then.
    I like the Polygon Lasso tool... just wish the double-click to close could be turned off (I am far faster tracing areas with the Polygon Lasso tool than futzing with the Magnetic Lasso tool... but the rapid fire use of the Polygon tool is triggering the double-click to close action).
    In the Wacom control panel, there is a setting for Double-Click Distance, but turning it to OFF had no effect.  Also setting the Mouse settings double-click speed made no difference... I am still triggering the double-click to close.
    In any event, I'll work around the issue.
    Thanks again.
    Mike

  • Double click detection

    Hello,
    I have a JTree and I want to detect mouse double click over some nodes. I am using the following code in my JTree (which implements MouseListener) :
    public void mouseClicked(MouseEvent e) {
    if (e.getClickCount() == 2)          
    // MY ACTION
    the snag is that it also detect double clicks when it does not occured over a node. In that case I would like no action to be launched.
    How can I do it ??
    Thank you.
    Sylvain.

    Hi,
    I achived the following way to get the things working like you would to. Take a look:
    public void mouseClicked(MouseEvent evt) {
      if ( evt.getClickCount() == 2 ) {
       TreeNode node = (TreeNode)ree.getLastSelectedPathComponent();
       if ( node.isLeaf() ) {
        // Go ahead
    I hope this help you.
    Regards,
    Ualter Junior.

  • Is it possible to disable title bar double clicking response?

    Hello,
    I run apps under the Wine simulator and for some reason double clicks inside the window are registering as title bar double clicks *and* application clicks, causing the window to go full screen (or to collapse to the dock if that setting is enabled) as well as the expected behavior of selecting what I clicked.
    Plus, I find the double click title bar action to be annoying and would like to disable it in general.
    Its it even possible to disable this?
    Thanks!

    Thanks for the reply, Lanny.
    Unfortunately, that just reverses the problem for me...
    If the option is checked, the app will minimize if I double click in the window body
    If the option is un-checked, the app will go full screen if I double click in the window body
    I'd like to prevent any action when double clicking the title bar, if possible.

  • Double click in ALV tree output????

    Hi all,
    I am able to display output in tree format. But I want to add the double click functionality to some of the fields in output. Means if I double click on some value in output tree, it should call some transaction. Please help me with this issue of double clicking.
    Please tell how to handle events in this report tree display.
    For the following code its displaying output in tree format and in right way. But i need to add double click functionality to this.
    So provide me some sample program for this one....
    * create hierarchy
      CALL METHOD tree1->set_table_for_first_display
              EXPORTING
                   it_list_commentary   = lt_list_commentary
                   i_background_id      = 'ALV_BACKGROUND'
                   i_save               = 'A'
                   is_variant            = ls_variant
              CHANGING
                   it_sort              = gt_sort[]
                   it_outtab            = itab_outtab
                   it_fieldcatalog      = t_fieldcat. "gt_fieldcatalog.
    * expand first level
      CALL METHOD tree1->expand_tree
             EXPORTING
                 i_level = 1.
    * optimize column-width
      CALL METHOD tree1->column_optimize
               EXPORTING
                   i_start_column = tree1->c_hierarchy_column_name
                   i_end_column   = tree1->c_hierarchy_column_name.
    In grid ALV we can have double cilck functionality using code:
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                i_callback_program       = w_repid
                i_callback_pf_status_set = 'PF_STATUS'
                i_callback_user_command  = 'USER_COMMAND'
                is_layout                = ls_layout
                it_fieldcat              = gt_fc[]
    Here we can write subroutine for USER_COMMAND and handle the double click evenet. But tell me how to provide this in tree ALV.
    <REMOVED BY MODERATOR>
    Regards,
    Sachin
    Edited by: Alvaro Tejada Galindo on Feb 14, 2008 1:47 PM

    Hello Sachin
    The following sample report ZUS_SDN_ALV_TREE_DEMO demonstrates the crucial parts for double-click event handling (nodes & items) in ALV trees.
    *& Report  ZUS_SDN_ALV_TREE_DEMO
    *& Thread: double click in ALV tree output????
    *& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="742412"></a>
    REPORT  zus_sdn_alv_tree_demo.
    CLASS cl_gui_column_tree DEFINITION LOAD.
    CLASS cl_gui_cfw DEFINITION LOAD.
    TYPE-POOLS: abap.
    TYPES: BEGIN OF ty_s_outtab.
    INCLUDE TYPE knvv AS data.
    TYPES: nkey       TYPE lvc_nkey.
    TYPES: parent_key TYPE lvc_nkey.
    TYPES: END OF ty_s_outtab.
    TYPES: ty_t_outtab    TYPE STANDARD TABLE OF ty_s_outtab
                          WITH DEFAULT KEY.
    DATA: gt_outtab    TYPE ty_t_outtab.
    DATA:
      gd_okcode        TYPE ui_func,
      gd_repid         TYPE syst-repid,
      gt_fcat          TYPE lvc_t_fcat,
      gs_layout        TYPE lvc_s_layo,
      gs_variant       TYPE disvariant,
      go_docking       TYPE REF TO cl_gui_docking_container,
      go_tree          TYPE REF TO cl_gui_alv_tree.
    *       CLASS lcl_eventhandler DEFINITION
    CLASS lcl_eventhandler DEFINITION.
      PUBLIC SECTION.
        CLASS-METHODS:
        handle_node_double_click
          FOR EVENT node_double_click OF cl_gui_alv_tree
          IMPORTING node_key,
        handle_item_double_click
          FOR EVENT item_double_click OF cl_gui_alv_tree
          IMPORTING node_key
                    fieldname.
    ENDCLASS.                    "lcl_eventhandler DEFINITION
    *       CLASS lcl_eventhandler IMPLEMENTATION
    CLASS lcl_eventhandler IMPLEMENTATION.
      METHOD handle_node_double_click.
        message 'Event=Double-Click on Node' type 'I'.
        call transaction 'XD03'.
      ENDMETHOD.                    "handle_node_double_click
      METHOD handle_item_double_click.
        message 'Event=Double-Click on Item' type 'I'.
        call transaction 'VA03'.
      ENDMETHOD.                    "handle_item_double_click
    ENDCLASS.                    "lcl_eventhandler IMPLEMENTATION
    START-OF-SELECTION.
      PERFORM init_controls.
      gd_repid = syst-repid.
      CALL METHOD go_docking->link
        EXPORTING
          repid                       = gd_repid
          dynnr                       = '0100'
    *      container                   =
        EXCEPTIONS
          cntl_error                  = 1
          cntl_system_error           = 2
          lifetime_dynpro_dynpro_link = 3
          OTHERS                      = 4.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CALL SCREEN '0100'.
    ** NOTE: no elements on screen
    **  PROCESS BEFORE OUTPUT.
    **    MODULE STATUS_0100.
    **  PROCESS AFTER INPUT.
    **    MODULE USER_COMMAND_0100.
    END-OF-SELECTION.
    *&      Module  STATUS_0100  OUTPUT
    *       text
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'STATUS_0100'.
    *  SET TITLEBAR 'xxx'.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
    *       text
    MODULE user_command_0100 INPUT.
      TRANSLATE gd_okcode TO UPPER CASE.
      CASE gd_okcode.
        WHEN 'BACK'  OR
             'EXIT'  OR
             'CANC'.
          SET SCREEN 0. LEAVE SCREEN.
        WHEN 'REFRESH'.
        WHEN OTHERS.
      ENDCASE.
      CLEAR: gd_okcode.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Form  init_controls
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM init_controls .
    * Create docking container
      CREATE OBJECT go_docking
        EXPORTING
          parent = cl_gui_container=>screen0
          ratio  = 90
        EXCEPTIONS
          OTHERS = 6.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * create tree control
      CREATE OBJECT go_tree
        EXPORTING
            parent              = go_docking
            node_selection_mode = cl_gui_column_tree=>node_sel_mode_multiple
            item_selection      = 'X'  " required for double-click event on item
            no_html_header      = ''
            no_toolbar          = ''
        EXCEPTIONS
            cntl_error                   = 1
            cntl_system_error            = 2
            create_error                 = 3
            lifetime_error               = 4
            illegal_node_selection_mode  = 5
            failed                       = 6
            illegal_column_name          = 7.
      IF sy-subrc <> 0.
        MESSAGE x208(00) WITH 'ERROR'.                          "#EC NOTEXT
      ENDIF.
    * create Hierarchy-header
      DATA ls_hierarchy_header TYPE treev_hhdr.
      PERFORM build_hierarchy_header CHANGING ls_hierarchy_header.
      PERFORM build_fieldcatalog.
      PERFORM set_layout_and_variant.
    * create emty tree-control
      CALL METHOD go_tree->set_table_for_first_display
        EXPORTING
    **      i_structure_name     = 'KNVV'
          is_variant           = gs_variant
          i_save               = 'A'
    *      i_default            = 'X'
          is_hierarchy_header  = ls_hierarchy_header
    *      is_exception_field   =
    *      it_special_groups    =
    *      it_list_commentary   =
    *      i_logo               =
    *      i_background_id      =
    *      it_toolbar_excluding =
    *      it_except_qinfo      =
        CHANGING
          it_outtab            = gt_outtab
    *      it_filter            =
          it_fieldcatalog      = gt_fcat.
    * create hierarchy
      PERFORM create_hierarchy.
    * register events
      PERFORM register_events.
    * adjust column_width
      CALL METHOD go_tree->column_optimize.
    ENDFORM.                    " init_controls
    *&      Form  build_hierarchy_header
    *       build hierarchy-header-information
    *      -->P_L_HIERARCHY_HEADER  strucxture for hierarchy-header
    FORM build_hierarchy_header CHANGING
                                   p_hierarchy_header TYPE treev_hhdr.
      p_hierarchy_header-heading = 'Hierarchy Header'.          "#EC NOTEXT
      p_hierarchy_header-tooltip =
                             'This is the Hierarchy Header !'.  "#EC NOTEXT
      p_hierarchy_header-width = 30.
      p_hierarchy_header-width_pix = ''.
    ENDFORM.                               " build_hierarchy_header
    *&      Form  BUILD_FIELDCATALOG
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM build_fieldcatalog .
      REFRESH: gt_fcat.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
    *     I_BUFFER_ACTIVE              =
          i_structure_name             = 'KNVV'
    *     I_CLIENT_NEVER_DISPLAY       = 'X'
    *     I_BYPASSING_BUFFER           =
    *     I_INTERNAL_TABNAME           =
        CHANGING
          ct_fieldcat                  = gt_fcat
        EXCEPTIONS
          inconsistent_interface       = 1
          program_error                = 2
          OTHERS                       = 3.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      DELETE gt_fcat FROM 8.
    ENDFORM.                    " BUILD_FIELDCATALOG
    *&      Form  SET_LAYOUT_AND_VARIANT
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM set_layout_and_variant .
      CLEAR: gs_layout,
             gs_variant.
      gs_variant-report = syst-repid.
      gs_variant-handle = 'TREE'.
    ENDFORM.                    " SET_LAYOUT_AND_VARIANT
    *&      Form  create_hierarchy
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM create_hierarchy .
      DATA: ls_knvv    TYPE sflight,
            ls_outtab  TYPE ty_s_outtab,
            lt_outtab  TYPE ty_t_outtab.
    * get data
      SELECT * FROM knvv INTO CORRESPONDING FIELDS OF TABLE lt_outtab
                            UP TO 200 ROWS .                "#EC CI_NOWHERE
      SORT lt_outtab BY kunnr vkorg.
    * add data to tree
      DATA: ld_kunnr_key TYPE lvc_nkey,
            ld_vkorg_key TYPE lvc_nkey,
            ld_last_key  TYPE lvc_nkey.
      LOOP AT lt_outtab INTO ls_outtab.
        ON CHANGE OF ls_outtab-kunnr.
          PERFORM add_customer_line USING    ls_outtab-data
                                  CHANGING ld_kunnr_key.
        ENDON.
        ON CHANGE OF ls_outtab-vkorg.
          PERFORM add_salesorg_line USING    ls_outtab-data
                                             ld_kunnr_key
                                  CHANGING ld_vkorg_key.
        ENDON.
        PERFORM add_complete_line USING  ls_outtab-data
                                         ld_vkorg_key
                                CHANGING ld_last_key.
      ENDLOOP.
    * calculate totals
      CALL METHOD go_tree->update_calculations.
    * this method must be called to send the data to the frontend
      CALL METHOD go_tree->frontend_update.
    ENDFORM.                    " create_hierarchy
    *&      Form  add_customer_line
    *       add hierarchy-level 1 to tree
    *      -->P_LS_SFLIGHT  sflight
    *      -->P_RELEATKEY   relatkey
    *     <-->p_node_key    new node-key
    FORM add_customer_line USING     us_data TYPE ty_s_outtab-data
                                     ud_relat_key TYPE lvc_nkey
                         CHANGING  cd_node_key TYPE lvc_nkey.
      DATA: l_node_text TYPE lvc_value,
            ls_data TYPE ty_s_outtab-data.
    * set item-layout
      DATA: lt_item_layout TYPE lvc_t_layi,
            ls_item_layout TYPE lvc_s_layi.
      ls_item_layout-t_image = '@A0@'.  " icon_customer.
      ls_item_layout-fieldname = go_tree->c_hierarchy_column_name.
      ls_item_layout-style   =
                            cl_gui_column_tree=>style_intensifd_critical.
      APPEND ls_item_layout TO lt_item_layout.
    * add node
      l_node_text =  us_data-kunnr.
      DATA: ls_node TYPE lvc_s_layn.
      ls_node-n_image   = space.
      ls_node-exp_image = space.
      CALL METHOD go_tree->add_node
        EXPORTING
          i_relat_node_key = ud_relat_key
          i_relationship   = cl_gui_column_tree=>relat_last_child
          i_node_text      = l_node_text
          is_outtab_line   = ls_data
          is_node_layout   = ls_node
          it_item_layout   = lt_item_layout
        IMPORTING
          e_new_node_key   = cd_node_key.
    ENDFORM.                               " add_customer_line
    *&      Form  add_salesorg_line
    *       add hierarchy-level 1 to tree
    *      -->P_LS_SFLIGHT  sflight
    *      -->P_RELEATKEY   relatkey
    *     <-->p_node_key    new node-key
    FORM add_salesorg_line USING     us_data TYPE ty_s_outtab-data
                                     ud_relat_key TYPE lvc_nkey
                         CHANGING  cd_node_key TYPE lvc_nkey.
      DATA: l_node_text TYPE lvc_value,
            ls_data TYPE ty_s_outtab-data.
    * set item-layout
      DATA: lt_item_layout TYPE lvc_t_layi,
            ls_item_layout TYPE lvc_s_layi.
      ls_item_layout-t_image = '@DS@'.  " ICON_PARTNER_SALES_ACTIVITY
      ls_item_layout-fieldname = go_tree->c_hierarchy_column_name.
      ls_item_layout-style   =
                            cl_gui_column_tree=>style_intensifd_critical.
      APPEND ls_item_layout TO lt_item_layout.
    * add node
      l_node_text =  us_data-vkorg.
      DATA: ls_node TYPE lvc_s_layn.
      ls_node-n_image   = space.
      ls_node-exp_image = space.
      CALL METHOD go_tree->add_node
        EXPORTING
          i_relat_node_key = ud_relat_key
          i_relationship   = cl_gui_column_tree=>relat_last_child
          i_node_text      = l_node_text
          is_outtab_line   = ls_data
          is_node_layout   = ls_node
          it_item_layout   = lt_item_layout
        IMPORTING
          e_new_node_key   = cd_node_key.
    ENDFORM.                               " add_salesorg_line
    *&      Form  add_cmplete_line
    *       add hierarchy-level 3 to tree
    *      -->P_LS_SFLIGHT  sflight
    *      -->P_RELEATKEY   relatkey
    *     <-->p_node_key    new node-key
    FORM add_complete_line USING     us_data TYPE ty_s_outtab-data
                                     ud_relat_key TYPE lvc_nkey
                         CHANGING  cd_node_key TYPE lvc_nkey.
      DATA: l_node_text TYPE lvc_value.
    * set item-layout
      DATA: lt_item_layout TYPE lvc_t_layi,
            ls_item_layout TYPE lvc_s_layi.
      ls_item_layout-fieldname = go_tree->c_hierarchy_column_name.
      ls_item_layout-class   = cl_gui_column_tree=>item_class_checkbox.
    **  ls_item_layout-editable = 'X'.
      APPEND ls_item_layout TO lt_item_layout.
    **  CLEAR ls_item_layout.
    **  ls_item_layout-fieldname = 'PLANETYPE'.
    **  ls_item_layout-alignment = cl_gui_column_tree=>align_right.
    **  APPEND ls_item_layout TO lt_item_layout.
      l_node_text =  us_data-vtweg.
      DATA: ls_node TYPE lvc_s_layn.
      ls_node-n_image   = space.
      ls_node-exp_image = space.
      CALL METHOD go_tree->add_node
        EXPORTING
          i_relat_node_key = ud_relat_key
          i_relationship   = cl_gui_column_tree=>relat_last_child
          is_outtab_line   = us_data
          i_node_text      = l_node_text
          is_node_layout   = ls_node
          it_item_layout   = lt_item_layout
        IMPORTING
          e_new_node_key   = cd_node_key.
    ENDFORM.                               " add_complete_line
    *&      Form  register_events
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM register_events.
    * define the events which will be passed to the backend
      DATA: lt_events TYPE cntl_simple_events,
            l_event TYPE cntl_simple_event.
    * define the events which will be passed to the backend
      l_event-eventid = cl_gui_column_tree=>eventid_expand_no_children.
      APPEND l_event TO lt_events.
    **  l_event-eventid = cl_gui_column_tree=>eventid_checkbox_change.
    **  APPEND l_event TO lt_events.
    **  l_event-eventid = cl_gui_column_tree=>eventid_header_context_men_req.
    **  APPEND l_event TO lt_events.
    **  l_event-eventid = cl_gui_column_tree=>eventid_node_context_menu_req.
    **  APPEND l_event TO lt_events.
    **  l_event-eventid = cl_gui_column_tree=>eventid_item_context_menu_req.
    **  APPEND l_event TO lt_events.
    **  l_event-eventid = cl_gui_column_tree=>eventid_header_click.
    **  APPEND l_event TO lt_events.
    **  l_event-eventid = cl_gui_column_tree=>eventid_item_keypress.
    **  APPEND l_event TO lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_node_double_click.
      APPEND l_event TO lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_item_double_click.
      APPEND l_event TO lt_events.
      CALL METHOD go_tree->set_registered_events
        EXPORTING
          events                    = lt_events
        EXCEPTIONS
          cntl_error                = 1
          cntl_system_error         = 2
          illegal_event_combination = 3.
      IF sy-subrc <> 0.
        MESSAGE x208(00) WITH 'ERROR'.                          "#EC NOTEXT
      ENDIF.
    * set Handler
      set handler:
        lcl_eventhandler=>handle_node_double_click for go_tree,
        lcl_eventhandler=>handle_item_double_click for go_tree.
    **  DATA: l_event_receiver TYPE REF TO lcl_tree_event_receiver.
    **  CREATE OBJECT l_event_receiver.
    **  SET HANDLER l_event_receiver->handle_node_ctmenu_request
    **                                                        FOR tree1.
    **  SET HANDLER l_event_receiver->handle_node_ctmenu_selected
    **                                                        FOR tree1.
    **  SET HANDLER l_event_receiver->handle_item_ctmenu_request
    **                                                        FOR tree1.
    **  SET HANDLER l_event_receiver->handle_item_ctmenu_selected
    **                                                        FOR tree1.
    **  SET HANDLER l_event_receiver->handle_checkbox_change FOR tree1.
    ENDFORM.                               " register_events
    Regards
      Uwe

  • Double click in ALV tree display....

    Hi all,
    I am able to display output in tree format. But I want to add the double click functionality to some of the fields in output. Means if I double click on some value in output tree, it should call some transaction. Please help me with this issue of double clicking.
    My code as of now is as below:
    Please tell how to handle events in this report tree display and how and where to write the code for this functionlity of double click.
    FORM alv_tree.
    PERFORM build_sort_table.  “----
    table is sorted
    create container for alv-tree
      DATA: l_tree_container_name(30) TYPE c,
            l_custom_container TYPE REF TO cl_gui_custom_container.
      l_tree_container_name = 'TREE1'.
      CREATE OBJECT l_custom_container
          EXPORTING
                container_name = l_tree_container_name
          EXCEPTIONS
                cntl_error                  = 1
                cntl_system_error           = 2
                create_error                = 3
                lifetime_error              = 4
                lifetime_dynpro_dynpro_link = 5.
    create tree control
      CREATE OBJECT tree1
        EXPORTING
            i_parent              = l_custom_container
            i_node_selection_mode =
                                  cl_gui_column_tree=>node_sel_mode_multiple
            i_item_selection      = 'X'
            i_no_html_header      = ''
            i_no_toolbar          = ''
        EXCEPTIONS
            cntl_error                   = 1
            cntl_system_error            = 2
            create_error                 = 3
            lifetime_error               = 4
            illegal_node_selection_mode  = 5
            failed                       = 6
            illegal_column_name          = 7.
    create info-table for html-header
      DATA: lt_list_commentary TYPE slis_t_listheader.
      PERFORM build_comment USING
                     lt_list_commentary. “----
    already created
    repid for saving variants
      DATA: ls_variant TYPE disvariant.
      ls_variant-report = sy-repid.
    register events
      PERFORM register_events.
    create hierarchy
      CALL METHOD tree1->set_table_for_first_display
              EXPORTING
                   it_list_commentary   = lt_list_commentary
                   i_background_id      = 'ALV_BACKGROUND'
                   i_save               = 'A'
                   is_variant            = ls_variant
              CHANGING
                   it_sort              = gt_sort[]
                   it_outtab            = itab_outtab
                   it_fieldcatalog      = t_fieldcat. "gt_fieldcatalog.
    expand first level
      CALL METHOD tree1->expand_tree
             EXPORTING
                 i_level = 1.
    optimize column-width
      CALL METHOD tree1->column_optimize
               EXPORTING
                   i_start_column = tree1->c_hierarchy_column_name
                   i_end_column   = tree1->c_hierarchy_column_name.
    ENDFORM.                    " alv_tree
    FORM register_events.
    define the events which will be passed to the backend
      data: lt_events type cntl_simple_events,
            l_event type cntl_simple_event.
    define the events which will be passed to the backend
      l_event-eventid = cl_gui_column_tree=>eventid_node_context_menu_req.
      append l_event to lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_item_context_menu_req.
      append l_event to lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_header_context_men_req.
      append l_event to lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_expand_no_children.
      append l_event to lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_header_click.
      append l_event to lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_item_keypress.
      append l_event to lt_events.
      call method tree1->set_registered_events
        exporting
          events = lt_events
        exceptions
          cntl_error                = 1
          cntl_system_error         = 2
          illegal_event_combination = 3.
    ENDFORM.                    " register_events

    hi
    (also check u have refresh the field)
    Check the demo program,In this double click the data fields it will display some field in screen,You can check it
    BCALV_GRID_DND_TREE
    Thanks
    Edited by: dharma raj on Jun 17, 2009 7:41 PM

  • Photoshop CS2 will not open to double click in Snow Lepard

    Since loading Snow Leopard I have been unable to open Photoshop files with a double click. Double clicking .psd file opens PS with the message "Could not complete your request because Photoshop does not recognize this type of file." Right click "open with" gets the same result. I CAN open files through the file menu in PS. But, files opened via the file menu and saved as... will not open with a double click.
    The "Open with" in the file info window reads "Adobe Photoshop CS2". Even forcing it to open in Preview and then back to PS CS2, sort of like hitting it with a hammer, does not improve the situation.
    CS2 on and year old dual quad.
    Before you knee jerk a "CS2, what did you expect..." CS2 seems to work fine once open. And I have access to another brand new iMac 24" with CS2 and Snow Leopard that does not have this problem, files open with a double click.
    On my troubled machine the thousands of files in question opened yesterday, pre Snow Leopard. I have found a few PS files that are several years old that do open to a double click.
    Thoughts?

    In a partial answer to my own question...
    I have discovered that the Adobe CS2 files (as well as Illustrator CS2, Microsoft Office X, Silo, etc.) will open with a double click in some cases.
    Files on my main hard drive (Mac pro dual quad with four one terabyte hard drives, Snow Leopard 10.6.1) is a RAID made up of two of the internal terabyte hard drives will not open with a double clip. (They do open via the file menu in the given program).
    But files on non-RAID drives open with a double click as expected.
    It appears that the RAID drive (Apple software RAID) is the culprit.
    It is likely that a simple fix from Apple in the operating system to correct the opening of files with a double click from an Apple sotware RAID drive would solve the problem as the various programs all work fine otherwise with Snow Leopard 10.6.1.

Maybe you are looking for