Package com.sun.star.awt

Examples of com.sun.star.awt.XListBox


    public static interface Renderer {
        public String render(Object item);
    }

    public static void fillList(Object list, Object[] items, Renderer renderer) {
        XListBox xlist = (XListBox) UnoRuntime.queryInterface(XListBox.class, list);
        Helper.setUnoPropertyValue(UnoDataAware.getModel(list), "StringItemList", new String[] {});
        for (short i = 0; i < items.length; i++)
            if (items[i] != null)
                xlist.addItem((renderer != null ? renderer.render(items[i]) : items[i].toString()), i);
    }
View Full Code Here


                    case SOSECFIELDNAME:
                    case SOTHIRDFIELDNAME:
                    case SOFOURTHFIELDNAME:
                        scontrolname = getControlName(EventObject.Source);
                        String scontrolnameSuffix = sIncSuffix + "_" + scontrolname.substring(scontrolname.length() - 1, scontrolname.length());
                        XListBox xCurFieldListBox = (XListBox) UnoRuntime.queryInterface(XListBox.class, CurUnoDialog.xDlgContainer.getControl(scontrolname));
                        String CurDisplayFieldName = xCurFieldListBox.getSelectedItem();
                        FieldColumn CurFieldColumn = new FieldColumn(oQueryMetaData, CurDisplayFieldName);
                        XControl xValueControl = CurUnoDialog.xDlgContainer.getControl("txtValue" + scontrolnameSuffix);
                        XInterface xValueModel = (XInterface) UnoDialog.getModel(xValueControl);
                        Helper.setUnoPropertyValue(xValueModel, "TreatAsNumber", new Boolean(CurFieldColumn.bIsNumberFormat));
                        oQueryMetaData.getNumberFormatter().setNumberFormat(xValueModel, CurFieldColumn.DBFormatKey, oQueryMetaData.getNumberFormatter());
