|
Lines 232-237
Link Here
|
| 232 |
|
232 |
|
| 233 |
private static final int DESCRIPTION_HEIGHT = 10 * 14; |
233 |
private static final int DESCRIPTION_HEIGHT = 10 * 14; |
| 234 |
|
234 |
|
|
|
235 |
protected static final int SUMMARY_HEIGHT = 20; |
| 236 |
|
| 235 |
private static final String LABEL_BUTTON_SUBMIT = "Submit"; |
237 |
private static final String LABEL_BUTTON_SUBMIT = "Submit"; |
| 236 |
|
238 |
|
| 237 |
private static final String LABEL_COPY_TO_CLIPBOARD = "Copy to Clipboard"; |
239 |
private static final String LABEL_COPY_TO_CLIPBOARD = "Copy to Clipboard"; |
|
Lines 250-256
Link Here
|
| 250 |
|
252 |
|
| 251 |
private boolean expandedStateAttributes = false; |
253 |
private boolean expandedStateAttributes = false; |
| 252 |
|
254 |
|
| 253 |
protected Text summaryText; |
255 |
protected StyledText summaryText; |
| 254 |
|
256 |
|
| 255 |
protected Button submitButton; |
257 |
protected Button submitButton; |
| 256 |
|
258 |
|
|
Lines 264-269
Link Here
|
| 264 |
|
266 |
|
| 265 |
private Composite editorComposite; |
267 |
private Composite editorComposite; |
| 266 |
|
268 |
|
|
|
269 |
protected TextViewer newSummaryTextViewer; |
| 270 |
|
| 267 |
private TextViewer newCommentTextViewer; |
271 |
private TextViewer newCommentTextViewer; |
| 268 |
|
272 |
|
| 269 |
private org.eclipse.swt.widgets.List ccList; |
273 |
private org.eclipse.swt.widgets.List ccList; |
|
Lines 809-815
Link Here
|
| 809 |
|
813 |
|
| 810 |
protected void createSummaryLayout(Composite composite) { |
814 |
protected void createSummaryLayout(Composite composite) { |
| 811 |
|
815 |
|
| 812 |
addSummaryText(composite); |
816 |
Composite summaryComposite = toolkit.createComposite(composite); |
|
|
817 |
GridLayout summaryLayout = new GridLayout(2, false); |
| 818 |
summaryLayout.verticalSpacing = 0; |
| 819 |
summaryLayout.marginHeight = 2; |
| 820 |
summaryComposite.setLayout(summaryLayout); |
| 821 |
GridDataFactory.fillDefaults().grab(true, false).applyTo(summaryComposite); |
| 822 |
|
| 823 |
if (taskData != null) { |
| 824 |
final RepositoryTaskAttribute attribute = taskData.getAttribute(RepositoryTaskAttribute.SUMMARY); |
| 825 |
if (attribute != null) { |
| 826 |
|
| 827 |
newSummaryTextViewer = addTextEditor(repository, summaryComposite, attribute.getValue(), true, SWT.FLAT); |
| 828 |
newSummaryTextViewer.setEditable(true); |
| 829 |
|
| 830 |
GridDataFactory.fillDefaults().grab(true, false).hint(DESCRIPTION_WIDTH, SUMMARY_HEIGHT).applyTo( |
| 831 |
newSummaryTextViewer.getControl()); |
| 832 |
newSummaryTextViewer.getControl().setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER); |
| 833 |
|
| 834 |
newSummaryTextViewer.getTextWidget().addModifyListener(new ModifyListener() { |
| 835 |
|
| 836 |
public void modifyText(ModifyEvent e) { |
| 837 |
String sel = summaryText.getText(); |
| 838 |
RepositoryTaskAttribute a = taskData.getAttribute(RepositoryTaskAttribute.SUMMARY); |
| 839 |
if (!(a.getValue().equals(sel))) { |
| 840 |
a.setValue(sel); |
| 841 |
markDirty(true); |
| 842 |
} |
| 843 |
} |
| 844 |
}); |
| 845 |
|
| 846 |
//raphael ackermann: not sure whether a listener is needed here. |
| 847 |
// newSummaryTextViewer.getTextWidget().addListener(SWT.FocusIn, new NewCommentListener()); |
| 848 |
summaryText = newSummaryTextViewer.getTextWidget(); |
| 849 |
} |
| 850 |
} |
| 851 |
toolkit.paintBordersFor(summaryComposite); |
| 813 |
|
852 |
|
| 814 |
Composite headerInfoComposite = toolkit.createComposite(composite); |
853 |
Composite headerInfoComposite = toolkit.createComposite(composite); |
| 815 |
GridLayout headerLayout = new GridLayout(11, false); |
854 |
GridLayout headerLayout = new GridLayout(11, false); |
|
Lines 1218-1265
Link Here
|
| 1218 |
return false; |
1257 |
return false; |
| 1219 |
} |
1258 |
} |
| 1220 |
|
1259 |
|
| 1221 |
/** |
|
|
| 1222 |
* Adds a text field to display and edit the task's summary. |
| 1223 |
* |
| 1224 |
* @param attributesComposite |
| 1225 |
* The composite to add the text field to. |
| 1226 |
*/ |
| 1227 |
protected void addSummaryText(Composite attributesComposite) { |
| 1228 |
Composite summaryComposite = toolkit.createComposite(attributesComposite); |
| 1229 |
GridLayout summaryLayout = new GridLayout(2, false); |
| 1230 |
summaryLayout.verticalSpacing = 0; |
| 1231 |
summaryLayout.marginHeight = 2; |
| 1232 |
summaryComposite.setLayout(summaryLayout); |
| 1233 |
GridDataFactory.fillDefaults().grab(true, false).applyTo(summaryComposite); |
| 1234 |
|
| 1235 |
if (taskData != null) { |
| 1236 |
RepositoryTaskAttribute attribute = taskData.getAttribute(RepositoryTaskAttribute.SUMMARY); |
| 1237 |
if (attribute != null) { |
| 1238 |
// Label summaryLabel = createLabel(summaryComposite, |
| 1239 |
// attribute); |
| 1240 |
// summaryLabel.setFont(TITLE_FONT); |
| 1241 |
summaryText = createTextField(summaryComposite, attribute, SWT.FLAT); |
| 1242 |
IThemeManager themeManager = getSite().getWorkbenchWindow().getWorkbench().getThemeManager(); |
| 1243 |
Font summaryFont = themeManager.getCurrentTheme().getFontRegistry().get( |
| 1244 |
TaskListColorsAndFonts.TASK_EDITOR_FONT); |
| 1245 |
summaryText.setFont(summaryFont); |
| 1246 |
|
| 1247 |
GridDataFactory.fillDefaults().grab(true, false).hint(DESCRIPTION_WIDTH, SWT.DEFAULT).applyTo( |
| 1248 |
summaryText); |
| 1249 |
summaryText.addModifyListener(new ModifyListener() { |
| 1250 |
public void modifyText(ModifyEvent e) { |
| 1251 |
String sel = summaryText.getText(); |
| 1252 |
RepositoryTaskAttribute a = taskData.getAttribute(RepositoryTaskAttribute.SUMMARY); |
| 1253 |
if (!(a.getValue().equals(sel))) { |
| 1254 |
a.setValue(sel); |
| 1255 |
markDirty(true); |
| 1256 |
} |
| 1257 |
} |
| 1258 |
}); |
| 1259 |
} |
| 1260 |
} |
| 1261 |
toolkit.paintBordersFor(summaryComposite); |
| 1262 |
} |
| 1263 |
|
1260 |
|
| 1264 |
protected boolean supportsAttachmentDelete() { |
1261 |
protected boolean supportsAttachmentDelete() { |
| 1265 |
return false; |
1262 |
return false; |
|
Lines 2789-2795
Link Here
|
| 2789 |
public void handleEvent(Event event) { |
2786 |
public void handleEvent(Event event) { |
| 2790 |
fireSelectionChanged(new SelectionChangedEvent(selectionProvider, new StructuredSelection( |
2787 |
fireSelectionChanged(new SelectionChangedEvent(selectionProvider, new StructuredSelection( |
| 2791 |
new RepositoryTaskSelection(taskData.getId(), taskData.getRepositoryUrl(), |
2788 |
new RepositoryTaskSelection(taskData.getId(), taskData.getRepositoryUrl(), |
| 2792 |
taskData.getRepositoryKind(), "New Comment", false, taskData.getSummary())))); |
2789 |
taskData.getRepositoryKind(), getSectionLabel(SECTION_NAME.NEWCOMMENT_SECTION), false, |
|
|
2790 |
taskData.getSummary())))); |
| 2793 |
} |
2791 |
} |
| 2794 |
} |
2792 |
} |