themeinstaller/source/src/com/nokia/tools/themeinstaller/defrep/operations/FileOperation.java
equal
deleted
inserted
replaced
|
1 /* |
|
2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Base class for file operations |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 package com.nokia.tools.themeinstaller.defrep.operations; |
|
20 |
|
21 import java.io.File; |
|
22 import java.util.Observable; |
|
23 import java.util.Observer; |
|
24 |
|
25 public abstract class FileOperation extends Observable implements Runnable |
|
26 { |
|
27 |
|
28 // File related to the operation |
|
29 protected File iFile; |
|
30 |
|
31 // Listener of the operation |
|
32 protected Observer iListener; |
|
33 |
|
34 /** |
|
35 * Called when the operation is finished. Sets the observable object as |
|
36 * changed and notifies its observers. |
|
37 * |
|
38 * @param aFile The file under operation |
|
39 * @param aErrorCode Error code |
|
40 */ |
|
41 protected void finished( File aFile, int aErrorCode ) |
|
42 { |
|
43 FileOperationEvent event = new FileOperationEvent( aFile, |
|
44 aErrorCode ); |
|
45 super.setChanged(); |
|
46 super.notifyObservers( event ); |
|
47 } |
|
48 } |