Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 150922 | Differences between
and this patch

Collapse All | Expand All

(-)ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/BuildPathsBlock.java (-5 / +6 lines)
Lines 323-328 Link Here
323
		fClassPathList.setElements(newClassPath);
323
		fClassPathList.setElements(newClassPath);
324
		fClassPathList.setCheckedElements(exportedEntries);
324
		fClassPathList.setCheckedElements(exportedEntries);
325
		
325
		
326
		if (fSourceContainerPage != null) {
327
			fSourceContainerPage.init(fCurrJProject);
328
			fProjectsPage.init(fCurrJProject);
329
			fLibrariesPage.init(fCurrJProject);
330
		}
331
		
326
		initializeTimeStamps();
332
		initializeTimeStamps();
327
		updateUI();
333
		updateUI();
328
	}
334
	}
Lines 350-360 Link Here
350
		fBuildPathDialogField.refresh();
356
		fBuildPathDialogField.refresh();
351
		fClassPathList.refresh();
357
		fClassPathList.refresh();
352
	
358
	
353
		if (fSourceContainerPage != null) {
354
			fSourceContainerPage.init(fCurrJProject);
355
			fProjectsPage.init(fCurrJProject);
356
			fLibrariesPage.init(fCurrJProject);
357
		}
358
		doStatusLineUpdate();
359
		doStatusLineUpdate();
359
	}
360
	}
360
	
361
	
(-)ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceContainerWorkbookPage.java (-2 / +11 lines)
Lines 26-31 Link Here
26
import org.eclipse.swt.events.KeyEvent;
26
import org.eclipse.swt.events.KeyEvent;
27
import org.eclipse.swt.widgets.Composite;
27
import org.eclipse.swt.widgets.Composite;
28
import org.eclipse.swt.widgets.Control;
28
import org.eclipse.swt.widgets.Control;
29
import org.eclipse.swt.widgets.Display;
29
import org.eclipse.swt.widgets.Shell;
30
import org.eclipse.swt.widgets.Shell;
30
31
31
import org.eclipse.jface.action.IAction;
32
import org.eclipse.jface.action.IAction;
Lines 168-175 Link Here
168
	}
169
	}
169
	
170
	
170
	public void init(IJavaProject jproject) {
171
	public void init(IJavaProject jproject) {
171
		fCurrJProject= jproject;	
172
		fCurrJProject= jproject;
172
		updateFoldersList();
173
		if (Display.getCurrent() != null) {
174
			updateFoldersList();
175
		} else {
176
			Display.getDefault().asyncExec(new Runnable() {
177
				public void run() {
178
					updateFoldersList();
179
				}
180
			});
181
		}
173
	}
182
	}
174
	
183
	
175
	private void updateFoldersList() {	
184
	private void updateFoldersList() {	
(-)ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/LibrariesWorkbookPage.java (-2 / +10 lines)
Lines 37-42 Link Here
37
import org.eclipse.swt.events.KeyEvent;
37
import org.eclipse.swt.events.KeyEvent;
38
import org.eclipse.swt.widgets.Composite;
38
import org.eclipse.swt.widgets.Composite;
39
import org.eclipse.swt.widgets.Control;
39
import org.eclipse.swt.widgets.Control;
40
import org.eclipse.swt.widgets.Display;
40
import org.eclipse.swt.widgets.Shell;
41
import org.eclipse.swt.widgets.Shell;
41
42
42
import org.eclipse.jface.dialogs.MessageDialog;
43
import org.eclipse.jface.dialogs.MessageDialog;
Lines 130-139 Link Here
130
		
131
		
131
	public void init(IJavaProject jproject) {
132
	public void init(IJavaProject jproject) {
132
		fCurrJProject= jproject;
133
		fCurrJProject= jproject;
133
		updateLibrariesList();
134
		if (Display.getCurrent() != null) {
135
			updateLibrariesList();
136
		} else {
137
			Display.getDefault().asyncExec(new Runnable() {
138
				public void run() {
139
					updateLibrariesList();
140
				}
141
			});
142
		}
134
	}
143
	}
135
	
144
	
136
	
137
	private void updateLibrariesList() {
145
	private void updateLibrariesList() {
138
		List cpelements= fClassPathList.getElements();
146
		List cpelements= fClassPathList.getElements();
139
		List libelements= new ArrayList(cpelements.size());
147
		List libelements= new ArrayList(cpelements.size());
(-)ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/ProjectsWorkbookPage.java (-3 / +13 lines)
Lines 18-23 Link Here
18
import org.eclipse.swt.events.KeyEvent;
18
import org.eclipse.swt.events.KeyEvent;
19
import org.eclipse.swt.widgets.Composite;
19
import org.eclipse.swt.widgets.Composite;
20
import org.eclipse.swt.widgets.Control;
20
import org.eclipse.swt.widgets.Control;
21
import org.eclipse.swt.widgets.Display;
21
import org.eclipse.swt.widgets.Shell;
22
import org.eclipse.swt.widgets.Shell;
22
23
23
import org.eclipse.jface.viewers.ArrayContentProvider;
24
import org.eclipse.jface.viewers.ArrayContentProvider;
Lines 87-94 Link Here
87
		fProjectsList.setViewerSorter(new CPListElementSorter());
88
		fProjectsList.setViewerSorter(new CPListElementSorter());
88
	}
89
	}
89
	
90
	
90
	public void init(IJavaProject jproject) {
91
	public void init(final IJavaProject jproject) {
91
		updateProjectsList(jproject);
92
		fCurrJProject= jproject;
93
		
94
		if (Display.getCurrent() != null) {
95
			updateProjectsList(jproject);
96
		} else {
97
			Display.getDefault().asyncExec(new Runnable() {
98
				public void run() {
99
					updateProjectsList(jproject);
100
				}
101
			});
102
		}
92
	}
103
	}
93
		
104
		
94
	private void updateProjectsList(IJavaProject currJProject) {
105
	private void updateProjectsList(IJavaProject currJProject) {
Lines 104-110 Link Here
104
			}
115
			}
105
		}
116
		}
