1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 package complex.imageManager; 25 26 import com.sun.star.embed.XStorage; 27 import com.sun.star.ui.XUIConfigurationPersistence; 28 import lib.TestParameters; 29 30 31 32 public class _XUIConfigurationPersistence { 33 34 35 TestParameters tEnv = null; 36 public XUIConfigurationPersistence oObj; 37 private XStorage xStore = null; 38 _XUIConfigurationPersistence(TestParameters tEnv, XUIConfigurationPersistence oObj)39 public _XUIConfigurationPersistence(TestParameters tEnv, XUIConfigurationPersistence oObj) { 40 41 this.tEnv = tEnv; 42 this.oObj = oObj; 43 } 44 before()45 public void before() { 46 xStore = (XStorage)tEnv.get("XUIConfigurationStorage.Storage"); 47 } 48 _reload()49 public boolean _reload() { 50 try { 51 oObj.reload(); 52 } 53 catch(com.sun.star.uno.Exception e) { 54 55 } 56 return true; 57 } 58 _store()59 public boolean _store() { 60 try { 61 oObj.store(); 62 } 63 catch(com.sun.star.uno.Exception e) { 64 65 } 66 return true; 67 } 68 _storeToStorage()69 public boolean _storeToStorage() { 70 boolean result = true; 71 try { 72 oObj.storeToStorage(xStore); 73 } 74 catch(com.sun.star.uno.Exception e) { 75 result = false; 76 77 } 78 return result; 79 } 80 _isModified()81 public boolean _isModified() { 82 return !oObj.isModified(); 83 } 84 _isReadOnly()85 public boolean _isReadOnly() { 86 return !oObj.isReadOnly(); 87 } 88 89 } 90