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 104650 Details for
Bug 235222
[wikitext] integrates Texile-J with bugzilla task editor
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]
updated patch
clipboard.txt (text/plain), 14.25 KB, created by
Steffen Pingel
on 2008-06-12 06:53:19 EDT
(
hide
)
Description:
updated patch
Filename:
MIME Type:
Creator:
Steffen Pingel
Created:
2008-06-12 06:53:19 EDT
Size:
14.25 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mylyn.sandbox.ui >Index: src/org/eclipse/mylyn/internal/sandbox/ui/editors/TaskEditorExtensions.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.sandbox.ui/src/org/eclipse/mylyn/internal/sandbox/ui/editors/TaskEditorExtensions.java,v >retrieving revision 1.1 >diff -u -r1.1 TaskEditorExtensions.java >--- src/org/eclipse/mylyn/internal/sandbox/ui/editors/TaskEditorExtensions.java 6 Jun 2008 22:55:54 -0000 1.1 >+++ src/org/eclipse/mylyn/internal/sandbox/ui/editors/TaskEditorExtensions.java 12 Jun 2008 10:52:43 -0000 >@@ -34,6 +34,7 @@ > private static boolean initialized; > > public static SortedSet<RegisteredTaskEditorExtension> getTaskEditorExtensions() { >+ init(); > return new TreeSet<RegisteredTaskEditorExtension>(extensionsById.values()); > } > >Index: src/org/eclipse/mylyn/internal/sandbox/ui/editors/TaskEditorExtensionReader.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.sandbox.ui/src/org/eclipse/mylyn/internal/sandbox/ui/editors/TaskEditorExtensionReader.java,v >retrieving revision 1.1 >diff -u -r1.1 TaskEditorExtensionReader.java >--- src/org/eclipse/mylyn/internal/sandbox/ui/editors/TaskEditorExtensionReader.java 6 Jun 2008 22:55:54 -0000 1.1 >+++ src/org/eclipse/mylyn/internal/sandbox/ui/editors/TaskEditorExtensionReader.java 12 Jun 2008 10:52:43 -0000 >@@ -28,7 +28,7 @@ > > public static final String ATTR_NAME = "name"; > >- public static final String EXTENSION_TASK_EDITOR_EXTENSIONS = "org.eclipse.mylyn.tasks.ui.taskEditorExtensions"; >+ public static final String EXTENSION_TASK_EDITOR_EXTENSIONS = "org.eclipse.mylyn.sandbox.ui.taskEditorExtensions"; > > private static final String REPOSITORY_ASSOCIATION = "repositoryAssociation"; > >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.sandbox.ui/plugin.xml,v >retrieving revision 1.83 >diff -u -r1.83 plugin.xml >--- plugin.xml 11 Jun 2008 23:46:16 -0000 1.83 >+++ plugin.xml 12 Jun 2008 10:52:43 -0000 >@@ -357,6 +357,13 @@ > state="true"> > </decorator> > </extension> >+ <extension >+ point="org.eclipse.mylyn.tasks.ui.editors"> >+ <pageFactory >+ class="org.eclipse.mylyn.internal.sandbox.ui.editors.ExtensibleBugzillaTaskEditorPageFactory" >+ id="org.eclipse.mylyn.sandbox..pageFactories.extensibleBugzillaTaskEditor"> >+ </pageFactory> >+ </extension> > > > >@@ -389,6 +396,7 @@ > contentProvider="org.eclipse.mylyn.internal.sandbox.ui.GroupedTaskListContentProvider:Sheduled"/> > </extension> > --> >+ > > </plugin> > >Index: src/org/eclipse/mylyn/internal/sandbox/ui/editors/ExtensibleBugzillaTaskEditorPage.java >=================================================================== >RCS file: src/org/eclipse/mylyn/internal/sandbox/ui/editors/ExtensibleBugzillaTaskEditorPage.java >diff -N src/org/eclipse/mylyn/internal/sandbox/ui/editors/ExtensibleBugzillaTaskEditorPage.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylyn/internal/sandbox/ui/editors/ExtensibleBugzillaTaskEditorPage.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,50 @@ >+/******************************************************************************* >+ * Copyright (c) 2004, 2007 Mylyn project committers and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ *******************************************************************************/ >+ >+package org.eclipse.mylyn.internal.sandbox.ui.editors; >+ >+import org.eclipse.mylyn.internal.bugzilla.ui.editor.BugzillaTaskEditorPage; >+import org.eclipse.mylyn.tasks.core.data.TaskAttribute; >+import org.eclipse.mylyn.tasks.ui.editors.AbstractAttributeEditor; >+import org.eclipse.mylyn.tasks.ui.editors.AttributeEditorFactory; >+import org.eclipse.mylyn.tasks.ui.editors.TaskEditor; >+import org.eclipse.swt.SWT; >+import org.eclipse.ui.contexts.IContextService; >+ >+/** >+ * A bugzilla task editor page that has wiki facilities. >+ * >+ * @author Jingwen Ou >+ */ >+public class ExtensibleBugzillaTaskEditorPage extends BugzillaTaskEditorPage { >+ >+ public ExtensibleBugzillaTaskEditorPage(TaskEditor editor) { >+ super(editor); >+ } >+ >+ @Override >+ protected AttributeEditorFactory createAttributeEditorFactory() { >+ final AttributeEditorFactory bugzillaFactory = super.createAttributeEditorFactory(); >+ AttributeEditorFactory factory = new AttributeEditorFactory(getModel(), getTaskRepository()) { >+ @Override >+ public AbstractAttributeEditor createEditor(String type, TaskAttribute taskAttribute) { >+ // replace description part and the comment part >+ AbstractTaskEditorExtension extension = TaskEditorExtensions.getTaskEditorExtension(getTaskRepository()); >+ if (extension != null) { >+ if (TaskAttribute.TYPE_LONG_RICH_TEXT.equals(type)) { >+ return new ExtensibleRichTextAttributeEditor((IContextService) getEditor().getEditorSite().getService( >+ IContextService.class), getModel(), getTaskRepository(), extension, taskAttribute, >+ SWT.MULTI); >+ } >+ } >+ return bugzillaFactory.createEditor(type, taskAttribute); >+ } >+ }; >+ return factory; >+ } >+} >Index: src/org/eclipse/mylyn/internal/sandbox/ui/editors/ExtensibleRichTextAttributeEditor.java >=================================================================== >RCS file: src/org/eclipse/mylyn/internal/sandbox/ui/editors/ExtensibleRichTextAttributeEditor.java >diff -N src/org/eclipse/mylyn/internal/sandbox/ui/editors/ExtensibleRichTextAttributeEditor.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylyn/internal/sandbox/ui/editors/ExtensibleRichTextAttributeEditor.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,176 @@ >+/******************************************************************************* >+ * Copyright (c) 2004, 2007 Mylyn project committers and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ *******************************************************************************/ >+ >+package org.eclipse.mylyn.internal.sandbox.ui.editors; >+ >+import org.eclipse.jface.text.Document; >+import org.eclipse.jface.text.ITextListener; >+import org.eclipse.jface.text.TextEvent; >+import org.eclipse.jface.text.source.SourceViewer; >+import org.eclipse.jface.viewers.Viewer; >+import org.eclipse.mylyn.internal.provisional.commons.ui.CommonThemes; >+import org.eclipse.mylyn.internal.tasks.ui.editors.RichTextAttributeEditor; >+import org.eclipse.mylyn.tasks.core.TaskRepository; >+import org.eclipse.mylyn.tasks.core.data.TaskAttribute; >+import org.eclipse.mylyn.tasks.core.data.TaskDataModel; >+import org.eclipse.swt.SWT; >+import org.eclipse.swt.custom.CTabFolder; >+import org.eclipse.swt.custom.CTabItem; >+import org.eclipse.swt.events.DisposeEvent; >+import org.eclipse.swt.events.DisposeListener; >+import org.eclipse.swt.events.FocusEvent; >+import org.eclipse.swt.events.FocusListener; >+import org.eclipse.swt.events.SelectionEvent; >+import org.eclipse.swt.events.SelectionListener; >+import org.eclipse.swt.graphics.Font; >+import org.eclipse.swt.widgets.Composite; >+import org.eclipse.ui.PlatformUI; >+import org.eclipse.ui.contexts.IContextActivation; >+import org.eclipse.ui.contexts.IContextService; >+import org.eclipse.ui.forms.widgets.FormToolkit; >+import org.eclipse.ui.themes.IThemeManager; >+ >+/** >+ * A multitab source viewer that can edit and preview Textile wikitext markup. >+ * >+ * TODO generalize RichTextAttributeEditor: add a protected method to create the SourceViewer then subclasses can then >+ * create its own SourceViewer without overriding createControl and copying the code in it >+ * >+ * @author Jingwen Ou >+ */ >+public class ExtensibleRichTextAttributeEditor extends RichTextAttributeEditor { >+ >+ private SourceViewer source; >+ >+ private final TaskRepository taskRepository; >+ >+ private final int styles; >+ >+ private final IContextService contextService; >+ >+ private IContextActivation contextActivation; >+ >+ private final AbstractTaskEditorExtension extension; >+ >+ public ExtensibleRichTextAttributeEditor(IContextService contextService, TaskDataModel manager, >+ TaskRepository taskRepository, AbstractTaskEditorExtension extension, TaskAttribute taskAttribute, >+ int styles) { >+ super(manager, taskRepository, taskAttribute, styles); >+ this.contextService = contextService; >+ this.taskRepository = taskRepository; >+ this.extension = extension; >+ this.styles = styles; >+ } >+ >+ @Override >+ public SourceViewer getViewer() { >+ return source; >+ } >+ >+ @Override >+ public void createControl(Composite parent, FormToolkit toolkit) { >+ if (isReadOnly()) { >+ source = extension.createViewer(taskRepository, parent, styles); >+ source.setDocument(new Document(getValue())); >+ >+ setControl(source instanceof Viewer ? ((Viewer) source).getControl() : source.getTextWidget()); >+ } else { >+ CTabFolder folder = new CTabFolder(parent, SWT.FLAT | SWT.BOTTOM); >+ >+ /** wikitext markup editor **/ >+ >+ CTabItem viewerItem = new CTabItem(folder, SWT.NONE); >+ viewerItem.setText("Source"); >+ viewerItem.setToolTipText("Edit Source"); >+ >+ source = extension.createEditor(taskRepository, folder, styles | SWT.V_SCROLL); >+ if (source.getDocument() == null) { >+ source.setDocument(new Document(getValue())); >+ } >+ source.addTextListener(new ITextListener() { >+ public void textChanged(TextEvent event) { >+ // filter out events caused by text presentation changes, e.g. annotation drawing >+ String value = source.getTextWidget().getText(); >+ if (!getValue().equals(value)) { >+ setValue(value); >+ } >+ } >+ }); >+ source.getControl().setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER); >+ >+ //setting up focus stuff, copied from Daivd's solution >+ FocusListener focusListener = new FocusListener() { >+ >+ public void focusGained(FocusEvent e) { >+ setContext(); >+ } >+ >+ public void focusLost(FocusEvent e) { >+ unsetContext(); >+ } >+ }; >+ source.getTextWidget().addFocusListener(focusListener); >+ DisposeListener disposeListener = new DisposeListener() { >+ public void widgetDisposed(DisposeEvent e) { >+ unsetContext(); >+ } >+ }; >+ source.getTextWidget().addDisposeListener(disposeListener); >+ >+ viewerItem.setControl(source instanceof Viewer ? ((Viewer) source).getControl() : source.getTextWidget()); >+ folder.setSelection(viewerItem); >+ >+ /** wikitext markup viewer **/ >+ >+ CTabItem previewItem = new CTabItem(folder, SWT.NONE); >+ previewItem.setText("Preview"); >+ previewItem.setToolTipText("Preview Source"); >+ >+ final SourceViewer preview = extension.createViewer(taskRepository, folder, styles); >+ >+ previewItem.setControl(preview instanceof Viewer ? ((Viewer) preview).getControl() >+ : preview.getTextWidget()); >+ >+ folder.addSelectionListener(new SelectionListener() { >+ public void widgetDefaultSelected(SelectionEvent selectionevent) { >+ widgetSelected(selectionevent); >+ } >+ >+ public void widgetSelected(SelectionEvent selectionevent) { >+ Document document = new Document(source.getDocument().get()); >+ preview.setDocument(document); >+ } >+ }); >+ >+ setControl(folder); >+ } >+ >+ IThemeManager themeManager = PlatformUI.getWorkbench().getThemeManager(); >+ Font font = themeManager.getCurrentTheme().getFontRegistry().get(CommonThemes.FONT_EDITOR_COMMENT); >+ source.getTextWidget().setFont(font); >+ toolkit.adapt(source.getControl(), true, false); >+ >+ } >+ >+ protected void unsetContext() { >+ if (contextActivation != null) { >+ contextService.deactivateContext(contextActivation); >+ contextActivation = null; >+ } >+ } >+ >+ protected void setContext() { >+ if (contextActivation != null) { >+ contextService.deactivateContext(contextActivation); >+ contextActivation = null; >+ } >+ if (contextService != null && extension.getEditorContextId() != null) { >+ contextActivation = contextService.activateContext(extension.getEditorContextId()); >+ } >+ } >+} >Index: src/org/eclipse/mylyn/internal/sandbox/ui/editors/ExtensibleBugzillaTaskEditorPageFactory.java >=================================================================== >RCS file: src/org/eclipse/mylyn/internal/sandbox/ui/editors/ExtensibleBugzillaTaskEditorPageFactory.java >diff -N src/org/eclipse/mylyn/internal/sandbox/ui/editors/ExtensibleBugzillaTaskEditorPageFactory.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylyn/internal/sandbox/ui/editors/ExtensibleBugzillaTaskEditorPageFactory.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,40 @@ >+/******************************************************************************* >+ * Copyright (c) 2004, 2007 Mylyn project committers and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ *******************************************************************************/ >+ >+package org.eclipse.mylyn.internal.sandbox.ui.editors; >+ >+import org.eclipse.mylyn.internal.bugzilla.ui.editor.BugzillaTaskEditorPageFactory; >+import org.eclipse.mylyn.tasks.ui.editors.TaskEditor; >+import org.eclipse.mylyn.tasks.ui.editors.TaskEditorInput; >+import org.eclipse.ui.forms.editor.FormPage; >+ >+/** >+ * A bugzilla task editor page factory that invokes a task editor page that has wiki facilities >+ * >+ * @author Jingwen Ou >+ * @author Steffen Pingel >+ */ >+public class ExtensibleBugzillaTaskEditorPageFactory extends BugzillaTaskEditorPageFactory { >+ >+ @Override >+ public boolean canCreatePageFor(TaskEditorInput input) { >+ return super.canCreatePageFor(input) >+ && TaskEditorExtensions.getTaskEditorExtension(input.getTaskRepository()) != null; >+ } >+ >+ @Override >+ public FormPage createPage(TaskEditor parentEditor) { >+ return new ExtensibleBugzillaTaskEditorPage(parentEditor); >+ } >+ >+ @Override >+ public String[] getConflictingIds(TaskEditorInput input) { >+ return new String[] { "org.eclipse.mylyn.bugzilla.ui.pageFactory" }; >+ } >+ >+}
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 235222
:
103264
|
103615
|
104084
|
104233
|
104234
|
104240
|
104576
|
104592
| 104650 |
104651
|
104678
|
104721