JTree: How to set different cell editor for different tree Nodes.

I have a JTree and I want to set different cell editors for different node depending on some condition. E.g. I want to set ComboBox as editor for leaf node but each leaf node will have its own set of data.
Any help or pointer?
Thanks in advance
Sachin

take there:
http://www.mutualinstrument.com/Easy/FAQ/Tree/tree.html

Similar Messages

  • A different cell renderer for the root node ??

    Is it possible to use one cell renderer for the root and a different cell renderer for the other nodes ?
    Thanks.

    Well I tried that and it didn't work.I do it without any problems so what how did you do it?
    Hint - in the renderer compare tree.getModel().getRoot() with the value using == .
    >
    Basically I have a checkbox at each node. So, I tried
    setting the checkbox invisible for the root. Hard work! Since you are just wanting to change the rendering rule for the root you should change the renderer.
    >
    But then all the nodes have an invisible
    checkbox.............................

  • How to set up Pymnt Method for different business units

    Hi,
    Can anyone shed some light as to how to set up P Method in FBZP in a way that one type can be identified according to its Business Unit?
    To clarify, FBZP is currently set up in a repeated way:
    Pymnt Methods:
    T - Transfer - Business Oil
    S - Transfer - Business Engineering
    V - Transfer - Business Equipment
    A - Boleto - Business Oil
    N - Boleto - Business Engineering
    C - Boleto - Business Equipment
    As you can see, we are repeating same payment method as it is needed for business to identify which business unit this refers to.
    Is there a way of setting up only one type of Transfer and one type of Boleto and how this will categorize the type of Business Unit ??
    Any input is welcome
    Regards
    Roger

    Hi Roger:
    How about some enhancement on F110? The logic would be something like read all the proposal lines, group by profit center and then re-assign the payment method based on profit center. There are couple of user exits available starting with RFFOX###, depending on the payment method and the program you using.
    Something similar to substitution rules user exit.
    Not sure if there is any other standard configuration to combine lines by profit center.
    Thanks.
    Rahul

  • Setting cell editor for individual cell in JTable

    Hi there,
    I want to provide individual cell editor for my JTable. Basically, my JTable shows property names and values. I want to show different cell editors for different properties.
    I followed the advice in this post:
    http://forum.java.sun.com/thread.jsp?forum=57&thread=423318
    but I have a question:
    I looked at the code of DefaultCellEditor. It just has a single editor component (the one provided in the constructor), so all the methods use the same component and certain aspects are customized for the type of component. Again, there can be only one type of component at a time.The problem that I am facing is that I will have different components for different row/column of the same table. So how do I implement some of the methods (for example, getCellEditorValue()), when I have multiple editor components?
    Also, how do I commit changes made by the user?
    I am extremely confused.
    Someone please help!
    Thanks.

    Actually, that's what I am currently doing.
    Here is my cell editor class:
    public class ObjectPropertyEditor extends DefaultCellEditor
           public ObjectPropertyEditor()
              super(new JTextField());
              Vector list = new Vector();
              list.add("Yes");
              list.add("No");
             myCombo = new JComboBox(list);
          public Component getTableCellEditorComponent(JTable table, Object value,
              boolean isSelected, int row, int column)
             String colName = (String)table.getValueAt(row,0);
             if(colName.equalsIgnoreCase("Leaf-Node?")) //if it is the "Leaf" property, return the combo box as the editor
                 return myCombo;
            else  //for all other properties, use JTextField of the super class
                return super.getTableCellEditorComponent(table,value,isSelected,row,column);
        private JComboBox myCombo;
    }The problem I have is that when I select a new item from the combo box, the new selection is not reflected in the tableModel. I don't know how I can achive that. I think I need the functionalities that DefaultCellEditor gives to its delegate when its constructor arguments is a combo box. But how can I get two different sets of functionalities (JTextField and JComboBox) ?
    Please help!
    Thanks.

  • Creating a Cell Editor for a JTree

    Hi...
    I would like to be able to edit the nodes of a JTree dynamically, but I'm not sure how to do it. I have unsuccessfully tried to implement a celleditor by extended the DefaultTreeCellEditor. The editing works fine, but once the cell has been edited, I get a ClassCastException.
    I know that I need to get the edited value and then make appropriate changes to the DefaultMutableTreeNode object stored, but I am not sure where to do all this. I would really appreciate some tips on where to get the edited value entered, and how I can access the object being edited. Thanks.
    ..VJ..

    So, you have a big table whose cells each contain a little table. I assume you already have the little tables working correctly with cell editors and so on, and you want to write a cell editor for the big table. Correct?
    My problem with this is that I can't imagine how this would actually work in practice. Suppose I click on a cell in the big table; then the cell renderer displays the appropriate little table. At this point should I see one of the cells in that little table selected, and should I be able to use the Tab key to move around the little table? And if so, then I can't use the Tab key to move around the big table. Next, suppose I press F2 indicating that I want to edit the little table. What should change? Should I now be able to tab around the little table, whereas I couldn't before? And if so, how do I indicate that I have stopped editing the little table? Pressing Enter indicates to the little table's cell editor that its editing is finished, but how should I tell the big table's cell editor that its editing is finished?
    Perhaps if you can answer this, you may have a better idea of how to solve your problem. Sorry I only have questions and not answers.

  • How to use the cell editor in FICO reports for YTD

    HI experts,
    I am working with BI7.0, in the below report, i have displayed result based on user input.but how to calculate the YTD values. User will give the input like 072007, results will be display one year from 072007 to 062006 (one yearback) and one more column is YTD
    Report structure is :
         user input(single value): 072007
              AUG06....JAN07....JULY07....YTD
    KEYFIGURE-1        453      -
    777     -
       232       -
      777 (Only Jan07 value of Keyfigure-1)   
    KEYFIGURE-2        879      -
    233        -
    123       -
      ???? (only sum from Jan07 to July07)
    KEYFIGURE-3        212            -
    879      -
    989                -
    KEYFIGURE-4        234            -
    656      -
    788                   -
    KEYFIGURE-5        345            -
    878      -
    878                 -
    KEYFIGURE-6        767            -
    767       -
    323                 -
    KEYFIGURE-7        879            -
    878     -
    999                -
    999 (Only last value of keyfigure-7 (July07)
    in the above report, total 7 keyfigures so 7rows of YTD column
    1) in the first YTD column, how will display only one value (keyfigure-1) of Jan07?
    2) in the last YTD Column, how will display only one value (keyfigure-7) of July07?
    3) from 2 to 6 columns of YTD, how will display the sum from Jan07 to July07?
    Note: months will be changed based on user input(single Value)
    how can use cell editor for above the senior.
    if any option is availabel please let me know
    Thanks
    kishore

    I think the following should work:
    Context:
    Rows (node,c=0:n)
    --- rowIndex (integer)
    selectedRowIndex (integer)
    Bind the "selectedKey" property of the radio button (cell editor) to attribute "selectedRowIndex" (outside table data source node) and bind "keyToSelect" to attribute "Rows.rowIndex". Make sure that the "rowIndex" attribute will contain the index of the node element in node "Rows".
    Armin

  • HT2500 How do I set up separate and different mail signatures for different email accounts?

    How do I set up separate and different mail signatures for different email accounts?

    Hi Tom,
    In Mail>Preferences>Signatures, highlight the All Signatures icon on the left, drag the sigs you want to he Account on the left...

  • Hi I have two questions. I am using NAS 4.1 and was wondering is it possible to set a different session timeout for different users? How is the session timeout set? Thanks, YS

     

    <i>I am using NAS 4.1 and was wondering is it possible to set a different session timeout for different users?</i>
    Um, there is no such thing as NAS4.1.
    I'm assuming that you mean NAS4.0 (maybe NAS4.0sp1?). If so, then the session timeouts are specified in the session section of the NTV configuration files.
    AFAIK, you can specify session timeouts on a per user basis.

  • List UIBB - Access to cell editor for a certain table line possible

    Hi,
    I am looking for a way to access the cell editor of the last table line as I want to mark it as a special - summary - line.
    I intend a similar approach like in WebDynrpo ABAP when accessing the node info and modifying the "CELL DESIGN" attribute like in the following code (copied from WD Comp WDR_TEST_TABLE, View CELL DESIGN, method FILL_CELL_DESIGNS) :
      data tab type IF_CELL_DESIGN=>Elements_Cell_Designs.
      data line type IF_CELL_DESIGN=>Element_Cell_Designs.
      data node_info type ref to if_wd_context_node_info.
      data attribute_info type wdr_context_attribute_info.
      data attr_value type WDR_CONTEXT_ATTR_VALUE.
      node_info = node->get_node_info( ).
      attribute_info = node_info->get_attribute( 'CELL_DESIGN' ).
      line-is_expanded = abap_true.
      line-is_leaf     = abap_false.
      line-key         = 'FIRST'.
      loop at attribute_info-value_set into attr_value.
        line-text = sy-tabix.
        concatenate 'Text #' line-text into line-text. "#EC NOTEXT
        line-cell_design = attr_value-value.
        insert line into table tab.
        line-is_leaf = abap_true.
        line-key = attr_value-value.
        line-parent_key = 'FIRST'.
      endloop.
      node->bind_table( tab ).
    I suspect the method IF_FPM_GUIBB_LISTGET_DATA (or IF_FPM_GUIBB_LISTGET_DEFINITION) of my feeder class to be the right access point.
    But unfortunately, I have not yet found out how to change the cell design for specific lines, only for whole columns.
    Can anyone give me a hint here?
    BTW: The "summary" line is not a sum of the lines above, but determined by backend logic, so not ALV-summary line for me.
    Kind Regards

    Hi,
    A short update for all interested:
    My current work around is to always set the lead selection to the summary line. It does in a kind "mark" that line as special as long as I cannot mark it using a different cell design.
    How do I assure this?
    I have implemented the following code in a redefinition of the method ADJUST_SELECTION:
    *- alter selection
      DATA:
       ls_size TYPE rstabix.
      "get index of summary line
      ls_size-tabix = mo_collection->size( ).
      "change only if there are any cash conc. proposals
      IF ls_size-tabix > 0.
        "do FPM selection
        CLEAR: ev_lead_index, et_selection.
        ev_lead_index = ls_size-tabix.
        APPEND ls_size TO et_selection.
        "do BOL selection
        mo_collection->if_bol_bo_col_multi_sel~unmark_all( ).
        mo_collection->if_bol_bo_col_multi_sel~mark( iv_index = ls_size-tabix ).
      ENDIF.
    The general downside is, that no other selection is possible!
    The selection is always reset to the summary line with each roundtrip.
    Waiting for a better solution...
    Kind Regards,
    Robert

  • How to set up Airport Extreme for 11ac and 11n?

    I have just purchased the new Airport Extreme (August 2014) because Apple's website states
    Simultaneous dual-band support.
    AirPort Extreme features simultaneous dual-band 802.11ac Wi‑Fi. That means it transmits at both the 2.4GHz and 5GHz frequencies at the same time. So no matter which band your wireless devices use, they’ll automatically connect to the best available band for the fastest possible performance.
    I have number of Macs in my home from a new MacBook Pro with Mavericks to a Macbook Air with Snow Leopard (due to required software) and iPads.
    So after setting up the new Extreme my new MacBook only accesses 11n as does my older Macs. I checked by holding down the option key while clicking the WiFi icon at the top of my Mac. Well, not so automatic then as I was expecting 11ac and 3 times faster access (as stated by Apple).
    I then looked for some documentation for setting up but cannot find anything.
    Hence my question here.
    How to set up Airport Extreme for 11ac and 11n simultaneously?
    At present the new Extreme is no better than my previous 2 year old one.
    Thank you.
    Michael

    How to set up Airport Extreme for 11ac and 11n simultaneously?
    Assuming that it is operating correctly, 802.11ac and 802.11b/g/n are broadcast simultaneously by default.
    Simultaneous dual-band support.
    AirPort Extreme features simultaneous dual-band 802.11ac Wi‑Fi. That means it transmits at both the 2.4GHz and 5GHz frequencies at the same time. So no matter which band your wireless devices use, they’ll automatically connect to the best available band for the fastest possible performance.
    That is advertising. The real information is usually found in the small and hard to read footnotes:
    Based on theoretical peak speeds. Actual speeds will be lower.
    AirPort Extreme is based on an IEEE 802.11ac draft specification. Performance based on comparison with Apple’s 802.11n products. Comparison assumes AirPort Extreme network with 802.11ac-enabled computer. Speed and range will be less if an 802.11a/b/g product joins the network. Accessing the wireless network requires a Wi‑Fi-enabled device. Actual speed will vary based on range, connection rate, site conditions, size of network, and other factors. Range will vary with site conditions.
    Since the 802.11ac signal is being broadcast only using the 5 GHz band, some users report that they have had better results by using the option to assign a different name to the 5 GHz band, and then pointing their Mac to that specific signal or network. You may want to try that option.
    But first as a test, please locate the MacBook Pro about 10-15 feet or 3-4 meters from the AirPort Extreme with clear line-of-sight between the two devices. Restart both the AirPort Extreme and the Macbook Pro and then check to see if the Mac is connected to an 802.11ac signal.
    If not, please power off your other wireless devices...computers, mobile devices, etc. temporarily, and try the same test again.
    Please report on your results.

  • How to get mobile model name for different types mobile devices

    Hi,
    I have checked few thread in this forum about getting mobile model name at server. So far, i noticed the mobile name is set manually in the midlet as user-agent .
    HttpConnection connection = null;           connection = (HttpConnection)Connector.open(url);          connection.setRequestMethod(HttpConnection.POST);          connection.setRequestProperty("User-Agent","Nokia7110 Profile/MIDP-1.0 Configuration/CLDC-1.0");
    i retrieve the header information from servlet like below :-
    String userAgent = request.getHeader("User-Agent");
    How to get mobile model name for different model devices , not by manually adding the model name in midlet?
    Thanks in advance :-)

    Hi,
    In J2ME there is no method to get the model number from the device. how ever you can use the APIs provided by the device manufacturer if available. But still the APIs will not work with devices from other manufacturer or sometimes it will not work with the devices of the same manufacturer if the API is not supported. so it is better to send the device model name through the header.

  • How to set a fixed width for a box

    Hi there,
    Struggling here.... must admit. 
    I need a solution whereby I can set a fixed width for a box that is grouping two buttons.  I suppose generally, I want to know how to set a fixed width for anything element.
    See the picture below.  I want the two buttons to stay the same distance apart, and I want the grouped buttons to stay the same distance from the right edge of the window, even as a user resizes the window.
    This is what happens when you reduce the size of the window .....
    I would like to stop this from happening.
    I can't figure out how accomplish keeping the parent div a fixed width, and a fixed position from the right side of the window, so the buttons won't overlap.
    Perhaps I'm doing the whole thing wrong. 
    I mean, is there a way to accomplish this without grouping the buttons?  That is, make the buttons fixed width, fixed distance apart from each other, and fixed distance from the right side of the window, even as the user resizes the page?
    I am trying to accomplish this using the Min/Max width settings, but given that there are so many different units to choose from, and the fact that when I place a button or box on the screen, it seems to be creating that button or box with a percentage-based width, I don't know how many pixels to set it to.... sigh....
    Many thanks in advance for your help.
    Sam

    Okay after much futzing I figured out at least part of the solution I need, but if someone knows of a more efficent way to do this please let me know. 
    I set a fixed minimum width in pixels for both of the buttons at 156px.
    I then made the left button float left and the right button float right.
    I then made the parent div for the buttons float right.
    That made the buttons stay the same size.
    The only thing I need to figure out how to do now is make the parent div stay a consistent distance in pixels from the right.  I tried setting a right margin but that didn't work.  As you size the window down, the div gets closer to the edge, until it passes it.  

  • Setting new cell variant for an alv table column

    Hi,
    I want to set a new cell variant for a column. Therefore I did the following steps:
    1. Create an object of CL_SALV_WD_CV_STANDARD
    2. SET_KEY( 'CELLVAR1 )
    3. set_cell_design([..]-goodvalue_medium )
    4. SET_EDITOR( lr_alv_input_field )
    After that I added the cell variant to the column by using the method "add_cell_variant".
    The last step is to call method SET_SELECTED_CELL_VARIANT.
    I checked my program by using get_selected_cell_variant( ) and the return string was okay.
    But when the table is displayed, the new cell variant isn't working. I defined an input field as the cell editor for my new cell variant but when the table is shown, it is just text - no input possible. In addition to that the selected cell design (goodvalue_medium , step 3) isn't working. So I think the cell variant is not used.
    Can you help me?
    Thanks & Regards,
    Hendrik

    Hi
    I wonder if you can help me please, I too am having issues implementing ALV cell changes in WDA?
    I am basically trying to dynamically change the individual color of a cell (not the entire column or row) dependant on certain criteria. I apologies but find that you are the closest resource for any potential information. Please see screen shot below.
    Currently my code is as follows:
    see: www.picasaweb.google.co.uk/dave.alexander69/Pictures#5244416971466907938
    data: lr_cv TYPE REF TO cl_salv_wd_cv_standard.
    loop at table 1 row data
            loop at table columns
              for the date columns only...
              IF <fs_column>-id(4) = 'CELL'.
               get and set column header dates from select option user input - done
                loop at table 2 row data (table 2 contains date ranges for row concerned)
                  MOVE: ls_zdata-variance TO lv_variance.
                  method 1 - as in sap press WD4A -:
                  lr_cv = cl_wd_table_standard_cell=>new_table_standard_cell(
                                                     view        = view
                                                    variant_key = lv_variance ).
                 as mentioned...
                  CREATE OBJECT lr_cv.
                  lr_cv->set_key( 'VARIANCE' ).
                  lr_cv->set_cell_design( '09' ).
                  lr_cv->set_editor( lr_input_field ).
                  lr_column->add_cell_variant( lr_cv ).
                  lr_column->set_cell_editor( lr_input_field ).
                  lr_column->set_sel_cell_variant_fieldname( 'VARIANCE' ).
                  lr_column->set_cell_design_fieldname( value = 'COLOR_CELL' ).
                  lr_field = lr_table->if_salv_wd_field_settings~get_field( <fs_column>-id ).
                  lr_field->if_salv_wd_sort~set_sort_allowed( abap_false ).
                  the only way I get cell coloring to work - but this is for entire column?
                  ls_zdata-color_cell = cl_wd_table_standard_cell=>e_cell_design-one.
                  MODIFY lt_zdata FROM ls_zdata..
                ENDLOOP.
              ENDIF.
              IF <fs_column>-id = 'COLOR_CELL'.
                CALL METHOD lr_column->set_visible( EXPORTING value = '00' ).
              ENDIF.
            ENDLOOP
          ENDLOOP.
    As you see I am in the dark a bit regarding cell variants and wonder if you can point me in a better direction.
    Many thanks for any help,
    Dave Alexander

  • Cell Editor for a JTable within A JTable Cell

    My individual cells each contain a seperate JTable and I need to write a cell editor for it. I'm not really sure how to write one so if someone show me where I can find some useful examples of such a cell editor I would greatly appreciate it. Thank you for your time. :-)

    So, you have a big table whose cells each contain a little table. I assume you already have the little tables working correctly with cell editors and so on, and you want to write a cell editor for the big table. Correct?
    My problem with this is that I can't imagine how this would actually work in practice. Suppose I click on a cell in the big table; then the cell renderer displays the appropriate little table. At this point should I see one of the cells in that little table selected, and should I be able to use the Tab key to move around the little table? And if so, then I can't use the Tab key to move around the big table. Next, suppose I press F2 indicating that I want to edit the little table. What should change? Should I now be able to tab around the little table, whereas I couldn't before? And if so, how do I indicate that I have stopped editing the little table? Pressing Enter indicates to the little table's cell editor that its editing is finished, but how should I tell the big table's cell editor that its editing is finished?
    Perhaps if you can answer this, you may have a better idea of how to solve your problem. Sorry I only have questions and not answers.

  • How can i change the ringtone for different contacts.  "edit contacts" won't let me`??

    how can i change the ringtones for different contacts on the razor.  "edit contacts" wont allow me to

    Here is the Instructions your Looking For:  Down towards the Bottom of the Instructions shows how to set Ringtones for each Contact.
    How do I download and use ringtones on my DROID  Razr & RAZR MAXX?
    Quick links
    Set any of your songs on your SDcard as a phone ringtone
    Choose Phone ringtones through settings menu
    Customize the text message ringtone
    Assign a ringtone to a specific contact
    Download ringtones from Play Store      
    1. Set any of your songs on your SDcard as a phone ringtone:
    Touch Apps > My music
    While the music is playing, touch the phone Menu Key > More > Use as ringtone 
    The ringtone is set as your default incoming call ringtone and copied to your Phone ringtone list.       
    Note: The above instructions are for the My music player and not for other players such as Play music.      2. Choose Phone ringtones through settings menu:
    Press the Menu key
    Touch Settings
    Touch Sound
    Touch Phone ringtone  (If option is greyed out, make sure handset volume is not set to Silent Mode)
    Select a Phone ringtone from the list. Press OK to set. (Music files you have set as Incoming Call ringtone from your SDcard will be included in this list along with downloaded and preloaded ringtones.
    3. Customize the text message ringtone
    From the homescreen or from within the applications tray, touch Text messaging
    Press the Menu key (On the left with 4 squares)
    Touch Messaging Settings
    Touch Select ringtones (if option is greyed out, make sure Notifications is turned on / actived)
    Touch on any Notification ringtone to select and hear a sample.
    Press OK to set as notification ringtone
    CLICK HERE for instructions on creating your own custom ringtone for Text Messages
    4. Assign a ringtone to a specific contact:
    Press Contacts icon on homescreen or tap on Contacts application from the Applications Tray
    Touch and select the specific contact
    Press the menu key
    Touch Options
    Touch V (down)  icon next to Ringtone
    Choose a Phone ringtone from the list and tap OK to set.
    Note: To assign a music/song from your memory card as a ringtone, first follow step1 above and follow step 4 again. 5. Download ringtones from the Play Store
    From the applications menu, touch Play Store
    Touch search  to search for ringtones.
    Answers others found helpful
    How do I setup and use Bluetooth on my DROID RAZR MAXX?
    How do I transfer files to/from my DROID RAZR MAXX?
    How do I set up and use the Smart Actions application using the DROID RAZR MAXX?
    How do I use the DROID RAZR MAXX for video chat?
    How do I force my DROID RAZR MAXX to reboot or restart?

Maybe you are looking for

  • How to send html file

    I have created an html file that i want to email. I didn't want to email it as an attachment but as the contents of the email(so the recipient opens the email and sees the html file). How do I do this?

  • CR XI and charts -newb question within

    Hi All, Great website and resource!  I'm a CR newbie and need help with charts.  I'll be using CR to develop single page summary sheets that contain only charts and cross-tabs.  The data is identified by dates that range from 2002 to 2008, and certai

  • Reorganisation of tables

    Hi, in Oracle segment advisor you will find suggestions like "shrink space" or "Reorganise" to reorganise a table. I understand the different commands behind these options, but can you explain the criteria Oracle uses to choose between these two opti

  • Where do I find symbols to use in correspondence

    where do I find symbols on firefox i.e." umlaut" etc.

  • Help with HR Hire Transaction PA40

    When I start a HR WorkFlow to hire a Person With the transaction PA40. When I save the second Info-type, "Create Organizatinal Assignment", the system require a new login. Reading the code I viewed that the function HR_EVENT_CREATE. call function 'SW