How to expand a JTree depending on a property

Hi I have a JTree that needs to be expandAll if a property in the ini file is true. Can some tell me how I can do it or give me an example. If needed i can post my code. Here the addtreeDisplays() has to expandAll depending on a string(true ).
Can some help me out.
Thanks,
public class TreeDisplayPanel extends JPanel implements QMRequestListener,
                                                        TopologySelectionListener,
                                                                      PropertyChangeListener
    /** Creates new TreeDisplayPanel */
    //Key to get from property file
    String _treeKey = "tree.display.type";
    //default display
    public final static int TREE_DISPLAY = 0;
    public final static int STAR_DISPLAY = 1;
    public final static int BOTH_DISPLAY =2;
     Properties _displayProp = null;
    //Main panel where everything gets put on to be displayed
    public JPanel _mainDisplayPanel;
    //current default display
    private int treeDisplayPreference = STAR_DISPLAY;
    private MQETabbedPane _treeTabPane;
    private MQETabbedPane _viewTabPane;
    private String treeDisplayTitle;
     static private final String treeviewKey = "tree.view.text";
     static private final String starviewKey = "star.view.text";
     static private final String splitviewKey = "split.view.text";
     static private final String mergeviewKey = "merge.view.text";
     // Default tree displays.
     private HyperbolicTreePanel hyperbolicTreePanel = null;
     private NavigatorTreePanel navigatorTreePanel = null;
     // A store for any queue manager tree displays created
     // by the user. This will enable these trees to be
     // modified whenever the user invokes a expand/collapse
     // all action on a node or whenever the user changes
     // the leaf node expansion preference.
     private Vector<NavigatorTreePanel> qmgrTreeDisplays =
        new Vector<NavigatorTreePanel>();
     //HashMap of indexes correspond to indexes in tabbed paned that are merged, it contains
    //hashtables of components in those merged indexes
    HashMap _qmMergedIndexes = new HashMap();
    //Current listeners to this panel on node selections
    protected Vector<TopologySelectionListener> _tsListeners =
        new Vector<TopologySelectionListener>();
     private TopologyModel m_model = null;
     private TopologyModelNode m_nnode = null;
     private TopologyDisplayPanel tdp = null;
    public TreeDisplayPanel(TopologyModel model, Properties prop, String displayTitle) {
        super(new BorderLayout());
          m_model = model;
          _displayProp = prop;
          treeDisplayTitle = displayTitle;
        initComponent();
        initGui();
    private void initComponent()
          _mainDisplayPanel = ComponentFactory.getInstance().createTitledPanel(treeDisplayTitle);
          _mainDisplayPanel.setLayout(new BorderLayout());
          add(_mainDisplayPanel, BorderLayout.CENTER);
    private void initGui()
        if (_displayProp != null)
               // Get the current display preference.
               String defaultDisplay = Integer.toString(STAR_DISPLAY);
            treeDisplayPreference = Integer.parseInt(_displayProp.getProperty(_treeKey, defaultDisplay));
        try
            //Add according to your display property
            _treeTabPane = new MQETabbedPane();
            _viewTabPane = new MQETabbedPane(JTabbedPane.BOTTOM);
            _viewTabPane.addMouseListener(new MouseListener()
                public void mouseClicked(MouseEvent e)
                    final int tabNum = _viewTabPane.getUI().tabForCoordinate(_viewTabPane,e.getX(),e.getY());
                    //Only if the mouse click is a right mouse and tab number is not on overview pane or doc pane is the popup valid
                    if (SwingUtilities.isRightMouseButton(e) && tabNum > 1)
                        final String tabStr = _viewTabPane.getTitleAt(tabNum);
                        JPopupMenu popup = new JPopupMenu();
                        JMenuItem menuItem1 = new JMenuItem(new AbstractAction("Close " + tabStr)
                            public void actionPerformed(ActionEvent e)
                                //Remove it from our HashMap of merged panes if it exists
                                if (_qmMergedIndexes.containsKey(tabStr))
                                    _qmMergedIndexes.remove(tabStr);
                                        // Remove the Qmgr tree display.
                                        NavigatorTreePanel treePanel = (NavigatorTreePanel)_viewTabPane.getComponentAt(tabNum);
                                        ExpandingModelNode model = (ExpandingModelNode)treePanel.getNavigatorTreeModel();
                                        model.getNode().removeTreeModelListener(model);
                                        qmgrTreeDisplays.remove(treePanel);
                                _viewTabPane.removeTabAt(tabNum);
                              String mergeview = StringFactory.getString(mergeviewKey);
                        JMenu merge = new JMenu(mergeview);
                        merge.setEnabled(false);
                        int numTabs = _viewTabPane.getTabCount();
                        //System.out.println("Num of tabs " + numTabs);
                        //Only allow merging if you have more then 2 panes (1 - Overview, 2 - Qmgr, 3-Qmgr....
                        //Also if the current pane is not a merge pane already
                        if (numTabs > 3 && !_qmMergedIndexes.containsKey(tabStr))
                            //Do not enable this menu if the number of already merged Indexes - the number of tabs
                            //is greater then two (One Valid pane + Overview pane). The reason is because then there is
                            //no valid pane to merge with
                            if ((numTabs - _qmMergedIndexes.size()) > 3)
                                merge.setEnabled(true);
                                for (int i = 2; i<numTabs; i++)
                                    //Add only valid tabs and not already merged tabs
                                    if (i != tabNum && !_qmMergedIndexes.containsKey(_viewTabPane.getTitleAt(i)))
                                        //JMenuItem mergeItem = new JMenuItem(new AbstractAction(_viewTabPane.getTitleAt(i))
                                                  JMenuItem mergeItem = new JMenuItem(new AbstractAction(_viewTabPane.getToolTipTextAt(i))
                                            public void actionPerformed(ActionEvent e)
                                                try
                                                    //System.out.println("Action Name for " + e.getActionCommand());
                                                    //Work around for java bug in JTabbedPane
                                                    _viewTabPane.setSelectedIndex(0);
                                                    _viewTabPane.validate();
                                                    //End workaround
                                                    //Strip off the fully qualified name to contain only the name of the QM name
                                                                 String mergeTabName = m_model.getQMgrName(e.getActionCommand());
                                                                 JPanel splitPanel = new JPanel(new BorderLayout());
                                                    JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
                                                    splitPane.setBorder(null);
                                                    splitPane.setOneTouchExpandable(true);
                                                    int mergeTabIndex =  _viewTabPane.indexOfTab(mergeTabName);
                                                    String mergeTabString = _viewTabPane.getTitleAt(mergeTabIndex);
                                                                 Component mergeComp = _viewTabPane.getComponentAt(mergeTabIndex);
                                                    String mergeCompAddress = _viewTabPane.getToolTipTextAt(mergeTabIndex);
                                                                 splitPane.setLeftComponent(mergeComp);
                                                                 int currentTabIndex =  _viewTabPane.indexOfTab(tabStr);
                                                    Component currentComp = _viewTabPane.getComponentAt(currentTabIndex);
                                                                 String currentCompAddress = _viewTabPane.getToolTipTextAt(currentTabIndex);
                                                    splitPane.setRightComponent(currentComp);
                                                    splitPanel.add(splitPane, BorderLayout.CENTER);
                                                    String mergeName = mergeTabName + "/" + tabStr;
                                                                 String toolTipName = mergeCompAddress + " | " + currentCompAddress;
                                                    //_viewTabPane.addTab(mergeName, splitPanel);
                                                                 addTabToDisplay(mergeName, toolTipName, splitPanel);
                                                    splitPane.setDividerLocation(.5);
                                                    int mergeIndex = _viewTabPane.indexOfTab(mergeName);
                                                                  if (mergeIndex != -1)
                                                        //_viewTabPane.setToolTipTextAt(mergeIndex, mergeName);
                                                                      //_viewTabPane.setSelectedIndex(mergeIndex);
                                                        //Now lets update our ongoing vector/hashmap
                                                        //Create a hash map with the current merged view
                                                        Hashtable mergeViews = new Hashtable();
                                                        mergeViews.put(mergeCompAddress,mergeComp);
                                                        mergeViews.put(currentCompAddress,currentComp);
                                                        _qmMergedIndexes.put(mergeName, mergeViews);
                                                catch (Exception ex)
                                                    ex.printStackTrace();
                                        merge.add(mergeItem);
                              String splitKey = StringFactory.getString(splitviewKey);
                        JMenu splitMenu = new JMenu(splitKey);
                        splitMenu.setEnabled(false);
                        //Only allow to split if the current tab has a merged view
                        if (_qmMergedIndexes.containsKey(tabStr))
                            splitMenu.setEnabled(true);
                            Hashtable mergeHash = (Hashtable)_qmMergedIndexes.get(tabStr);
                            Enumeration enumeration = mergeHash.keys();
                            while (enumeration.hasMoreElements())
                                //Create a new menu item for each QM in View
                                String node = (String)enumeration.nextElement();
                                JMenuItem mergeItem = new JMenuItem(new AbstractAction(node)
                                    public void actionPerformed(ActionEvent e)
                                        //Work around for java bug in JTabbedPane
                                        _viewTabPane.setSelectedIndex(0);
                                        _viewTabPane.validate();
                                        //End workaround
                                        String splitTabName = e.getActionCommand();
                                        //Get the merge hash for this tab num
                                        Hashtable splitHash = (Hashtable)_qmMergedIndexes.get(tabStr);
                                        Enumeration enumeration = splitHash.keys();
                                        _viewTabPane.removeTabAt(tabNum);
                                                  int iIndexOfSplit = 0;
                                        while (enumeration.hasMoreElements())
                                            //Add new pane for the views in the hashtable
                                            String nodeAddress = (String)enumeration.nextElement();
                                                       String nodeName = m_model.getQMgrName(nodeAddress);
                                                       NavigatorTreePanel currentComp = (NavigatorTreePanel)splitHash.get(nodeAddress);
                                            addTabToDisplay(nodeName,nodeAddress,currentComp);
                                                       //Now if this tab this we just added is equal to the menu item of the split menu,
                                                       //store this so that we can give focus to it later
                                                       if (splitTabName.equals(nodeAddress))
                                                            iIndexOfSplit = _viewTabPane.getTabCount()-1;
                                        //Also remove it from our vector of merged tabs
                                        _qmMergedIndexes.remove(tabStr);
                                        //int mergeIndex = _viewTabPane.indexOfTab(splitTabName);
                                        //if (mergeIndex != -1)
                                                  if (iIndexOfSplit != -1)
                                            //_viewTabPane.setSelectedIndex(mergeIndex);
                                                       _viewTabPane.setSelectedIndex(iIndexOfSplit);
                                splitMenu.add(mergeItem);
                        popup.add(menuItem1);
                        popup.add(merge);
                        popup.add(splitMenu);
                        if (popup != null)
                            Point p = e.getPoint();
                            popup.show((Component)e.getSource(), (int)p.getX(), (int)p.getY());
                public void mouseEntered(MouseEvent e)
                public void mouseExited(MouseEvent e)
                public void mousePressed(MouseEvent e)
                public void mouseReleased(MouseEvent e)
               //Don't forget to add the tree's
               addTreeDisplays();
            _viewTabPane.addTab(StringFactory.getString("perspective.display.overview.tab"), _treeTabPane);
               _viewTabPane.addTab(StringFactory.getString("perspective.display.documentation.tab"), new DocDisplayPanel());
            _mainDisplayPanel.add(_viewTabPane, BorderLayout.CENTER);
        catch(Exception e)
            e.printStackTrace();
     private void addTabToDisplay(String nameStr, String toolStr, JComponent c)
          if (_viewTabPane == null)
               return;
          _viewTabPane.addTab(nameStr, c);
          int tabNum = _viewTabPane.getTabCount()-1;
          if (toolStr != null)
               _viewTabPane.setToolTipTextAt(tabNum, toolStr);
          _viewTabPane.setSelectedIndex(tabNum);
     private void addTreeDisplays()
          String starKey = StringFactory.getString(starviewKey);
          String treeKey = StringFactory.getString(treeviewKey);
          //navigatorTreePanel.expandTreePath(this, true);
          String test = MQEPreferencesDialog.getPreferenceValue("expand.leaf.startup");
          System.out.println("test{{{{{{{{{{"+test);
          //System.out.println("test{{{{{{{{{{"+m_nnode.);
          if (treeDisplayPreference == BOTH_DISPLAY)
               hyperbolicTreePanel = new HyperbolicTreePanel(m_model);
               hyperbolicTreePanel.addQMRequestListener(this);
               hyperbolicTreePanel.addTopologySelectionListener(this);
               //hyperbolicTreePanel.expandTreePath((TopologyModelNode)m_model.getRoot(), true);
               //hyperbolicTreePanel.expandTreePath(m_nnode, true);
               _treeTabPane.addTab("", IconFactory.getInstance().getIcon("staricon"), hyperbolicTreePanel, starKey);
               navigatorTreePanel = new NavigatorTreePanel(m_model);
               navigatorTreePanel.addQMRequestListener(this);
               navigatorTreePanel.addTopologySelectionListener(this);
               _treeTabPane.addTab("", IconFactory.getInstance().getIcon("treeicon"), navigatorTreePanel, treeKey);
          else if (treeDisplayPreference == TREE_DISPLAY)
               navigatorTreePanel = new NavigatorTreePanel(m_model);
               navigatorTreePanel.addQMRequestListener(this);
               navigatorTreePanel.addTopologySelectionListener(this);
               _treeTabPane.addTab("", IconFactory.getInstance().getIcon("treeicon"), navigatorTreePanel, treeKey);
          else
               hyperbolicTreePanel = new HyperbolicTreePanel(m_model);
               hyperbolicTreePanel.addQMRequestListener(this);
               hyperbolicTreePanel.addTopologySelectionListener(this);
               _treeTabPane.addTab("", IconFactory.getInstance().getIcon("staricon"), hyperbolicTreePanel, starKey);
    public void addTopologySelectionListener(TopologySelectionListener tsl)
        if (tsl != null)
            _tsListeners.add(tsl);
    public void removeTopologySelectionListener(TopologySelectionListener tsl)
        if (tsl != null)
            _tsListeners.remove(tsl);
    protected void fireTopologySelection(TopologyModelNode node)
        for (TopologySelectionListener tsl : _tsListeners)
            tsl.receiveTopologySelection(node);
   /* TopologySelectionListener methods                                     */
    public void receiveTopologySelection(TopologyModelNode node)
        //Since this panel can have multiple panels in it's current Tabbed display.
        //This class registers to each of the TopologyDisplayPanels as a listener for selections
        //This way no matter who is currently active, they will funnel the event to here and it this
        //panel will send the event on foward
        if (node != null)
            fireTopologySelection(node);
   /* QMRequestListener methods                                             */
    public void receiveQMRequest(TopologyModelNode node)
        //Check to see if this node is already in a Tab already
        System.out.println("Queue Manager request");
          boolean doesExist = false;
        int tabNum =0;
          //Fix for activity 00033248 TAB PANES FOR IDENTICAL QMANAGERS ON DIFF MACHINES
          //The only unique names are in the tooltips so lets just cycle through all the tabs
          //and search for this Queue Manager name.  Using indexOfTab in JTabbedPane will not
          //work here because it will return first location of a matching queue manager name, but
          //we could have multiple tabs open with same queue manager name.
          for (int i = 0; i < _viewTabPane.getTabCount();i++)
               String toolTipStr = _viewTabPane.getToolTipTextAt(i);
               //Using the string method for indexOf, covers us when we have a merged tab window
               if ((toolTipStr != null) && (toolTipStr.indexOf(((ResourceProxy)node).getAddress().trim()) != -1))
                    //We already have existing queue manager tab open
                    doesExist = true;
                    tabNum = i;
                    break;
          if ( !doesExist)
               //Create the tab
            NavigatorTreePanel treePanel = new NavigatorTreePanel(new ExpandingModelNode(node));
            treePanel.addTopologySelectionListener(this);
               // Add the tree panel to a container so that it can be accessed
               // for expand/collapse all and tree refresh actions.
               qmgrTreeDisplays.add(treePanel);
               //Fix for activity 00033248 TAB PANES FOR IDENTICAL QMANAGERS ON DIFF MACHINES
               addTabToDisplay(((ResourceProxy)node).getName().trim(), ((ResourceProxy)node).getAddress().trim(), treePanel);
            node.getModel().expandNode(node);
          else
               _viewTabPane.setSelectedIndex(tabNum);
   /* PropertyChangeListener methods                                        */
        public void propertyChange(PropertyChangeEvent evt){
          String propertyChanged = evt.getPropertyName();
          if (propertyChanged.equals(MQEDisplayPreferences.treeDisplayProperty)){
               int newPreference = ((Integer)evt.getNewValue()).intValue();
               changeTreeDisplays(newPreference);
          else if (propertyChanged.equals(MQEDisplayPreferences.expandLeafProperty)){
               // The enable leaf node preference has changed so update the MQE
               // tree displays according to the new preference setting.
               refreshTreeDisplays();
          else{
               // Ignore the property change event.
    * Changes the trees displayed by MQE according to
     * the preference set by the current user.
    * @param the new trees display preference.*/
     public void changeTreeDisplays(int preference)
          // Assign the new tree display preference.
          treeDisplayPreference = preference;
          // Recreate the tree display according
          // to the new preference.
          m_model.removeTreeModelListeners();
          _treeTabPane.removeAll();
          addTreeDisplays();
          refreshTreeDisplays();
    * Fully expands the Navigator display trees from the specified node.
    * @param the node from which each tree will be fully expanded.
     public void expandAll(TopologyModelNode node)
          node.expandAll();
          final TopologyModelNode fnode = node;
          Runnable doTask = new Runnable(){
               public void run(){
                    // Fire a tree structure changed notification for
                    // the StarTree, (1) because it will not display
                    // tree nodes correctly without it and (2) it appears
                    // to be the only tree interested in doing anything
                    // with it!
                    fnode.fireTreeStructureChanged(TopologyModel.STRUCTURE_CHANGE);
                    if (hyperbolicTreePanel != null)
                         hyperbolicTreePanel.expand(fnode);
                    if (navigatorTreePanel != null)
                         navigatorTreePanel.expand(fnode);
                    for (NavigatorTreePanel navTreePanel : qmgrTreeDisplays){
                         navTreePanel.expand(fnode);
          SwingUtilities.invokeLater(doTask);
    * Fully collapses the Navigator display trees from the specified node.
    * @param the node from which each tree will be fully collapsed.
     public void collapseAll(TopologyModelNode node)
          final TopologyModelNode fnode = node;
          Runnable doTask = new Runnable(){
               public void run(){
                    if (hyperbolicTreePanel != null)
                         hyperbolicTreePanel.collapse(fnode);
                    if (navigatorTreePanel != null)
                         navigatorTreePanel.collapse(fnode);
                    for (NavigatorTreePanel navTreePanel : qmgrTreeDisplays){
                         navTreePanel.collapse(fnode);
          SwingUtilities.invokeLater(doTask);
    * Will ensure that all tree nodes, starting from the root, are correctly displayed.
     public void refreshTreeDisplays()
          if (hyperbolicTreePanel != null){
               TopologyModel model = hyperbolicTreePanel.getTopologyModel();
               if (model != null){
                    hyperbolicTreePanel.expandTreePath((TopologyModelNode)model.getRoot(), true);
                    hyperbolicTreePanel.refreshTreeDisplay((TopologyModelNode)model.getRoot());
          if (navigatorTreePanel != null){
               TopologyModel model = navigatorTreePanel.getTopologyModel();
               if (model != null){
                    navigatorTreePanel.refreshTreeDisplay((TopologyModelNode)model.getRoot());
                    navigatorTreePanel.repaint();
          for (NavigatorTreePanel navTreePanel : qmgrTreeDisplays){
               ExpandingModelNode model = (ExpandingModelNode)navTreePanel.getNavigatorTreeModel();
               if (model != null){
                    navigatorTreePanel.expand((TopologyModelNode)model.getRoot());
                    navTreePanel.refreshTreeDisplay((TopologyModelNode)model.getRoot());
                    navTreePanel.repaint();
}

you really don't need to post all that code, few people will read it, or try to compile/run it.
just a tree in a scrollpane in a frame is all you need, then add the method/problem to the basic,
and post that so its only 20 to 30 lines long.
here's your basic tree/scrollpane/frame, with an expandAll()
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
class Testing
  public void buildGUI()
    JTree tree = new JTree();
    expandAll(tree);
    JFrame f = new JFrame();
    f.getContentPane().add(new JScrollPane(tree));
    f.pack();
    f.setLocationRelativeTo(null);
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.setVisible(true);
  public void expandAll(JTree tree)
    int row = 0;
    while (row < tree.getRowCount())
      tree.expandRow(row);
      row++;
  public static void main(String[] args)
    SwingUtilities.invokeLater(new Runnable(){
      public void run(){
        new Testing().buildGUI();
}so, is your problem with the expandAll(), or with reading the properties file?

Similar Messages

  • How to expand the hierarchy column automatically when delivery reports by a

    Hi Experts,
    In OBIEE 11.1.1.6.0,how to expand the hierarchy column automatically when delivery reports by agent?
    For example:
    In SampleLite RPD, when we drag "Time Hierarchy" and Sales column into the report , and sent it by agent ,it will only display "Total" sales, not show all level value,such as Year,Month,Day.So how to expand the hierarchy column automatically when delivery reports by agent?
    If we expand all levels and save them, it will be ok, however, when we add new data, it will be collpased automatically and not show the lowest level data, requiring Users or Developer to modify this report for expanding the hierarchy. We think it is very trouble, is there any good suggestion or method for achieving our requirement?

    958054 wrote:
    Hi Dpka,
    Is it any difference? I look at the result is same.
    Firstly, you said it is 'Add member of ',
    Now, you said it is 'Keep member of'
    Could you please tell me which options I must select ? Thanks very much.Here is some notes from the documentation to make a better sense of how those two options would work:
    •Selection steps — When you create selection steps, you can add a group or a calculated item in a step. Subsequent Keep Only or Remove steps might reference members that were included in the group or calculated item.
    ◦A group list is affected by members that are kept or removed in subsequent steps, but the group outline value remains the same. For example, suppose the MyNewYork group contains Albany and Buffalo and its value is 100. Suppose Albany is removed in a later step. The value of the MyNewYork group remains at 100, but Albany is no longer listed with the group.
    ◦A calculated item is not affected by members that are kept or removed in subsequent steps, because removals can affect the components of the formula.
    •Groups and calculated items — A step can include a group or calculated item. Groups and calculated items can be used only with Add steps; they cannot be used in Keep Only or Remove steps.

  • How to disable the Language dependent option for 0PROJECT and 0WBS_ELEMT

    Hi Friends,
                Some Info Objects are re installed in latest version that's why DBW and QBW is not sinked. that's why giving transports errors.
               In DBW both Info Objects(0PROJECT and 0WBS_ELEMT) having the option text language dependent is checked. I go for disable that option it is not accepting to disable.
              when i am going to delete the data from both the info objects it's not deleting the data from both the objects. it is giving message some master data is not deleting.
           Please give me solution for this how to disable text language dependent option for both the objects.
       I am waiting for your valuable replies.
    Thanks,
    Guna.

    Hi Rajesh,
              i did that changes in RSD1 but not accepting that change.
    It is showing the error message for The Text Table /BI0/TPROJECT must be converted incompatibly with an activation of characteristic 0PROJECT (changes to the key in the table). Table /BI0/TPROJECT contains data. Parts of this data were lost in the conversion.
    Please give me help for solving this issue.
    Thnaks,
    Guna.
    Edited by: gunasekhar raya on Mar 24, 2009 11:58 AM
    Edited by: gunasekhar raya on Mar 24, 2009 5:42 PM
    Edited by: gunasekhar raya on Mar 24, 2009 5:43 PM

  • How to Expand the Screen of Windows Server 2003 on VMware Server 2 ?

    Folks,
    Hello. Because Windows 7 is not compatible to be installed PeopleSoft PIA, I have to install VMware Server 2 and then install Windows Server 2003, that is compatible with PIA, on the virtual machine.
    But when I open Windows Server 2003 on the virtual machine, the screen of Win2K3 is very small, and its size is about 1/4 of the screen of my computer screen. This is not comfortable to work for a long time.
    Does any folks know how to expand the screen of Windows Server 2003 on VMware Server 2 virtual machine so that its size covers the entire screen of my computer ?
    Thanks in advance !
    Lucy

    Did you already installed the VMWare tools onto your VMWare guest OS ? Generally, it helps a lot to be able to redefine a larger screen definition.
    Nicolas.

  • How can create a JTree with cellRender is checkbox realized multiple selec

    How can create a JTree with cellRender is checkbox realized multiple selection function.thanks for every
    one's help.

    Hi,
    1. Create a value node in your context name Table and set its cardinality to 0:n
    2. Create 2 value attributes within the Table node name value1 and value2
    3. Goto Outline view> Right click on TransparentUIContainer>Apply Template> Select Table>mark the node Table and it's attributes.
    you have created a table and binded its value to context
    Table UI properties
    4.Set Selection Mode to Multi
    5.Set Visible Row Count to 5
    6.ScrollableColCount to 5
    In your implemetaion, you can add values to table as follow:
    IPrivate<viewname>.ITableElement ele = wdContext.nodeTable().createTableElement();
    ele.setValue1(<value>);
    ele.setValue2(<value>);
    wdContext.nodeTable().addElement(ele);
    The above code will allow you to add elements to your table node.
    Regards,
    Murtuza

  • How to expand the folder via applescript?

    Dear apple experts,
    How to expand the folder via applescript?
    Manually we are using command + option + right arrow, but how we handle this in applescript?
    Thanks in advance,
    Velladurai.G

    Hello
    Finder's container's "expanded" and "completely expanded" properties have long been marked "NOT AVAILABLE YET" under OSX:
    Finder.sdef > Containers and Folders suite
    container n [inh. item] : An item that contains other items
        elements
            contains items, containers, folders, files, alias files, application files, document files, internet location files, clippings, packages.
        properties
            entire contents (specifier, r/o) : the entire contents of the container, including the contents of its children
            expandable (boolean, r/o) : (NOT AVAILABLE YET) Is the container capable of being expanded as an outline?
            expanded (boolean) : (NOT AVAILABLE YET) Is the container opened as an outline? (can only be set for containers viewed as lists)
            completely expanded (boolean) : (NOT AVAILABLE YET) Are the container and all of its children opened as outlines? (can only be set for containers viewed as lists)
            container window (specifier, r/o) : the container window for this folder
    A way to expand a given folder is to use keystroke command of System Events to invoke the keyboard shortcut in Finder. Something like the following script.
      kLeftArrowCharCode            = 28,
      kRightArrowCharCode           = 29,
      kUpArrowCharCode              = 30,
      kDownArrowCharCode            = 31,
    --set f to (path to downloads folder from user domain) -- target folder e.g.
    set f to (choose folder)
    tell application "Finder"
        reveal f
        tell Finder window 1
            set cv to current view
            if cv = column view then return -- do nothing
            if cv = icon view then set current view to list view
        end tell
        my _keystroke(it, character id 29, {option down, command down}, 0.2)
    end tell
    on _keystroke(_app, _key, _modifiers, _delay)
            reference _app : application reference
            string _key : character(s) to be keystroked [1]
            list _modifiers : list of modifier key to be pressed; enumerations are
                    command down
                    option down
                    shift down
                    control down
            number _delay : post-delay amount [sec]
            [1] Character must be present on the current keyboard layout. Otherwise, it is replaced by 'a'.
        tell _app to activate
        tell application "System Events"
            tell (process 1 whose bundle identifier = (_app's id))
                keystroke _key using _modifiers
            end tell
        end tell
        if _delay > 0 then delay _delay
    end _keystroke
    Regards,
    H

  • How to make default Currency  depending upon plant in table entries

    Hi,,
    How to make default Currency  depending upon plant in table entries?
    I am making entries in SM30.
    I have the following fields in z table.
    plaant , material,month.year,PFvalue,Currency.
    Can  some body throw light for this issue,please?\
    I am familiar  with modification-events.
    With Regards,
    Jaheer

    Hi,
      In PBO, within a LOOP, table control is filled via a Structure/Work Area.
      In that module, code as follows,
    LOOP AT SCREEN.
        IF WA-FIELD1 = C_1 AND SCREEN-GROUP1 = C_G1.
          SCREEN-INPUT = 0.
          MODIFY SCREEN.
        ENDIF.
    ENDLOOP.
      Here, WA is a strcture & FIELD1 is its field, like that...
      I already did this.
      Check it out & Reply.
    Yours,
    R.Nagarajan
    We can

  • How do you compile Flex-dependent classes with ASC?

    Hi,
    I've been trying unsuccessfully for most of the evening to compile a .as file that relies on mx.collections.ListCollectionView using asc. I figured I could just import the Flex framework SWCs from the command line with asc, but asc doesn't seem to respect SWCs - it only seems to respect .abc files.
    So, I've spent most of my time trying to compile the Flex framework into a single .abc file that I can import whenever I want to compile a class that relies on Flex. I figured I could make a base .as file with include statements for all of the Flex .as files (copying the approach I saw for files like builtin.as) and compile that, but all I seem to get are compiler errors - mostly "[Compiler] Error #1181: Forward reference to base class (base class name)."
    I have a feeling I'm doing this completely the wrong way. I'd very much appreciate any assistance that anybody can offer me.
    Thanks,
    - max

    <div class=Section1><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'>I use MXMLC to compile my .as file projects.<o:p></o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'><o:p> </o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'>Alex Harui<o:p></o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'>Flex SDK Developer<o:p></o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'><a href="http://www.adobe.com/"><span style='color:blue'>Adobe<br />Systems Inc.</span></a><o:p></o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'>Blog: <a href="http://blogs.adobe.com/aharui"><span<br />style='color:blue'>http://blogs.adobe.com/aharui</span></a><o:p></o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'><o:p> </o:p></span></p><br /><br /><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><br /><br /><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span<br />style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Maxim Porges<br />[mailto:[email protected]] <br><br /><b>Sent:</b> Monday, February 09, 2009 9:22 PM<br><br /><b>To:</b> [email protected]<br><br /><b>Subject:</b> How do you compile Flex-dependent classes with ASC?<o:p></o:p></span></p><br /><br /></div><br /><br /><p class=MsoNormal><o:p> </o:p></p><br /><br /><p class=MsoNormal style='margin-bottom:12.0pt'>A new discussion was started by<br />Maxim Porges in <br><br /><br><br /><b>Developers</b> --<br><br />  How do you compile Flex-dependent classes with ASC?<br><br /><br><br />Hi, <br><br /><br><br />I've been trying unsuccessfully for most of the evening to compile a .as file<br />that relies on mx.collections.ListCollectionView using asc. I figured I could<br />just import the Flex framework SWCs from the command line with asc, but asc<br />doesn't seem to respect SWCs - it only seems to respect .abc files. <br><br /><br><br />So, I've spent most of my time trying to compile the Flex framework into a<br />single .abc file that I can import whenever I want to compile a class that<br />relies on Flex. I figured I could make a base .as file with include statements<br />for all of the Flex .as files (copying the approach I saw for files like<br />builtin.as) and compile that, but all I seem to get are compiler errors -<br />mostly &quot;[Compiler] Error #1181: Forward reference to base class (base<br />class name).&quot; <br><br /><br><br />I have a feeling I'm doing this completely the wrong way. I'd very much<br />appreciate any assistance that anybody can offer me. <br><br /><br><br />Thanks, <br><br /><br><br />- max <o:p></o:p></p><br /><br /><div class=MsoNormal><br /><br /><hr size=2 width=200 style='width:150.0pt' align=left><br /><br /></div><br /><br /><p class=MsoNormal style='margin-bottom:12.0pt'>View/reply at <a<br />href="http://www.adobeforums.com/webx?13@@.59b7d5d2">How do you compile<br />Flex-dependent classes with ASC?</a><br><br />Replies by email are OK.<br><br />Use the <a<br />href="http://www.adobeforums.com/webx?280@@.59b7d5d2!folder=.3c060fa3">unsubscribe</a>< br />form to cancel your email subscription.<o:p></o:p></p><br /><br /></div>

  • How to expand B2B document

    I login B2B and click the document link.
    The Document Protocols are listed but are not expanded. I have to click the + icon to view the docu I have created and discard the change.
    How to expand them?

    B2B version is 11.1.1.2
    I am new in B2B and learing the B2B sample (b2b-101-custom-generic-file.pdf) download from Oracle.
    I create Custom (version 1.0 and import the schema file) Document Protocol.
    Then, I turn off the PC.
    After I trun on the B2B, I find all protocols are not expanded. I need to view the document protocol which I have not finished.
    I have to click the Add icon (+). Then the Custom protocol is expanded. But I have to discard the change.
    What I want to do is I want all the protocols are expanded automatically after the page is loaded.

  • How to avoid the objects dependency in the packages by standard settings?

    Hi,
    How to avoid the objects dependency in the packages by standard settings?
    Example Scenario -> Our project uses two packages u2018ZZP1u2019 and u2018ZZP2u2019 for developments in the system u2018SN1u2019. We created a domain u2018ZZ_DO_TESTu2019 in the Package u2018ZZP1u2019. Now we have to make sure that the developer should not use or refer domain u2018ZZ_DO_TESTu2019 for the developments in the package u2018ZZP2u2019.
    u2026Naddy

    Evevn i felt that in the CTS at least a warning can be given if the included objects refer to any other object(s) which arre:
      1. Local Objects
      2. Locked under other requests,
      3. Lastly able to detect cyclic dependency as in we had a situation where we had a program locked in request A which calls an FM locked in request B. Now Request B refers to a message which is locked in request A.Since it was a message it gave only requrn code 4 in transport and transport ended with warnings. But if it is some other object then it is going to give compile error in at least one transport and neither can be moved without the other.
    Anyways, i will check the BAPI he has mentioned and see if any workaround can be done,
    Request: Please keep the post active until we arrive at a good solution,Thanks.

  • I need to know how to expand the browser window so it fills my laptop screen

    i need to know how to expand the browser window so it fills my laptop screen this isnt  about the + or - tabs

    have a look at the top left of your browser window that looks like two arrows pointing up and down in a slant, click it and it will put your browser in full screen mode...

  • How to read and update the value of property file

    Hi,
    I am not able read the values from property file.
    Please tell me how to read and update the values from property file using Properties class
    This is my property file : - Config.properties its located in D:\newfolder
    Values
    SMTP = localhost
    Now i need to change the value of the SMTP
    New value :
    SMTP =10.60.1.9
    Pls Help me
    Thanks
    Merlin Rosina,

    Post a small (<1 page) example program that forum members can copy and run that demonstrates your problem.

  • How to make a Jtree expandable

    Hi have a JTree and when I expand the tree and catch an exption hence not adding any children I would like the node that I have expanded to autamatically be collapsed, and ready for a future expand, as I have a situation were a node in the tree might not yet have any children (the children will be added dynamically).
    I would like to handel the 9iexeption in such a way that the tree is ready for use and has the "+ sign available" to the user,
    at the moomemt it thincks there are no chldren and has no "+ " or "-" sign so no future expand is posible
    please help !!!!

    hentchocan wrote:
    I want to make a JTree that has a TextArea nodes. So each child when expanded shows a text area containing some information . Can any one provide example of such behaviour .
    Best Regards,Here the reply button works.

  • JTree - How to Expand all Nodes in the Tree

    I have a tree that has one primary node, two sub-nodes, and multiple sub-sub-nodes under those. I want to expand (show) all these nodes in the tree when the tree first loads. I tried expandRow() but that only seems to expand one row at a time by entering a single integer for the row. Is there any way to expand all rows/nodes when loading the tree?

    see
    http://forum.java.sun.com/thread.jsp?forum=57&thread=148793

  • How to make a JTree respond to changes in the Hashtable

    Hi,
    Can anyone give the classes and methods from which I can make the JTree reflect to changes in the Hashtable. Im using the hashtable to construct a JTree but changes in hashtable are not reflected to the JTree.
    I used tree.updateUI(). It works if I insert to a collapsed node. In case a node is expanded and if I add a node to it through the Hashtable it does not reflect.
    Thanking u,
    Karan.

    A JTree will reflect changes made to its model if this model does fire the appropriate events. So, make sure to update the tree's model whenever necessary. See also [How to Use Trees|http://java.sun.com/docs/books/tutorial/uiswing/components/tree.html].

Maybe you are looking for