OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

some questions in java!

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
manutudescends
General User
General User


Joined: 21 Nov 2005
Posts: 25
Location: Toulouse, France

PostPosted: Wed Feb 15, 2006 7:41 am    Post subject: some questions in java! Reply with quote

Hello
first question:
I have a Xframe and a XWindow but i don't know how to save automaticaly document when frame is closing.

second question

i hide all this bar
Quote:
"private:resource/toolbar/alignmentbar",
"private:resource/toolbar/arrowshapes",
"private:resource/toolbar/basicshapes",
"private:resource/toolbar/calloutshapes",
"private:resource/toolbar/colorbar",
"private:resource/toolbar/drawbar",
"private:resource/toolbar/drawobjectbar",
"private:resource/toolbar/extrusionobjectbar",
"private:resource/toolbar/fontworkobjectbar",
"private:resource/toolbar/fontworkshapetypes",
"private:resource/toolbar/formatobjectbar",
"private:resource/toolbar/formcontrols",
"private:resource/toolbar/formdesign",
"private:resource/toolbar/formsfilterbar",
"private:resource/toolbar/formsnavigationbar",
"private:resource/toolbar/formsobjectbar",
"private:resource/toolbar/formtextobjectbar",
"private:resource/toolbar/fullscreenbar",
"private:resource/toolbar/graphicobjectbar",
"private:resource/toolbar/insertbar",
"private:resource/toolbar/insertcellsbar",
"private:resource/toolbar/insertobjectbar",
"private:resource/toolbar/mediaobjectbar",
"private:resource/toolbar/moreformcontrols",
"private:resource/toolbar/previewbar",
"private:resource/toolbar/standardbar",
"private:resource/toolbar/starshapes",
"private:resource/toolbar/symbolshapes",
"private:resource/toolbar/textobjectbar",
"private:resource/toolbar/toolbar",
"private:resource/toolbar/viewerbar",
"private:resource/menubar/menubar",
"private:resource/statusbar/statusbar" ,


but i don't know how hide personnal bar, how can i do this ?

third question:

how to disable the ruler ?
Back to top
View user's profile Send private message
GarryTan
General User
General User


Joined: 11 Feb 2006
Posts: 5

PostPosted: Thu Feb 16, 2006 6:52 pm    Post subject: solution Reply with quote

Here's my solution -- you have to use XViewSettingsSupplier as discussed in the API docs.

The property you care about is ShowRulers


Code:

public void setDocumentDefaultProps() {
      logger.debug("setting default properties");
      try {
//         XPropertySet props = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, aBean.getController());
         OfficeDocument doc = aBean.getDocument();
         Object obj = UnoRuntime.queryInterface(com.sun.star.view.XViewSettingsSupplier.class, doc.getCurrentController());      
         com.sun.star.view.XViewSettingsSupplier settings = (com.sun.star.view.XViewSettingsSupplier) obj;
         
         XPropertySet props = settings.getViewSettings();
         
         
         props.setPropertyValue("ShowRulers", false);         
         XPropertySetInfo propInfo = props.getPropertySetInfo();

//         for (int i = 0; i < propInfo.getProperties().length; i++) {
//            logger.debug(
//                  "prop " + propInfo.getProperties()[i].Name
//                  + " value " + props.getPropertyValue(propInfo.getProperties()[i].Name));
//         }
         
      } catch (NoConnectionException e) {
         logger.error("Exception while setting document properties", e);
      } catch (UnknownPropertyException e) {
         logger.error("Exception while setting document properties", e);
      } catch (WrappedTargetException e) {
         logger.error("Exception while setting document properties", e);
      } catch (PropertyVetoException e) {
         logger.error("Exception while setting document properties", e);
      } catch (IllegalArgumentException e) {
         logger.error("Exception while setting document properties", e);
      }
   }
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group