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 104240 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]
patch against sandbox for Textile-J contributed editor
mylyn.sandbox.patch.txt (text/plain), 15.29 KB, created by
David Green
on 2008-06-09 21:36:38 EDT
(
hide
)
Description:
patch against sandbox for Textile-J contributed editor
Filename:
MIME Type:
Creator:
David Green
Created:
2008-06-09 21:36:38 EDT
Size:
15.29 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mylyn.sandbox.ui >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 10 Jun 2008 01:28:00 -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: 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 10 Jun 2008 01:28:00 -0000 >@@ -34,6 +34,7 @@ > private static boolean initialized; > > public static SortedSet<RegisteredTaskEditorExtension> getTaskEditorExtensions() { >+ init(); > return new TreeSet<RegisteredTaskEditorExtension>(extensionsById.values()); > } > >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.sandbox.ui/plugin.xml,v >retrieving revision 1.82 >diff -u -r1.82 plugin.xml >--- plugin.xml 6 Jun 2008 22:55:55 -0000 1.82 >+++ plugin.xml 10 Jun 2008 01:28:00 -0000 >@@ -389,6 +389,14 @@ > contentProvider="org.eclipse.mylyn.internal.sandbox.ui.GroupedTaskListContentProvider:Sheduled"/> > </extension> > --> >+ >+ <extension >+ point="org.eclipse.mylyn.tasks.ui.editors"> >+ <pageFactory >+ class="org.eclipse.mylyn.internal.sandbox.ui.editors.BuzillaTaskEditorPageFactory2" >+ id="org.eclipse.mylyn.internal.sandbox.ui.bugzillaPageFactory2"> >+ </pageFactory> >+ </extension> > > </plugin> > >Index: src/org/eclipse/mylyn/internal/sandbox/ui/editors/ExtensionAttributeEditorFactory.java >=================================================================== >RCS file: src/org/eclipse/mylyn/internal/sandbox/ui/editors/ExtensionAttributeEditorFactory.java >diff -N src/org/eclipse/mylyn/internal/sandbox/ui/editors/ExtensionAttributeEditorFactory.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylyn/internal/sandbox/ui/editors/ExtensionAttributeEditorFactory.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,54 @@ >+/******************************************************************************* >+ * 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.tasks.core.TaskRepository; >+import org.eclipse.mylyn.tasks.core.data.TaskAttribute; >+import org.eclipse.mylyn.tasks.core.data.TaskDataModel; >+import org.eclipse.mylyn.tasks.ui.editors.AbstractAttributeEditor; >+import org.eclipse.mylyn.tasks.ui.editors.AttributeEditorFactory; >+import org.eclipse.swt.SWT; >+import org.eclipse.ui.IEditorSite; >+import org.eclipse.ui.contexts.IContextService; >+ >+public class ExtensionAttributeEditorFactory extends AttributeEditorFactory { >+ >+ private final AbstractTaskEditorExtension extension; >+ >+ private final TaskDataModel model; >+ >+ private final TaskRepository taskRepository; >+ >+ private final IEditorSite editorSite; >+ >+ public ExtensionAttributeEditorFactory(IEditorSite editorSite, TaskDataModel model, TaskRepository taskRepository) { >+ super(model, taskRepository); >+ this.model = model; >+ this.taskRepository = taskRepository; >+ this.editorSite = editorSite; >+ extension = TaskEditorExtensions.getTaskEditorExtension(taskRepository); >+ } >+ >+ @Override >+ public AbstractAttributeEditor createEditor(String type, TaskAttribute taskAttribute) { >+ if (extension != null) { >+ if (TaskAttribute.TYPE_SHORT_RICH_TEXT.equals(type)) { >+ return new ExtensionRichTextAttributeEditor( >+ (IContextService) editorSite.getService(IContextService.class), model, taskRepository, >+ extension, taskAttribute, SWT.SINGLE); >+ } else if (TaskAttribute.TYPE_LONG_RICH_TEXT.equals(type)) { >+ return new ExtensionRichTextAttributeEditor( >+ (IContextService) editorSite.getService(IContextService.class), model, taskRepository, >+ extension, taskAttribute, SWT.MULTI); >+ } >+ } >+ return super.createEditor(type, taskAttribute); >+ } >+ >+} >Index: src/org/eclipse/mylyn/internal/sandbox/ui/editors/ExtensionRichTextAttributeEditor.java >=================================================================== >RCS file: src/org/eclipse/mylyn/internal/sandbox/ui/editors/ExtensionRichTextAttributeEditor.java >diff -N src/org/eclipse/mylyn/internal/sandbox/ui/editors/ExtensionRichTextAttributeEditor.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylyn/internal/sandbox/ui/editors/ExtensionRichTextAttributeEditor.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,157 @@ >+/******************************************************************************* >+ * 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.mylyn.internal.provisional.commons.ui.CommonThemes; >+import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal; >+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.mylyn.tasks.ui.editors.AbstractAttributeEditor; >+import org.eclipse.mylyn.tasks.ui.editors.LayoutHint; >+import org.eclipse.mylyn.tasks.ui.editors.LayoutHint.ColumnSpan; >+import org.eclipse.mylyn.tasks.ui.editors.LayoutHint.RowSpan; >+import org.eclipse.swt.SWT; >+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.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; >+ >+public class ExtensionRichTextAttributeEditor extends AbstractAttributeEditor { >+ >+ private final AbstractTaskEditorExtension extension; >+ >+ private final TaskRepository taskRepository; >+ >+ private final int style; >+ >+ private SourceViewer viewer; >+ >+ private final IContextService contextService; >+ >+ private FocusListener focusListener; >+ >+ private IContextActivation contextActivation; >+ >+ private DisposeListener disposeListener; >+ >+ public ExtensionRichTextAttributeEditor(IContextService contextService, TaskDataModel manager, >+ TaskRepository taskRepository, AbstractTaskEditorExtension extension, TaskAttribute taskAttribute, int style) { >+ super(manager, taskAttribute); >+ this.contextService = contextService; >+ this.taskRepository = taskRepository; >+ this.extension = extension; >+ this.style = style; >+ if ((style & SWT.MULTI) != 0) { >+ setLayoutHint(new LayoutHint(RowSpan.MULTIPLE, ColumnSpan.MULTIPLE)); >+ } else { >+ setLayoutHint(new LayoutHint(RowSpan.SINGLE, ColumnSpan.MULTIPLE)); >+ } >+ } >+ >+ @Override >+ public void createControl(Composite parent, FormToolkit toolkit) { >+ int style = this.style; >+ if (!isReadOnly() && (style & TasksUiInternal.SWT_NO_SCROLL) == 0) { >+ style |= SWT.V_SCROLL; >+ } >+ style = SWT.FLAT | SWT.WRAP | style; >+ >+ if (isReadOnly()) { >+ viewer = extension.createViewer(taskRepository, parent, style); >+ } else { >+ viewer = extension.createEditor(taskRepository, parent, style); >+ } >+ Document document = new Document(getValue()); >+ >+ IThemeManager themeManager = PlatformUI.getWorkbench().getThemeManager(); >+ Font font = themeManager.getCurrentTheme().getFontRegistry().get(CommonThemes.FONT_EDITOR_COMMENT); >+ viewer.getTextWidget().setFont(font); >+ >+ if (isReadOnly()) { >+ viewer.setEditable(false); >+ viewer.setDocument(document); >+ } else { >+ viewer.setEditable(true); >+ viewer.setDocument(document); >+ >+ viewer.addTextListener(new ITextListener() { >+ public void textChanged(TextEvent event) { >+ // filter out events caused by text presentation changes, e.g. annotation drawing >+ String value = viewer.getTextWidget().getText(); >+ if (!getValue().equals(value)) { >+ setValue(value); >+ } >+ } >+ }); >+ viewer.getControl().setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER); >+ } >+ >+ toolkit.adapt(viewer.getTextWidget(), true, false); >+ >+ setControl(viewer.getTextWidget()); >+ >+ focusListener = new FocusListener() { >+ >+ public void focusGained(FocusEvent e) { >+ setContext(); >+ } >+ >+ public void focusLost(FocusEvent e) { >+ unsetContext(); >+ } >+ }; >+ >+ viewer.getTextWidget().addFocusListener(focusListener); >+ disposeListener = new DisposeListener() { >+ public void widgetDisposed(DisposeEvent e) { >+ unsetContext(); >+ } >+ }; >+ >+ viewer.getTextWidget().addDisposeListener(disposeListener); >+ } >+ >+ 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()); >+ } >+ } >+ >+ public String getValue() { >+ return getAttributeMapper().getValue(getTaskAttribute()); >+ } >+ >+ public void setValue(String value) { >+ getAttributeMapper().setValue(getTaskAttribute(), value); >+ attributeChanged(); >+ } >+} >Index: src/org/eclipse/mylyn/internal/sandbox/ui/editors/BuzillaTaskEditorPageFactory2.java >=================================================================== >RCS file: src/org/eclipse/mylyn/internal/sandbox/ui/editors/BuzillaTaskEditorPageFactory2.java >diff -N src/org/eclipse/mylyn/internal/sandbox/ui/editors/BuzillaTaskEditorPageFactory2.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylyn/internal/sandbox/ui/editors/BuzillaTaskEditorPageFactory2.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,61 @@ >+/******************************************************************************* >+ * 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.core.BugzillaCorePlugin; >+import org.eclipse.mylyn.internal.provisional.commons.ui.CommonImages; >+import org.eclipse.mylyn.tasks.ui.ITasksUiConstants; >+import org.eclipse.mylyn.tasks.ui.TasksUiImages; >+import org.eclipse.mylyn.tasks.ui.TasksUiUtil; >+import org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPageFactory; >+import org.eclipse.mylyn.tasks.ui.editors.TaskEditor; >+import org.eclipse.mylyn.tasks.ui.editors.TaskEditorInput; >+import org.eclipse.swt.graphics.Image; >+import org.eclipse.ui.forms.editor.FormPage; >+ >+public class BuzillaTaskEditorPageFactory2 extends AbstractTaskEditorPageFactory { >+ >+ @Override >+ public boolean canCreatePageFor(TaskEditorInput input) { >+ if (input.getTask().getConnectorKind().equals(BugzillaCorePlugin.CONNECTOR_KIND) >+ || TasksUiUtil.isOutgoingNewTask(input.getTask(), BugzillaCorePlugin.CONNECTOR_KIND)) { >+ return true; >+ } >+ return false; >+ } >+ >+ @Override >+ public FormPage createPage(TaskEditor parentEditor) { >+ return new BugzillaTaskEditorPage2(parentEditor); >+ } >+ >+ @Override >+ public String[] getConflictingIds(TaskEditorInput input) { >+ if (!input.getTask().getConnectorKind().equals(BugzillaCorePlugin.CONNECTOR_KIND)) { >+ return new String[] { ITasksUiConstants.ID_PAGE_PLANNING }; >+ } >+ return null; >+ } >+ >+ @Override >+ public int getPriority() { >+ return PRIORITY_TASK; >+ } >+ >+ @Override >+ public Image getPageImage() { >+ return CommonImages.getImage(TasksUiImages.REPOSITORY); >+ } >+ >+ @Override >+ public String getPageText() { >+ return "Bugzilla 2"; >+ } >+ >+} >Index: src/org/eclipse/mylyn/internal/sandbox/ui/editors/BugzillaTaskEditorPage2.java >=================================================================== >RCS file: src/org/eclipse/mylyn/internal/sandbox/ui/editors/BugzillaTaskEditorPage2.java >diff -N src/org/eclipse/mylyn/internal/sandbox/ui/editors/BugzillaTaskEditorPage2.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylyn/internal/sandbox/ui/editors/BugzillaTaskEditorPage2.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,26 @@ >+/******************************************************************************* >+ * 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.ui.editors.AttributeEditorFactory; >+import org.eclipse.mylyn.tasks.ui.editors.TaskEditor; >+ >+public class BugzillaTaskEditorPage2 extends BugzillaTaskEditorPage { >+ >+ public BugzillaTaskEditorPage2(TaskEditor editor) { >+ super(editor); >+ } >+ >+ @Override >+ protected AttributeEditorFactory createAttributeEditorFactory() { >+ return new ExtensionAttributeEditorFactory(getEditor().getEditorSite(), getModel(), getTaskRepository()); >+ } >+ >+}
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