[mobility] How do you make an SVGComboBox uneditable

  • From: "mtb" < >
  • To:
  • Subject: [mobility] How do you make an SVGComboBox uneditable
  • Date: Fri, 14 Dec 2012 08:56:45 -0500

I am currently building a J2ME app using netbeans and the SVG UI Snippets 
NetBeans plugin.

For some reason whenever I run the app in an emulator the combo box is always 
editable (i.e if you can change the values of the list of items).

Any ideas how I can make the combo box uneditable?

the svg code

Code:

<g id="combobox_0" transform="translate(66.252304,250.66594)">
    <!-- Metadata information. Please don't edit. -->
    <text display="none">type=combobox</text>
    <rect x="0" y="-5" rx="5" ry="5" width="90" height="30" fill="none" 
stroke="rgb(255,165,0)" stroke-width="2" visibility="hidden">
        <set attributeName="visibility" attributeType="XML" 
begin="combobox_0.focusin" fill="freeze" to="visible"/>
        <set attributeName="visibility" attributeType="XML" 
begin="combobox_0.focusout" fill="freeze" to="hidden"/>
    </rect>
    <rect id="combobox_0_border" transform=""   x="5.0" y="0.0" rx="4" ry="4" 
width="80" height="20" fill="none" stroke="rgb(73,46,55)" stroke-width="1.5"/>
    <g>
        <!-- Metadata information. Please don't edit. -->
        <text display="none">type=button</text>
        <rect id="combobox_0_button" 
transform="matrix(1.0,0.0,0.0,0.89200264,0.0,1.2104801)"    x="65.4"  rx="4"  
ry="4" y="0.0" width="20" height="20" fill="none" stroke="rgb(73,46,55)" 
stroke-width="1.5">
            <animate id="combobox_0_button_pressed" attributeName="stroke" 
attributeType="XML" begin="indefinite" dur="0.25s" fill="freeze" to="red"/>
            <animate id="combobox_0_button_released" attributeName="stroke" 
attributeType="XML" begin="indefinite" dur="0.25s" fill="freeze" to="black"/>
        </rect>
    </g>
    <polygon transform="translate(73.0,8.0)" id="_18_0"   points="0,0 4,0 
2,4" fill="blue" stroke="rgb(73,46,55)" stroke-width="1.5"/>
    <g id="combobox_0_editor">
        <!-- this editor is SVGTextField component -->
        <!-- Metadata information. Please don't edit. -->
        <text display="none">type=editor</text>
        <text display="none">editable=false</text>
        <text display="none">enabled=true</text>
        <g>
            <text id="combobox_0_editor_text" x="10.0" y="16.0" 
font-size="16" font-family="">Item 1</text>
            <!-- Metadata information. Please don't edit. -->
            <text display="none">type=text</text>
        </g>
    </g>
    <rect visibility="hidden" x="5.0" y="0" width="60" height="20" />
</g>




 <g id="combobox_0_list" visibility="hidden"   
transform="translate(66.252304,250.66594)">
    <!-- Metadata information. Please don't edit. -->
    <text display="none">ref=combobox_0</text>
    <text display="none">type=list</text>
    <g>
        <text id="combobox_0_list_hidden_text" visibility="hidden" x="10" 
y="13" font-size="16" font-family="">HIDDEN TEXT</text>
        <!-- Metadata information. Please don't edit. -->
        <text display="none">type=hidden_text</text>
    </g>
    <g>
        <!-- Metadata information. Please don't edit. -->
        <text display="none">type=bound</text>
        <rect 
transform="matrix(1.0165975,0.0,0.0,1.0,-0.118946075,2.3333359)"  
id="combobox_0_list_bound" rx="5" ry="5" x="5.0" y="0" width="80" height="50" 
visibility="inherit" fill="white" stroke="rgb(73,46,55)" stroke-width="1.5" />
    </g>
    <g>
        <!-- Metadata information. Please don't edit. -->
        <text display="none">type=selection</text>
        <rect id="combobox_0_list_selection" x="6.0" y="0" stroke="black"  
stroke-width="1" fill="rgb(200,200,255)" visibility="inherit" width="80" 
height="0"/>
    </g>
    <g  id="combobox_0_list_current_selection">
        <!-- Metadata information. Please don't edit. -->
        <text display="none">type=current_selection</text>
    </g>
    <g  id="combobox_0_list_content" visibility="inherit">
        <!-- Metadata information. Please don't edit. -->
        <text display="none">type=content</text>
    </g>
</g>   


and the java code

Code:

public SVGComboBox getSvgComboBox() {
    if (svgComboBox == null) {
        // write pre-init user code here
        svgComboBox = new SVGComboBox(getSvgForm(), "combobox_0");
        // write post-init user code here

        Vector vector = new Vector(); 
        vector.addElement("1");
        vector.addElement("2");
        vector.addElement("3");
        vector.addElement("4");
        vector.addElement("5");
        vector.addElement("6");
        svgComboBox.setModel( new SVGComboBox.DefaultModel( vector ));

    }
    return svgComboBox;
}








[mobility] How do you make an SVGComboBox uneditable

mtb 12/14/2012

Project Features

About this Project

Mobility was started in November 2009, is owned by dstrupl, and has 37 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20140418.2d69abc). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close