Lines 10-24
Link Here
|
10 |
*******************************************************************************/ |
10 |
*******************************************************************************/ |
11 |
package org.eclipse.ui.ide.dialogs; |
11 |
package org.eclipse.ui.ide.dialogs; |
12 |
|
12 |
|
|
|
13 |
import java.io.File; |
14 |
import java.net.URI; |
15 |
import java.util.ArrayList; |
16 |
|
17 |
import org.eclipse.core.filesystem.URIUtil; |
18 |
import org.eclipse.core.resources.IContainer; |
19 |
import org.eclipse.core.resources.IPathVariable; |
13 |
import org.eclipse.core.resources.IPathVariableManager; |
20 |
import org.eclipse.core.resources.IPathVariableManager; |
14 |
import org.eclipse.core.resources.IResource; |
21 |
import org.eclipse.core.resources.IResource; |
15 |
import org.eclipse.core.resources.ResourcesPlugin; |
22 |
import org.eclipse.core.resources.ResourcesPlugin; |
|
|
23 |
import org.eclipse.core.runtime.IPath; |
24 |
import org.eclipse.core.runtime.Path; |
16 |
import org.eclipse.jface.dialogs.IDialogConstants; |
25 |
import org.eclipse.jface.dialogs.IDialogConstants; |
17 |
import org.eclipse.jface.dialogs.MessageDialog; |
26 |
import org.eclipse.jface.dialogs.TrayDialog; |
|
|
27 |
import org.eclipse.jface.preference.IPreferenceStore; |
28 |
import org.eclipse.jface.resource.CompositeImageDescriptor; |
29 |
import org.eclipse.jface.resource.ImageDescriptor; |
18 |
import org.eclipse.jface.window.Window; |
30 |
import org.eclipse.jface.window.Window; |
19 |
import org.eclipse.swt.SWT; |
31 |
import org.eclipse.swt.SWT; |
|
|
32 |
import org.eclipse.swt.dnd.DND; |
20 |
import org.eclipse.swt.events.SelectionEvent; |
33 |
import org.eclipse.swt.events.SelectionEvent; |
21 |
import org.eclipse.swt.events.SelectionListener; |
34 |
import org.eclipse.swt.events.SelectionListener; |
|
|
35 |
import org.eclipse.swt.graphics.Image; |
36 |
import org.eclipse.swt.graphics.Point; |
22 |
import org.eclipse.swt.layout.GridData; |
37 |
import org.eclipse.swt.layout.GridData; |
23 |
import org.eclipse.swt.layout.GridLayout; |
38 |
import org.eclipse.swt.layout.GridLayout; |
24 |
import org.eclipse.swt.widgets.Button; |
39 |
import org.eclipse.swt.widgets.Button; |
Lines 27-62
Link Here
|
27 |
import org.eclipse.swt.widgets.Control; |
42 |
import org.eclipse.swt.widgets.Control; |
28 |
import org.eclipse.swt.widgets.Label; |
43 |
import org.eclipse.swt.widgets.Label; |
29 |
import org.eclipse.swt.widgets.Shell; |
44 |
import org.eclipse.swt.widgets.Shell; |
|
|
45 |
import org.eclipse.ui.ISharedImages; |
46 |
import org.eclipse.ui.PlatformUI; |
30 |
import org.eclipse.ui.internal.ide.IDEInternalPreferences; |
47 |
import org.eclipse.ui.internal.ide.IDEInternalPreferences; |
31 |
import org.eclipse.ui.internal.ide.IDEWorkbenchMessages; |
48 |
import org.eclipse.ui.internal.ide.IDEWorkbenchMessages; |
32 |
import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin; |
49 |
import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin; |
|
|
50 |
import org.eclipse.ui.internal.ide.IIDEHelpContextIds; |
51 |
import org.eclipse.ui.internal.ide.misc.OverlayIcon; |
52 |
import org.eclipse.ui.plugin.AbstractUIPlugin; |
33 |
|
53 |
|
34 |
/** |
54 |
/** |
|
|
55 |
* Dialog to customize how files and resources are created in a project hierarchy |
35 |
* @since 3.6 |
56 |
* @since 3.6 |
36 |
* |
57 |
* |
37 |
*/ |
58 |
*/ |
38 |
public class ImportTypeDialog extends MessageDialog implements SelectionListener { |
59 |
public class ImportTypeDialog extends TrayDialog implements SelectionListener { |
|
|
60 |
|
61 |
/** |
62 |
* Do not perform an import operation |
63 |
*/ |
64 |
public final static int IMPORT_NONE = 0; |
65 |
/** |
66 |
* Copy the files and folders to the destination |
67 |
*/ |
68 |
public final static int IMPORT_COPY = 1; |
69 |
/** |
70 |
* Recreate the file and folder hierarchy using groups and links |
71 |
*/ |
72 |
public final static int IMPORT_VIRTUAL_FOLDERS_AND_LINKS = 2; |
73 |
/** |
74 |
* Create linked resources for each file and folder |
75 |
*/ |
76 |
public final static int IMPORT_LINK = 4; |
77 |
/** |
78 |
* Move the files and folders to the destination |
79 |
*/ |
80 |
public final static int IMPORT_MOVE = 8; |
81 |
/** |
82 |
* Import only files |
83 |
*/ |
84 |
public final static int IMPORT_FILES_ONLY = 16; |
85 |
|
86 |
/** |
87 |
* @param shell |
88 |
* @param dropOperation |
89 |
* @param names |
90 |
* @param target |
91 |
*/ |
92 |
public ImportTypeDialog(Shell shell, int dropOperation, String[] names, IContainer target) { |
93 |
this(shell, selectAppropriateMask(dropOperation, names, target), getPreferredVariable(names, target), target.isVirtual()); |
94 |
} |
95 |
|
96 |
|
97 |
/** |
98 |
* @param shell |
99 |
* @param dropOperation |
100 |
* @param sources |
101 |
* @param target |
102 |
*/ |
103 |
public ImportTypeDialog(Shell shell, int dropOperation, |
104 |
IResource[] sources, IContainer target) { |
105 |
this(shell, selectAppropriateMask(dropOperation, sources, target), getPreferredVariable(sources, target), target.isVirtual()); |
106 |
} |
107 |
|
108 |
/** |
109 |
* @param names |
110 |
* @param target |
111 |
* @return the most appropriate path variable given the context |
112 |
*/ |
113 |
private static String getPreferredVariable(String[] names, |
114 |
IContainer target) { |
115 |
IPath[] paths = new IPath[names.length]; |
116 |
for (int i = 0; i < names.length; i++) { |
117 |
paths[i] = Path.fromOSString(names[i]); |
118 |
} |
119 |
return getPreferredVariable(paths, target); |
120 |
} |
121 |
/** |
122 |
* @param sources |
123 |
* @param target |
124 |
* @return the most appropriate path variable given the context |
125 |
*/ |
126 |
private static String getPreferredVariable(IResource[] sources, |
127 |
IContainer target) { |
128 |
IPath[] paths = new IPath[sources.length]; |
129 |
for (int i = 0; i < sources.length; i++) { |
130 |
paths[i] = sources[i].getLocation(); |
131 |
} |
132 |
return getPreferredVariable(paths, target); |
133 |
} |
134 |
|
135 |
/** |
136 |
* Find the most appropriate path variable for a set of paths. |
137 |
* The first thing is to find a common root for all the paths. |
138 |
* So for the following paths: |
139 |
* c:\foo\path\bar\dir1\file1.txt |
140 |
* c:\foo\path\bar\dir2\file2.txt |
141 |
* The following root will be selected: |
142 |
* c:\foo\path\bar\ |
143 |
* Then, given all the path variable locations, the variable |
144 |
* who's distance (in segments) from the common root in the smallest |
145 |
* will be chosen. |
146 |
* A priority is given as to variables enclosing the root, as others |
147 |
* only being enclosed by the root. |
148 |
* |
149 |
* So if there's two variables, being |
150 |
* FOO - c:\foo\ |
151 |
* DIR1 - c:\foo\path\bar\dir1 |
152 |
* And the common root is: |
153 |
* c:\foo\path\bar |
154 |
* FOO will be selected over DIR1, even through the distance between |
155 |
* the common root and DIR1 is (1), and the distance between the |
156 |
* common root and FOO is (2). This is because selecting DIR1 would |
157 |
* cause the location to be relative to its parent. |
158 |
* @param paths |
159 |
* @param target |
160 |
* @return the most appropriate path variable given the context |
161 |
*/ |
162 |
private static String getPreferredVariable(IPath[] paths, |
163 |
IContainer target) { |
164 |
IPath commonRoot = null; |
165 |
for (int i = 0; i < paths.length; i++) { |
166 |
if (paths[i] != null) { |
167 |
if (commonRoot == null) |
168 |
commonRoot = paths[i]; |
169 |
else { |
170 |
int count = commonRoot.matchingFirstSegments(paths[i]); |
171 |
int remainingSegments = commonRoot.segmentCount() - count; |
172 |
if (remainingSegments <= 0) |
173 |
return null; |
174 |
commonRoot = commonRoot.removeLastSegments(remainingSegments); |
175 |
} |
176 |
} |
177 |
} |
178 |
|
179 |
String mostAppropriate = null; |
180 |
String mostAppropriateToParent = null; |
181 |
int mostAppropriateCount = Integer.MAX_VALUE; |
182 |
int mostAppropriateCountToParent = Integer.MAX_VALUE; |
183 |
IPathVariableManager pathVariableManager = target.getProject().getPathVariableManager(); |
184 |
String [] variables = pathVariableManager.getPathVariableNames(target); |
185 |
|
186 |
for (int i = 0; i < variables.length; i++) { |
187 |
IPathVariable var = pathVariableManager.getPathVariable(variables[i], target); |
188 |
if (var.isPreferred()) { |
189 |
URI value = pathVariableManager.getValue(variables[i], target); |
190 |
if (value != null) { |
191 |
IPath path = URIUtil.toPath(value); |
192 |
if (path != null) { |
193 |
int difference = path.matchingFirstSegments(commonRoot); |
194 |
if (difference > 0) { |
195 |
if (difference < mostAppropriateCount) { |
196 |
mostAppropriateCount = difference; |
197 |
mostAppropriate = variables[i]; |
198 |
} |
199 |
} |
200 |
else { |
201 |
// calculate if commonRoot could be relative to the parent of path |
202 |
difference = commonRoot.matchingFirstSegments(path); |
203 |
if (difference > 0) { |
204 |
if (difference < mostAppropriateCountToParent) { |
205 |
mostAppropriateCountToParent = difference; |
206 |
mostAppropriateToParent = variables[i]; |
207 |
} |
208 |
} |
209 |
} |
210 |
} |
211 |
} |
212 |
} |
213 |
} |
214 |
|
215 |
if (mostAppropriate == null) { |
216 |
if (mostAppropriateToParent == null) |
217 |
return "PROJECT_LOC"; //$NON-NLS-1$ |
218 |
return mostAppropriateToParent; |
219 |
} |
220 |
return mostAppropriate; |
221 |
} |
222 |
|
223 |
/** |
224 |
* @param dropOperation |
225 |
* @param names |
226 |
* @param target |
227 |
* @return the appropriate import mask given the files dropped on the target |
228 |
*/ |
229 |
private static int selectAppropriateMask(int dropOperation, String[] names, IContainer target) { |
230 |
int mask = ImportTypeDialog.IMPORT_VIRTUAL_FOLDERS_AND_LINKS | ImportTypeDialog.IMPORT_LINK; |
231 |
if (!target.isVirtual() && (dropOperation != DND.DROP_LINK)) |
232 |
mask |= ImportTypeDialog.IMPORT_COPY; |
233 |
if (areOnlyFiles(names)) |
234 |
mask |= ImportTypeDialog.IMPORT_FILES_ONLY; |
235 |
return mask; |
236 |
} |
237 |
|
238 |
/** |
239 |
* @param dropOperation |
240 |
* @param resources |
241 |
* @param target |
242 |
* @return the appropriate import mask given the files dropped on the target |
243 |
*/ |
244 |
private static int selectAppropriateMask(int dropOperation, IResource[] resources, IContainer target) { |
245 |
int mask = ImportTypeDialog.IMPORT_VIRTUAL_FOLDERS_AND_LINKS | ImportTypeDialog.IMPORT_LINK; |
246 |
if (!target.isVirtual() && (dropOperation != DND.DROP_LINK)) |
247 |
mask |= ImportTypeDialog.IMPORT_COPY; |
248 |
if (areOnlyFiles(resources)) |
249 |
mask |= ImportTypeDialog.IMPORT_FILES_ONLY; |
250 |
return mask; |
251 |
} |
252 |
|
253 |
private static boolean areOnlyFiles(String[] names) { |
254 |
for (int i = 0; i < names.length; i++) { |
255 |
File file = new File(names[i]); |
256 |
if (file.exists() && !file.isFile()) |
257 |
return false; |
258 |
} |
259 |
return true; |
260 |
} |
261 |
|
262 |
private static boolean areOnlyFiles(IResource[] resources) { |
263 |
for (int i = 0; i < resources.length; i++) { |
264 |
if (resources[i].getType() != IResource.FILE) |
265 |
return false; |
266 |
} |
267 |
return true; |
268 |
} |
269 |
|
270 |
private Image fileImage; |
271 |
private Image linkedFileImage; |
272 |
private Image folderAndFileImage; |
273 |
private Image virtualFolderAndFileImage; |
274 |
private Image linkedFolderAndFileImage; |
275 |
private int operationMask; |
276 |
private int currentSelection; |
277 |
private Button copyButton = null; |
278 |
private Button shadowCopyButton = null; |
279 |
private Button linkButton = null; |
280 |
private Button moveButton = null; |
281 |
private Combo variableCombo = null; |
282 |
private Button alwaysPerformThisOperation = null; |
283 |
private Button variableCheckbox = null; |
284 |
private String variable = null; |
285 |
private IResource receivingResource = null; |
286 |
private boolean targetIsVirtual; |
287 |
private String preferredVariable; |
39 |
|
288 |
|
40 |
/** |
289 |
/** |
41 |
* @param parentShell |
290 |
* @param parentShell |
42 |
* @param operationMask |
291 |
* @param operationMask |
43 |
*/ |
292 |
*/ |
44 |
public ImportTypeDialog(Shell parentShell, int operationMask) { |
293 |
private ImportTypeDialog(Shell parentShell, int operationMask, String preferredVariable, boolean targetIsVirtual) { |
45 |
super(parentShell, IDEWorkbenchMessages.ImportTypeDialog_title, null, IDEWorkbenchMessages.ImportTypeDialog_question, |
294 |
super(parentShell); |
46 |
MessageDialog.QUESTION, new String[] {IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL}, 0); |
|
|
47 |
|
295 |
|
|
|
296 |
this.preferredVariable = preferredVariable; |
48 |
this.operationMask = operationMask; |
297 |
this.operationMask = operationMask; |
|
|
298 |
this.targetIsVirtual = targetIsVirtual; |
49 |
currentSelection = 0; |
299 |
currentSelection = 0; |
50 |
String tmp = readContextPreference(IDEInternalPreferences.IMPORT_FILES_AND_FOLDERS_TYPE); |
300 |
String tmp = readContextPreference(IDEInternalPreferences.IMPORT_FILES_AND_FOLDERS_TYPE); |
51 |
if (tmp.length() > 0) |
301 |
if (tmp.length() > 0) |
52 |
currentSelection = Integer.parseInt(tmp); |
302 |
currentSelection = Integer.parseInt(tmp); |
53 |
currentSelection = currentSelection & operationMask; |
303 |
currentSelection = currentSelection & operationMask; |
54 |
if (currentSelection == 0) { |
304 |
if (currentSelection == 0) { |
55 |
if ((operationMask & IMPORT_COPY) != 0) |
305 |
if (hasFlag(IMPORT_COPY)) |
56 |
currentSelection = IMPORT_COPY; |
306 |
currentSelection = IMPORT_COPY; |
57 |
else |
307 |
else |
58 |
currentSelection = IMPORT_MOVE; |
308 |
currentSelection = IMPORT_MOVE; |
59 |
} |
309 |
} |
|
|
310 |
ImageDescriptor fileDescriptor = PlatformUI.getWorkbench().getSharedImages().getImageDescriptor( |
311 |
ISharedImages.IMG_OBJ_FILE); |
312 |
ImageDescriptor folderDescriptor = PlatformUI.getWorkbench().getSharedImages().getImageDescriptor( |
313 |
ISharedImages.IMG_OBJ_FOLDER); |
314 |
|
315 |
ImageDescriptor[][] linkedResourceOverlayMap = new ImageDescriptor[4][1]; |
316 |
linkedResourceOverlayMap[1]= new ImageDescriptor[] {AbstractUIPlugin.imageDescriptorFromPlugin( |
317 |
IDEWorkbenchPlugin.IDE_WORKBENCH, |
318 |
"$nl$/icons/full/ovr16/link_ovr.gif")}; //$NON-NLS-1$ |
319 |
|
320 |
CompositeImageDescriptor linkedFileDescriptor = new OverlayIcon(fileDescriptor, linkedResourceOverlayMap, new Point(16, 16)); |
321 |
|
322 |
CompositeImageDescriptor linkedFolderDescriptor = new OverlayIcon(folderDescriptor, linkedResourceOverlayMap, new Point(16, 16)); |
323 |
|
324 |
ImageDescriptor[][] virtualFolderOverlayMap = new ImageDescriptor[4][1]; |
325 |
virtualFolderOverlayMap[1]= new ImageDescriptor[] {AbstractUIPlugin.imageDescriptorFromPlugin( |
326 |
IDEWorkbenchPlugin.IDE_WORKBENCH, |
327 |
"$nl$/icons/full/ovr16/virt_ovr.gif")}; //$NON-NLS-1$ |
328 |
CompositeImageDescriptor virtualFolderDescriptor = new OverlayIcon(folderDescriptor, virtualFolderOverlayMap, new Point(16, 16)); |
329 |
|
330 |
fileImage = fileDescriptor.createImage(); |
331 |
|
332 |
linkedFileImage = linkedFileDescriptor.createImage(); |
333 |
|
334 |
CompositeImageDescriptor desc = new AlignedCompositeImageDescriptor(fileDescriptor, folderDescriptor); |
335 |
folderAndFileImage = desc.createImage(); |
336 |
|
337 |
desc = new AlignedCompositeImageDescriptor(linkedFileDescriptor, virtualFolderDescriptor); |
338 |
virtualFolderAndFileImage = desc.createImage(); |
339 |
|
340 |
desc = new AlignedCompositeImageDescriptor(linkedFileDescriptor, linkedFolderDescriptor); |
341 |
linkedFolderAndFileImage = desc.createImage(); |
342 |
|
343 |
if (Boolean.valueOf(readContextPreference(IDEInternalPreferences.IMPORT_FILES_AND_FOLDERS_RELATIVE)).booleanValue()) |
344 |
variable = preferredVariable; |
345 |
} |
346 |
|
347 |
class AlignedCompositeImageDescriptor extends CompositeImageDescriptor { |
348 |
|
349 |
ImageDescriptor first, second; |
350 |
|
351 |
private int SPACE = 4; |
352 |
AlignedCompositeImageDescriptor(ImageDescriptor first, ImageDescriptor second) { |
353 |
this.first = first; |
354 |
this.second = second; |
355 |
} |
356 |
/* (non-Javadoc) |
357 |
* @see org.eclipse.jface.resource.CompositeImageDescriptor#drawCompositeImage(int, int) |
358 |
*/ |
359 |
protected void drawCompositeImage(int width, int height) { |
360 |
drawImage(first.getImageData(), 0, 0); |
361 |
drawImage(second.getImageData(), first.getImageData().width + SPACE, 0); |
362 |
} |
363 |
|
364 |
/* (non-Javadoc) |
365 |
* @see org.eclipse.jface.resource.CompositeImageDescriptor#getSize() |
366 |
*/ |
367 |
protected Point getSize() { |
368 |
return new Point(first.getImageData().width + second.getImageData().width + SPACE, |
369 |
Math.max(first.getImageData().height, second.getImageData().height)); |
370 |
} |
371 |
|
372 |
} |
373 |
|
374 |
/* (non-Javadoc) |
375 |
* @see org.eclipse.jface.dialogs.TrayDialog#close() |
376 |
*/ |
377 |
public boolean close() { |
378 |
fileImage.dispose(); |
379 |
linkedFileImage.dispose(); |
380 |
folderAndFileImage.dispose(); |
381 |
virtualFolderAndFileImage.dispose(); |
382 |
linkedFolderAndFileImage.dispose(); |
383 |
return super.close(); |
60 |
} |
384 |
} |
61 |
|
385 |
|
62 |
// the format of the context is operationMask,value:operationMask,value:operationMask,value |
386 |
// the format of the context is operationMask,value:operationMask,value:operationMask,value |
Lines 101-143
Link Here
|
101 |
} |
425 |
} |
102 |
|
426 |
|
103 |
/** |
427 |
/** |
104 |
* Generate linked resources relative to their preferred variable (typically the PROJECT_LOC variable) |
|
|
105 |
*/ |
106 |
public static final String AUTOMATIC = "PROJECT_LOC"; //$NON-NLS-1$ |
107 |
/** |
108 |
* Generate linked resources with absolute path locations. |
109 |
*/ |
110 |
public static final String ABSOLUTE_PATH = "default"; //$NON-NLS-1$ |
111 |
|
112 |
/** |
113 |
* @return The currently selected variable, or AUTOMATIC or ABSOLUTE_PATH |
428 |
* @return The currently selected variable, or AUTOMATIC or ABSOLUTE_PATH |
114 |
*/ |
429 |
*/ |
115 |
public String getVariable() { |
430 |
public String getVariable() { |
116 |
if (variable == ABSOLUTE_PATH) |
|
|
117 |
return null; |
118 |
return variable; |
431 |
return variable; |
119 |
} |
432 |
} |
120 |
|
433 |
|
121 |
/** |
|
|
122 |
* Copy the files and folders to the destination |
123 |
*/ |
124 |
public final static int IMPORT_COPY = 1; |
125 |
/** |
126 |
* Recreate the file and folder hierarchy using groups and links |
127 |
*/ |
128 |
public final static int IMPORT_GROUPS_AND_LINKS = 2; |
129 |
/** |
130 |
* Create linked resources for each file and folder |
131 |
*/ |
132 |
public final static int IMPORT_LINK = 4; |
133 |
/** |
134 |
* Move the files and folders to the destination |
135 |
*/ |
136 |
public final static int IMPORT_MOVE = 8; |
137 |
/** |
138 |
* Do not perform an import operation |
139 |
*/ |
140 |
public final static int IMPORT_NONE = 0; |
141 |
|
434 |
|
142 |
/** |
435 |
/** |
143 |
* @return The current selection (one of IMPORT_COPY, IMPORT_GROUPS_AND_LINKS, IMPORT_LINK and IMPORT_MOVE) |
436 |
* @return The current selection (one of IMPORT_COPY, IMPORT_GROUPS_AND_LINKS, IMPORT_LINK and IMPORT_MOVE) |
Lines 146-234
Link Here
|
146 |
return currentSelection; |
439 |
return currentSelection; |
147 |
} |
440 |
} |
148 |
|
441 |
|
149 |
private int operationMask; |
|
|
150 |
private int currentSelection; |
151 |
private Button copyButton = null; |
152 |
private Button shadowCopyButton = null; |
153 |
private Button linkButton = null; |
154 |
private Button moveButton = null; |
155 |
private Combo variableCombo = null; |
156 |
private Button alwaysPerformThisOperation = null; |
157 |
private Label variableLabel = null; |
158 |
private String variable = ABSOLUTE_PATH; |
159 |
private IResource receivingResource = null; |
160 |
|
161 |
/* (non-Javadoc) |
442 |
/* (non-Javadoc) |
162 |
* @see org.eclipse.jface.dialogs.MessageDialog#open() |
443 |
* @see org.eclipse.jface.dialogs.MessageDialog#open() |
163 |
*/ |
444 |
*/ |
164 |
public int open() { |
445 |
public int open() { |
165 |
String showDialogMap = readContextPreference(IDEInternalPreferences.IMPORT_FILES_AND_FOLDERS_SHOW_DIALOG); |
446 |
IPreferenceStore store = IDEWorkbenchPlugin.getDefault().getPreferenceStore(); |
166 |
if (showDialogMap.length() == 0 || !Boolean.valueOf(showDialogMap).booleanValue()) |
447 |
|
|
|
448 |
String mode = store.getString(targetIsVirtual? IDEInternalPreferences.IMPORT_FILES_AND_FOLDERS_VIRTUAL_FOLDER_MODE:IDEInternalPreferences.IMPORT_FILES_AND_FOLDERS_MODE); |
449 |
|
450 |
if (mode.equals(IDEInternalPreferences.IMPORT_FILES_AND_FOLDERS_MODE_PROMPT)) |
167 |
return super.open(); |
451 |
return super.open(); |
168 |
return Window.OK; |
452 |
if (mode.equals(IDEInternalPreferences.IMPORT_FILES_AND_FOLDERS_MODE_MOVE_COPY) && hasFlag(IMPORT_COPY)) { |
|
|
453 |
this.currentSelection = IMPORT_COPY; |
454 |
return Window.OK; |
455 |
} |
456 |
if (mode.equals(IDEInternalPreferences.IMPORT_FILES_AND_FOLDERS_MODE_MOVE_COPY) && hasFlag(IMPORT_MOVE)) { |
457 |
this.currentSelection = IMPORT_MOVE; |
458 |
return Window.OK; |
459 |
} |
460 |
if (mode.equals(IDEInternalPreferences.IMPORT_FILES_AND_FOLDERS_MODE_LINK) && hasFlag(IMPORT_LINK)) { |
461 |
this.currentSelection = IMPORT_LINK; |
462 |
return Window.OK; |
463 |
} |
464 |
if (mode.equals(IDEInternalPreferences.IMPORT_FILES_AND_FOLDERS_MODE_LINK_AND_VIRTUAL_FOLDER) && hasFlag(IMPORT_VIRTUAL_FOLDERS_AND_LINKS)) { |
465 |
this.currentSelection = IMPORT_VIRTUAL_FOLDERS_AND_LINKS; |
466 |
return Window.OK; |
467 |
} |
468 |
|
469 |
return super.open(); |
169 |
} |
470 |
} |
170 |
|
471 |
|
171 |
protected Control createCustomArea(Composite parent) { |
472 |
protected void configureShell(Shell shell) { |
|
|
473 |
super.configureShell(shell); |
474 |
String title = (operationMask & IMPORT_FILES_ONLY) != 0 ? IDEWorkbenchMessages.ImportTypeDialog_titleFilesOnly: |
475 |
IDEWorkbenchMessages.ImportTypeDialog_title; |
476 |
shell.setText(title); |
477 |
PlatformUI.getWorkbench().getHelpSystem().setHelp(shell, |
478 |
IIDEHelpContextIds.IMPORT_TYPE_DIALOG); |
479 |
} |
480 |
|
481 |
protected Control createMessageArea(Composite parent) { |
172 |
Composite composite = new Composite(parent, 0); |
482 |
Composite composite = new Composite(parent, 0); |
173 |
GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true); |
483 |
GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true); |
174 |
composite.setLayoutData(gridData); |
484 |
composite.setLayoutData(gridData); |
175 |
|
485 |
|
176 |
GridLayout layout = new GridLayout(); |
486 |
|
|
|
487 |
GridLayout layout = new GridLayout(); |
177 |
layout.numColumns = 1; |
488 |
layout.numColumns = 1; |
178 |
layout.verticalSpacing = 9; |
489 |
layout.marginTop= convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN); |
179 |
layout.marginLeft = 32; |
490 |
layout.marginWidth= convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); |
180 |
layout.marginTop = 0; |
|
|
181 |
composite.setLayout(layout); |
491 |
composite.setLayout(layout); |
182 |
|
492 |
|
183 |
if ((operationMask & IMPORT_COPY) != 0) { |
493 |
String message = (operationMask & IMPORT_FILES_ONLY) != 0 ? IDEWorkbenchMessages.ImportTypeDialog_questionFilesOnly: |
|
|
494 |
IDEWorkbenchMessages.ImportTypeDialog_question; |
495 |
|
496 |
// create message |
497 |
if (message != null) { |
498 |
Label messageLabel = new Label(composite, SWT.WRAP); |
499 |
messageLabel.setText(message); |
500 |
gridData = new GridData(SWT.FILL, SWT.BEGINNING, true, false); |
501 |
messageLabel.setLayoutData(gridData); |
502 |
} |
503 |
return composite; |
504 |
} |
505 |
|
506 |
protected Control createDialogArea(Composite parent) { |
507 |
boolean linkIsOnlyChoice = hasFlag(IMPORT_LINK) && !(hasFlag(IMPORT_COPY | IMPORT_MOVE) || (hasFlag(IMPORT_VIRTUAL_FOLDERS_AND_LINKS) && !hasFlag(IMPORT_FILES_ONLY))); |
508 |
|
509 |
if (!linkIsOnlyChoice) |
510 |
createMessageArea(parent); |
511 |
Composite composite = new Composite(parent, 0); |
512 |
GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true); |
513 |
composite.setLayoutData(gridData); |
514 |
|
515 |
|
516 |
GridLayout layout = new GridLayout(); |
517 |
layout.numColumns = 1; |
518 |
layout.marginWidth= convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); |
519 |
layout.verticalSpacing= convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); |
520 |
layout.horizontalSpacing= convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); |
521 |
|
522 |
int indent= linkIsOnlyChoice ? 0: convertWidthInCharsToPixels(3); |
523 |
|
524 |
layout.marginWidth += indent; |
525 |
composite.setLayout(layout); |
526 |
|
527 |
if (hasFlag(IMPORT_COPY)) { |
184 |
copyButton = new Button(composite, SWT.RADIO); |
528 |
copyButton = new Button(composite, SWT.RADIO); |
185 |
copyButton.setText(IDEWorkbenchMessages.ImportTypeDialog_copyFilesAndDirectories); |
529 |
copyButton.setText(hasFlag(IMPORT_FILES_ONLY) ? IDEWorkbenchMessages.ImportTypeDialog_copyFiles: IDEWorkbenchMessages.ImportTypeDialog_copyFilesAndDirectories); |
186 |
gridData = new GridData(GridData.FILL_HORIZONTAL); |
530 |
gridData = new GridData(GridData.FILL_HORIZONTAL); |
187 |
copyButton.setLayoutData(gridData); |
531 |
copyButton.setLayoutData(gridData); |
188 |
copyButton.setData(new Integer(IMPORT_COPY)); |
532 |
copyButton.setData(new Integer(IMPORT_COPY)); |
189 |
copyButton.addSelectionListener(this); |
533 |
copyButton.addSelectionListener(this); |
|
|
534 |
if (hasFlag(IMPORT_VIRTUAL_FOLDERS_AND_LINKS | IMPORT_LINK)) |
535 |
copyButton.setImage(hasFlag(IMPORT_FILES_ONLY) ? fileImage:folderAndFileImage); |
190 |
} |
536 |
} |
191 |
|
537 |
|
192 |
if ((operationMask & IMPORT_MOVE) != 0) { |
538 |
if (hasFlag(IMPORT_MOVE)) { |
193 |
moveButton = new Button(composite, SWT.RADIO); |
539 |
moveButton = new Button(composite, SWT.RADIO); |
194 |
moveButton.setText(IDEWorkbenchMessages.ImportTypeDialog_moveFilesAndDirectories); |
540 |
moveButton.setText(hasFlag(IMPORT_FILES_ONLY) ? IDEWorkbenchMessages.ImportTypeDialog_moveFiles:IDEWorkbenchMessages.ImportTypeDialog_moveFilesAndDirectories); |
195 |
gridData = new GridData(GridData.FILL_HORIZONTAL); |
541 |
gridData = new GridData(GridData.FILL_HORIZONTAL); |
196 |
moveButton.setLayoutData(gridData); |
542 |
moveButton.setLayoutData(gridData); |
197 |
moveButton.setData(new Integer(IMPORT_MOVE)); |
543 |
moveButton.setData(new Integer(IMPORT_MOVE)); |
198 |
moveButton.addSelectionListener(this); |
544 |
moveButton.addSelectionListener(this); |
199 |
} |
545 |
} |
200 |
|
546 |
|
201 |
if ((operationMask & IMPORT_GROUPS_AND_LINKS) != 0) { |
547 |
if (hasFlag(IMPORT_LINK) && !linkIsOnlyChoice) { |
202 |
shadowCopyButton = new Button(composite, SWT.RADIO); |
|
|
203 |
shadowCopyButton.setText(IDEWorkbenchMessages.ImportTypeDialog_recreateFilesAndDirectories); |
204 |
gridData = new GridData(GridData.FILL_HORIZONTAL); |
205 |
shadowCopyButton.setLayoutData(gridData); |
206 |
shadowCopyButton.setData(new Integer(IMPORT_GROUPS_AND_LINKS)); |
207 |
shadowCopyButton.addSelectionListener(this); |
208 |
} |
209 |
if ((operationMask & IMPORT_LINK) != 0) { |
210 |
linkButton = new Button(composite, SWT.RADIO); |
548 |
linkButton = new Button(composite, SWT.RADIO); |
211 |
linkButton.setText(IDEWorkbenchMessages.ImportTypeDialog_createLinks); |
549 |
linkButton.setText(hasFlag(IMPORT_FILES_ONLY) ? IDEWorkbenchMessages.ImportTypeDialog_linkFiles:IDEWorkbenchMessages.ImportTypeDialog_createLinks); |
212 |
gridData = new GridData(GridData.FILL_HORIZONTAL); |
550 |
gridData = new GridData(GridData.FILL_HORIZONTAL); |
213 |
linkButton.setLayoutData(gridData); |
551 |
linkButton.setLayoutData(gridData); |
214 |
linkButton.setData(new Integer(IMPORT_LINK)); |
552 |
linkButton.setData(new Integer(IMPORT_LINK)); |
215 |
linkButton.addSelectionListener(this); |
553 |
linkButton.addSelectionListener(this); |
|
|
554 |
linkButton.setImage(hasFlag(IMPORT_FILES_ONLY) ? linkedFileImage:linkedFolderAndFileImage); |
216 |
} |
555 |
} |
217 |
|
556 |
|
218 |
if ((operationMask & (IMPORT_GROUPS_AND_LINKS | IMPORT_LINK)) != 0) { |
557 |
if (hasFlag(IMPORT_VIRTUAL_FOLDERS_AND_LINKS) && !hasFlag(IMPORT_FILES_ONLY)) { |
|
|
558 |
shadowCopyButton = new Button(composite, SWT.RADIO); |
559 |
shadowCopyButton.setText(IDEWorkbenchMessages.ImportTypeDialog_recreateFilesAndDirectories); |
560 |
gridData = new GridData(GridData.FILL_HORIZONTAL); |
561 |
shadowCopyButton.setLayoutData(gridData); |
562 |
shadowCopyButton.setData(new Integer(IMPORT_VIRTUAL_FOLDERS_AND_LINKS)); |
563 |
shadowCopyButton.addSelectionListener(this); |
564 |
shadowCopyButton.setImage(virtualFolderAndFileImage); |
565 |
} |
566 |
|
567 |
if (hasFlag(IMPORT_VIRTUAL_FOLDERS_AND_LINKS | IMPORT_LINK)) { |
219 |
Composite variableGroup = new Composite(composite, 0); |
568 |
Composite variableGroup = new Composite(composite, 0); |
220 |
gridData = new GridData(SWT.FILL, SWT.FILL, true, true); |
569 |
gridData = new GridData(SWT.FILL, SWT.FILL, true, true); |
221 |
variableGroup.setLayoutData(gridData); |
570 |
variableGroup.setLayoutData(gridData); |
222 |
|
571 |
|
223 |
layout = new GridLayout(); |
572 |
layout = new GridLayout(); |
224 |
layout.numColumns = 2; |
573 |
layout.numColumns = 2; |
225 |
layout.verticalSpacing = 9; |
574 |
layout.marginWidth= 0; |
226 |
variableGroup.setLayout(layout); |
575 |
variableGroup.setLayout(layout); |
227 |
|
576 |
|
228 |
variableLabel = new Label(variableGroup, 0); |
577 |
variableCheckbox = new Button(variableGroup, SWT.CHECK); |
229 |
variableLabel.setText(IDEWorkbenchMessages.ImportTypeDialog_importElementsAs); |
578 |
variableCheckbox.setText(IDEWorkbenchMessages.ImportTypeDialog_importElementsAs); |
|
|
579 |
variableCheckbox.setToolTipText(IDEWorkbenchMessages.ImportTypeDialog_importElementsAsTooltip); |
230 |
gridData = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING); |
580 |
gridData = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING); |
231 |
variableLabel.setLayoutData(gridData); |
581 |
variableCheckbox.setLayoutData(gridData); |
|
|
582 |
variableCheckbox.addSelectionListener(new SelectionListener() { |
583 |
public void widgetSelected(SelectionEvent e) { |
584 |
selectRelativeCombo(); |
585 |
} |
586 |
public void widgetDefaultSelected(SelectionEvent e) { |
587 |
selectRelativeCombo(); |
588 |
} |
589 |
private void selectRelativeCombo() { |
590 |
if (variableCheckbox.getSelection()) { |
591 |
variableCombo.setEnabled(true); |
592 |
selectVariable(variableCombo.getItem(variableCombo.getSelectionIndex())); |
593 |
} |
594 |
else { |
595 |
variableCombo.setEnabled(false); |
596 |
variable = null; |
597 |
} |
598 |
|
599 |
} |
600 |
}); |
232 |
|
601 |
|
233 |
variableCombo = new Combo(variableGroup, SWT.DROP_DOWN | SWT.READ_ONLY); |
602 |
variableCombo = new Combo(variableGroup, SWT.DROP_DOWN | SWT.READ_ONLY); |
234 |
gridData = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING); // GridData.FILL_HORIZONTAL); |
603 |
gridData = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING); // GridData.FILL_HORIZONTAL); |
Lines 248-331
Link Here
|
248 |
} |
617 |
} |
249 |
}); |
618 |
}); |
250 |
setupVariableContent(); |
619 |
setupVariableContent(); |
251 |
selectVariable(readContextPreference(IDEInternalPreferences.IMPORT_FILES_AND_FOLDERS_VARIABLE)); |
620 |
variableCheckbox.setSelection(variable != null); |
|
|
621 |
if (variable != null) |
622 |
selectVariable(variable); |
623 |
else |
624 |
selectVariable(preferredVariable); |
252 |
} |
625 |
} |
253 |
|
626 |
|
254 |
alwaysPerformThisOperation = new Button(composite, SWT.CHECK); |
627 |
if (linkIsOnlyChoice) { |
255 |
alwaysPerformThisOperation.setText(IDEWorkbenchMessages.ImportTypeDialog_alwaysPerformThisOperation); |
628 |
currentSelection = IMPORT_LINK; |
|
|
629 |
parent.getShell().setText(IDEWorkbenchMessages.ImportTypeDialog_titleFilesLinking); |
630 |
} |
631 |
alwaysPerformThisOperation = new Button(parent, SWT.CHECK); |
632 |
alwaysPerformThisOperation.setText(linkIsOnlyChoice? IDEWorkbenchMessages.ImportTypeDialog_alwaysUseLocationWhenLinkingFiles: IDEWorkbenchMessages.ImportTypeDialog_alwaysPerformThisOperation); |
256 |
gridData = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING); |
633 |
gridData = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING); |
|
|
634 |
gridData.horizontalIndent = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); |
257 |
alwaysPerformThisOperation.setLayoutData(gridData); |
635 |
alwaysPerformThisOperation.setLayoutData(gridData); |
258 |
|
636 |
|
259 |
refreshSelection(); |
637 |
refreshSelection(); |
260 |
return composite; |
638 |
return composite; |
261 |
} |
639 |
} |
|
|
640 |
|
641 |
private boolean hasFlag(int flag) { |
642 |
return (operationMask & flag) != 0; |
643 |
} |
262 |
|
644 |
|
263 |
private void editVariables() { |
645 |
private void editVariables() { |
|
|
646 |
String selectedItem = variable; |
264 |
PathVariableEditDialog dialog = new PathVariableEditDialog(getShell()); |
647 |
PathVariableEditDialog dialog = new PathVariableEditDialog(getShell()); |
265 |
dialog.setResource(receivingResource); |
648 |
dialog.setResource(receivingResource); |
266 |
if (dialog.open() == IDialogConstants.OK_ID) { |
649 |
if (dialog.open() == IDialogConstants.OK_ID) { |
267 |
String[] variableNames = (String[]) dialog.getResult(); |
650 |
String[] variableNames = (String[]) dialog.getResult(); |
268 |
if (variableNames != null && variableNames.length >= 1) { |
651 |
if (variableNames != null && variableNames.length >= 1) { |
269 |
variable = variableNames[0]; |
652 |
selectedItem = variableNames[0]; |
270 |
} |
653 |
} |
271 |
} |
654 |
} |
272 |
setupVariableContent(); |
655 |
setupVariableContent(); |
273 |
selectVariable(variable); |
656 |
if (selectedItem != null) { |
|
|
657 |
selectVariable(selectedItem); |
658 |
} |
274 |
} |
659 |
} |
275 |
|
660 |
|
276 |
private void selectVariable(String var) { |
661 |
private void selectVariable(String var) { |
277 |
if (var.equals(IDEWorkbenchMessages.ImportTypeDialog_automatic) || var.equals(AUTOMATIC)) { |
662 |
String[] items = variableCombo.getItems(); |
278 |
variableCombo.select(0); |
663 |
for (int i = 0; i < items.length; i++) { |
279 |
variable = var; |
664 |
if (var.equals(items[i])) { |
280 |
} |
665 |
variableCombo.select(i); |
281 |
else |
666 |
variable = items[i]; |
282 |
if (var.equals(IDEWorkbenchMessages.ImportTypeDialog_absolutePath) || var.equals(ABSOLUTE_PATH)) { |
667 |
return; |
283 |
variableCombo.select(1); |
|
|
284 |
variable = var; |
285 |
} |
286 |
else { |
287 |
String[] items = variableCombo.getItems(); |
288 |
for (int i = 0; i < items.length; i++) { |
289 |
if (var.equals(items[i])) { |
290 |
variableCombo.select(i); |
291 |
if (i == 0) |
292 |
variable = AUTOMATIC; |
293 |
else |
294 |
if (i == 1) |
295 |
variable = ABSOLUTE_PATH; |
296 |
else |
297 |
variable = items[i]; |
298 |
return; |
299 |
} |
300 |
} |
668 |
} |
301 |
variableCombo.select(0); |
|
|
302 |
variable = AUTOMATIC; |
303 |
} |
669 |
} |
|
|
670 |
variableCombo.select(0); |
671 |
variable = items[0]; |
304 |
} |
672 |
} |
|
|
673 |
|
305 |
private void setupVariableContent() { |
674 |
private void setupVariableContent() { |
306 |
String[] items; |
|
|
307 |
IPathVariableManager pathVariableManager; |
675 |
IPathVariableManager pathVariableManager; |
308 |
if (receivingResource != null) |
676 |
if (receivingResource != null) |
309 |
pathVariableManager = receivingResource.getProject().getPathVariableManager(); |
677 |
pathVariableManager = receivingResource.getProject().getPathVariableManager(); |
310 |
else |
678 |
else |
311 |
pathVariableManager = ResourcesPlugin.getWorkspace().getPathVariableManager(); |
679 |
pathVariableManager = ResourcesPlugin.getWorkspace().getPathVariableManager(); |
312 |
String[] variables = pathVariableManager.getPathVariableNames(); |
680 |
String[] variables = pathVariableManager.getPathVariableNames(receivingResource); |
313 |
items = new String[variables.length + 3]; |
681 |
|
314 |
items[0] = IDEWorkbenchMessages.ImportTypeDialog_automatic; |
682 |
ArrayList items = new ArrayList(); |
315 |
items[1] = IDEWorkbenchMessages.ImportTypeDialog_absolutePath; |
683 |
for (int i = 0; i < variables.length; i++) { |
316 |
for (int i = 0; i < variables.length; i++) |
684 |
if (variables[i].equals("PARENT")) //$NON-NLS-1$ |
317 |
items[i + 2] = variables[i]; |
685 |
continue; |
318 |
items[items.length - 1] = IDEWorkbenchMessages.ImportTypeDialog_editVariables; |
686 |
items.add(variables[i]); |
319 |
variableCombo.setItems(items); |
687 |
} |
|
|
688 |
items.add(IDEWorkbenchMessages.ImportTypeDialog_editVariables); |
689 |
variableCombo.setItems((String[]) items.toArray(new String[0])); |
320 |
super.getShell().layout(true); |
690 |
super.getShell().layout(true); |
321 |
} |
691 |
} |
322 |
|
692 |
|
323 |
protected void buttonPressed(int buttonId) { |
693 |
protected void buttonPressed(int buttonId) { |
324 |
if (buttonId == IDialogConstants.OK_ID) { |
694 |
if (buttonId == IDialogConstants.OK_ID) { |
325 |
writeContextPreference(IDEInternalPreferences.IMPORT_FILES_AND_FOLDERS_TYPE, Integer.toString(currentSelection)); |
695 |
writeContextPreference(IDEInternalPreferences.IMPORT_FILES_AND_FOLDERS_TYPE, Integer.toString(currentSelection)); |
326 |
String storageVariable = currentSelection == 0? AUTOMATIC: (currentSelection == 1 ? ABSOLUTE_PATH:variable); |
696 |
writeContextPreference(IDEInternalPreferences.IMPORT_FILES_AND_FOLDERS_RELATIVE, Boolean.toString(variable != null)); |
327 |
writeContextPreference(IDEInternalPreferences.IMPORT_FILES_AND_FOLDERS_VARIABLE, storageVariable); |
697 |
|
328 |
writeContextPreference(IDEInternalPreferences.IMPORT_FILES_AND_FOLDERS_SHOW_DIALOG, Boolean.toString(alwaysPerformThisOperation.getSelection())); |
698 |
IPreferenceStore store = IDEWorkbenchPlugin.getDefault().getPreferenceStore(); |
|
|
699 |
if (alwaysPerformThisOperation.getSelection()) { |
700 |
String mode = IDEInternalPreferences.IMPORT_FILES_AND_FOLDERS_MODE_PROMPT; |
701 |
switch(currentSelection) { |
702 |
case IMPORT_COPY: |
703 |
case IMPORT_MOVE: |
704 |
mode = IDEInternalPreferences.IMPORT_FILES_AND_FOLDERS_MODE_MOVE_COPY; |
705 |
break; |
706 |
case IMPORT_LINK: |
707 |
mode = IDEInternalPreferences.IMPORT_FILES_AND_FOLDERS_MODE_LINK; |
708 |
break; |
709 |
case IMPORT_VIRTUAL_FOLDERS_AND_LINKS: |
710 |
mode = IDEInternalPreferences.IMPORT_FILES_AND_FOLDERS_MODE_LINK_AND_VIRTUAL_FOLDER; |
711 |
break; |
712 |
} |
713 |
store.putValue(targetIsVirtual? IDEInternalPreferences.IMPORT_FILES_AND_FOLDERS_VIRTUAL_FOLDER_MODE:IDEInternalPreferences.IMPORT_FILES_AND_FOLDERS_MODE, mode); |
714 |
} |
329 |
} |
715 |
} |
330 |
super.buttonPressed(buttonId); |
716 |
super.buttonPressed(buttonId); |
331 |
} |
717 |
} |
Lines 344-358
Link Here
|
344 |
if (copyButton != null) |
730 |
if (copyButton != null) |
345 |
copyButton.setSelection(currentSelection == IMPORT_COPY); |
731 |
copyButton.setSelection(currentSelection == IMPORT_COPY); |
346 |
if (shadowCopyButton != null) |
732 |
if (shadowCopyButton != null) |
347 |
shadowCopyButton.setSelection(currentSelection == IMPORT_GROUPS_AND_LINKS); |
733 |
shadowCopyButton.setSelection(currentSelection == IMPORT_VIRTUAL_FOLDERS_AND_LINKS); |
348 |
if (linkButton != null) |
734 |
if (linkButton != null) |
349 |
linkButton.setSelection(currentSelection == IMPORT_LINK); |
735 |
linkButton.setSelection(currentSelection == IMPORT_LINK); |
350 |
if (moveButton != null) |
736 |
if (moveButton != null) |
351 |
moveButton.setSelection(currentSelection == IMPORT_MOVE); |
737 |
moveButton.setSelection(currentSelection == IMPORT_MOVE); |
|
|
738 |
if (variableCheckbox != null) |
739 |
variableCheckbox.setEnabled((currentSelection & (IMPORT_VIRTUAL_FOLDERS_AND_LINKS | IMPORT_LINK)) != 0); |
352 |
if (variableCombo != null) |
740 |
if (variableCombo != null) |
353 |
variableCombo.setEnabled((currentSelection & (IMPORT_GROUPS_AND_LINKS | IMPORT_LINK)) != 0); |
741 |
variableCombo.setEnabled(variableCheckbox.getSelection() && variableCheckbox.isEnabled()); |
354 |
if (variableLabel != null) |
|
|
355 |
variableLabel.setEnabled((currentSelection & (IMPORT_GROUPS_AND_LINKS | IMPORT_LINK)) != 0); |
356 |
} |
742 |
} |
357 |
|
743 |
|
358 |
/** Set the project that is the destination of the import operation |
744 |
/** Set the project that is the destination of the import operation |