Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 75922 Details for
Bug 195514
support spell checking in description, comment and summary field
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Added TextViewer support to the summary field in both the task editor and the newTask editor
clipboard.txt (text/plain), 14.01 KB, created by
Raphael Ackermann
on 2007-08-12 09:06:41 EDT
(
hide
)
Description:
Added TextViewer support to the summary field in both the task editor and the newTask editor
Filename:
MIME Type:
Creator:
Raphael Ackermann
Created:
2007-08-12 09:06:41 EDT
Size:
14.01 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mylyn.tasks.ui >Index: src/org/eclipse/mylyn/tasks/ui/editors/AbstractNewRepositoryTaskEditor.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractNewRepositoryTaskEditor.java,v >retrieving revision 1.42 >diff -u -r1.42 AbstractNewRepositoryTaskEditor.java >--- src/org/eclipse/mylyn/tasks/ui/editors/AbstractNewRepositoryTaskEditor.java 19 Jul 2007 00:45:11 -0000 1.42 >+++ src/org/eclipse/mylyn/tasks/ui/editors/AbstractNewRepositoryTaskEditor.java 12 Aug 2007 13:07:27 -0000 >@@ -24,7 +24,6 @@ > import org.eclipse.jface.viewers.SelectionChangedEvent; > import org.eclipse.jface.viewers.StructuredSelection; > import org.eclipse.mylyn.internal.tasks.core.TaskCategory; >-import org.eclipse.mylyn.internal.tasks.ui.TaskListColorsAndFonts; > import org.eclipse.mylyn.internal.tasks.ui.TasksUiImages; > import org.eclipse.mylyn.internal.tasks.ui.TasksUiPreferenceConstants; > import org.eclipse.mylyn.internal.tasks.ui.editors.RepositoryTaskOutlineNode; >@@ -33,17 +32,17 @@ > import org.eclipse.mylyn.tasks.core.AbstractTask; > import org.eclipse.mylyn.tasks.core.AbstractTaskCategory; > import org.eclipse.mylyn.tasks.core.AbstractTaskContainer; >-import org.eclipse.mylyn.tasks.core.RepositoryTaskAttribute; > import org.eclipse.mylyn.tasks.core.TaskList; > import org.eclipse.mylyn.tasks.ui.DatePicker; > import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; > import org.eclipse.swt.SWT; > import org.eclipse.swt.custom.CCombo; >+import org.eclipse.swt.custom.VerifyKeyListener; > import org.eclipse.swt.events.ModifyEvent; > import org.eclipse.swt.events.ModifyListener; > import org.eclipse.swt.events.SelectionAdapter; > import org.eclipse.swt.events.SelectionEvent; >-import org.eclipse.swt.graphics.Font; >+import org.eclipse.swt.events.VerifyEvent; > import org.eclipse.swt.layout.GridData; > import org.eclipse.swt.layout.GridLayout; > import org.eclipse.swt.widgets.Button; >@@ -63,7 +62,6 @@ > import org.eclipse.ui.forms.widgets.FormToolkit; > import org.eclipse.ui.forms.widgets.ImageHyperlink; > import org.eclipse.ui.forms.widgets.Section; >-import org.eclipse.ui.themes.IThemeManager; > > /** > * An editor used to view a locally created bug that does not yet exist on a server. >@@ -73,7 +71,20 @@ > */ > public abstract class AbstractNewRepositoryTaskEditor extends AbstractRepositoryTaskEditor { > >- private static final int DESCRIPTION_WIDTH = 79 * 7; // 500; >+ /** >+ * @author Raphael Ackermann (bug 195514) >+ */ >+ protected class TabVerifyKeyListener implements VerifyKeyListener { >+ >+ public void verifyKey(VerifyEvent event) { >+ // if there is a tab key, do not "execute" it and instead select the Attributes section >+ if (event.keyCode == SWT.TAB) { >+ event.doit = false; >+ selectAttributes(); >+ } >+ } >+ >+ } > > private static final int DEFAULT_FIELD_WIDTH = 150; > >@@ -141,27 +152,15 @@ > > } > >+ /** >+ * @author Raphael Ackermann (modifications) (bug 195514) >+ * @param composite >+ */ > @Override > protected void createSummaryLayout(Composite composite) { >- Composite summaryComposite = getManagedForm().getToolkit().createComposite(composite); >- GridLayout summaryLayout = new GridLayout(2, false); >- summaryLayout.verticalSpacing = 0; >- summaryLayout.marginHeight = 2; >- summaryComposite.setLayout(summaryLayout); >- GridDataFactory.fillDefaults().grab(true, false).applyTo(summaryComposite); >- >- RepositoryTaskAttribute attribute = taskData.getAttribute(RepositoryTaskAttribute.SUMMARY); >- if (attribute != null) { >- createLabel(summaryComposite, attribute); >- summaryText = createTextField(summaryComposite, attribute, SWT.FLAT); >- summaryText.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER); >- IThemeManager themeManager = getSite().getWorkbenchWindow().getWorkbench().getThemeManager(); >- Font summaryFont = themeManager.getCurrentTheme().getFontRegistry().get( >- TaskListColorsAndFonts.TASK_EDITOR_FONT); >- summaryText.setFont(summaryFont); >- >- GridDataFactory.fillDefaults().grab(true, false).hint(DESCRIPTION_WIDTH, SWT.DEFAULT).applyTo(summaryText); >- summaryText.addModifyListener(new ModifyListener() { >+ addSummaryText(composite); >+ if (newSummaryTextViewer != null) { >+ newSummaryTextViewer.getTextWidget().addModifyListener(new ModifyListener() { > public void modifyText(ModifyEvent e) { > String sel = summaryText.getText(); > if (!(newSummary.equals(sel))) { >@@ -170,44 +169,10 @@ > } > } > }); >+ newSummaryTextViewer.prependVerifyKeyListener(new TabVerifyKeyListener()); > } >- getManagedForm().getToolkit().paintBordersFor(summaryComposite); > } > >-// @Override >-// protected void addSummaryText(Composite attributesComposite) { >-// >-// Composite summaryComposite = getManagedForm().getToolkit().createComposite(attributesComposite); >-// GridLayout summaryLayout = new GridLayout(2, false); >-// summaryLayout.verticalSpacing = 0; >-// summaryLayout.marginHeight = 2; >-// summaryComposite.setLayout(summaryLayout); >-// GridDataFactory.fillDefaults().grab(true, false).applyTo(summaryComposite); >-// >-// RepositoryTaskAttribute attribute = taskData.getAttribute(RepositoryTaskAttribute.SUMMARY); >-// if (attribute != null) { >-// createLabel(summaryComposite, attribute); >-// summaryText = createTextField(summaryComposite, attribute, SWT.FLAT); >-// summaryText.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER); >-// IThemeManager themeManager = getSite().getWorkbenchWindow().getWorkbench().getThemeManager(); >-// Font summaryFont = themeManager.getCurrentTheme().getFontRegistry().get( >-// TaskListColorsAndFonts.TASK_EDITOR_FONT); >-// summaryText.setFont(summaryFont); >-// >-// GridDataFactory.fillDefaults().grab(true, false).hint(DESCRIPTION_WIDTH, SWT.DEFAULT).applyTo(summaryText); >-// summaryText.addModifyListener(new ModifyListener() { >-// public void modifyText(ModifyEvent e) { >-// String sel = summaryText.getText(); >-// if (!(newSummary.equals(sel))) { >-// newSummary = sel; >-// markDirty(true); >-// } >-// } >-// }); >-// } >-// getManagedForm().getToolkit().paintBordersFor(summaryComposite); >-// } >- > @Override > protected void createAttachmentLayout(Composite comp) { > // currently can't attach while creating new bug >@@ -349,6 +314,14 @@ > return true; > } > >+ /** >+ * @author Raphael Ackermann (bug 198526) >+ */ >+ @Override >+ public void setFocus() { >+ summaryText.setFocus(); >+ } >+ > @Override > public boolean isSaveAsAllowed() { > return false; >Index: src/org/eclipse/mylyn/tasks/ui/editors/AbstractRepositoryTaskEditor.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractRepositoryTaskEditor.java,v >retrieving revision 1.208 >diff -u -r1.208 AbstractRepositoryTaskEditor.java >--- src/org/eclipse/mylyn/tasks/ui/editors/AbstractRepositoryTaskEditor.java 9 Aug 2007 21:30:12 -0000 1.208 >+++ src/org/eclipse/mylyn/tasks/ui/editors/AbstractRepositoryTaskEditor.java 12 Aug 2007 13:07:30 -0000 >@@ -114,6 +114,7 @@ > import org.eclipse.swt.custom.CCombo; > import org.eclipse.swt.custom.StackLayout; > import org.eclipse.swt.custom.StyledText; >+import org.eclipse.swt.custom.VerifyKeyListener; > import org.eclipse.swt.dnd.DND; > import org.eclipse.swt.dnd.DropTarget; > import org.eclipse.swt.dnd.FileTransfer; >@@ -124,6 +125,7 @@ > import org.eclipse.swt.events.SelectionAdapter; > import org.eclipse.swt.events.SelectionEvent; > import org.eclipse.swt.events.SelectionListener; >+import org.eclipse.swt.events.VerifyEvent; > import org.eclipse.swt.graphics.Color; > import org.eclipse.swt.graphics.Cursor; > import org.eclipse.swt.graphics.Font; >@@ -186,6 +188,21 @@ > */ > public abstract class AbstractRepositoryTaskEditor extends TaskFormPage { > >+ /** >+ * @author Raphael Ackermann (bug 195514) >+ */ >+ private class TabVerifyKeyListener implements VerifyKeyListener { >+ >+ public void verifyKey(VerifyEvent event) { >+ // if there is a tab key, do not "execute" it and instead select the Status control >+ if (event.keyCode == SWT.TAB) { >+ event.doit = false; >+ headerInfoComposite.setFocus(); >+ } >+ } >+ >+ } >+ > private static final String ERROR_NOCONNECTIVITY = "Unable to submit at this time. Check connectivity and retry."; > > private static final String LABEL_HISTORY = "History"; >@@ -232,6 +249,8 @@ > > private static final int DESCRIPTION_HEIGHT = 10 * 14; > >+ protected static final int SUMMARY_HEIGHT = 20; >+ > private static final String LABEL_BUTTON_SUBMIT = "Submit"; > > private static final String LABEL_COPY_TO_CLIPBOARD = "Copy to Clipboard"; >@@ -250,7 +269,7 @@ > > private boolean expandedStateAttributes = false; > >- protected Text summaryText; >+ protected StyledText summaryText; > > protected Button submitButton; > >@@ -264,6 +283,8 @@ > > private Composite editorComposite; > >+ protected TextViewer newSummaryTextViewer; >+ > private TextViewer newCommentTextViewer; > > private org.eclipse.swt.widgets.List ccList; >@@ -695,7 +716,7 @@ > > createSummaryLayout(editorComposite); > >- Section attributesSection = createSection(editorComposite, getSectionLabel(SECTION_NAME.ATTRIBTUES_SECTION)); >+ attributesSection = createSection(editorComposite, getSectionLabel(SECTION_NAME.ATTRIBTUES_SECTION)); > attributesSection.setExpanded(expandedStateAttributes || hasAttributeChanges); > > Composite toolbarComposite = toolkit.createComposite(attributesSection); >@@ -807,11 +828,27 @@ > } > } > >+ /** >+ * @author Raphael Ackermann (modifications) (bug 195514) >+ * @param composite >+ */ > protected void createSummaryLayout(Composite composite) { >- > addSummaryText(composite); >+ if (newSummaryTextViewer != null) { >+ newSummaryTextViewer.getTextWidget().addModifyListener(new ModifyListener() { >+ public void modifyText(ModifyEvent e) { >+ String sel = summaryText.getText(); >+ RepositoryTaskAttribute a = taskData.getAttribute(RepositoryTaskAttribute.SUMMARY); >+ if (!(a.getValue().equals(sel))) { >+ a.setValue(sel); >+ markDirty(true); >+ } >+ } >+ }); >+ newSummaryTextViewer.prependVerifyKeyListener(new TabVerifyKeyListener()); >+ } > >- Composite headerInfoComposite = toolkit.createComposite(composite); >+ headerInfoComposite = toolkit.createComposite(composite); > GridLayout headerLayout = new GridLayout(11, false); > headerLayout.verticalSpacing = 1; > headerLayout.marginHeight = 1; >@@ -1219,10 +1256,11 @@ > } > > /** >- * Adds a text field to display and edit the task's summary. >+ * Adds a text editor with spell checking enabled to display and edit the task's summary. > * >+ * @author Raphael Ackermann (modifications) (bug 195514) > * @param attributesComposite >- * The composite to add the text field to. >+ * The composite to add the text editor to. > */ > protected void addSummaryText(Composite attributesComposite) { > Composite summaryComposite = toolkit.createComposite(attributesComposite); >@@ -1233,31 +1271,18 @@ > GridDataFactory.fillDefaults().grab(true, false).applyTo(summaryComposite); > > if (taskData != null) { >- RepositoryTaskAttribute attribute = taskData.getAttribute(RepositoryTaskAttribute.SUMMARY); >+ final RepositoryTaskAttribute attribute = taskData.getAttribute(RepositoryTaskAttribute.SUMMARY); > if (attribute != null) { >- // Label summaryLabel = createLabel(summaryComposite, >- // attribute); >- // summaryLabel.setFont(TITLE_FONT); >- summaryText = createTextField(summaryComposite, attribute, SWT.FLAT); >- IThemeManager themeManager = getSite().getWorkbenchWindow().getWorkbench().getThemeManager(); >- Font summaryFont = themeManager.getCurrentTheme().getFontRegistry().get( >- TaskListColorsAndFonts.TASK_EDITOR_FONT); >- summaryText.setFont(summaryFont); >- >- GridDataFactory.fillDefaults().grab(true, false).hint(DESCRIPTION_WIDTH, SWT.DEFAULT).applyTo( >- summaryText); >- summaryText.addModifyListener(new ModifyListener() { >- public void modifyText(ModifyEvent e) { >- String sel = summaryText.getText(); >- RepositoryTaskAttribute a = taskData.getAttribute(RepositoryTaskAttribute.SUMMARY); >- if (!(a.getValue().equals(sel))) { >- a.setValue(sel); >- markDirty(true); >- } >- } >- }); >+ >+ newSummaryTextViewer = addTextEditor(repository, summaryComposite, attribute.getValue(), true, SWT.FLAT); >+ newSummaryTextViewer.setEditable(true); >+ >+ GridDataFactory.fillDefaults().grab(true, false).hint(DESCRIPTION_WIDTH, SUMMARY_HEIGHT).applyTo( >+ newSummaryTextViewer.getControl()); >+ newSummaryTextViewer.getControl().setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER); > } > } >+ summaryText = newSummaryTextViewer.getTextWidget(); > toolkit.paintBordersFor(summaryComposite); > } > >@@ -2663,6 +2688,13 @@ > focusOn(addCommentsTextBox, false); > } > >+ /** >+ * @author Raphael Ackermann (bug 195514) >+ */ >+ protected void selectAttributes() { >+ focusOn(attributesSection, false); >+ } >+ > private void selectDescription() { > focusOn(descriptionTextViewer.getTextWidget(), false); > } >@@ -2745,6 +2777,10 @@ > > private boolean formBusy = false; > >+ private Composite headerInfoComposite; >+ >+ private Section attributesSection; >+ > public void close() { > Display activeDisplay = getSite().getShell().getDisplay(); > activeDisplay.asyncExec(new Runnable() { >@@ -2793,7 +2829,8 @@ > public void handleEvent(Event event) { > fireSelectionChanged(new SelectionChangedEvent(selectionProvider, new StructuredSelection( > new RepositoryTaskSelection(taskData.getId(), taskData.getRepositoryUrl(), >- taskData.getRepositoryKind(), "New Comment", false, taskData.getSummary())))); >+ taskData.getRepositoryKind(), getSectionLabel(SECTION_NAME.NEWCOMMENT_SECTION), false, >+ taskData.getSummary())))); > } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 195514
:
75019
|
75020
| 75922 |
75923
|
76388
|
76389