1*76b6b121SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*76b6b121SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*76b6b121SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*76b6b121SAndrew Rist * distributed with this work for additional information 6*76b6b121SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*76b6b121SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*76b6b121SAndrew Rist * "License"); you may not use this file except in compliance 9*76b6b121SAndrew Rist * with the License. You may obtain a copy of the License at 10*76b6b121SAndrew Rist * 11*76b6b121SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*76b6b121SAndrew Rist * 13*76b6b121SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*76b6b121SAndrew Rist * software distributed under the License is distributed on an 15*76b6b121SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*76b6b121SAndrew Rist * KIND, either express or implied. See the License for the 17*76b6b121SAndrew Rist * specific language governing permissions and limitations 18*76b6b121SAndrew Rist * under the License. 19*76b6b121SAndrew Rist * 20*76b6b121SAndrew Rist *************************************************************/ 21*76b6b121SAndrew Rist 22*76b6b121SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir package complex.framework.recovery; 25cdf0e10cSrcweir 26cdf0e10cSrcweir import com.sun.star.awt.XWindow; 27cdf0e10cSrcweir import com.sun.star.lang.XMultiServiceFactory; 28cdf0e10cSrcweir import util.UITools; 29cdf0e10cSrcweir 30cdf0e10cSrcweir /** 31cdf0e10cSrcweir * Thread to crash the office. This thread dies after the office process 32cdf0e10cSrcweir * is nopt longer available. 33cdf0e10cSrcweir */ 34cdf0e10cSrcweir public class KlickButtonThread extends Thread { 35cdf0e10cSrcweir private XWindow xWindow = null; 36cdf0e10cSrcweir private XMultiServiceFactory xMSF = null; 37cdf0e10cSrcweir private String buttonName = null; 38cdf0e10cSrcweir KlickButtonThread(XMultiServiceFactory xMSF, XWindow xWindow, String buttonName)39cdf0e10cSrcweir public KlickButtonThread(XMultiServiceFactory xMSF, XWindow xWindow, String buttonName) { 40cdf0e10cSrcweir this.xWindow = xWindow; 41cdf0e10cSrcweir this.xMSF = xMSF; 42cdf0e10cSrcweir this.buttonName = buttonName; 43cdf0e10cSrcweir } 44cdf0e10cSrcweir run()45cdf0e10cSrcweir public void run() { 46cdf0e10cSrcweir try{ 47cdf0e10cSrcweir UITools oUITools = new UITools(xMSF, xWindow); 48cdf0e10cSrcweir 49cdf0e10cSrcweir oUITools.clickButton(buttonName); 50cdf0e10cSrcweir 51cdf0e10cSrcweir } catch (Exception e){} 52cdf0e10cSrcweir } 53cdf0e10cSrcweir } 54