Lines 121-127
Link Here
|
121 |
|
121 |
|
122 |
private ScrolledForm form; |
122 |
private ScrolledForm form; |
123 |
|
123 |
|
124 |
private Text summary; |
124 |
private TextViewer summaryEditor; |
125 |
|
125 |
|
126 |
private Text issueReportURL; |
126 |
private Text issueReportURL; |
127 |
|
127 |
|
Lines 182-193
Link Here
|
182 |
} |
182 |
} |
183 |
} |
183 |
} |
184 |
|
184 |
|
185 |
if (summary == null) |
185 |
if (summaryEditor == null) |
186 |
return; |
186 |
return; |
187 |
if (!summary.isDisposed()) { |
187 |
|
188 |
if (!summary.getText().equals(updateTask.getSummary())) { |
188 |
if (!summaryEditor.getTextWidget().isDisposed()) { |
|
|
189 |
if (!summaryEditor.getTextWidget().getText().equals(updateTask.getSummary())) { |
189 |
boolean wasDirty = TaskPlanningEditor.this.isDirty; |
190 |
boolean wasDirty = TaskPlanningEditor.this.isDirty; |
190 |
summary.setText(updateTask.getSummary()); |
191 |
summaryEditor.getTextWidget().setText(updateTask.getSummary()); |
191 |
TaskPlanningEditor.this.markDirty(wasDirty); |
192 |
TaskPlanningEditor.this.markDirty(wasDirty); |
192 |
} |
193 |
} |
193 |
if (parentEditor != null) { |
194 |
if (parentEditor != null) { |
Lines 218-224
Link Here
|
218 |
@Override |
219 |
@Override |
219 |
public void doSave(IProgressMonitor monitor) { |
220 |
public void doSave(IProgressMonitor monitor) { |
220 |
if (task instanceof LocalTask) { |
221 |
if (task instanceof LocalTask) { |
221 |
String label = summary.getText(); |
222 |
String label = summaryEditor.getTextWidget().getText(); |
222 |
// task.setDescription(label); |
223 |
// task.setDescription(label); |
223 |
TasksUiPlugin.getTaskListManager().getTaskList().renameTask(task, label); |
224 |
TasksUiPlugin.getTaskListManager().getTaskList().renameTask(task, label); |
224 |
|
225 |
|
Lines 295-305
Link Here
|
295 |
createPlanningSection(editorComposite); |
296 |
createPlanningSection(editorComposite); |
296 |
createNotesSection(editorComposite); |
297 |
createNotesSection(editorComposite); |
297 |
|
298 |
|
298 |
if (summary != null && LocalRepositoryConnector.DEFAULT_SUMMARY.equals(summary.getText())) { |
299 |
if (summaryEditor != null && summaryEditor.getTextWidget() != null && LocalRepositoryConnector.DEFAULT_SUMMARY.equals(summaryEditor.getTextWidget().getText())) { |
299 |
summary.setSelection(0, summary.getText().length()); |
300 |
summaryEditor.setSelectedRange(0, summaryEditor.getTextWidget().getText().length()); |
300 |
summary.setFocus(); |
301 |
summaryEditor.getTextWidget().setFocus(); |
301 |
} else if (summary != null) { |
302 |
} else if (summaryEditor != null && summaryEditor.getTextWidget() != null) { |
302 |
summary.setFocus(); |
303 |
summaryEditor.getTextWidget().setFocus(); |
303 |
} |
304 |
} |
304 |
} |
305 |
} |
305 |
|
306 |
|
Lines 348-355
Link Here
|
348 |
@Override |
349 |
@Override |
349 |
public void setFocus() { |
350 |
public void setFocus() { |
350 |
// form.setFocus(); |
351 |
// form.setFocus(); |
351 |
if (summary != null && !summary.isDisposed()) { |
352 |
if (summaryEditor != null && summaryEditor.getTextWidget() != null && !summaryEditor.getTextWidget().isDisposed()) { |
352 |
summary.setFocus(); |
353 |
summaryEditor.getTextWidget().setFocus(); |
353 |
} |
354 |
} |
354 |
} |
355 |
} |
355 |
|
356 |
|
Lines 386-401
Link Here
|
386 |
summaryComposite.setLayout(summaryLayout); |
387 |
summaryComposite.setLayout(summaryLayout); |
387 |
GridDataFactory.fillDefaults().grab(true, false).applyTo(summaryComposite); |
388 |
GridDataFactory.fillDefaults().grab(true, false).applyTo(summaryComposite); |
388 |
|
389 |
|
389 |
summary = toolkit.createText(summaryComposite, task.getSummary(), SWT.LEFT | SWT.FLAT); |
390 |
TaskRepository repository = null; |
390 |
summary.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER); |
391 |
if (task != null && !(task instanceof LocalTask)) { |
391 |
GridDataFactory.fillDefaults().minSize(100, SWT.DEFAULT).grab(true, false).applyTo(summary); |
392 |
AbstractTask repositoryTask = task; |
|
|
393 |
repository = TasksUiPlugin.getRepositoryManager().getRepository(repositoryTask.getConnectorKind(), |
394 |
repositoryTask.getRepositoryUrl()); |
395 |
} |
396 |
summaryEditor = addTextEditor(repository, summaryComposite, task.getSummary(), true, SWT.FLAT | SWT.MULTI |
397 |
| SWT.WRAP | SWT.V_SCROLL); |
398 |
|
399 |
summaryEditor.getControl().setLayoutData(new GridData(GridData.FILL_BOTH)); |
400 |
summaryEditor.getControl().setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER); |
392 |
|
401 |
|
393 |
if (!(task instanceof LocalTask)) { |
402 |
if (!(task instanceof LocalTask)) { |
394 |
summary.setEnabled(false); |
403 |
summaryEditor.setEditable(false); |
395 |
} else { |
404 |
} else { |
396 |
summary.addModifyListener(new ModifyListener() { |
405 |
summaryEditor.setEditable(true); |
397 |
public void modifyText(ModifyEvent e) { |
406 |
summaryEditor.addTextListener(new ITextListener() { |
398 |
markDirty(true); |
407 |
public void textChanged(TextEvent event) { |
|
|
408 |
if (!task.getSummary().equals(summaryEditor.getTextWidget().getText())) { |
409 |
markDirty(true); |
410 |
} |
399 |
} |
411 |
} |
400 |
}); |
412 |
}); |
401 |
} |
413 |
} |
Lines 569-575
Link Here
|
569 |
|
581 |
|
570 |
@Override |
582 |
@Override |
571 |
protected void setTitle(final String pageTitle) { |
583 |
protected void setTitle(final String pageTitle) { |
572 |
summary.setText(pageTitle); |
584 |
summaryEditor.getTextWidget().setText(pageTitle); |
573 |
TaskPlanningEditor.this.markDirty(true); |
585 |
TaskPlanningEditor.this.markDirty(true); |
574 |
} |
586 |
} |
575 |
|
587 |
|
Lines 933-944
Link Here
|
933 |
|
945 |
|
934 |
/** for testing - should cause dirty state */ |
946 |
/** for testing - should cause dirty state */ |
935 |
public void setDescription(String desc) { |
947 |
public void setDescription(String desc) { |
936 |
this.summary.setText(desc); |
948 |
this.summaryEditor.getTextWidget().setText(desc); |
937 |
} |
949 |
} |
938 |
|
950 |
|
939 |
/** for testing */ |
951 |
/** for testing */ |
940 |
public String getDescription() { |
952 |
public String getDescription() { |
941 |
return this.summary.getText(); |
953 |
return this.summaryEditor.getTextWidget().getText(); |
942 |
} |
954 |
} |
943 |
|
955 |
|
944 |
/** for testing */ |
956 |
/** for testing */ |