KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > update > internal > core > ConfigurationActivity


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.update.internal.core;
12 import java.io.*;
13
14 import org.eclipse.update.configuration.*;
15 import org.eclipse.update.internal.model.*;
16 public class ConfigurationActivity
17     extends ConfigurationActivityModel
18     implements IActivity, IWritable {
19         
20     /**
21      * Default constructor
22      */

23     public ConfigurationActivity() {
24     }
25     
26     /**
27      * Constructor with action
28      */

29     public ConfigurationActivity(int action) {
30         super();
31         setAction(action);
32         setStatus(STATUS_NOK);
33     }
34     
35     /*
36      * @see IWritable#write(int, PrintWriter)
37      */

38     public void write(int indent, PrintWriter w) {
39 // String gap= ""; //$NON-NLS-1$
40
// for (int i= 0; i < indent; i++)
41
// gap += " "; //$NON-NLS-1$
42
// String increment= ""; //$NON-NLS-1$
43
// for (int i= 0; i < IWritable.INDENT; i++)
44
// increment += " "; //$NON-NLS-1$
45
//
46
// // ACTIVITY
47
// w.print(gap + "<" + InstallConfigurationParser.ACTIVITY + " ");
48
// //$NON-NLS-1$ //$NON-NLS-2$
49
// w.println("action=\"" + getAction() + "\" "); //$NON-NLS-1$ //$NON-NLS-2$
50
// if (getLabel() != null) {
51
// w.println(gap + increment+ "label=\"" + UpdateManagerUtils.Writer.xmlSafe(getLabel()) + "\" ");
52
// //$NON-NLS-1$ //$NON-NLS-2$
53
// }
54
// w.println(gap + increment+"date=\"" + getDate().getTime() + "\" ");
55
// //$NON-NLS-1$ //$NON-NLS-2$
56
// w.println(gap + increment+"status=\"" + getStatus() + "\">"); //$NON-NLS-1$ //$NON-NLS-2$
57
//
58
// // end
59
// w.println(gap + "</" + InstallConfigurationParser.ACTIVITY + ">");
60
// //$NON-NLS-1$ //$NON-NLS-2$
61
// w.println(""); //$NON-NLS-1$
62
}
63     
64     /*
65      * @see IActivity#getInstallConfiguration()
66      */

67     public IInstallConfiguration getInstallConfiguration() {
68         return (IInstallConfiguration) getInstallConfigurationModel();
69     }
70     
71     public boolean equals(Object JavaDoc other) {
72         if (!(other instanceof ConfigurationActivity))
73             return false;
74         if (this == other)
75             return true;
76         
77         ConfigurationActivity activity = (ConfigurationActivity) other;
78         return getAction() == activity.getAction()
79                 && getLabel().equals(activity.getLabel())
80                 && getStatus() == activity.getStatus();
81     }
82 }
83
Popular Tags