Implicit & Explicit Null Labels

Hi..
I am a bit confused in Implicit and Explicit null labels. The RFC Says as follows :
IMPLICIT NULL LABEL:This label value is only legal at the bottom of the label stack. It indicates that the label stack must be popped,
and the forwarding of the packet must then be based on the IPv4 header.
EXPLICIT NULL LABEL : This is a label that an LSR may assign and distribute, but which never actually appears in the encapsulation. When an LSR would otherwise replace the label at the top of the stack with a new label, but the new label is "Implicit NULL", the LSR will pop the stack instead of doing the
replacement. Although this value may never appear in the encapsulation, it needs to be specified in the Label Distribution Protocol, so a value is reserved.
My question is, which one is used in PHP operation. Consider I have a scenario like this :
CE1--PE1---P---PE2---CE2
How do I make the P router as the PHP router in this case???I need to have a implicit null label set on P router????
What about explicit null label then???
Regards,
RAJ

by defaulf, the P router will use implicit null label. For you to use the explicit null label, use the command
mpls ldp explicit-null.
The explicit null label is often useful in QoS implementation scenarios.
See the following url
http://www.cisco.com/en/US/products/ps6350/products_command_reference_chapter09186a0080430c63.html#wp1020450

Similar Messages

  • Implicit null and explicit null

    Hi,
    1) If a router receives a label of 0,what is it supposed to do..?
    label poppoing or swapping th label with 0.
    2) If a router receives the label of 3,whether it pops the label or swap the incoming label with the value of 3..?
    Thansk

    1. If a router recieves a label value of 0, this implies the explicit null label. The router will swap the top label for label 0 and forward the packet. The next LSR will pop the packet.
    2. If a label of 3 is recieved, this implies the implicit null label. The router in this case will pop the top label and forward the remaining. If there was only one label in the stack, it will forward the IP packet, else the labelled packet with the topmost label removed.
    Check this link, and RFC 3032 for more explanation
    http://www.cisco.com/en/US/tech/tk436/tk428/technologies_q_and_a_item09186a00800949e5.shtml#q13

  • Implicit-Null Label Value

    Hi,
    A quick question. Does anyone know if when said that last hop router signals implicit null to penultimate router it actually sends the advertisement (LDP for example) with a label value of 3 or is there another way to signal that?
    If so, I assume that with MPLS-TE LSPs it's the same thing but with RSVP Resv message...
    Thanks,
    David

    Hello David,
    in fact Label value 3 has the meaning "implicit null". So whatever protocoll is used (LDP or RSVP) this is the signaled value to activate PHP (penultimate hop popping).
    From RFC 3032 section 2.1
    " iv. A value of 3 represents the "Implicit NULL Label". This is a label that an LSR may assign and distribute, but which never actually appears in the encapsulation. When an LSR would otherwise replace the label at the top of the stack with a new label, but the new label is "Implicit NULL", the LSR will pop the stack instead of doing the replacement. Although this value may never appear in the encapsulation, it needs to be specified in the Label Distribution Protocol, so a value is reserved."
    Hope this helps! Please rate all helpful posts!
    Martin

  • Advertise implicit-null label for static routes

    Hi, I want to ask if there is any way to change the label or stop adveritise label for an static route. Normally LDP advertises an Implicit Null label for directly connected routes. We want to do similar thing for static routes.
    We need to do this is because somehow we need to do rate-limit on the PE interface connecting to the core network instead of the interface connecting to CE. As the incoming packets still got labelled, the rate-limit is skipped. So we want to stop the PE creates label for the static routes or advertises them with implicit null label. Thanks in advance.

    Calvin,
    Bear in mind that if you only enter the "no mpls ldp advertise-label" command, LDP will stop propagating all labels, which might not ba what you want. If you selectively want to propagate certain labels, then you need to also use "mpls advertise label for " as Shivlu suggested.
    Regards,

  • How to eliminate explicit "null" values

    Hello,
    I am having a problem in eliminating the explicit "null" values while retrieving them from the database.
    Here is my problem as follows,
    For the optional fields in a form i am explicitly entering "null" as value or else it is throwing null pointer exception in linux. While i am trying to display the values existing in a table it is displaying fine when i use this condition
    if(varialble.equals("null") ||varialble.equals("") || variable.equals(null))
    varialble = "";
    else
    out.println(variable)
    But when i use the same for the values i retrieve from the view it is displaying "Null" for the explicit "null" values and null from implicit null values.
    Please help me out how to remove the explicit null values. It would be great help if somebody replies me at the earliest.
    Thanks in advance
    daya

    the following is the code which i am using to retrieve values.
    import java.sql.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.util.*;
    import java.io.*;
    import StrChk.*;
    public class DataSearch extends HttpServlet
         Connection con=null;
         Statement st=null;
         ResultSet rs=null;
         ResultSetMetaData rsmd=null;
         PrintWriter out=null;
         public void doPost(HttpServletRequest req, HttpServletResponse res)
         throws IOException,ServletException
              String key;
              String sql;
              res.setContentType("text/html");
              out = res.getWriter();
              try
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   con = DriverManager.getConnection("jdbc:odbc:daya","daya","daya");
                   st = con.createStatement();
              catch(Exception e)
                   System.out.println("Error Accessing DataBase:"+e);
              key = req.getParameter("key");
    //          Search(str1.retString(key));
              Search(key);
         public void Search(String key)
              int res=0;
              boolean flag=true,found=false;
              StringTokenizer strt = new StringTokenizer(key, " ");
              String sql;
              String str1,str2;
              int i=0;
    int count = strt.countTokens();
    String keywords[] = new String[count+1];
              keywords=key;
              i++;
              if(count > 1)
         count++;
                   while(strt.hasMoreTokens())
                   keywords[i] = strt.nextToken();
                        i++;
              out.println("<html><title>DataSearch</title>");
              out.println("<script>");
              out.println("function myclose(){ self.close(); } ");
              out.println("</script><body>");
              for(i=0; i<count && flag==true; i++)
                   try
              /* sql = "select ";
                   sql += " nvl(\"Topic Title\",' '), ";
                   sql += " nvl(\"Name\",' '), ";
                   sql += " nvl(\"Title\",' '), ";
                   sql += " nvl(\"Affiliation\",' '), ";
                   sql += " nvl(\"Street Name\",' '), ";
                   sql += " nvl(\"City\",' '), ";
                   sql += " nvl(\"State\",' '), ";
                   sql += " nvl(\"Country\",' '), ";
                   sql += " nvl(\"Zip Code\",' '), ";
                   sql += " nvl(\"Phone\",' '), ";
                   sql += " nvl(\"Fax\",' '), ";
                   sql += " nvl(\"eMail\",' '), ";
                   sql += " nvl(\"Web Site\",' ') ";
                   sql += " from SEARCHVWUSERDET where ";
                   sql += " lower(\"Name\") like " + "lower('%" + keywords[i] + "%') or ";
                   sql += " lower(\"Title\") like " + "lower('%" + keywords[i] + "%') or ";
                   sql += " lower(\"Affiliation\") like " + "lower('%" + keywords[i] + "%') or ";
                   sql += " lower(\"Street Name\") like " + "lower('%" + keywords[i] + "%') or ";
                   sql += " lower(\"City\") like " + "lower('%" + keywords[i] + "%') or ";
                   sql += " lower(\"State\") like " + "lower('%" + keywords[i] + "%') or ";
                   sql += " lower(\"Country\") like " + "lower('%" + keywords[i] + "%') or ";
                   sql += " lower(\"eMail\") like " + "lower('%" + keywords[i] + "%') or ";
                   sql += " lower(\"Web Site\") like " + "lower('%" + keywords[i] + "%')";*/
                   sql = "select ";
                   sql += " nvl(\"Name\",' '), ";
                   sql += " nvl(\"Title\",' '), ";
                   sql += " nvl(\"Affiliation\",' '), ";
                   sql += " nvl(\"Street Name\",' '), ";
                   sql += " nvl(\"City\",' '), ";
                   sql += " nvl(\"State\",' '), ";
                   sql += " nvl(\"Country\",' '), ";
                   sql += " nvl(\"Zip Code\",' '), ";
                   sql += " nvl(\"Phone\",' '), ";
                   sql += " nvl(\"Fax\",' '), ";
                   sql += " nvl(\"eMail\",' '), ";
                   sql += " nvl(\"Web Site\",' '), ";
                   sql += " nvl(\"Key Words\",' ') ";
                   sql += " from searchcombi where ";
                   sql += " lower(\"Name\") like " + "lower('%" + keywords[i] + "%') or ";
                   sql += " lower(\"Title\") like " + "lower('%" + keywords[i] + "%') or ";
                   sql += " lower(\"Affiliation\") like " + "lower('%" + keywords[i] + "%') or ";
                   sql += " lower(\"Street Name\") like " + "lower('%" + keywords[i] + "%') or ";
                   sql += " lower(\"City\") like " + "lower('%" + keywords[i] + "%') or ";
                   sql += " lower(\"State\") like " + "lower('%" + keywords[i] + "%') or ";
                   sql += " lower(\"Country\") like " + "lower('%" + keywords[i] + "%') or ";
                   sql += " lower(\"eMail\") like " + "lower('%" + keywords[i] + "%') or ";
                   sql += " lower(\"Web Site\") like " + "lower('%" + keywords[i] + "%') or";
                   sql += " lower(\"Key Words\") like " + "lower('%" + keywords[i] + "%')";
                   sql += " order by \"Name\" ";
                   rs = st.executeQuery(sql);
                   //out.println(sql);
                   if(rs.next())
                        if(i == 0)
                             flag=false;
                        found=true;
                        res=0;
                   do
                        res++;
                   }while(rs.next());
                   out.println(res++);
                   out.println("<center><font color=#ff9999 face=\"verdana, geneva, arial, sans-serif\" size=2><b>Searched for \""+ keywords[i]+"\", ");
                   out.println("Total Matches found : "+res+"</center><br>");
                   rs = st.executeQuery(sql);
                   while(rs.next())
                        res++;
                             out.println("<table width=600 align=center>");
                             str1 = disp(rs.getString(1),keywords[i]);
                             out.println(str1);
                             //if(str1.equals("null") || str1.equals(" ") || str1.equals(null))
                             if(str1 == "null" || str1 == "")
                                  str1 = "";
                             else
                                  out.println("<tr><td width=150><font color = green face=\"verdana, geneva, arial, sans-serif\" size=2><b>Name </td><td><font face=\"verdana, geneva, arial, sans-serif\" size=2>"+str1+"</td></tr>");
                                  //System.out.println(str1);
                                  //out.println(str1);
                             str2="";
                             str1 = disp(rs.getString(2),keywords[i]);
                             if(!str1.equals("") || !str1.equals(""))
                                  str2 = str1;          
                             str1 = disp(rs.getString(3),keywords[i]);
                             if(!str1.equals(" ") || !str1.equals(""))
                                  if(str2.length() > 0 || !str2.endsWith(", "))
                                       str2+= ", ";
                                  str2 += str1;
                             if(!str2.equals(""))
                                  out.println("<tr><td width=150><font color = green face=\"verdana, geneva, arial, sans-serif\" size=2><b>Title, Affiliation</td><td><font face=\"verdana, geneva, arial, sans-serif\" size=2>");
                                  out.println(str2);     
                                  out.println("</td></tr>");
                             str2="";
                             str1 = disp(rs.getString(4),keywords[i]);
                             if(!str1.equals(" ") || !str1.equals(""))
                                  str2 = str1;          
                             str1 = disp(rs.getString(5),keywords[i]);
                             if(!str1.equals(" ") || !str1.equals(""))
                                  if(str2.length() > 0 || !str2.endsWith(", "))
                                       str2+= ", ";
                                  str2 += str1;
                             str1 = disp(rs.getString(6),keywords[i]);
                             if(!str1.equals(" ") || !str1.equals(""))
                                  if(str2.length() > 0 || !str2.endsWith(", "))
                                       str2+= ", ";
                                  str2 += str1;
                             str1 = disp(rs.getString(7),keywords[i]);
                             if(!str1.equals(" ") || !str1.equals(""))
                                  if(str2.length() > 0 || !str2.endsWith(", "))
                                       str2+= ", ";
                                  str2 += str1;
                             str1 = disp(rs.getString(8),keywords[i]);
                             if(!str1.equals(" ") || !str1.equals(""))
                                  if(str2.length() > 0 || !str2.endsWith(", "))
                                       str2+= ", ";
                                  str2 += str1;
                             if(!str2.equals(""))
                                  out.println("<tr><td valign=top width=150><font color = green face=\"verdana, geneva, arial, sans-serif\" size=2><b>Address </td>");
                                  out.println("<td><font face=\"verdana, geneva, arial, sans-serif\" size=2>");
                                  out.println(str2);     
                                  out.println("</td></tr>");
                             str1 = disp(rs.getString(9),keywords[i]);
                             if(!str1.equals(" ") || !str1.equals(""))
                                  out.println("<tr><td width=150><font color = green face=\"verdana, geneva, arial, sans-serif\" size=2><b>Phone</td><td><font face=\"verdana, geneva, arial, sans-serif\" size=2>"+str1+"</td></tr>");
                             str1 = disp(rs.getString(10),keywords[i]);
                             if(!str1.equals(" ") || !str1.equals(""))
                                  out.println("<tr><td width=150><font color = green face=\"verdana, geneva, arial, sans-serif\" size=2><b>Fax</td><td><font face=\"verdana, geneva, arial, sans-serif\" size=2>"+str1+"</td></tr>");      
                             str1 = disp(rs.getString(11),keywords[i]).toLowerCase();
                             if(!str1.equals(" ") || !str1.equals(""))
                                  out.println("<tr><td width=150><font color = green face=\"verdana, geneva, arial, sans-serif\" size=2><b>eMail</td><td><font face=\"verdana, geneva, arial, sans-serif\" size=2>"+str1+"</td></tr>");
                             str1 = disp(rs.getString(12),keywords[i]).toLowerCase();
                             if(str1.equals("null") || str1.equals(" ") || str1.equals(null))
                                  str1="";
                             else
                                  out.println("<tr><td width=150><font color = green face=\"verdana, geneva, arial, sans-serif\" size=2><b>Web Site</td><td><font face=\"verdana, geneva, arial, sans-serif\" size=2>"+str1+"</td></tr>");
                             str1 = disp((rs.getString(13)).replace(',',' '),keywords[i]);
                             if(str1 == "null" || str1 == null || str1 == "")
                             //if(!rs.wasNull())
                                  out.println("nothing");
                             else
                                  out.println("<tr><td width=150><font color = green face=\"verdana, geneva, arial, sans-serif\" size=2><b>Key Words</td><td><font face=\"verdana, geneva, arial, sans-serif\" size=2>"+str1+"</td></tr>");
                             out.println("<tr><td width=150><hr></td><td><hr></td></tr>");
                             out.println("</table><br>");
                   } // end while
                   } // end if
                   catch(Exception e)
                        System.out.println("Exception while executing query: "+ e);
              } // end for
              if(!found)
                   out.println("<center><font color=#ff9999 face=\"verdana, geneva, arial, sans-serif\" size=2><b>Searched for \""+ key+"\", ");
                   out.println("Total Matches found : 0</center><br>");
              out.println("<center><a href=\"javascript:myclose()\"><font color=red face=\"verdana, geneva, arial, sans-serif\" size=2>Close</a></center>");
              out.println("</body></html>");
         public void doGet(HttpServletRequest req, HttpServletResponse res)
         throws IOException,ServletException
              doPost(req,res);
         public String disp(String str1, String str2)
              int i,j,k;
              boolean found=false;
              String s1,s2,s3;
              String t1,t2;
              t1 = initCap(str1);
              s1 = t1.toLowerCase();
              s2 = str2.toLowerCase();
              for(i=0;i<s1.length() && !found ;i++)
                   k=i;
                   for(j=0;j<s2.length() && k < s1.length() && s1.charAt(k) == s2.charAt(j) ;j++,k++);
                   if(j==s2.length())
                        found=true;
              if(found)
                   i--;
                   s3 = t1.substring(0,i);
                   s3 += "<font color=blue face=\"verdana, geneva, arial, sans-serif\" size=2><b>";
                   s3 += t1.substring(i,i+str2.length());
                   s3 += "</font></b>";
                   s3 += t1.substring(i+str2.length(),t1.length());
              else
                   s3 = t1;
              return s3;
         public String initCap(String str)
              StringTokenizer st = new StringTokenizer(str," ");
              String s1="";
              String s2="";
              String s3="";
              String s4="";
              while(st.hasMoreElements())
                   s1 = (String)st.nextElement();
                   if(s1.length() > 0)
                        s2 = s1.substring(0,1);
                        s2 = s2.toUpperCase();
                   if(s1.length() > 1)
                        s3 = s1.substring(1,s1.length());
                   s2 += s3;
                   s4 +=" "+s2;
              return s4;

  • Labels

    How implicit NULL and Explicit NULL label are useful in MPLS netowrk? what is main function of both the labels?

    Dan,
    implicit (label value of 3) and explicit (label value of 0) null labels are used by the router terminating an LSP to tell the penultimate hop how to behave when sending traffic along the LSP. An implicit null means that the penultimate hop router has to pop the label before forwarding to the egress router and explicit null means swap the incoming label with a label value of 0 (explicit null). The explicit null is sometimes used to convey the MPLS QOS value down to the egress router (sometimes refer to the pipe mode).
    Refer to the following document for more information on the pipe mode.
    http://www/en/US/tech/tk828/technologies_q_and_a_item09186a00800a43f5.shtml#wp27375
    Regards,

  • Penultimate labels

    It seems to me now that pop labels are only sent for directly connected network prefixes, and not for other learnt prefixes but outside the mpls cloud. For these other prefixes, the edge LSR uses the untagged label.
    Is there a way to configure, such that pop labels are sent for all prefixes outside the MPLS cloud?
    Does the default route always have the implicit-null label?
    Also, what is the difference in the implicit-null and explicit-null labels?

    Prefixes outside the MPLS domain will usually be outside your AS and therefore learnt via BGP. Inside your MPLS domain these prefixes are resolvable via the BGP next hop, which is a FEC belonging to one of your edge LSRs.
    From the edge LSR you can force the propagation of an explicit-null label (label value of 0) by configuring the "mpls ldp explicit-null" command. By default LDP uses implicit-null labels for all attached FECs.
    The implicit-null (label value of 3) means that the top label has to be removed (popped) before the packet is forwarded to the next-hop. In non l3vpn or l2vpn scenarios, this will leave your packet without labels and the edge LSR will base its QOS decision on the IP precedence rather than the experimental bits.
    The explicit-null means that the top label will be replaced by an explicit-label value of zero. This is used in some QOS scenarios, where mpls experimental bits have to be used rather than IP precedence. For more information on when it might be wishable to use an explicit-null label, refer to the following document:
    http://www.cisco.com/en/US/partner/tech/tk436/tk428/technologies_tech_note09186a008022ad7e.shtml#modes
    Hope this helps,

  • 6PE without PHP

    Hi All,
    I need some info on the following 6PE scenario.
    The 6PE rfc states that second label must be used. Though I understand the above condition in a penultimate hop popping scenario, I am not clear about it when PHP is not involved.
    When PHP is not involved the 6PE router will be receiving packets with two labels (top label corresponding to IPv4 LSP and the bottom label corresponding to IPv6 prefix). How will the packet be processed by the 6PE router?
    Will the 6PE router do the following?
    1. pop the top label
    2. inspect the bottom label
    3. pop the bottom label
    4. forward the unlabeled packet to the
    destination?
    Are there any additional configuration involved in this?
    Thanks in advance.
    Cheers,
    Sriram K

    Hi Sriram,
    Your description is correct.
    Usually the top label points to the BGP next hop, which in 6PE usually is the IPv4 address of the Loopback of the egress PE. The default is to allocate implicit null for it resulting in PHP and the egress PE will forward the packet based on the bottom label.
    If you do not want to use PHP you can configure a PE to allocate an explicit null label to the directly connected networks including the BGP next hop address.
    Then the penultimate LSR will send bottom label plus explicit null. The egress PE will remove the explicit null label and forward the packet based on the bottom label.
    So with PHP there is one label lookup less than without PHP, but forwarding is not changed, because ultimately in both cases it is based on the bottom label (usually assigned to the IPv6 prefix).
    The only configuration required is to enforce the allocation of the explicit null label, which is done with the command:
    Router(config)#mpls ldp explicit-null
    A detailed description of the command with all the options can be found for example at
    http://www.cisco.com/en/US/docs/ios/12_3/switch/command/reference/swi_m2.html#wp1076838
    Hope this helps! Please use the rating system.
    Regards,
    Martin

  • Implicit null

    hai experts,
    just now stepped into mpls world.
    i am refering the book "MPLS Fundamentals" by Luc De Ghein.
    In the implicit null portion the author states that " PHP is the default mode in cisco IOS.In case of ipv4 over mpls ,cisco ios only advertise the implicit null label for directly connected routes and summarized routes."
    but some of them told me that it will send implicit null for all routes it learns.
    Which is true or is there any hidden meaning in connected and summarized routes???

    Hi,
    If the question is about IPv4 routes learned in a VRF, then implicit-null will not be used at all - neither for PE directly connected nor for summary routes. The reason is that a PE needs a VPN label to identify the VRF context, because the IP destination address alone can not do it as you might have overlapping IP addresses in different VRFs. If you have a look at the labels in a VRF (show mpls forwarding-table vrf ...) you will see "Aggregate" for VRF connected or VRF summary routes. This denotes, that the PE will use the VPN label to select the proper VRF context and then has to perform an additional IP lookup to figure out, who should get the packet. If a label is for a VRF connected network the IP packet could be for the PE or the CE sharing this network. A VPN label alone in this case will not be enough, a double lookup is needed.
    So implicit-null is used for summary routes or directly connected routes in the global IP routing table of a PE.
    Hope this helps!
    Regards, Martin

  • Adding "Explicit" labels

    Is it possible to add an "explicit content" label to music you've ripped from a CD? It's great the the iTMS tunes have this label, but I'd like to organize my library so that I can filter content according to those labels (which also brings up the question as to whether you can create smart playlists to check for the labels in the first place).
    I've also read that you can't remove the "explicit" label from iTMS music, but I wanted to confirm this -- I've bought nonexplicit tracks from otherwise explicit-labeled albums, so the label isn't always accurate.
    I haven't been able to find an "explicit" tag mentioned in any of the MP3 or AAC file specifications, but I may be wrong. I also know that iTunes categorizes explicit podcasts on the basis of the XML files, but that doesn't really seem to apply here either.

    Thanks! I've actually taken that step so far, but it strikes me as a little redundant. If there's already a system for labeling songs as "explicit," then I shouldn't have to repeat the designation by setting up a comletely separate grouping.
    No, it's not causing any earth-shattering difficulty -- and in that regard, there are any number of questions on this board far more deserving of an immediate response -- but just something that's been bugging me. And since I haven't been able to find any answers "out there," I thought this was the best place to look.

  • Difference between address-family ipv6 and address-family ipv6 labeled unicast

    Hello Experts,
    Can someone explain me the difference between address-family ipv6 and address-family ipv6 labeled unicast. Per my understanding, i think both of them are used to send labelled IPv6 prefix advertisements through BGP..If so, are the following configs same?
    address-family ipv6
    neighbor 192.168.0.1 activate
    neighbor 192.168.0.1 send-label
    router bgp 10
    neighbor 192.168.0.1
    address-family ipv6 labelled unicast
    Please let me know if my understanding is correct
    Thanks
    Mukundh

    Thanks for the reply Nagendra...
    I have another related query regarding this. We have BGP neighborship flapping between 2 routers ...One is Cisco 7204 and another is Juniper M120 I think.... The Juniper logs show that BGP is flapped due to family inet6 not configured on the Juniper end and Juniper is receiving BGP advertisements with native IPv6 as next hop from Cisco when it shouldn't be receiving that.. The following are commands on Cisco and Juniper...
    ##### CISCO####
    outer bgp 5603
    neighbor 95.176.254.10 inherit peer-session LAR  neighbor 95.176.254.10 description --- M320-LAB-LJ-CIGALETOVA  address-family ipv4
      neighbor 95.176.254.10 activate
      neighbor 95.176.254.10 inherit peer-policy LAR-ipv4  address-family ipv6
      neighbor 95.176.254.10 activate
      neighbor 95.176.254.10 send-community both
      neighbor 95.176.254.10 route-reflector-client
      neighbor 95.176.254.10 send-label
    template peer-session LAR
      remote-as 5603
      update-source Loopback0
      timers 30 90
    exit-peer-session
    template peer-policy LAR-ipv4
      route-map LAR-ipv4-out out
      route-reflector-client
      soft-reconfiguration inbound
      send-community both
    exit-peer-policy
    ####JUNIPER####
    protocols{bgp{
    group I-BGP-IPV4 {
                type internal;
                family inet {
                    unicast;
                family inet6 {
                    labeled-unicast {
                        explicit-null;
                export RR-Export-All;
                neighbor 95.176.255.254 {
                    description C7201-RR-IP-CIGALETOVA;
                    local-address 95.176.254.10;
                neighbor 95.176.255.252 {
                    description C7201-RR-IP-CIGALETOVA;
                    local-address 95.176.254.10;
    By the cisco command above, shouldn't cisco be sending only labelled ipv6 prefixes or am I wrong in this. And if Cisco sends both unlabelled and labelled prefixes, is there a way to make it send only ipv6 prefixes?
    Thanks
    Mukundh

  • More Fun with NULLs and Empty Strings

    Greetings,
    I ran across this behavior recently and thought I'd share with the forum. I'm running 10.2.0.2. Note the difference in behavior between passing and explicit NULL in the parameter vice passing an empty string (''):
    CREATE OR REPLACE PROCEDURE NULL_ES_TEST(PARAM1 IN VARCHAR2) IS
    VAR1 CHAR(1);
    BEGIN
    IF PARAM1 IS NULL THEN
    DBMS_OUTPUT.PUT_LINE('PARAM1 IS NULL');
    END IF;
    VAR1 := PARAM1;
    IF VAR1 IS NULL THEN
    DBMS_OUTPUT.PUT_LINE('VAR1 IS NULL');
    ELSE
    DBMS_OUTPUT.PUT_LINE('VAR1 IS NOT NULL');
    END IF;
    DBMS_OUTPUT.PUT_LINE('THE LENGTH OF VAR1 IS '||TO_CHAR(LENGTH(VAR1)));
    END NULL_ES_TEST;
    EXEC NULL_ES_TEST(PARAM1 => '');
    PARAM1 IS NULL
    VAR1 IS NOT NULL
    THE LENGTH OF VAR1 IS 1
    (var1 now holds a single space)
    EXEC NULL_ES_TEST(PARAM1 => NULL);
    PARAM1 IS NULL
    VAR1 IS NULL
    THE LENGTH OF VAR1 IS
    Any Comments or Insights are welcome.
    Sincerely,
    Dale Ward

    Well somethings not as expected (tested on 10.2.0.3)
    Even if you default the parameter to '', it treats null and '' differently.
    SQL> ed
    Wrote file afiedt.buf
      1  CREATE OR REPLACE PROCEDURE NULL_ES_TEST(PARAM1 IN VARCHAR2 := '') IS
      2    VAR1 CHAR(1);
      3  BEGIN
      4    IF PARAM1 IS NULL THEN
      5      DBMS_OUTPUT.PUT_LINE('PARAM1 IS NULL');
      6    END IF;
      7    VAR1 := PARAM1;
      8    IF VAR1 IS NULL THEN
      9      DBMS_OUTPUT.PUT_LINE('VAR1 IS NULL');
    10    ELSE
    11      DBMS_OUTPUT.PUT_LINE('VAR1 IS NOT NULL');
    12    END IF;
    13    DBMS_OUTPUT.PUT_LINE('THE LENGTH OF VAR1 IS '||TO_CHAR(LENGTH(VAR1)));
    14* END NULL_ES_TEST;
    SQL> /
    Procedure created.
    SQL> exec null_es_test(null);
    PARAM1 IS NULL
    VAR1 IS NULL
    THE LENGTH OF VAR1 IS
    PL/SQL procedure successfully completed.
    SQL> exec null_es_test('');
    PARAM1 IS NULL
    VAR1 IS NOT NULL
    THE LENGTH OF VAR1 IS 1
    PL/SQL procedure successfully completed.
    SQL>

  • Update Jcombobox 's label in render

    hi ,everybody, i have a problem about combobox, any body can help me!
    thank you!
    I want to have a combobox with checkbox as item, I rewrite a render writen by ice, because the combobox has three state, when I click diferent checkbox in this combobox , the label of combobox will update rightly, but if I click one checkbox to change the checkbox state ,the label will no update , it seem that when I click one checkbox many times .the menthod
    getListCellRendererComponent(JList list, Object value, int index,
                        boolean isSelected, boolean cellHasFocus)
    will no update label
    my code :
    mainclass:
    import java.awt.BorderLayout;
    import java.awt.Component;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.util.Iterator;
    import java.util.Vector;
    import javax.swing.DefaultListCellRenderer;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JList;
    import javax.swing.JPanel;
    import javax.swing.plaf.basic.BasicComboBoxEditor;
    public class mainclass {
          public static void main(String[] args) {
                 final testbox myComboBox = new testbox();
                 myComboBox.addItem("SelectAll");
                 myComboBox.addItem("ClearAll");
                 myComboBox.addItem("GrayedAll");
                 for(int i = 0; i < 5; i++) {
                     myComboBox.addItem("Item " + i);
                 JFrame frame = new JFrame("My ComboBox");
                 frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
                 frame.setSize(150, 60);
                 frame.setLocation(300, 300);
                 //frame.setJMenuBar( menubar );
                 JPanel panel=new JPanel();
                 panel.setLayout(new BorderLayout());
                 panel.add(myComboBox,BorderLayout.NORTH);        
                 frame.getContentPane().add(panel);
                 frame.setVisible(true);
                 final IconedCellRendererField renderer = IconedCellRendererField.getCheckBoxRendererInstance();
                 myComboBox.setRenderer(renderer);
                 myComboBox.addActionListener(new ActionListener()
                     public void actionPerformed(ActionEvent e)
                          if(myComboBox.getSelectedItem().toString().equals("SelectAll")){
                               renderer.selectAll(true);                         
                          if(myComboBox.getSelectedItem().toString().equals("ClearAll")){
                               renderer.clearAll(true);
                          if(myComboBox.getSelectedItem().toString().equals("GrayedAll")){
                               renderer.grayedAll(true);
    }renderer:
    import java.awt.*;
    import java.awt.event.*;
    //import java.io.*;
    //import java.net.*;
    import java.util.*;
    import javax.swing.*;
    //import javax.swing.event.*;
    import javax.swing.border.*;
    //import javax.swing.table.*;
    public class IconedCellRendererField extends DefaultListCellRenderer implements MouseListener {
         public Icon icon, selIcon;
         Icon[] icons = null;
         public boolean useIconBackground = true, useIndexSensitiveIcons = false,
                   useCheckBoxAsIcon = false, useLinkState = false;
         Dimension labelDim = null;
         public JLabel iconLabel;
         public JCheckBox box = null;
         public JPanel noback;
         public SelectionStateHandler selStateHandler = null;     
         private JList theList = null;
         public boolean[] selState = null, enableState = null;
         int offset = 5;
         Rectangle rect = null;
         int currentLinkRow = -1;
         boolean isOnRow = false, paintDivider = false;
         private Icon dividerImage = null;     
         private Color linkColor = Color.blue, hoverColor = Color.red, selectedLinkColor = Color.green;
         /* Initialises the renderer with one icon that is displayed without the
          * cell background.
         public IconedCellRendererField(Icon icon) {
              this(icon,false);
         /* Initialises the renderer with two icons that provide a switch capability
          * when a row is selected/deselected
         public IconedCellRendererField(Icon icon, Icon selIcon) {
              this.icon = icon;
              this.selIcon = selIcon;
              //addMouseListener(this);
         /* Initialises the renderer with two icons that provide a switch capability
          * when a row is selected/deselected. The boolean argument enables the icon
          * to either use the renderer background or appear transparent.
         public IconedCellRendererField(Icon icon, Icon selIcon, boolean useIconBackground) {
              this(icon, selIcon);
              setIconHasBackground(useIconBackground);
              createNoBackgroundPanel();
         /* Initialises the renderer with a single no siwthing icon. The boolean
          * argument enables the icon to either use the renderer background
          * or appear transparent.
         public IconedCellRendererField(Icon icon, boolean useIconBackground) {
              this(icon, icon, useIconBackground);
         /* Initialises the renderer to load two icons from the provided image locations.
          * This enables icon switching on selection.
         public IconedCellRendererField(String iconLoc, String selIconLoc) {
              icon = new ImageIcon(iconLoc);
              selIcon = new ImageIcon(selIconLoc);
              //addMouseListener(this);
         /* Initialises the renderer to load a single icon from the provided image location.
          * The icon can either have the renderer background or not based on the
          * boolean property.
         public IconedCellRendererField(String iconLoc, boolean iconBackground) {
              this(iconLoc, iconLoc, iconBackground);
         /* Initialises the renderer to load two icons from the provided image locations.
          * This enables icon switching on selection. The icon can either have the renderer
          * background or not based on the boolean property.
         public IconedCellRendererField(String iconLoc, String selIconLoc, boolean iconBackground) {
              this(iconLoc, selIconLoc);
              setIconHasBackground(iconBackground);
              createNoBackgroundPanel();
         /* Initialises the renderer to load a single icon from the provided image location.
         public IconedCellRendererField(String iconLoc) {
              this(iconLoc, true);
         /* Initialises the renderer with an array of image icons that are repeated for
          * each row in the list.
         public IconedCellRendererField(Icon[] icons, boolean useIconBackground) {
              this(icons[0], icons[0], useIconBackground);
         public void createNoBackgroundPanel() {
              iconLabel = new JLabel((Icon)null, JLabel.CENTER);
              if(labelDim != null) {      iconLabel.setPreferredSize(labelDim); }
              iconLabel.setBorder( new EmptyBorder(1,5,1,5) );
              noback = new JPanel( new BorderLayout() ) {
                  * Overridden for performance reasons.
                  * See the <a href="#override">Implementation Note</a>
                  * for more information.
                  //public void validate() {}
                 // public void invalidate() {}          
                  public void repaint() {}
                  //public void revalidate() {}
                  public void repaint(long tm, int x, int y, int width, int height) {}
                  public void repaint(Rectangle r) {}
                  protected void firePropertyChange(String propertyName, Object oldValue, Object newValue) {
                        // Strings get interned...
                        if (propertyName == "text"
                                   || ((propertyName == "font" || propertyName == "foreground")
                                       && oldValue != newValue)) {
                            super.firePropertyChange(propertyName, oldValue, newValue);
                  public void firePropertyChange(String propertyName, byte oldValue, byte newValue) {}
                  public void firePropertyChange(String propertyName, char oldValue, char newValue) {}
                  public void firePropertyChange(String propertyName, short oldValue, short newValue) {}
                  public void firePropertyChange(String propertyName, int oldValue, int newValue) {}
                  public void firePropertyChange(String propertyName, long oldValue, long newValue) {}
                  public void firePropertyChange(String propertyName, float oldValue, float newValue) {}
                  public void firePropertyChange(String propertyName, double oldValue, double newValue) {}
                  public void firePropertyChange(String propertyName, boolean oldValue, boolean newValue) {}
              if(useCheckBoxAsIcon()) {
                   box = new JCheckBox();
                   //box.addMouseListener(this);
                   box.setOpaque(false);
                   noback.add( box, BorderLayout.WEST );
                   //noback.addMouseListener(this);
                   rect = box.getBounds();
                   //list.addMouseListener(this);
              } else {
                   noback.add( iconLabel, BorderLayout.WEST );
              noback.add( this, BorderLayout.CENTER );
              noback.setBorder( new EmptyBorder(1,1,1,1) );
              noback.setOpaque(false);
         public Component getListCellRendererComponent(JList list, Object value, int index,
                        boolean isSelected, boolean cellHasFocus) {
              System.out.println(value+"+"+index+"+"+isSelected+"+"+cellHasFocus);
              if(theList == null || theList != list) {
                   theList = list;
                   if(useLinkState) {
                        attachLinkSimulationListener();
              setOpaque(true);
              setText( value == null ? "" : value.toString());
              if(useIndexSensitiveIcons) {
                   icon = getIcon(index);
              if(useIconBackground)
                   setIcon(icon);          
              setFont( list.getFont() );
              setToolTipText(value.toString() );
              if(list.isEnabled())
                   setEnabled( isEnabled(index) );
              else
                   setEnabled( list.isEnabled() );
              if(isSelected && isEnabled(index) ) {
                   setForeground( Color.black );
                   setBackground( new Color(223, 235, 245) );
                   if(useIndexSensitiveIcons) {
                        selIcon = getIcon(index);
                   if(useIconBackground)
                        setIcon(selIcon);
              } else {
                   setForeground(Color.black);
                   setBackground(Color.white);
                   setBorder(null);
              if(cellHasFocus) {
                   setBorder( new CompoundBorder( new LineBorder( new Color(150, 150, 220) ),
                                                      new EmptyBorder(2,2,2,2)  ) );
              } else {
                   setBorder( new EmptyBorder(2,2,2,2));
              if(useLinkState) {
                   if(currentLinkRow == index) {
                        setText("<html><u>" + value.toString()+"</u></html>" );     
                        setForeground( getHoverLinkColor() );               
                   } else {
                        setForeground( getLinkColor() );
                   if(isSelected) {
                        setForeground( getSelectedLinkColor() );
                   setBackground(Color.white);
                   setBorder( new EmptyBorder(1,1,1,1) );
              if( shdPaintDivider() ) {
                   Border border = null;
                   if(dividerImage != null) {
                        border = new MatteBorder(0,0,1,0, dividerImage);
                   } else {
                        border = new MatteBorder(0,0,1,0, getLinkColor() );
                   if(index < theList.getModel().getSize() - 1 ) {
                        setBorder( new CompoundBorder(getBorder(),border) );
                   } else {
                        setBorder( new EmptyBorder(1,1,1,1) );
              if(useIconBackground == false) {
                  if(isSelected)
                      iconLabel.setIcon(selIcon);
                  else
                      iconLabel.setIcon(icon);
                  if(useCheckBoxAsIcon()) {
                      if(selState == null) {
                          updateSelectionStateTrackers(list);
                      if(selStateHandler == null) {
                          list.addMouseListener( selStateHandler = new SelectionStateHandler(list) );
                      try {
                          box.setSelected( selState[index] );
                      } catch(Exception e) {}
                  if( shdPaintDivider() ) {              
                      //if(index < theList.getModel().getSize() - 1 ) {
                          noback.setBorder( getBorder() );
                          setBorder( new EmptyBorder(1,1,1,1) );
                      //} else {
                      //  noback.get
                  // this should cause a JComboBox to paint the Label instead of the
                  // check box + label combination
                  if(index == -1) {
                       Vector<Object> v=new Vector<Object>();
                       v=getSelectedObjects();
                        String val=generateString();
                       JLabel label=new JLabel(val);                    
                      if(iconLabel.getIcon() != null) {
                           label.setIcon( iconLabel.getIcon() );
                      System.out.println("label");
                      return label;
                  return noback;
              return this;
         public String generateString()
              String val = "";
              if(selState[0]==true&&selState[1]==false&&selState[2]==false){
                    for(int i = 3; i < theList.getModel().getSize(); i++) {
                           String curString=theList.getModel().getElementAt(i).toString();
                           if(val.length()==0){
                                  val=val+curString+"-1";
                           } else {                              
                                  val=val+"&"+curString+"-1";
               //clear all     
               if(selState[1]==true&&selState[0]==false&&selState[2]==false ){                                   
                      for(int i = 3; i < theList.getModel().getSize(); i++) {
                           String curString=theList.getModel().getElementAt(i).toString();
                           if(val.length()==0){
                                  val=val+curString+"-0";
                           } else {                              
                                  val=val+"&"+curString+"-0";
              //grayedall
               if(selState[2]==true&&selState[0]==false&&selState[1]==false ){                                   
                      val="";                      
               if(selState[0]==false&&selState[1]==false&&selState[2]==false ){
                    for(int i = 3; i < theList.getModel().getSize(); i++) {
                           String curString=theList.getModel().getElementAt(i).toString();
                           if(selState==true&&enableState[i]==false){
                             continue;
                        if(selState[i]==true&&enableState[i]==true){
                             if(val.length()==0){
                                       val=val+curString+"-1";
                             } else {                              
                                       val=val+"&"+curString+"-1";
                        if(selState[i]==false&&enableState[i]==true){
                             if(val.length()==0){
                                       val=val+curString+"-0";
                             } else {                              
                                       val=val+"&"+curString+"-0";
              return val;
         public void updateSelectionStateTrackers(JList list) {
              selState = new boolean[ list.getModel().getSize() ];
              enableState = new boolean[ list.getModel().getSize() ];
              for(int i = 0; i < selState.length; i++) {
                   selState[i] = false;
                   enableState[i] = true;
         public int[] getSelectedIndices() {
              if(!useCheckBoxAsIcon()) {
                   return new int[0];
              int length = 0;
              if(selState==null){
                   return null;
              for(int i = 0; i < selState.length; i++) {
                   if(selState[i]) {
                        length++;
              int[] indices = new int[length];
              for(int i = 0, n = 0; i < selState.length; i++) {
                   if(selState[i]) {
                        indices[n++] = i;
              //System.out.println("Selected Indices.length = " + indices.length);
              return indices;
         public Vector<Object> getSelectedObjects() {
              int[] indices = getSelectedIndices();
              Vector<Object> objects = new Vector<Object>();
              if(indices==null){
                   return null;
              for(int i = 0; i < indices.length; i++) {
                   objects.addElement( theList.getModel().getElementAt(indices[i]) );
              return objects;
         public void setIconHasBackground(boolean b) {
              useIconBackground = b;
         public Icon[] getIcons() {
              return icons;
         public Icon getIcon(int index) {
              if(icons != null && icons.length == 0) {
                   return icon;
              if(icons != null && index > icons.length) {
                   index = index - (icons.length - 1);
              return icons[index];
         public void setIcons(Icon[] icons) {
              if(icons != null) {
                   useIndexSensitiveIcons = true;
              this.icons = icons;
         public void setIcon(Icon icon, int index) {
              if(icons != null && icons.length > 0) {
                   icons[index] = icon;
         public void setIconLabelDimension(Dimension dim) {
              labelDim = dim;
         public static IconedCellRendererField getCheckBoxRendererInstance() {
              IconedCellRendererField cr = new IconedCellRendererField(new EmptyIcon());
                   cr.setUseCheckBoxAsIcon(true);
              return cr;
         public void setUseCheckBoxAsIcon(boolean use) {
              useCheckBoxAsIcon = use;
              createNoBackgroundPanel();
         public boolean useCheckBoxAsIcon() {
              return useCheckBoxAsIcon;
         public void paintComponent(Graphics g) {
              super.paintComponent(g);
         public void setDisplayItemsAsLinks(boolean use) {
              useLinkState = use;
         public void setLinkColor(Color color) {
              linkColor = color;
              if(theList != null) {
                   theList.repaint();
         public Color getLinkColor() {
              return linkColor;
         public void setHoverLinkColor(Color color) {
              hoverColor = color;
              if(theList != null) {
                   theList.repaint();
         public Color getHoverLinkColor() {
              return hoverColor;
         public void setSelectedLinkColor(Color color) {
              selectedLinkColor = color;
              if(theList != null) {
                   theList.repaint();
         public Color getSelectedLinkColor() {
              return selectedLinkColor;
         public void attachLinkSimulationListener() {
              theList.setCursor( Cursor.getPredefinedCursor(Cursor.HAND_CURSOR) );
              theList.addMouseListener( new MouseAdapter() {
                   public void mouseEntered(MouseEvent e) {
                        isOnRow = true;                    
                   public void mouseExited(MouseEvent e) {
                        isOnRow = false;
    currentLinkRow = -1;
    theList.repaint();
              theList.addMouseMotionListener( new MouseMotionAdapter() {
                   public void mouseMoved(MouseEvent e) {
    isOnRow = true;
    currentLinkRow = theList.locationToIndex( e.getPoint() );
    theList.repaint();
              /*table.addMouseListener(new MouseAdapter() {
    public void mouseEntered(MouseEvent e) {
    public void mouseExited(MouseEvent e) {
    isOnRow = false;
    currentHighlightRow = -1;
    table.repaint();
    table.addMouseMotionListener( new MouseMotionAdapter() {
    public void mouseMoved(MouseEvent e) {
    isOnRow = true;
    currentHighlightRow = table.rowAtPoint( e.getPoint() );
    table.repaint();
         public boolean shdPaintDivider() {
              return paintDivider;
         public void setPaintDivider(boolean paintDivider) {
              this.paintDivider = paintDivider;
         public void setDividerImage(Icon icon) {
              this.dividerImage = icon;
              setPaintDivider(true);
         private void dispatchEvent(MouseEvent me) {
    if(rect != null && box != null && rect.contains(me.getX(), me.getY())){
    Point pt = me.getPoint();
    pt.translate(0,0);
    box.setBounds(rect);
    box.dispatchEvent(new MouseEvent(box, me.getID()
    , me.getWhen(), me.getModifiers()
    , pt.x, pt.y, me.getClickCount()
    , me.isPopupTrigger(), me.getButton()));
    if(!box.isValid()) {
         repaint();
         System.out.println("Dispatch Event: Box.invalid called");
    System.out.println("Dispatch Event called");
    } else {
         System.out.println("Dispatch Event Called, rect null");
    public void mouseClicked(MouseEvent me){
    dispatchEvent(me);
    public void mouseEntered(MouseEvent me){
    dispatchEvent(me);
    public void mouseExited(MouseEvent me){
    dispatchEvent(me);
    public void mousePressed(MouseEvent me){
    dispatchEvent(me);
    public void mouseReleased(MouseEvent me){
    dispatchEvent(me);
    public class SelectionStateHandler extends MouseAdapter {
         JList list = null;
         public SelectionStateHandler(JList list) {
              this.list = list;
         public void mouseClicked(MouseEvent e)
              * Handles the checkbox selection process. Uses the bounds property of the
              * check box within the selected cell to determine whether the checkbox should
              * be selected or not
              public void mouseReleased(MouseEvent e) {
                   /*if(list == null || list.getSelectedIndex() == -1
         || !isEnabled( list.locationToIndex(e.getPoint()) ) ) {
         return;
              if(list == null || list.getSelectedIndex() == -1){
                   return;
         int[] indices = list.getSelectedIndices();
         // get the current relative position of the check box
         //rect = box.getBounds(rect);
         for(int i = 0; i < indices.length; i++) {
         // get the current relative position of the check box
         int loc = list.locationToIndex( e.getPoint() );
         rect = list.getCellBounds(loc,loc);
         // ensure the point clicked in within the checkBox
         if(e.getX() < (rect.getX() + 20) ) {
              Object obj=list.getModel().getElementAt(i);
              //if(!obj.equals("SelectAll")&&!obj.equals("ClearAll")&&!obj.equals("GrayedAll")){
                   if(indices[i]>2){
                        selState[0]=false;
                        selState[1]=false;
                        selState[2]=false;
                        //����
                        if(!this.isEnabled(indices[i])&&selState[indices[i]]==true){
                             this.setEnabled(indices[i],true);
                             selState[indices[i]]=false;
                        } else if(this.isEnabled(indices[i])&&selState[indices[i]]==true){
                             //����
                             selState[indices[i]]=true;
                             this.setEnabled(indices[i],false);                              
                        }else if(this.isEnabled(indices[i])&&selState[indices[i]]==false){
                             //����
                             selState[indices[i]]=true;
                             this.setEnabled(indices[i],true);
                   } else {
                        selState[indices[i]] = !selState[indices[i]];
         list.revalidate();
         list.repaint();
         public void selectAll(boolean b) {
              for(int i = 0; i < list.getModel().getSize(); i++) {
                   try {
                        this.enableAll(true);
                        Object obj=list.getModel().getElementAt(i);
                        if(!obj.equals("ClearAll")&&!obj.equals("GrayedAll")){
                             selState[i] = b;
                        } else{
                             selState[i]=!b;
                        selState[0]=false;
                   } catch(ArrayIndexOutOfBoundsException aie) {
                        updateSelectionStateTrackers(list);
                        selectAll(b);
                        return;
              if(list != null) {
                   list.revalidate();
                   list.repaint();
         public void clearAll(boolean b){
              for(int i = 0; i < list.getModel().getSize(); i++) {
                   try {
                        Object obj=list.getModel().getElementAt(i);
                        this.enableAll(true);
                        if(!obj.equals("ClearAll")){
                             selState[i] = !b;
                        } else{
                             selState[i]=b;
                        selState[1]=false;
                   } catch(ArrayIndexOutOfBoundsException aie) {
                        updateSelectionStateTrackers(list);
                        selectAll(b);
                        return;
              if(list != null) {
                   list.revalidate();
                   list.repaint();
         public void grayedAll(boolean b){
              for(int i = 0; i < list.getModel().getSize(); i++) {
                   try {
                        Object obj=list.getModel().getElementAt(i);
                        if(!obj.equals("SelectAll")&&!obj.equals("ClearAll")){
                             if(i==2){
                                  selState[i] = !b;
                             }else{                             
                                  selState[i] = b;
                             this.setEnabled(i,false);
                        } else{
                             selState[i]=!b;                          
                   } catch(ArrayIndexOutOfBoundsException aie) {
                        updateSelectionStateTrackers(list);
                        selectAll(b);
                        return;
              if(list != null) {
                   list.revalidate();
                   list.repaint();
         public void setSelectedIndex(int index) {
              for(int i = 0; i < list.getModel().getSize(); i++) {
                   selState[i] = false;
              selectIndex(index);
         public void selectIndex(int index) {
              try {
                   selState[index] = true;
              } catch(ArrayIndexOutOfBoundsException aie) {
                   updateSelectionStateTrackers(list);
                   selectIndex(index);
                   return;
              if(list != null) {
                   list.revalidate();
                   list.repaint();
         public void setEnabled(int index, boolean b) {
              try {
                   enableState[index] = b;
              } catch(ArrayIndexOutOfBoundsException aie) {
                   updateSelectionStateTrackers(list);
                   setEnabled(index, b);
         public boolean isEnabled(int index) {
              if(index == -1) {
                   return true;
              boolean isEnabled = true;
              try {
                   isEnabled = enableState[index];
              } catch(ArrayIndexOutOfBoundsException aie) {
                   updateSelectionStateTrackers(list);
                   return isEnabled(index);
              return isEnabled;
         public void enableAll(boolean b) {
              for(int i = 0; i < enableState.length; i++) {
                   enableState[i] = b;
    public void selectAll(boolean b) {
         if(selStateHandler == null) {
              return;
         selStateHandler.selectAll(b);
    public void clearAll(boolean b){
         if(selStateHandler == null) {
              return;
         selStateHandler.clearAll(b);
    public void grayedAll(boolean b){
         if(selStateHandler == null) {
              return;
         selStateHandler.grayedAll(b);
    public void setSelectedIndex(int index) {
         if(selStateHandler == null) {
              return;
         selStateHandler.setSelectedIndex(index);
    public void selectIndex(int index) {
         if(selStateHandler == null) {
              return;
         selStateHandler.selectIndex(index);
    public void enableAll(boolean b) {
         if(selStateHandler == null) {
              return;
         selStateHandler.enableAll(b);
    public void setEnabled(int index, boolean enable) {
         if(selStateHandler == null) {
              return;
         selStateHandler.setEnabled(index, enable);
    public boolean isEnabled(int index) {
         if(selStateHandler == null) {
              return true;
         return selStateHandler.isEnabled(index);
    public boolean isEnabledAll() {
         if(enableState == null) return true;
         for(int i = 0; i < enableState.length; i++) {
              if(!isEnabled(i)) {
                   return false;
         return true;
    // EmptyIcon implementation
    public static class EmptyIcon implements Icon {
         int width = 16, height = 16;
         public EmptyIcon() {
         setSize(16,16);
         public EmptyIcon(int width, int height) {
         setSize(width, height);
         public void setSize(int width, int height) {
         this.width = width;
         this.height = height;
         public int getIconWidth() {  return width; }
         public int getIconHeight() { return height; }
         public void paintIcon(Component c, Graphics g, int x, int y) {}
    public int getItemCount(){
         if(theList!=null){
              return theList.getModel().getSize();
         } else {
              return 0;
         public boolean[] getEnableState() {
              return enableState;
         public boolean[] getSelState() {
              return selState;
         public JList getTheList() {
              return theList;
    testbox :import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JFrame;
    import javax.swing.JComboBox;
    import javax.swing.JMenu;
    import javax.swing.JMenuBar;
    public class testbox extends JComboBox
    * @param args
    JComboBox myComboBox;
    public testbox()
    myComboBox = new JComboBox();
    public void setPopupVisible(boolean b)
         if(b)
              myComboBox.showPopup();
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             

    You are updating the label value when (index == -1), let change into (index<=0).
    like below
    // this should cause a JComboBox to paint the Label instead of the
                // check box + label combination
                if (index <= 0) {
                    Vector v = new Vector();
                    v = getSelectedObjects();
                    String val = generateString();
                    JLabel label = new JLabel(val);
                    if (iconLabel.getIcon() != null) {
                        label.setIcon(iconLabel.getIcon());
                    System.out.println("label");
                    return label;
                }

  • Reporting Services Chart Legend Label

    I am creating a chart from analysis services cube data
    data is like this
    District            Year          Value
    A                    2001          10
    B                    2002          29
    (null)              2003           19
    The charts are creating fine but the legends are not showing fine. In series group i have also tried to use an expression to fix the null label.
    For null value the label is created as "Series 1". I don't want this to happen. for null value i want my chart legend to show as "State"
    Any help will be appriciated
    Regards

    Hi,
    You can use expression to achieve that. In series group, set the group on expression to be:
    =iif(Fields!<District>.Value is nothing, “State”, Fields!<District>.Value)
    Also, set the label expression to be:
    =iif(Fields!<District>.Value is nothing, “State”, Fields!<District>.Value)
    Hope this helps.
    Raymond

  • ViewRowImpl.writeXML: not to omit null values

    Hi.
    I want to use writeXML method in ViewRowImpl to get current row's data in XML format. Here is a snippet of my code
            Node rootNode = myViewRowImpl.writeXML(1, XMLInterface.XML_OPT_ALL_ROWS);
            StringWriter sw = new StringWriter();
            try {
                Transformer t = TransformerFactory.newInstance().newTransformer();
                t.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
                t.setOutputProperty(OutputKeys.INDENT, "yes");
                t.transform(new DOMSource(rootNode), new StreamResult(sw));
            } catch (TransformerException te) {
                System.out.println("Transformer Exception");
            System.out.println(sw.toString());
    ...The problem is that there are missing tags of attributes which has null value (does not have a value). How to "force" writeXML method or even transformer to output empty tags for attributes that does not have values definied?
    Thx
    Regards

    As per the doc.
    38.7.3.2 Controlling Element Suppression for Null-Valued Attributes
    By default, if a view row attribute is null, then its corresponding element is omitted from the generated XML. Select the attribute on the Attributes page of the overview editor and in the Property Inspector, select the Custom Properties navigation tab and set the custom attribute-level property named Xml Explicit Null to any value (e.g. "true" or "yes") to cause an element to be included for the attribute if its value is null. For example, if an attribute named AssignedDate has this property set, then a row containing a null assigned date will contain a corresponding AssignedDate null="true"/ element. If you want this behavior for all attributes of a view object, you can define the Xml Explicit Null custom property at the view object level as a shortcut for defining it on each attribute.

Maybe you are looking for

  • Switchable Graphic Problem AMD & Windows 8.1- Solved

    Follow the steps accurately 1. Open This Pc or My Computer and then go to Uninstall or change a program 2. As the list is displayed, you will see Intel Graphic Driver & AMD Catalyst install manager. You have to uninstall it both in express mode so th

  • Directory Asst Calls

    Do any of you get directory assistance calls charged to your home phone every single month when you know good & well that no one in your home makes these calls???  Just wondering if I was the only one.  I've contacted Verizon the last 4 consecutive m

  • Q10 - MAPS . showing in arabic

    hi everyone... kindly help me .. my bb Q 10 maps is showing in arabic language. i tried many things but still its in arabic.   wen i bought it it was showing in English.. can any one help me how to change the display language of the map from arabic t

  • Download / Installation - Want to download and install on different drives. How?

    Hi, About to install the CS6 Production Premium trial via download assistant before making a purchase and I would like to know if it is possible to download and install to one drive and then move installation to a completely seperate drive without me

  • Using parental controls to log embedded video

    Is there any way to set up the parental controls to log the videos watched in an embedded video player on a web page? Youtube will show suggested content after a video is watched which can ultimately lead to content that I would want to monitor. Is t