1 'encoding UTF-8 Do not remove or change this line!
2 '**************************************************************************
3 '* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 '* Copyright 2008 by Sun Microsystems, Inc.
7 '* OpenOffice.org - a multi-platform office productivity suite
9 '* $RCSfile: options_ooo_java.inc,v $
13 '* last change: $Author: jsi $ $Date: 2008-06-16 12:18:15 $
15 '* This file is part of OpenOffice.org.
17 '* OpenOffice.org is free software: you can redistribute it and/or modify
18 '* it under the terms of the GNU Lesser General Public License version 3
19 '* only, as published by the Free Software Foundation.
21 '* OpenOffice.org is distributed in the hope that it will be useful,
22 '* but WITHOUT ANY WARRANTY; without even the implied warranty of
23 '* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 '* GNU Lesser General Public License version 3 for more details
25 '* (a copy is included in the LICENSE file that accompanied this code).
27 '* You should have received a copy of the GNU Lesser General Public License
28 '* version 3 along with OpenOffice.org. If not, see
29 '* <http://www.openoffice.org/license.html>
30 '* for a copy of the LGPLv3 License.
32 '/************************************************************************
34 '* owner : thorsten.bosbach@sun.com
36 '* short description : Tools->Options: OpenOffice.org Java
38 '\******************************************************************************
41 dim bJavaState as boolean
43 '///Options test for Java settings
46 hToolsOptions( "StarOffice", "Java" )
48 '///<li>Make sure Java is enabled. If it is not: Fix this</li>
49 printlog( "Verify that Java is enabled and configured" )
50 if ( usejava.isChecked() = false ) then
51 warnlog( "Java should be enabled by default, checking and restarting" )
52 bJavaState = hChangeJavaState( true )
53 if ( bJavaState = false ) then
54 warnlog( "Java is still not enabled, aborting test." )
60 printlog( " Java is enabled. Good." )
63 ' Needs a delay, it might take some time until the listbox gets populated
66 ' There should be a java-runtime installed. If not -> leave test
67 '///<li>Make sure Java at least one Java runtime is installed</li>
68 printlog( "Make sure at least one Java runtime is installed" )
69 if ( javalist.getitemcount() = 0 ) then
70 warnlog( "No java listed in listbox, the test will stop" )
75 printlog( " Java is installed, good." )
78 printlog( "Quickly test that all controls are active" )
79 '///<li>Verify that all controls are active</li></ul>
80 if ( add.isEnabled() ) then
81 printlog( " 'Add...' is enabled" )
83 warnlog( "The 'Add...' button is disabled" )
86 if ( parameters.isEnabled() ) then
87 printlog( " 'Parameters...' is enabled" )
89 warnlog( "The 'Parameters...' button is disabled" )
92 if ( classpath.isEnabled() ) then
93 printlog( " 'Class Path...' is enabled" )
95 warnlog( "The 'Class Path...' button is disabled" )
98 if ( JavaList.isEnabled() ) then
99 printlog( " 'JavaList' is enabled" )
101 warnlog( "The 'JavaList' button is disabled" )
104 kontext "OptionenDlg"
108 '*******************************************************************************
110 function hChangeJavaState( bEnable as boolean ) as boolean
111 ' this little fella switches Java support on and off including a restart of
112 ' the office to make the change active. The state is returned
115 printlog( " Enable Java" )
118 printlog( " Disable Java" )
122 ' leave tools/options
123 printlog( " Leave Tools/Options" )
124 kontext "OptionenDlg"
127 ' restart the office to make the change take effect
128 printlog( " Restart the application" )
129 call exitRestartTheOffice()
131 ' return to java page
132 printlog( " Return to Tools/Options Java-page" )
134 hToolsOptions( "StarOffice", "Java" )
137 if ( useJava.isChecked() ) then
138 hChangeJavaState() = true
140 hChangeJavaState() = false