106
		fProjectsList.setElements(checkedProjects);
117
		fProjectsList.setElements(checkedProjects);
107
		fCurrJProject= currJProject;
108
	}		
118
	}		
109
		
119
		
110
	// -------- UI creation ---------
120
	// -------- UI creation ---------
(-)ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/newsourcepage/NewSourceContainerWorkbookPage.java (-5 / +18 lines)
Lines 27-32 Link Here
27
import org.eclipse.swt.layout.GridLayout;
27
import org.eclipse.swt.layout.GridLayout;
28
import org.eclipse.swt.widgets.Composite;
28
import org.eclipse.swt.widgets.Composite;
29
import org.eclipse.swt.widgets.Control;
29
import org.eclipse.swt.widgets.Control;
30
import org.eclipse.swt.widgets.Display;
30
31
31
import org.eclipse.jface.action.ToolBarManager;
32
import org.eclipse.jface.action.ToolBarManager;
32
import org.eclipse.jface.operation.IRunnableContext;
33
import org.eclipse.jface.operation.IRunnableContext;
Lines 118-125 Link Here
118
     */
119
     */
119
    public void init(IJavaProject javaProject) {
120
    public void init(IJavaProject javaProject) {
120
		fJavaProject= javaProject;
121
		fJavaProject= javaProject;
121
        
122
		fPackageExplorer.addPostSelectionChangedListener(fHintTextGroup);
122
        fPackageExplorer.setInput(javaProject);
123
	    fActionGroup.getResetAllAction().setBreakPoint(javaProject);
124
125
		if (Display.getCurrent() != null) {
126
			doUpdateUI();
127
		} else {
128
			Display.getDefault().asyncExec(new Runnable() {
129
				public void run() {
130
					doUpdateUI();
131
				}
132
			});
133
		}
134
    }
135
    
136
	private void doUpdateUI() {
137
        fPackageExplorer.setInput(fJavaProject);
123
		
138
		
124
		boolean useFolderOutputs= false;
139
		boolean useFolderOutputs= false;
125
		List cpelements= fClassPathList.getElements();
140
		List cpelements= fClassPathList.getElements();
Lines 132-139 Link Here
132
			}
147
			}
133
		}
148
		}
134
		fUseFolderOutputs.setSelection(useFolderOutputs);
149
		fUseFolderOutputs.setSelection(useFolderOutputs);
135
		
136
		fPackageExplorer.addPostSelectionChangedListener(fHintTextGroup);
137
    }
150
    }
138
    
151
    
139
    public void dispose() {
152
    public void dispose() {
Lines 195-201 Link Here
195
        excomposite.setClient(fHintTextGroup.createControl(excomposite));
208
        excomposite.setClient(fHintTextGroup.createControl(excomposite));
196
        fUseFolderOutputs.doFillIntoGrid(body, 1);
209
        fUseFolderOutputs.doFillIntoGrid(body, 1);
197
		
210
		
198
	    fActionGroup= new DialogPackageExplorerActionGroup(fHintTextGroup, fContext, fPackageExplorer, this);
211
        fActionGroup= new DialogPackageExplorerActionGroup(fHintTextGroup, fContext, fPackageExplorer, this);
199
		fActionGroup.addBuildpathModifierListener(this);
212
		fActionGroup.addBuildpathModifierListener(this);
200
		   
213
		   
201
		
214
		
(-)ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/newsourcepage/ResetAllAction.java (-4 / +32 lines)
Lines 27-34 Link Here
27
27
28
import org.eclipse.ui.part.ISetSelectionTarget;
28
import org.eclipse.ui.part.ISetSelectionTarget;
29
29
30
import org.eclipse.jdt.core.ElementChangedEvent;
30
import org.eclipse.jdt.core.IClasspathEntry;
31
import org.eclipse.jdt.core.IClasspathEntry;
32
import org.eclipse.jdt.core.IElementChangedListener;
31
import org.eclipse.jdt.core.IJavaProject;
33
import org.eclipse.jdt.core.IJavaProject;
34
import org.eclipse.jdt.core.JavaCore;
32
import org.eclipse.jdt.core.JavaModelException;
35
import org.eclipse.jdt.core.JavaModelException;
33
36
34
import org.eclipse.jdt.internal.corext.buildpath.BuildpathDelta;
37
import org.eclipse.jdt.internal.corext.buildpath.BuildpathDelta;
Lines 68-79 Link Here
68
		return NewWizardMessages.PackageExplorerActionGroup_FormText_Default_ResetAll;
71
		return NewWizardMessages.PackageExplorerActionGroup_FormText_Default_ResetAll;
69
	}
72
	}
