How to set one row or node 's height in the jtree?

How to set height of one row or node in the jtree?
I found the method :jTree.setRowHeight(height);.
But I want to set height of one row ,not all rows of a jtree.
Thanks for help!

Who can help me?

Similar Messages

  • How to set Max Rows Retrieved by user security profile in CMC?

    Hi
    As we know, it is possible to set Max Rows Retrieved with query property (in the area 'Limits').
    However, it is mentioned in official documents that this setting can be overwritten by the BOE administrator in user security profile. Could any one tell me how this is done in CMC?
    Thanks in advance!
    Qing

    Hi Rishit,
    Thanks for your answer!
    Had a long holiday, so didn't give a feedback in time. Sorry for that!
    There is a tab 'Controls' in Universe Parameter, where there is a setting used to limit the size of result set.
    Then what's the priority between this setting and the similar setting in WebI query properties?
    However, acutally my question is how to set the limitation by user security profile in CMC.
    Do you have any idea about it?
    Qing
    Edited by: Qing Zhou on Jun 21, 2010 11:12 AM

  • How to create one more server node for SAP J2EE server?

    Hi,
    Can any one please suggest how to create one more server node for SAP J2EE server? I am using WAS700.
    Thanks and Regards,
    Smriti.

    Hai,
          Login into the Configtool(C:\usr\sap\SID\DVEBMGS<inst no>\j2ee\configtool) if ABAP+JAVA stack or C:\usr\sap\SID\JC<inst no>\j2ee\configtool) if JAVA stack
    click on the instance and and select the addserver button on the top to create a servernode for J2EE server.
    Thanks and Regards,

  • How just return one row of a one to many join..

    So I have a one to many join where the SMOPERATOR table has data I need however it has a couple of rows that match the JOIN condition in there. I just need to return one row. I think this can be accomplished with a subquery in the join however have not been able to come up with the right syntax to do so.
    So:
    SELECT "NUMBER" as danumber,
    NAME,
    SMINCREQ.ASSIGNMENT,
    SMOPERATOR.PRIMARY_ASSIGNMENT_GROUP,
    SMOPERATOR.WDMANAGERNAME,
    SMINCREQ.owner_manager_name,
    SMINCREQ.subcategory, TO_DATE('01-'||TO_CHAR(open_time,'MM-YYYY'),'DD-MM-YYYY')MONTHSORT,
    (CASE WHEN bc_request='f' THEN 'IAIO'
    WHEN (bc_request='t' and substr(assignment,1,3)<>'MTS') THEN 'RARO'
    WHEN (bc_request='t' and substr(assignment,1,3)='MTS') THEN 'M'
    ELSE 'U' end) as type
    from SMINCREQ
    left outer join SMOPERATOR on SMINCREQ.assignment=SMOPERATOR.primary_assignment_group
    WHERE SMINCREQ.owner_manager_name=:P170_SELECTION and SMOPERATOR.wdmanagername=:P170_SELECTION
    AND open_time BETWEEN to_date(:P170_SDATEB,'DD-MON-YYYY') AND to_date(:P170_EDATEB,'DD-MON-YYYY')
    AND
    (bc_request='f' and subcategory='ACTIVATION' and related_record<>'t')
    OR
    (bc_request='f' and subcategory<>'ACTIVATION')
    OR
    (bc_request='t' and substr(assignment,1,3)<>'MTS')
    order by OPEN_TIMe

    Hi,
    This sounds like a Top-N Query , where you pick N items (N=1 in this case) off the top of an orderded list. I think you want a separate ordered list for each assignment; the analytic ROW_NUMBER function does that easily.
    Since you didn't post CREATE TABLE and INSERT statements for your sample data, I'll use tables from the scott schema to show how this is done.
    Say you have a query like this:
    SELECT       d.dname
    ,       e.empno, e.ename, e.job, e.sal
    FROM       scott.dept  d
    JOIN       scott.emp   e  ON   d.deptno = e.deptno
    ORDER BY  dname
    ;which produces this output:
    DNAME               EMPNO ENAME      JOB              SAL
    ACCOUNTING           7934 MILLER     CLERK           1300
    ACCOUNTING           7839 KING       PRESIDENT       5000
    ACCOUNTING           7782 CLARK      MANAGER         2450
    RESEARCH             7876 ADAMS      CLERK           1100
    RESEARCH             7902 FORD       ANALYST         3000
    RESEARCH             7566 JONES      MANAGER         2975
    RESEARCH             7369 SMITH      CLERK            800
    RESEARCH             7788 SCOTT      ANALYST         3000
    SALES                7521 WARD       SALESMAN        1250
    SALES                7844 TURNER     SALESMAN        1500
    SALES                7499 ALLEN      SALESMAN        1600
    SALES                7900 JAMES      CLERK            950
    SALES                7698 BLAKE      MANAGER         2850
    SALES                7654 MARTIN     SALESMAN        1250Now say you want to change the query so that it only returns one row per department, like this:
    DNAME               EMPNO ENAME      JOB              SAL
    ACCOUNTING           7782 CLARK      MANAGER         2450
    RESEARCH             7876 ADAMS      CLERK           1100
    SALES                7499 ALLEN      SALESMAN        1600where the empno, ename, job and sal columns on each row of output are all taken from the same row of scott.emp, though it doesn't really matter which row that is.
    One way to do it is to use the analytic ROW_NUMBER function to assign a sequence of unique numbers (1, 2, 3, ...) to all the rows in each department. Since each sequence startw with 1, and the numbers are unique within a department, there will be exactly one row per departement that was assigned the numebr 1, and we''ll display that row.
    Here's how to code that:
    WITH     got_r_num     AS
         SELECT     d.dname
         ,     e.empno, e.ename, e.job, e.sal
         ,     ROW_NUMBER () OVER ( PARTITION BY  d.dname
                                   ORDER BY          e.ename
                           )         AS r_num
         FROM     scott.dept  d
         JOIN     scott.emp   e  ON   d.deptno = e.deptno
    SELECT       dname
    ,       empno, ename, job, sal
    FROM       got_r_num
    WHERE       r_num     = 1
    ORDER BY  dname
    ;Notice that he sub-query got_r_num is almost the same as the original query; only it has one additional column, r_num, in the SELECT clause, and the sub-qeury does not have an ORDER BY clause. (Sub-queries almost never have an ORDER BY clause.)
    The ROW_NUMBER function must have an ORDER BY clause. In this example, I used "ORDER BY ename", meaning that, within each department, the row with the first ename (in sort order) will get r_num=1. You can use any column, or expression, or expressions in the ORDER BY clause. You muight as well use something consistent and predictable, like ename, but if you really wanted arbitrary numbering you could use a constant in the analytic ORDER BY clause, e.g. "ORDER BY NULL".

  • How to update one row in AdvancedDataGrid

    My App have a AdvancedDataGrid and it has so much rows. Some
    data rows for AdvancedDataGrid has changed and i don't want to
    update all rows ... But i don't know how to update one row for my
    AdvancedDataGrid
    Some body help me ...
    Thanks so muchs !

    thanks ntsii.
    my problem is:
    [Bindable]
    var dp:ArrayColection = new ArrayColection({...});
    <mx:AdvancedDataGrid dataProvider="{dp}">
    <mx:groupedColumns>
    </mx:groupedColumns>
    </mx:AdvancedDataGrid>
    //==================================
    in my dp have more rows and some time one of them is changed
    then i guess the AdvancedDataGrid must build all rows when
    it's dataProvider (dp) have changed.
    And i don't want to that...
    But i am not sure the AdvancedDataGrid buld all rows from
    begin to end ... i don't know.. !

  • How to set special rows in jtable not selectable

    Hello programmers,
    anybody knows how to set special rows(p.E. row 0) in jtable not selectable.
    in advance thanks for your answers

    table = new JTable(...)
         public void changeSelection(int row, int column, boolean toggle, boolean extend)
              if (row == 0)
                   return;
              else
                   super.changeSelection(row, column, toggle, extend);
    };

  • What is an smpt password?  I have problems sending photos using the stamp at the bottom because it asks for some smpt password and I have no clue to find out what it is, how to set one of find one if I somehow put one in and don't know what it it.

    what is an smpt password?  I have problems sending photos using the stamp at the bottom because it asks for some smpt password and I have no clue to find out what it is, how to set one of find one if I somehow put one in and don't know what it it.

    It's the password for your outgoing mail in your Mail account. You need to set it up in your Preferences.
    Regards
    TD

  • How to set max row display rows in PO's PLD

    Hi,
    How to set max row display rows in PO's PLD
    Thanks and Best Regards
    Bruce

    Hi
    Max. Rows per Page is depend on PLD Settings and Depend on Repetitive Area Fieds Height.
    Try this,
    1st Case:
    ->> Administration Module.
    ->> System Initialization.
    ->> Open the Print Perferences Window.
    ->> Click General Tab on Print Perferences Window.
    ->> Assign the Max. Rows per Page - 99 (or) your wishes.
    ->> Update the Print Perferences.
    2nd Case:
    ->> Open your PLD.
    ->> Choose Repetitive Area on Field Index Window.
    ->> Click Format Tab on Properties Area Window.
    ->> Assign the Lines in Repetitive Area - Your Wishes .
    ->> Save the PLD.
    Regards,
    Madhan.

  • HT201328 I have been given permission for unlocking my iphone 3 GS from Orange. I want to set up the phone for my wife to use with a new number and carrier. Do I unlock under my itunes account first or set one up for her and then unlock the phone.

    I have been given permission for unlocking my iphone 3 GS from Orange. I want to set up the phone for my wife to use with a new number and carrier. Do I unlock under my itunes account first ( I now have a new iphone on this account) or set one up for her and then unlock the phone. I am worried about upsetting the new phone.

    I would complete unlocking as is and then
    restore as new once you know the iPhone is unlocked
    Be aware Orange will process the request at their speed
    one of the reasons they usually reside at bottom of User Sat surveys
    will likely take weeks
    This may also help
    http://support.apple.com/kb/HT5014

  • How to dislay a frame when i clck on the node or leaf on the JTree

    Hi All,
    Iam doing project on swing. In that iam doing with JTree. The Jtree is displaying on the left side of the splitpane .My problem is if i click on the nodes or leaf in the JTree one panel should be open in on the right side of the spltpane. Iam pasting the code.please can any body knows the solution please send me.
    regards
    sonali
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.BorderFactory;
    import javax.swing.border.*;
    import java.awt.event.*;
    import javax.swing.tree.*;
    import javax.swing.JTree;
    import javax.swing.tree.DefaultMutableTreeNode;
    import javax.swing.event.TreeSelectionListener;
    import javax.swing.event.TreeSelectionEvent;
    import javax.swing.tree.TreeSelectionModel;
    import javax.swing.tree.DefaultTreeCellRenderer;
    import java.net.URL;
    import javax.swing.*;
    import java.io.IOException;
    import javax.swing.JEditorPane;
    import javax.swing.JScrollPane;
    import javax.swing.JSplitPane;
    import javax.swing.JFrame;
    import Test.Test1;
    public class JFrame1 extends javax.swing.JFrame {
    JScrollPane sp;
    JPanel topPanel;
    JPanel leftPanel;
    JPanel bottomPanel;
    JPanel rightPanel;
    Border b ;
    JTree tree;
    DefaultTreeModel treeModel;
         public JFrame1(){
              getContentPane().setLayout(null);
              setSize(405,305);
              setVisible(false);
              JPanel1.setLayout(null);
              getContentPane().add(JPanel1);
              JPanel1.setLayout(new GridLayout(1, 1));
              JPanel1.setBounds(0,0,405,305);
              JPanel1.add(JSplitPane1);
              JSplitPane1.setBounds(0,5,405,305);
              JSplitPane1.setContinuousLayout(false);
              topPanel = new JPanel();
              leftPanel = new JPanel();
              bottomPanel = new JPanel();
              topPanel.setLayout(new FlowLayout());
              leftPanel.setLayout(null);
              b = new EtchedBorder();
              leftPanel.setBorder(b);
              leftPanel.setBounds(0,0,300,305);
              bottomPanel.setLayout(new FlowLayout());
              rightPanel = new JPanel();
              rightPanel.setBounds(108, 0, 300, 305);
              JSplitPane1.setRightComponent(rightPanel);
              JSplitPane1.setLeftComponent(leftPanel);
              rightPanel.setLayout(null);
              topPanel.setBounds(0,0,305,25);
              b = new EtchedBorder(0);
              topPanel.setBorder(b);
              bottomPanel.setBounds(0,26,300,280);
              b = new BevelBorder(1, Color.black,Color.black);
              bottomPanel.setBorder(b);
              rightPanel.add(topPanel);
              rightPanel.add(bottomPanel);
              JSplitPane1.setDividerLocation(120);
              DefaultMutableTreeNode root = new DefaultMutableTreeNode("Root");
    DefaultMutableTreeNode subroot = new DefaultMutableTreeNode("SubRoot");
    DefaultMutableTreeNode leaf1 = new DefaultMutableTreeNode("Leaf 1");
    DefaultMutableTreeNode leaf2 = new DefaultMutableTreeNode("Leaf 2");
    DefaultMutableTreeNode leaf3 = new DefaultMutableTreeNode("Leaf 3");
    DefaultMutableTreeNode subroot1 = new DefaultMutableTreeNode("SubRoot1");
    DefaultMutableTreeNode leaf11 = new DefaultMutableTreeNode("Leaf 11");
    DefaultMutableTreeNode leaf21 = new DefaultMutableTreeNode("Leaf 21");
    DefaultMutableTreeNode leaf31 = new DefaultMutableTreeNode("Leaf 31 skfjdsf sfjfdsl fslfkjdsfl sflkjaflksdfdslfjds lfsdlkfjdslk sdsdlkfjdsla fflkdasjfdslkjal");
    DefaultMutableTreeNode subroot2 = new DefaultMutableTreeNode("SubRoot2");
    DefaultMutableTreeNode leaf12 = new DefaultMutableTreeNode("Leaf 12");
    DefaultMutableTreeNode leaf22 = new DefaultMutableTreeNode("Leaf 22");
    DefaultMutableTreeNode leaf32 = new DefaultMutableTreeNode("Leaf 32");
    treeModel = new DefaultTreeModel(root);
    tree = new JTree(treeModel);
    treeModel.insertNodeInto(subroot, root, 0);
    treeModel.insertNodeInto(leaf1, subroot, 0);
    treeModel.insertNodeInto(leaf2, root, 1);
    treeModel.insertNodeInto(leaf3, root, 2);
    treeModel.insertNodeInto(subroot1, root, 3);
    treeModel.insertNodeInto(leaf11, subroot1, 0);
    treeModel.insertNodeInto(leaf21, subroot1, 1);
    treeModel.insertNodeInto(leaf31, subroot1, 2);
    treeModel.insertNodeInto(subroot2, root, 3);
    treeModel.insertNodeInto(leaf12, subroot2, 0);
    treeModel.insertNodeInto(leaf22, subroot2, 1);
    treeModel.insertNodeInto(leaf32, subroot2, 2);
    sp = new JScrollPane();
    sp.setBounds(0,0,300,305);
    sp.getViewport().add(tree);
    sp.setViewportBorder(BorderFactory.createRaisedBevelBorder());
    leftPanel.add(sp,BorderLayout.CENTER);
    //          SymPropertyChange lSymPropertyChange = new SymPropertyChange();
    //          JSplitPane1.addPropertyChangeListener(lSymPropertyChange);
              SymWindow aSymWindow = new SymWindow();
              this.addWindowListener(aSymWindow);
              SymComponent aSymComponent = new SymComponent();
              this.addComponentListener(aSymComponent);
         public JFrame1(String sTitle)
              this();
              setTitle(sTitle);
         public void setVisible(boolean b)
              if (b)
                   setLocation(50, 50);
              super.setVisible(b);
         static public void main(String args[])
              (new JFrame1()).setVisible(true);
         public void addNotify()
              Dimension size = getSize();
              super.addNotify();
              if (frameSizeAdjusted)
                   return;
              frameSizeAdjusted = false;
              Insets insets = getInsets();
              javax.swing.JMenuBar menuBar = getRootPane().getJMenuBar();
              int menuBarHeight = 0;
              if (menuBar != null)
                   menuBarHeight = menuBar.getPreferredSize().height;
              setSize(insets.left + insets.right + size.width, insets.top + insets.bottom + size.height + menuBarHeight);
         boolean frameSizeAdjusted = false;
         javax.swing.JPanel JPanel1 = new javax.swing.JPanel();
         javax.swing.JSplitPane JSplitPane1 = new javax.swing.JSplitPane();
         /*class SymPropertyChange implements java.beans.PropertyChangeListener{
              public void propertyChange(java.beans.PropertyChangeEvent event){
                   Object object = event.getSource();
                   if (object == JSplitPane1)
                        JSplitPane1_propertyChange(event);
    /*     void JSplitPane1_propertyChange(java.beans.PropertyChangeEvent event){
         System.out.println("!");
         sp.setSize((int)JSplitPane1.getLeftComponent().getBounds().getWidth()-2,(int)JSplitPane1.getLeftComponent().getBounds().getHeight()-2 );
         sp.repaint();
         tree.repaint();
         class SymWindow extends java.awt.event.WindowAdapter{
              public void windowActivated(java.awt.event.WindowEvent event){
                   Object object = event.getSource();
                   if (object == JFrame1.this)
                        JFrame1_windowActivated(event);
              public void windowIconified(java.awt.event.WindowEvent event){
                   Object object = event.getSource();
                   if (object == JFrame1.this)
                        JFrame1_windowIconified(event);
         void JFrame1_windowIconified(java.awt.event.WindowEvent event){
         void JFrame1_windowActivated(java.awt.event.WindowEvent event){
         class SymComponent extends java.awt.event.ComponentAdapter{
              public void componentShown(java.awt.event.ComponentEvent event){
                   Object object = event.getSource();
                   if (object == JFrame1.this)
                        JFrame1_componentShown(event);
              public void componentResized(java.awt.event.ComponentEvent event){
                   Object object = event.getSource();
                   if (object == JFrame1.this)
                        JFrame1_componentResized(event);
         void JFrame1_componentResized(java.awt.event.ComponentEvent event){
         System.out.println("!!");
              JPanel1.setSize(this.getContentPane().getMaximumSize());
              JSplitPane1.setSize((int)JPanel1.getMaximumSize().getWidth()-5,(int)JPanel1.getMaximumSize().getHeight()-5 );
              topPanel.setBounds(0, 0, rightPanel.getWidth()-3, 25);
              bottomPanel.setBounds(0,26,rightPanel.getWidth()-3,rightPanel.getHeight()-28);
              sp.setSize((int)leftPanel.getMaximumSize().getWidth(),(int)leftPanel.getMaximumSize().getHeight());
         sp.setAutoscrolls(true);
         //sp.setSize((int)JSplitPane1.getLeftComponent().getBounds().getWidth()-2,(int)JSplitPane1.getLeftComponent().getBounds().getHeight()-2 );
         sp.repaint();
         //sp.setSize((int)leftPanel.getSize().getWidth(),(int)leftPanel.getSize().getHeight() );
         void JFrame1_componentShown(java.awt.event.ComponentEvent event){
         System.out.println("!!!");
              JPanel1.setSize(this.getContentPane().getMaximumSize());
              JSplitPane1.setSize((int)JPanel1.getMaximumSize().getWidth()-5,(int)JPanel1.getMaximumSize().getHeight()-5 );
              topPanel.setBounds(0, 0, rightPanel.getWidth()-3, 25);
         sp.setSize((int)JSplitPane1.getLeftComponent().getBounds().getWidth()-2,(int)JSplitPane1.getLeftComponent().getBounds().getHeight()-2 );
         sp.repaint();
              bottomPanel.setBounds(0,26,rightPanel.getWidth()-3,rightPanel.getHeight()-28);
    }

    hi sculz,
    i develped the tree, and tree selection listener also the 4 th point i didnt able to do . here is the code belo what i did.
    iam not able to add the JSplit pane also.
    import java.io.*;
    import java.util.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.tree.*;
    import javax.swing.event.*;
    public class Tree08 extends JFrame{
    Hashtable theHashtable = new Hashtable();
    int frameWidth = 300;
    int frameHeight = 305;
    int numberRows = 19;
    JTree tree;
    JPanel treePanel;
    String plafClassName =
    "com.sun.java.swing.plaf.motif.MotifLookAndFeel";
    For future reference, the three plaf implementations
    are:
    com.sun.java.swing.plaf.metal.MetalLookAndFeel
    com.sun.java.swing.plaf.motif.MotifLookAndFeel
    com.sun.java.swing.plaf.windows.WindowsLookAndFeel
    JLabel display;
    public static void main(String args[]) {
    new Tree08();
    public Tree08 () {
    theHashtable.put("Cabbage","Good in slaw");
    theHashtable.put("Squash","The yellow variety");
    theHashtable.put("Onion","Not too hot");
    theHashtable.put("Squirrel","Likes to store nuts");
    theHashtable.put("Rabbit","Runs fast");
    theHashtable.put("Fox","Crazy like a ...");
    theHashtable.put("Horse","Fun to ride");
    theHashtable.put("Pig","Lives in mud");
    theHashtable.put("Cow","Gives us milk");
    theHashtable.put("Peach","From Georgia");
    theHashtable.put("Grape","Saueeze into wine");
    theHashtable.put("Apple","Red delicious");
    theHashtable.put("Orange","Very juicy");
    DefaultMutableTreeNode[] theTreeNodes = new
    DefaultMutableTreeNode[numberRows];
    theTreeNodes[0] = new DefaultMutableTreeNode("Sample
    Tree");
    theTreeNodes[1] = new
    DefaultMutableTreeNode("Vegetables");
    theTreeNodes[2] = new
    DefaultMutableTreeNode("Cabbage");
    theTreeNodes[3] = new
    DefaultMutableTreeNode("Squash");
    theTreeNodes[4] = new
    DefaultMutableTreeNode("Onion");
    theTreeNodes[5] = new
    DefaultMutableTreeNode("Animals");
    theTreeNodes[6] = new
    DefaultMutableTreeNode("Forrest");
    theTreeNodes[7] = new
    DefaultMutableTreeNode("Squirrel");
    theTreeNodes[8] = new
    DefaultMutableTreeNode("Rabbit");
    theTreeNodes[9] = new DefaultMutableTreeNode("Fox");
    theTreeNodes[10] = new
    DefaultMutableTreeNode("Farm");
    theTreeNodes[11] = new
    DefaultMutableTreeNode("Horse");
    theTreeNodes[12] = new DefaultMutableTreeNode("Pig");
    theTreeNodes[13] = new DefaultMutableTreeNode("Cow");
    theTreeNodes[14] = new
    DefaultMutableTreeNode("Fruit");
    theTreeNodes[15] = new
    DefaultMutableTreeNode("Peach");
    theTreeNodes[16] = new
    DefaultMutableTreeNode("Grape");
    theTreeNodes[17] = new
    DefaultMutableTreeNode("Apple");
    theTreeNodes[18] = new
    DefaultMutableTreeNode("Orange");
    theTreeNodes[0].add(theTreeNodes[1]);
    theTreeNodes[1].add(theTreeNodes[2]);
    theTreeNodes[1].add(theTreeNodes[3]);
    theTreeNodes[1].add(theTreeNodes[4]);
    theTreeNodes[0].add(theTreeNodes[5]);
    theTreeNodes[5].add(theTreeNodes[6]);
    theTreeNodes[6].add(theTreeNodes[7]);
    theTreeNodes[6].add(theTreeNodes[8]);
    theTreeNodes[6].add(theTreeNodes[9]);
    theTreeNodes[5].add(theTreeNodes[10]);
    theTreeNodes[10].add(theTreeNodes[11]);
    theTreeNodes[10].add(theTreeNodes[12]);
    theTreeNodes[10].add(theTreeNodes[13]);
    theTreeNodes[0].add(theTreeNodes[14]);
    theTreeNodes[14].add(theTreeNodes[15]);
    theTreeNodes[14].add(theTreeNodes[16]);
    theTreeNodes[14].add(theTreeNodes[17]);
    theTreeNodes[14].add(theTreeNodes[18]);
    treePanel = new TreePanel(theTreeNodes[0]);
    tree.addTreeSelectionListener(new MyTreeListener());
    Container content = getContentPane();
    content.add(treePanel,BorderLayout.CENTER);
    display = new JLabel("Display Selection Here");
    content.add(display,BorderLayout.SOUTH);
    setSize(frameWidth, frameHeight);
    setTitle("Copyright 1998, R.G.Baldwin");
    setVisible(true);
    this.addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    System.exit(0);}
    class MyTreeListener implements TreeSelectionListener{
    public void valueChanged(TreeSelectionEvent e) {
    DefaultMutableTreeNode theNode =
    (DefaultMutableTreeNode)
    (e.getPath().getLastPathComponent());
    if (theNode.isLeaf()) {
    display.setText((String)theHashtable.get(
    theNode.getUserObject()));
    class TreePanel extends JPanel {
    public TreePanel(TreeNode root){
    setLayout(new BorderLayout());
    tree = new JTree(root);
    JScrollPane sp = new JScrollPane(tree);
    add(sp, BorderLayout.CENTER);
    try{
    UIManager.setLookAndFeel(plafClassName);
    }catch(Exception ex){System.out.println(ex);}
    SwingUtilities.updateComponentTreeUI(this);
    for(int cnt = 0; cnt < numberRows; cnt++){
    tree.expandRow(cnt);
    regards
    sonali

  • How to pass one row of a result set to a cffunction?

    I can pass the entire result set of a query to a cffunction,
    but the function only needs one row.
    The code below is a syntax error, where "3" is array index
    notation for the third row of the result set.
    What is the correct way to pass one row of a result set to a
    cffunction?
    Thank you.

    iirc, cf does not allow one to reference and access a row of
    a resultset
    like that.
    you will have to create a structure/array that holds the data
    from
    specific query row and pass that to your function. looping
    over
    queryname.columnlist list will make it easier and not
    specific to any
    particular query. make it into another function that accepts
    a query and
    row number as arguments and returns a struct/array of that
    row data (or
    automatically passes it to another function).
    sample code for creating a structure of specific query row
    data:
    <cfset rowstruct = {}>
    <cfloop list="#queryname.columnlist#" index="col">
    <cfset rowstruct[col] = queryname[col][somerownumber]>
    </cfloop>
    <cfdump var="#rowstruct#">
    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com/

  • How to set some rows in ALV to be editable or some non editable.

    Dear all Gurus,
    I'm facing a situation here, I need your assistance.
    I'm creating a alv table where the user can enter a data and then this will be uploaded into the system. Now upon validation some records might fail and would need some changes and some records that had no problems would have been successfully posted.
    When the program returns to the user i want the successful one's to be greyed out and not editable. I'm not sure on how i could acess the rows of the table. I tried few classes and an all i could manage was to change the table setting and configs.
    Below i've pasted the code on how i've code my alv table. Please advice on how i could access the rows and disable the successfull ones. Please.
    METHOD wddoinit .
      DATA: l_ref_cmp_usage TYPE REF TO if_wd_component_usage,
            l_interface     TYPE REF TO iwci_salv_wd_table,
           l_model         TYPE ref to cl_salv_wd_config_table, "Contains all characteristics of a table(collumns, fields, etc)
            lt_columns      TYPE        salv_wd_t_column_ref,  " Table type
            lt_fields       TYPE        salv_wd_t_field_ref,   " Table type
            l_btn_ins       TYPE REF TO cl_salv_wd_fe_button,
            l_btn_del       TYPE REF TO cl_salv_wd_fe_button,
            l_btn_sell_all  TYPE REF TO cl_salv_wd_fe_button,
            l_btn_dell_all  TYPE REF TO cl_salv_wd_fe_button,
            l_btn_calc      TYPE REF TO cl_salv_wd_fe_button,
            l_btn_save      TYPE REF TO cl_salv_wd_fe_button,
            l_function      TYPE REF TO cl_salv_wd_function,
            l_column        TYPE REF TO cl_salv_wd_column,
            l_header        TYPE REF TO cl_salv_wd_column_header,
            lr_input_1      TYPE REF TO cl_salv_wd_uie_input_field,
            lr_input_2      TYPE REF TO cl_salv_wd_uie_input_field,
            lr_input_3      TYPE REF TO cl_salv_wd_uie_input_field,
            lr_input_4      TYPE REF TO cl_salv_wd_uie_input_field,
            lr_input_5      TYPE REF TO cl_salv_wd_uie_input_field,
            lr_input_6      TYPE REF TO cl_salv_wd_uie_input_field,
            lr_input_7      TYPE REF TO cl_salv_wd_uie_input_field,
            lr_input_8      TYPE REF TO cl_salv_wd_uie_input_field,
            lr_input_9      TYPE REF TO cl_salv_wd_uie_input_field,
            lr_input_10     TYPE REF TO cl_salv_wd_uie_input_field,
            lr_input_11     TYPE REF TO cl_salv_wd_uie_input_field,
            lr_input_12     TYPE REF TO cl_salv_wd_uie_input_field,
            l_link          TYPE REF TO cl_salv_wd_uie_button.
      CONSTANTS:
              zzto                        TYPE  string VALUE 'ZZTO',
              zzfrom                      TYPE  string VALUE 'ZZFROM',
              takeoff_date                TYPE  string VALUE 'TAKEOFF_DATE',
              read_date                   TYPE  string VALUE 'READ_DATE',
              takeoff_time                TYPE  string VALUE 'TAKEOFF_TIME',
              read_time                   TYPE  string VALUE 'READ_TIME',
              ac_hrs                      TYPE  string VALUE 'AC_HRS',
              le_hrs                      TYPE  string VALUE 'LE_HRS',
              re_hrs                      TYPE  string VALUE 'RE_HRS',
              ac_cycle                    TYPE  string VALUE 'AC_CYCLE',
              re_cycle                    TYPE  string VALUE 'RE_CYCLE',
              le_cycle                    TYPE  string VALUE 'LE_CYCLE',
              ltext                       TYPE  string VALUE 'LTEXT'.
      l_ref_cmp_usage =   wd_this->wd_cpuse_multi_alv( ).
      IF l_ref_cmp_usage->has_active_component( ) IS INITIAL.
        l_ref_cmp_usage->create_component( ).
      ENDIF.
    *Map the interface.
      l_interface = wd_this->wd_cpifc_multi_alv( ).
      DATA:
        node_mdoc                           TYPE REF TO if_wd_context_node,
        elem_mdoc                           TYPE REF TO if_wd_context_element.
    navigate from <CONTEXT> to <MDOC> via lead selection
      node_mdoc = wd_context->get_child_node( name = if_create_mass_entry=>wdctx_mdoc ).
      l_interface->set_data( r_node_data = node_mdoc ).
    *Map the model
      wd_this->l_model = l_interface->get_model( ).
    *Map the columns
      lt_columns = wd_this->l_model->if_salv_wd_column_settings~t_columns.
    *Map the fields
      lt_fields = wd_this->l_model->if_salv_wd_field_settings~t_fields.
      cl_salv_wd_model_table_util=>if_salv_wd_table_util_stdfuncs~set_all(
                        EXPORTING r_model = wd_this->l_model
                                  allowed = abap_false ). " try abap_true
    *Enable or Disable the ALV desired outlook and design
      wd_this->l_model->if_salv_wd_table_settings~delete_header( ).
      wd_this->l_model->if_salv_wd_table_settings~set_selection_mode(
                                           value  = cl_wd_table=>e_selection_mode-auto ).
      wd_this->l_model->if_salv_wd_table_settings~set_width( value = '100%'  ).
      wd_this->l_model->if_salv_wd_table_settings~set_visible_row_count( value  = '10' ).
      wd_this->l_model->if_salv_wd_table_settings~set_read_only( value  = abap_false  ).
      wd_this->l_model->if_salv_wd_std_functions~set_filter_filterline_allowed( value  = abap_true ).
      wd_this->l_model->if_salv_wd_std_functions~set_sort_headerclick_allowed( value = abap_true ).
      wd_this->l_model->if_salv_wd_std_functions~set_export_allowed( value = abap_false ).
    *Adding functionalities to the ALV
    *'Insert Row' Button
      CREATE OBJECT l_btn_ins.
      l_btn_ins->set_text( 'Insert Row' ).
      l_btn_ins->set_tooltip( 'To enter a new row' ).
      l_btn_ins->set_image_source( value = 'ICON_INSERT_ROW'  ).
      l_function = wd_this->l_model->if_salv_wd_function_settings~create_function( id = 'INSERT'  ).
      l_function->set_position( value = '1' ).
      l_function->set_editor( value = l_btn_ins  ).
    *'Delete Row' Button
      CREATE OBJECT l_btn_del.
      l_btn_del->set_text( 'Delete Row' ).
      l_btn_del->set_tooltip( 'Delete the selected row' ).
      l_btn_del->set_image_source( value = 'ICON_DELETE_ROW' ).
      l_function = wd_this->l_model->if_salv_wd_function_settings~create_function( id = 'DELETE'  ).
      l_function->set_position( value = '2' ).
      l_function->set_editor( value = l_btn_del  ).
    *'Select All' Button
      CREATE OBJECT l_btn_sell_all.
      l_btn_sell_all->set_text( 'Select All' ).
      l_btn_sell_all->set_tooltip( 'Select all entered record' ).
      l_btn_sell_all->set_image_source( value = 'ICON_INSERT_ROW'  ).
      l_function = wd_this->l_model->if_salv_wd_function_settings~create_function( id = 'SELECT'  ).
      l_function->set_position( value = '3' ).
      l_function->set_editor( value = l_btn_sell_all ).
    *'Deselect All' Button
      CREATE OBJECT l_btn_dell_all.
      l_btn_dell_all->set_text( 'Deselect All' ).
      l_btn_dell_all->set_tooltip( 'Deselect all records selected' ).
      l_btn_dell_all->set_image_source( value = 'ICON_DESELECT_ALL'  ).
      l_function = wd_this->l_model->if_salv_wd_function_settings~create_function( id = 'DESELECT'  ).
      l_function->set_position( value = '4' ).
      l_function->set_editor( value = l_btn_dell_all  ).
    *'Calculate' Button
      CREATE OBJECT l_btn_calc.
      l_btn_calc->set_text( 'Calculate Hours' ).
      l_btn_calc->set_tooltip( 'Calculate hours of each record' ).
      l_btn_calc->set_image_source( value = 'ICON_CALCULATION'  ).
      l_function = wd_this->l_model->if_salv_wd_function_settings~create_function( id = 'CALC'  ).
      l_function->set_position( value = '5' ).
      l_function->set_editor( value = l_btn_calc  ).
    *'Save' Button
      CREATE OBJECT l_btn_save.
      l_btn_save->set_text( 'Save All' ).
      l_btn_save->set_tooltip( 'Save all' ).
      l_btn_save->set_image_source( value = 'ICON_SYSTEM_SAVE'  ).
      l_function = wd_this->l_model->if_salv_wd_function_settings~create_function( id = 'SAVE'  ).
      l_function->set_position( value = '6' ).
      l_function->set_editor( value = l_btn_save  ).
      FIELD-SYMBOLS: <fs_column>  TYPE salv_wd_s_column_ref.
      LOOP AT lt_columns ASSIGNING <fs_column>.
        l_column = <fs_column>-r_column.
        l_column->get_header( RECEIVING value = l_header ).
        l_header->set_ddic_binding_field( value  = if_salv_wd_c_column_settings=>ddic_bind_none ).
        CASE <fs_column>-id .
          WHEN zzfrom.
            CREATE OBJECT lr_input_1  EXPORTING  value_fieldname = zzfrom.
            l_header->set_text( value = 'Flt Fr' ).
            l_column->set_position( value = '1'  ).
            l_column->set_cell_editor( lr_input_1 ).
           l_column->set_visible( '0' ).
          WHEN zzto.
            CREATE OBJECT lr_input_2  EXPORTING  value_fieldname = zzto.
            l_header->set_text( value = 'Flt To' ).
            l_column->set_position( value = '2'  ).
            l_column->set_cell_editor( lr_input_2 ).
          WHEN takeoff_date.
            CREATE OBJECT lr_input_3  EXPORTING  value_fieldname = takeoff_date.
            l_header->set_text( value = 'Takeoff Date' ).
            l_column->set_position( value = '3'  ).
            l_column->set_cell_editor( lr_input_3 ).
          WHEN read_date.
            CREATE OBJECT lr_input_4  EXPORTING  value_fieldname = read_date.
            l_header->set_text( value = 'Landing Date' ).
            l_column->set_position( value = '4'  ).
            l_column->set_cell_editor( lr_input_4 ).
          WHEN takeoff_time.
            CREATE OBJECT lr_input_5  EXPORTING  value_fieldname = takeoff_time.
            l_header->set_text( value = 'Takeoff Time' ).
            l_column->set_position( value = '5'  ).
            l_column->set_cell_editor( lr_input_5 ).
          WHEN read_time.
            CREATE OBJECT lr_input_6  EXPORTING  value_fieldname = read_time.
            l_header->set_text( value = 'Landing Time' ).
            l_column->set_position( value = '6'  ).
            l_column->set_cell_editor( lr_input_6 ).
          WHEN ac_hrs.
            CREATE OBJECT lr_input_7  EXPORTING  value_fieldname = ac_hrs.
            l_header->set_text( value = 'Flt Time' ).
            l_column->set_position( value = '7'  ).
            l_column->set_cell_editor( lr_input_7 ).
          WHEN le_hrs.
            CREATE OBJECT lr_input_8  EXPORTING  value_fieldname = le_hrs.
            l_header->set_text( value = 'LH Eng Runtime' ).
            l_column->set_position( value = '8'  ).
            l_column->set_cell_editor( lr_input_8 ).
          WHEN re_hrs.
            CREATE OBJECT lr_input_9  EXPORTING  value_fieldname = re_hrs.
            l_header->set_text( value = 'RH Eng Runtime' ).
            l_column->set_position( value = '9'  ).
            l_column->set_cell_editor( lr_input_9 ).
          WHEN ac_cycle.
            CREATE OBJECT lr_input_10  EXPORTING  value_fieldname = ac_cycle.
            l_header->set_text( value = 'No. of Landings' ).
            l_column->set_position( value = '10'  ).
            l_column->set_cell_editor( lr_input_10 ).
          WHEN re_cycle.
            CREATE OBJECT lr_input_11  EXPORTING  value_fieldname = re_cycle.
            l_header->set_text( value = 'RH Eng Start' ).
            l_column->set_position( value = '11'  ).
            l_column->set_cell_editor( lr_input_11 ).
          WHEN le_cycle.
            CREATE OBJECT lr_input_12  EXPORTING  value_fieldname = le_cycle.
            l_header->set_text( value = 'LH Eng Start' ).
            l_column->set_position( value = '12'  ).
            l_column->set_cell_editor( lr_input_12 ).
          WHEN ltext.
            CREATE OBJECT l_link.
            l_link->set_image_source( value = 'ICON_CREATE_TEXT'  ).
            l_link->set_text_fieldname( ltext ).
            l_link->set_tooltip( value = 'Create Log'   ).
            l_header->set_text( value = 'Enter Log').
            l_column->set_cell_editor( l_link ).
            l_column->set_h_align( cl_wd_table_column=>e_h_align-center ).
            l_column->set_position( value = '13' ).
          WHEN OTHERS.
            l_column->set_visible( '01' ).
        ENDCASE.
      ENDLOOP.
    ENDMETHOD.
    Your any help is highly appreciated. Thank you.
    Regards,
    Vinod

    Ok, here you go.
    In your context, apart from your display fields, add another attribute READ_ONLY, type char01. And lets assume you want the field by name field_1 to be editable or not based on some validation. Your code will be like this to initialize the ALV.
    DATA:
              l_alv_model               TYPE REF TO cl_salv_wd_config_table,
              lr_column_settings        TYPE REF TO if_salv_wd_column_settings,
              lr_column                 TYPE REF TO cl_salv_wd_column,
              lt_col                    TYPE SALV_WD_T_COLUMN_REF,
              ls_col                    TYPE SALV_WD_S_COLUMN_REF,
              lr_input_field            type ref to cl_salv_wd_uie_input_field.
        l_alv_model = l_ref_interfacecontroller->get_model( ).
        l_alv_model->IF_SALV_WD_TABLE_SETTINGS~SET_READ_ONLY( abap_false ).
        lr_column_settings ?= l_alv_model.
        lt_col = lr_column_settings->get_columns( ).
        LOOP AT lt_col INTO ls_col where ID = 'FIELD_1'.
             create object lr_input_field exporting value_fieldname = ls_col-id.
             lr_input_field->set_read_only_fieldname( 'READ_ONLY' ).
             ls_col-r_column->set_cell_editor( lr_input_field ).
        ENDLOOP.
    In your event handler, you read your node, do a get_static_attributes_table. Perform all validations. Loop through your internal table and set the field READ_ONLY as 'X' when validation succeeds. Do READ_ONLY = space when validation fails. Then do a bind_elements. Now the rows for which read_only is false, will be editable and vice versa.
    Hope I was clear enough. Get back if you have any doubts.
    Regards,
    Nithya

  • How to set value to Model Node of cardinality 0..N

    hi
    I am looking for a way to set value to a model node of cardinality 0..N
    i imported a WSDL into my applicaion , which has the following Node Structure.
    Context
    --- ModelNode_Request
          ---ModelNode2_Input
          ---ModleNode3_Roles  [ cardinality 0..n singleton 1..1]
               ****Model_Attribute RoleID     <<<<<<<<<<<<
               ****Model_Attribute SysID      <<<<<<<<<<<<
      ---ModelNode_Response
    i tried with the below code  but effort went in vain.
    i tried following ways to set the value but , i get Nullpointer expection error.
         wdContext.nodeRequest__SubmitRequest().nodeRequestDetails().nodeRoles().
              currentRolesElement().setRoleId("BASIC");
         wdContext.nodeRequest__SubmitRequest().nodeRequestDetails().nodeRoles().
              currentRolesElement().setSysId("R3_220");
    i aslo looked into the forum  https://www.sdn.sap.com/irj/scn/thread?messageID=2035342 but couldnt find any solid solution.
    It would be great if some one can throw some snippets on the same.
    Thanks
    Edited by: RR on Dec 22, 2008 5:48 PM

    Hi RR,
    As far as i know u can set model nodes and values nodes are different. whats shown in the link is for values node. u should do differently for model node..
        Since this is a model node...u first need to create an object of the node type. then create an arraylist for that and then add values..
    try this..
    // Create an object for structures in the node to be used
    Yweb_Po_Items objPOItems = null; // where Yweb_Po_Items is the structure of the node...
    // Create an abstractlist for structures in the RFC node to be used, if u are planning to give single or multiple rows (in node/table) as input to the RFC
    AbstractList POObjAbsList = new Yweb_Po_Items.Yweb_Po_Items_List();
    objPOItems = new Yweb_Po_Items();
    //    /set first set of values
    objPOItems.setColumn1(u201Cabcu201D); // here hard codede for example
    objPOItems.setColumn2(u201Cabcfghu201D);
    // add the object to the abstract list
    POObjAbsList.add(objPOItems);
    //    /set second set of values
    objPOItems.setColumn1(u201Cnewabcu201D);
    objPOItems.setColumn2(u201Cnewabcfghu201D);
    // add the object to the abstract list again
    POObjAbsList.add(objPOItems); // now u got 2 records
    // now set the abstractlist to the node in the RFC
    objGoodsReceiptPO.setPo_Items_In(POObjAbsList);
    Hope this information is useful...
    Thanks
    Md. Yusuf

  • How to set different row - column visibility attribute

    Hi all:
       I have one table in webdynpro for java. For example it have 4 rows, I need to set one column as different visible for row 1st and row 2nd .
               column1   column2
    row1      x               -
    row2      -               x
    Can I set it ?
    Thanks a lot.

    ya sure, u can
    make a visibility element and assign it to the tablecelleditor of each column of ur table. Now in the code, u must have bound the table to a node,  make the visibility element in the same node. Whichever row u want to make invisible, write the following code:
    wdcontext.node<nodename>.get<node name>elementat(<the row which u wish to make invisible>).set<visibility context>(wdvisibility.NONE);
    it will work.
    Let me know if u need further help....
    All The Best!!!
    Regards
    Gita

  • How to write one row of data at a time to "Write to File"

    I am trying to write 10 parameters to the LV "Write to File". This is for just one row at a time. This happens evertime I get a failure in my test routine. I am not quite sure how to accomplish this task. If I get another failure I write one row again. I testing 4 DUTS at a time so I write this row of data to each file. I am sure it is very simple.
    Thanks
    Philip

    Assuming your 10 parameters are an numeric array with 10 elements,  use "write to spreadsheet" file with append set to true. (... and if they are scalars, built the array first ).
    LabVIEW Champion . Do more with less code and in less time .

Maybe you are looking for