Lines 18-23
Link Here
|
18 |
import org.eclipse.jface.action.ToolBarManager; |
18 |
import org.eclipse.jface.action.ToolBarManager; |
19 |
import org.eclipse.jface.dialogs.MessageDialog; |
19 |
import org.eclipse.jface.dialogs.MessageDialog; |
20 |
import org.eclipse.jface.layout.GridDataFactory; |
20 |
import org.eclipse.jface.layout.GridDataFactory; |
|
|
21 |
import org.eclipse.jface.layout.GridLayoutFactory; |
21 |
import org.eclipse.jface.text.ITextListener; |
22 |
import org.eclipse.jface.text.ITextListener; |
22 |
import org.eclipse.jface.text.TextEvent; |
23 |
import org.eclipse.jface.text.TextEvent; |
23 |
import org.eclipse.jface.util.IPropertyChangeListener; |
24 |
import org.eclipse.jface.util.IPropertyChangeListener; |
Lines 63-69
Link Here
|
63 |
import org.eclipse.swt.widgets.Composite; |
64 |
import org.eclipse.swt.widgets.Composite; |
64 |
import org.eclipse.swt.widgets.Control; |
65 |
import org.eclipse.swt.widgets.Control; |
65 |
import org.eclipse.swt.widgets.Display; |
66 |
import org.eclipse.swt.widgets.Display; |
|
|
67 |
import org.eclipse.swt.widgets.Event; |
66 |
import org.eclipse.swt.widgets.Label; |
68 |
import org.eclipse.swt.widgets.Label; |
|
|
69 |
import org.eclipse.swt.widgets.Listener; |
67 |
import org.eclipse.swt.widgets.Spinner; |
70 |
import org.eclipse.swt.widgets.Spinner; |
68 |
import org.eclipse.swt.widgets.Text; |
71 |
import org.eclipse.swt.widgets.Text; |
69 |
import org.eclipse.ui.PlatformUI; |
72 |
import org.eclipse.ui.PlatformUI; |
Lines 202-207
Link Here
|
202 |
|
205 |
|
203 |
private Label scheduledLabel; |
206 |
private Label scheduledLabel; |
204 |
|
207 |
|
|
|
208 |
private Composite layoutControl; |
209 |
|
205 |
public PlanningPart(int sectionStyle) { |
210 |
public PlanningPart(int sectionStyle) { |
206 |
super(sectionStyle, Messages.PersonalPart_Personal_Planning); |
211 |
super(sectionStyle, Messages.PersonalPart_Personal_Planning); |
207 |
this.activeTimeEnabled = true; |
212 |
this.activeTimeEnabled = true; |
Lines 275-289
Link Here
|
275 |
if (section.isExpanded()) { |
280 |
if (section.isExpanded()) { |
276 |
expandSection(toolkit, section); |
281 |
expandSection(toolkit, section); |
277 |
} else { |
282 |
} else { |
278 |
section.addExpansionListener(new ExpansionAdapter() { |
283 |
final ExpansionAdapter expansionAdapter = new ExpansionAdapter() { |
279 |
@Override |
284 |
@Override |
280 |
public void expansionStateChanged(ExpansionEvent event) { |
285 |
public void expansionStateChanged(ExpansionEvent e) { |
281 |
if (sectionClient == null) { |
286 |
if (sectionClient == null) { |
282 |
expandSection(toolkit, section); |
287 |
expandSection(toolkit, section); |
283 |
if (page instanceof AbstractTaskEditorPage) { |
288 |
if (page instanceof AbstractTaskEditorPage) { |
284 |
((AbstractTaskEditorPage) page).reflow(); |
289 |
((AbstractTaskEditorPage) page).reflow(); |
285 |
} |
290 |
} |
286 |
} |
291 |
} |
|
|
292 |
|
293 |
} |
294 |
}; |
295 |
section.addExpansionListener(expansionAdapter); |
296 |
/// provide an SWT listener so that it can be triggered programatically when maximizing the section |
297 |
section.addListener(SWT.Expand, new Listener() { |
298 |
public void handleEvent(Event event) { |
299 |
expansionAdapter.expansionStateChanged(null); |
287 |
} |
300 |
} |
288 |
}); |
301 |
}); |
289 |
} |
302 |
} |
Lines 299-322
Link Here
|
299 |
|
312 |
|
300 |
private void expandSection(FormToolkit toolkit, Section section) { |
313 |
private void expandSection(FormToolkit toolkit, Section section) { |
301 |
sectionClient = toolkit.createComposite(section); |
314 |
sectionClient = toolkit.createComposite(section); |
|
|
315 |
GridLayoutFactory.fillDefaults().applyTo(sectionClient); |
316 |
layoutControl = toolkit.createComposite(sectionClient); |
317 |
GridDataFactory.fillDefaults().grab(true, true).applyTo(layoutControl); |
302 |
GridLayout layout = EditorUtil.createSectionClientLayout(); |
318 |
GridLayout layout = EditorUtil.createSectionClientLayout(); |
303 |
layout.numColumns = (needsDueDate) ? 6 : 4; |
319 |
layout.numColumns = (needsDueDate) ? 6 : 4; |
304 |
sectionClient.setLayout(layout); |
320 |
layoutControl.setLayout(layout); |
305 |
|
321 |
|
306 |
createScheduledDatePicker(toolkit, sectionClient); |
322 |
createScheduledDatePicker(toolkit, layoutControl); |
307 |
|
323 |
|
308 |
// disable due date picker if it's a repository due date |
324 |
// disable due date picker if it's a repository due date |
309 |
if (needsDueDate) { |
325 |
if (needsDueDate) { |
310 |
createDueDatePicker(toolkit, sectionClient); |
326 |
createDueDatePicker(toolkit, layoutControl); |
311 |
} |
327 |
} |
312 |
|
328 |
|
313 |
createEstimatedTime(toolkit, sectionClient); |
329 |
createEstimatedTime(toolkit, layoutControl); |
314 |
|
330 |
|
315 |
if (needsNotes()) { |
331 |
if (needsNotes()) { |
316 |
createNotesArea(toolkit, sectionClient, layout.numColumns); |
332 |
createNotesArea(toolkit, layoutControl, layout.numColumns); |
317 |
} |
333 |
} |
318 |
|
334 |
|
319 |
createActiveTime(toolkit, sectionClient, layout.numColumns); |
335 |
createActiveTime(toolkit, layoutControl, layout.numColumns); |
320 |
|
336 |
|
321 |
toolkit.paintBordersFor(sectionClient); |
337 |
toolkit.paintBordersFor(sectionClient); |
322 |
section.setClient(sectionClient); |
338 |
section.setClient(sectionClient); |
Lines 744-747
Link Here
|
744 |
return noteEditor; |
760 |
return noteEditor; |
745 |
} |
761 |
} |
746 |
|
762 |
|
|
|
763 |
public Control getLayoutControl() { |
764 |
return layoutControl; |
765 |
} |
766 |
|
747 |
} |
767 |
} |