70
73
71
	public void setBreakPoint(IJavaProject javaProject) throws JavaModelException {
74
	public void setBreakPoint(IJavaProject javaProject) {
72
		fJavaProject= javaProject;
75
		fJavaProject= javaProject;
76
		if (fJavaProject.exists()) {
77
			try {
78
	            fEntries= ClasspathModifier.getExistingEntries(fJavaProject);
79
	            fOutputLocation= fJavaProject.getOutputLocation();
80
            } catch (JavaModelException e) {
81
	            JavaPlugin.log(e);
82
	            return;
83
            }
84
			setEnabled(true);
85
		} else {
86
			JavaCore.addElementChangedListener(new IElementChangedListener() {
73
		
87
		
74
		fEntries= ClasspathModifier.getExistingEntries(javaProject);
88
				public void elementChanged(ElementChangedEvent event) {
75
		fOutputLocation= fJavaProject.getOutputLocation();
89
					if (fJavaProject.exists()) {
76
		setEnabled(canHandle(null));
90
						try {
91
	                        fEntries= ClasspathModifier.getExistingEntries(fJavaProject);
92
	                        fOutputLocation= fJavaProject.getOutputLocation();
93
                        } catch (JavaModelException e) {
94
                        	JavaPlugin.log(e);
95
                        	return;
96
                        } finally {
97
							JavaCore.removeElementChangedListener(this);
98
                        }
99
						setEnabled(true);
100
					}					
101
		        }
102
				
103
			}, ElementChangedEvent.POST_CHANGE);
104
		}
77
    }
105
    }
78
	
106
	
79
	/**
107
	/**
(-)ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/newsourcepage/DialogPackageExplorerActionGroup.java (+8 lines)
Lines 47-52 Link Here
47
	private final ClasspathModifierDropDownAction fDropDownAction;
47
	private final ClasspathModifierDropDownAction fDropDownAction;
48
	private final CreateLinkedSourceFolderAction fCreateLinkedSourceFolderAction;
48
	private final CreateLinkedSourceFolderAction fCreateLinkedSourceFolderAction;
49
	private final CreateSourceFolderAction fCreateSourceFolderAction;
49
	private final CreateSourceFolderAction fCreateSourceFolderAction;
50
	private final ResetAllAction fResetAllAction;
50
    
51
    
51
    /**
52
    /**
52
     * Constructor which creates the operations and based on this 
53
     * Constructor which creates the operations and based on this 
Lines 132-137 Link Here
132
        	}
133
        	}
133
        };
134
        };
134
		fDialogPackageExplorer.addSelectionChangedListener(fCreateSourceFolderAction);
135
		fDialogPackageExplorer.addSelectionChangedListener(fCreateSourceFolderAction);
136
		
137
		fResetAllAction= new ResetAllAction(provider, context, fDialogPackageExplorer);
135
138
136
        
139
        
137
        //options:
140
        //options:
Lines 219-224 Link Here
219
        
222
        
220
        tbm.add(fCreateLinkedSourceFolderAction);
223
        tbm.add(fCreateLinkedSourceFolderAction);
221
        tbm.add(fCreateSourceFolderAction);
224
        tbm.add(fCreateSourceFolderAction);
225
        tbm.add(fResetAllAction);
222
        tbm.add(new HelpAction());
226
        tbm.add(new HelpAction());
223
        
227
        
224
        tbm.update(true);
228
        tbm.update(true);
Lines 292-295 Link Here
292
	public EditOutputFolderAction getEditOutputFolderAction() {
296
	public EditOutputFolderAction getEditOutputFolderAction() {
293
	    return fEditOutputFolderAction;
297
	    return fEditOutputFolderAction;
294
    }
298
    }
299
300
	public ResetAllAction getResetAllAction() {
301
		return fResetAllAction;
302
    }
295
}
303
}

Return to bug 150922