View Full Code Here


            protected void setCondition(PropertyValue _filtercondition) {
            try {
                int ikey;
                XListBox xFieldsListBox = (XListBox) UnoRuntime.queryInterface(XListBox.class, ControlElements[SOLSTFIELDNAME]);
                xFieldsListBox.selectItem(_filtercondition.Name, true);
                XListBox xOperatorListBox = (XListBox) UnoRuntime.queryInterface(XListBox.class, ControlElements[SOLSTOPERATOR]);
                xOperatorListBox.selectItemPos((short) (_filtercondition.Handle - 1), true);
                if (AnyConverter.isString(_filtercondition.Value)){
                    String sValue = AnyConverter.toString(_filtercondition.Value);
                    if (sValue.indexOf("{D '") > -1){
                        sValue = JavaTools.replaceSubString(sValue, "","{D '");
                        sValue = JavaTools.replaceSubString(sValue, "","' }");
View Full Code Here

        // add to the list box control as item listener
        if ( m_useJavaCallbacks )
        {
            XControl control = m_document.getCurrentView().getControl( listBox );
            XListBox listBoxControl = (XListBox)UnoRuntime.queryInterface(
                XListBox.class, control );
            listBoxControl.addItemListener( this );
        }

        try
        {
            XStorable storable = (XStorable)m_document.query( XStorable.class );
View Full Code Here

            if ( m_useJavaCallbacks )
            {
                // after we switched to another sheet, we need to register at its list box
                // control, again. The reason is that controls exist as long as their sheet is active.
                XListBox listBoxControl = getListBoxControl( sheet );
                listBoxControl.addItemListener( this );

                // in the list box of this new sheet, select its name. Everything else
                // is way too confusing
                listBoxControl.selectItem( selectedEntry, true );
                    // don't do it. It deadlocks :(
            }
        }
        catch( com.sun.star.uno.Exception e )
        {
View Full Code Here

    /* ------------------------------------------------------------------ */
    /** simulates a user selecting an entry in a list box
    */
    private void simulateUserListBoxSelection( XPropertySet _listBox, String _selectEntry ) throws com.sun.star.uno.Exception
    {
        XListBox listBoxControl = (XListBox)UnoRuntime.queryInterface(
            XListBox.class, m_document.getCurrentView().getControl( _listBox ) );
        listBoxControl.selectItem( _selectEntry, true );
    }
View Full Code Here

        tEnv.addObjRelation("MODEL", the_Model);

        // adding object relation for XItemListener
        ifc.awt._XItemListener.TestItemListener listener =
                new ifc.awt._XItemListener.TestItemListener();
        XListBox list = (XListBox) UnoRuntime.queryInterface(XListBox.class,
                                                             oObj);
        list.addItemListener(listener);
        tEnv.addObjRelation("TestItemListener", listener);

        XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class,
                                                                aControl);
View Full Code Here

        tEnv.addObjRelation("MODEL",the_Model);

        // Adding relation for XItemListener
        ifc.awt._XItemListener.TestItemListener listener =
            new ifc.awt._XItemListener.TestItemListener() ;
        final XListBox box = (XListBox) UnoRuntime.queryInterface(XListBox.class, oObj) ;
        box.addItemListener(listener) ;
        tEnv.addObjRelation("TestItemListener", listener) ;

        // Adding relation for XWindow
        XWindow forObjRel = (XWindow)
                            UnoRuntime.queryInterface(XWindow.class, anotherCtrl);
       
        XWindow objWin = (XWindow)
                            UnoRuntime.queryInterface(XWindow.class, oObj);

        tEnv.addObjRelation("XWindow.AnotherWindow",forObjRel);
        tEnv.addObjRelation("XWindow.ControlShape",aShape);
       
        tEnv.addObjRelation("Win1",objWin);
        tEnv.addObjRelation("Win2",forObjRel);
       
        tEnv.addObjRelation("CONTROL",anotherCtrl);

        // adding relation for XChangeBroadcaster
        box.addItem("Item1", (short) 0);
        box.addItem("Item2", (short) 1);

        tEnv.addObjRelation("XChangeBroadcaster.Changer",
            new ifc.form._XChangeBroadcaster.Changer() {
                public void change(){
                    box.addItem("Item1", (short) 0);
                    box.addItem("Item2", (short) 1);
                    box.selectItemPos((short) 0, true);
                    box.selectItemPos((short) 1, true);
                }
            }
        );

        return tEnv;
View Full Code Here

                    case SO_SECONDFIELDNAME:
                    case SO_THIRDFIELDNAME:
                    case SO_FOURTHFIELDNAME:
                        sControlName = getControlName(EventObject.Source);
                        String sControlNameSuffix = sIncSuffix + "_" + getIndexNumber(sControlName);
                        XListBox xCurFieldListBox = (XListBox) UnoRuntime.queryInterface(XListBox.class, CurUnoDialog.xDlgContainer.getControl(sControlName));
                        String CurDisplayFieldName = xCurFieldListBox.getSelectedItem();
                        FieldColumn CurFieldColumn = new FieldColumn(oQueryMetaData, CurDisplayFieldName);
                       
                        String sControlNameTextValue = "txtValue" + sControlNameSuffix;
//                        String sControlNameBooleanList = "lstBoolean" + sControlNameSuffix;
//                        if (aFieldColumn.FieldType == DataType.BOOLEAN)
View Full Code Here

        protected void setCondition(PropertyValue _filtercondition)
        {
            try
            {
                int ikey;
                XListBox xFieldsListBox = (XListBox) UnoRuntime.queryInterface(XListBox.class, ControlElements[SOLSTFIELDNAME]);
                xFieldsListBox.selectItem(_filtercondition.Name, true);
                XListBox xOperatorListBox = (XListBox) UnoRuntime.queryInterface(XListBox.class, ControlElements[SOLSTOPERATOR]);
                xOperatorListBox.selectItemPos((short) (_filtercondition.Handle - 1), true);

                if (AnyConverter.isString(_filtercondition.Value))
                {
                    String sValue = AnyConverter.toString(_filtercondition.Value);
                    if (sValue.indexOf("{D '") > -1)
View Full Code Here

TOP

Related Classes of com.sun.star.awt.XListBox

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.