KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > ui > jarimport > JarImportData


1 /*******************************************************************************
2  * Copyright (c) 2005, 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.jdt.internal.ui.jarimport;
12
13 import java.net.URI JavaDoc;
14
15 import org.eclipse.ltk.core.refactoring.history.RefactoringHistory;
16
17 import org.eclipse.jdt.core.IPackageFragmentRoot;
18
19 import org.eclipse.jdt.ui.jarpackager.JarPackageData;
20
21 /**
22  * Module for a JAR file which includes refactoring information to import.
23  *
24  * @since 3.2
25  */

26 public final class JarImportData extends JarPackageData {
27
28     /** The time stamp of the existing jar file, or <code>-1</code> if not available */
29     private long fExistingStamp= -1;
30
31     /** The location of the new jar file to import, or <code>null</code> */
32     private URI JavaDoc fJarFileLocation= null;
33
34     /** The package fragment root to update, or <code>null</code> */
35     private IPackageFragmentRoot fPackageFragmentRoot= null;
36
37     /** The refactoring history to import, or <code>null</code> */
38     private RefactoringHistory fRefactoringHistory= null;
39
40     /** Should the jar file be renamed to the new file name? */
41     private boolean fRenameJarFile= true;
42
43     /**
44      * Returns the time stamp of the existing jar file.
45      *
46      * @return the time stamp, or <code>-1</code> if not available
47      */

48     public long getExistingTimeStamp() {
49         return fExistingStamp;
50     }
51
52     /**
53      * Returns the package fragment root to update.
54      *
55      * @return the package fragment root, or <code>null</code>
56      */

57     public IPackageFragmentRoot getPackageFragmentRoot() {
58         return fPackageFragmentRoot;
59     }
60
61     /**
62      * Returns the location of the new jar file.
63      *
64      * @return the location of the new jar file, or <code>null</code>
65      */

66     public URI JavaDoc getRefactoringFileLocation() {
67         return fJarFileLocation;
68     }
69
70     /**
71      * Returns the refactoring history.
72      *
73      * @return the refactoring history, or <code>null</code>
74      */

75     public RefactoringHistory getRefactoringHistory() {
76         return fRefactoringHistory;
77     }
78
79     /**
80      * Should the jar file be renamed to the new file name?
81      *
82      * @return <code>true</code> if it should be renamed, <code>false</code>
83      * otherwise
84      */

85     public boolean isRenameJarFile() {
86         return fRenameJarFile;
87     }
88
89     /**
90      * Sets the time stamp of the existing jar file.
91      *
92      * @param stamp
93      * the time stamp, or <code>-1</code> if not available
94      */

95     public void setExistingTimeStamp(final long stamp) {
96         if (stamp < -1) {
97             throw new IllegalArgumentException JavaDoc();
98         }
99         fExistingStamp= stamp;
100     }
101
102     /**
103      * Sets the package fragment root to update.
104      *
105      * @param root
106      * the package fragment root to set, or <code>null</code>
107      */

108     public void setPackageFragmentRoot(final IPackageFragmentRoot root) {
109         fPackageFragmentRoot= root;
110     }
111
112     /**
113      * Sets the location of the new jar file.
114      *
115      * @param uri
116      * the location of the new jar file, or <code>null</code>
117      */

118     public void setRefactoringFileLocation(final URI JavaDoc uri) {
119         fJarFileLocation= uri;
120     }
121
122     /**
123      * Sets the refactoring history.
124      *
125      * @param history
126      * the refactoring history to set, or <code>null</code>
127      */

128     public void setRefactoringHistory(final RefactoringHistory history) {
129         fRefactoringHistory= history;
130     }
131
132     /**
133      * Determines whether the jar file should be renamed.
134      *
135      * @param rename
136      * <code>true</code> to rename the jar file, <code>false</code>
137      * otherwise
138      */

139     public void setRenameJarFile(final boolean rename) {
140         fRenameJarFile= rename;
141     }
142 }
143
Popular Tags