Hi, 

I want customize view of openoffice 3.0 beta thought execute Java code.
The "slot:5920" could hide StatusBar,but the "slot:6661" is invalid.
Can anybody ask me , what is MenuBarVisible's new slotID in new OpenOffice 3.0 
Beta?


dispatch( "slot:5920", "StatusBarVisible", false );
dispatch( "slot:6661", "MenuBarVisible", false ); 

//================================================
 private boolean dispatch( String strSlotID, String strSlotName, boolean bValue 
)
 {
  try
  {
   XDispatchProvider xDispProv = (XDispatchProvider) 
UnoRuntime.queryInterface(XDispatchProvider.class,m_xDesktop.getCurrentFrame());
   m_xMultiComponentFactory.createInstanceWithContext(null, null);
   
   Object oTransformer = m_xMultiComponentFactory.createInstanceWithContext
     ("com.sun.star.util.URLTransformer", getXComponentContext());
   XURLTransformer xParser = (com.sun.star.util.XURLTransformer)
     UnoRuntime.queryInterface( XURLTransformer.class, oTransformer );
   URL[] aParseURL = new URL[1];
   aParseURL[0] = new URL();
   aParseURL[0].Complete = strSlotID;
   
   xParser.parseStrict(aParseURL);
   URL aURL = aParseURL[0];
   XDispatch xDispatcher = xDispProv.queryDispatch( aURL,"",0);
   if( xDispatcher != null )
   {
    com.sun.star.beans.PropertyValue[] lProperties = new 
com.sun.star.beans.PropertyValue[1];
    lProperties[0] = new com.sun.star.beans.PropertyValue();
    lProperties[0].Name  = strSlotName;
    lProperties[0].Value = new Boolean(bValue);   

    PropertyValue[] props = new PropertyValue[1];
    props[0] = new PropertyValue(strSlotName, 0, new 
Boolean(bValue),PropertyState.DIRECT_VALUE);
    
    xDispatcher.dispatch( aURL, props );
   }
  }
  catch( com.sun.star.uno.Exception e)
  {
   System.err.println( " Exception " + e );
   e.printStackTrace( System.err );
  }
  
  return true;
 }

Reply via email to