Examples of XGraphicProvider


Examples of com.sun.star.graphic.XGraphicProvider

    }
   
    private void insertIcons() {
        try {
            Object oGS = xMSF.createInstance("com.sun.star.graphic.GraphicProvider");
            XGraphicProvider xGraphicProvider = (XGraphicProvider) UnoRuntime.queryInterface(XGraphicProvider.class, oGS);
           
            PropertyValue GraphicValues[] = new PropertyValue[1];
            GraphicValues[0] = new PropertyValue();
            GraphicValues[0].Name = "URL";
            GraphicValues[0].Value = "private:resource/svx/imagelist/18000/18022";         
            XGraphic xGraphic = xGraphicProvider.queryGraphic(GraphicValues);
           
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
View Full Code Here

Examples of com.sun.star.graphic.XGraphicProvider

    private void insertIcons()
    {
        try
        {
            Object oGS = xMSF.createInstance("com.sun.star.graphic.GraphicProvider");
            XGraphicProvider xGraphicProvider = (XGraphicProvider) UnoRuntime.queryInterface(XGraphicProvider.class, oGS);

            PropertyValue GraphicValues[] = new PropertyValue[1];
            GraphicValues[0] = new PropertyValue();
            GraphicValues[0].Name = "URL";
            GraphicValues[0].Value = "private:resource/svx/imagelist/18000/18022";
            XGraphic xGraphic = xGraphicProvider.queryGraphic(GraphicValues);

        }
        catch (Exception e)
        {
            // TODO Auto-generated catch block
View Full Code Here

Examples of com.sun.star.graphic.XGraphicProvider

    public XGraphic setGraphic(XControl xImageControl, String sImageUrl){
        XGraphic xGraphic = null;
        try{
            Object oGraphicProvider = m_xContext.getServiceManager().createInstanceWithContext("com.sun.star.graphic.GraphicProvider", m_xContext);
            XGraphicProvider xGraphicProvider = (XGraphicProvider) UnoRuntime.queryInterface(XGraphicProvider.class, oGraphicProvider);
            PropertyValue[] aPropertyValues = new PropertyValue[1];
            PropertyValue aPropertyValue = new PropertyValue();
            aPropertyValue.Name = "URL";
            if(!sImageUrl.equals(""))
                aPropertyValue.Value = getPackageLocation() + sImageUrl;
            else
                aPropertyValue.Value = "";
            aPropertyValues[0] = aPropertyValue;
            xGraphic = xGraphicProvider.queryGraphic(aPropertyValues);
            XPropertySet xProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xImageControl.getModel());
            xProps.setPropertyValue("Graphic", xGraphic);
        } catch (UnknownPropertyException ex) {
            System.err.println(ex.getLocalizedMessage());
        } catch (PropertyVetoException ex) {
View Full Code Here

Examples of com.sun.star.graphic.XGraphicProvider

    }

    public XGraphic getGraphic(String sImageUrl){
        try{
            Object oGraphicProvider = m_xContext.getServiceManager().createInstanceWithContext("com.sun.star.graphic.GraphicProvider", m_xContext);
            XGraphicProvider xGraphicProvider = (XGraphicProvider) UnoRuntime.queryInterface(XGraphicProvider.class, oGraphicProvider);
            PropertyValue[] aPropertyValues = new PropertyValue[1];
            PropertyValue aPropertyValue = new PropertyValue();
            aPropertyValue.Name = "URL";
            if(!sImageUrl.equals(""))
                aPropertyValue.Value = getPackageLocation() + sImageUrl;
            else
                aPropertyValue.Value = "";
            aPropertyValues[0] = aPropertyValue;
            return xGraphicProvider.queryGraphic(aPropertyValues);
        } catch (UnknownPropertyException ex) {
            System.err.println(ex.getLocalizedMessage());
        } catch (PropertyVetoException ex) {
            System.err.println(ex.getLocalizedMessage());
        } catch (IllegalArgumentException ex) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.