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 104084 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]
integration step 1
clipboard.txt (text/plain), 39.59 KB, created by
Jingwen 'Owen' Ou
on 2008-06-07 08:57:18 EDT
(
hide
)
Description:
integration step 1
Filename:
MIME Type:
Creator:
Jingwen 'Owen' Ou
Created:
2008-06-07 08:57:18 EDT
Size:
39.59 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 7 Jun 2008 12:49:02 -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.82 >diff -u -r1.82 plugin.xml >--- plugin.xml 6 Jun 2008 22:55:55 -0000 1.82 >+++ plugin.xml 7 Jun 2008 12:49:02 -0000 >@@ -358,7 +358,29 @@ > </decorator> > </extension> > >- >+ <extension >+ point="org.eclipse.mylyn.tasks.ui.editors"> >+ <pageFactory >+ class="org.eclipse.mylyn.internal.sandbox.ui.editors.bugzilla.BugzillaTaskEditorPageFactory" >+ id="org.eclipse.mylyn.bugzilla.ui.pageFactory"> >+ </pageFactory> >+ </extension> >+ <extension >+ point="org.eclipse.mylyn.sandbox.ui.taskEditorExtensions"> >+ <taskEditorExtension >+ class="org.eclipse.mylyn.internal.sandbox.ui.editors.DefalutTaskEditorExtension" >+ id="org.eclipse.mylyn.sandbox.ui.defaultTaskEditorExtension" >+ name="Textile"> >+ </taskEditorExtension> >+ <repositoryAssociation >+ repository="bugzilla" >+ taskEditorExtension="org.eclipse.mylyn.sandbox.ui.defaultTaskEditorExtension"> >+ </repositoryAssociation> >+ <repositoryAssociation >+ repository="local" >+ taskEditorExtension="org.eclipse.mylyn.sandbox.ui.defaultTaskEditorExtension"> >+ </repositoryAssociation> >+ </extension> > > <!-- > <extension point="org.eclipse.mylyn.tasks.ui.presentations"> >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.sandbox.ui/META-INF/MANIFEST.MF,v >retrieving revision 1.210 >diff -u -r1.210 MANIFEST.MF >--- META-INF/MANIFEST.MF 6 Jun 2008 22:55:54 -0000 1.210 >+++ META-INF/MANIFEST.MF 7 Jun 2008 12:49:02 -0000 >@@ -27,7 +27,8 @@ > org.eclipse.mylyn.monitor.core;bundle-version="[3.0.0,4.0.0)", > org.eclipse.mylyn.resources.ui;bundle-version="[3.0.0,4.0.0)", > org.eclipse.mylyn.ide.ant;bundle-version="[3.0.0,4.0.0)", >- org.eclipse.mylyn.pde.ui;bundle-version="[3.0.0,4.0.0)" >+ org.eclipse.mylyn.pde.ui;bundle-version="[3.0.0,4.0.0)", >+ org.eclipse.mylyn.wikitext.textile.core;bundle-version="1.0.0" > Bundle-ActivationPolicy: lazy > Bundle-Vendor: Eclipse.org > Export-Package: org.eclipse.mylyn.internal.sandbox.bridge.bugs;x-internal:=true, >@@ -40,3 +41,5 @@ > org.eclipse.mylyn.internal.sandbox.ui.views;x-internal:=true > Bundle-RequiredExecutionEnvironment: J2SE-1.5 > Bundle-ClassPath: . >+Import-Package: org.eclipse.mylyn.wikitext.core.parser.markup, >+ org.eclipse.mylyn.wikitext.ui.viewer >Index: src/org/eclipse/mylyn/internal/sandbox/ui/editors/bugzilla/WikiTextAttributeEditor.java >=================================================================== >RCS file: src/org/eclipse/mylyn/internal/sandbox/ui/editors/bugzilla/WikiTextAttributeEditor.java >diff -N src/org/eclipse/mylyn/internal/sandbox/ui/editors/bugzilla/WikiTextAttributeEditor.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylyn/internal/sandbox/ui/editors/bugzilla/WikiTextAttributeEditor.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,103 @@ >+/******************************************************************************* >+ * 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.bugzilla; >+ >+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.sandbox.ui.editors.AbstractTaskEditorExtension; >+import org.eclipse.mylyn.internal.sandbox.ui.editors.TaskEditorExtensionHelper; >+import org.eclipse.mylyn.internal.sandbox.ui.editors.TaskEditorExtensions; >+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.graphics.Font; >+import org.eclipse.swt.widgets.Composite; >+import org.eclipse.ui.PlatformUI; >+import org.eclipse.ui.forms.widgets.FormToolkit; >+import org.eclipse.ui.themes.IThemeManager; >+ >+public class WikiTextAttributeEditor extends RichTextAttributeEditor { >+ >+ private final int style; >+ >+ private final TaskRepository taskRepository; >+ >+ private SourceViewer viewer; >+ >+ public WikiTextAttributeEditor(TaskDataModel manager, TaskRepository taskRepository, TaskAttribute taskAttribute, >+ int style) { >+ super(manager, taskRepository, taskAttribute, style); >+ this.style = style; >+ this.taskRepository = taskRepository; >+ >+ TaskEditorExtensionHelper.initEditorExtensions(); >+ } >+ >+ @Override >+ public void createControl(Composite parent, FormToolkit toolkit) { >+ int style = this.style; >+ if (!isReadOnly()) { >+ style |= SWT.V_SCROLL; >+ } >+ style = SWT.FLAT | SWT.WRAP | style; >+ >+ AbstractTaskEditorExtension extension = TaskEditorExtensions.getTaskEditorExtension(taskRepository); >+ if (extension != null) { >+ if (isReadOnly()) { >+ viewer = extension.createViewer(taskRepository, parent, style); >+ } else { >+ viewer = extension.createEditor(taskRepository, parent, style); >+ } >+ } >+ Document document = new Document(getValue()); >+ >+ if (viewer == null) { >+ super.createControl(parent, toolkit); >+ return; >+ } >+ >+ if (isReadOnly()) { >+ viewer.setEditable(false); >+ viewer.setDocument(document); >+ } else { >+ viewer.setEditable(true); >+ if (viewer.getDocument() == null) { >+ 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); >+ } >+ >+ IThemeManager themeManager = PlatformUI.getWorkbench().getThemeManager(); >+ Font font = themeManager.getCurrentTheme().getFontRegistry().get(CommonThemes.FONT_EDITOR_COMMENT); >+ viewer.getTextWidget().setFont(font); >+ toolkit.adapt(viewer.getTextWidget(), true, false); >+ >+ setControl(viewer.getTextWidget()); >+ } >+ >+ @Override >+ public SourceViewer getViewer() { >+ return viewer; >+ } >+ >+} >Index: src/org/eclipse/mylyn/internal/sandbox/ui/editors/bugzilla/TaskEditorWikiNewCommentPart.java >=================================================================== >RCS file: src/org/eclipse/mylyn/internal/sandbox/ui/editors/bugzilla/TaskEditorWikiNewCommentPart.java >diff -N src/org/eclipse/mylyn/internal/sandbox/ui/editors/bugzilla/TaskEditorWikiNewCommentPart.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylyn/internal/sandbox/ui/editors/bugzilla/TaskEditorWikiNewCommentPart.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,27 @@ >+/******************************************************************************* >+ * 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.bugzilla; >+ >+import org.eclipse.mylyn.tasks.core.data.TaskAttribute; >+import org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPage; >+import org.eclipse.ui.forms.widgets.ExpandableComposite; >+ >+public class TaskEditorWikiNewCommentPart extends TaskEditorWikiTextPart { >+ public TaskEditorWikiNewCommentPart() { >+ setPartName("New Comment"); >+ setSectionStyle(ExpandableComposite.TITLE_BAR | ExpandableComposite.EXPANDED); >+ setExpandVertically(true); >+ } >+ >+ @Override >+ public void initialize(AbstractTaskEditorPage taskEditorPage) { >+ super.initialize(taskEditorPage); >+ setAttribute(getModel().getTaskData().getRoot().getMappedAttribute(TaskAttribute.COMMENT_NEW)); >+ } >+} >Index: src/org/eclipse/mylyn/internal/sandbox/ui/editors/bugzilla/BugzillaTaskEditorPage.java >=================================================================== >RCS file: src/org/eclipse/mylyn/internal/sandbox/ui/editors/bugzilla/BugzillaTaskEditorPage.java >diff -N src/org/eclipse/mylyn/internal/sandbox/ui/editors/bugzilla/BugzillaTaskEditorPage.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylyn/internal/sandbox/ui/editors/bugzilla/BugzillaTaskEditorPage.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,144 @@ >+/******************************************************************************* >+ * 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.bugzilla; >+ >+import java.util.Set; >+ >+import org.eclipse.core.runtime.CoreException; >+import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute; >+import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin; >+import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants; >+import org.eclipse.mylyn.internal.bugzilla.ui.editor.BugzillaCcAttributeEditor; >+import org.eclipse.mylyn.internal.bugzilla.ui.editor.BugzillaKeywordAttributeEditor; >+import org.eclipse.mylyn.internal.bugzilla.ui.editor.BugzillaPeoplePart; >+import org.eclipse.mylyn.internal.bugzilla.ui.editor.BugzillaPlanningEditorPart; >+import org.eclipse.mylyn.tasks.core.data.TaskAttribute; >+import org.eclipse.mylyn.tasks.core.data.TaskData; >+import org.eclipse.mylyn.tasks.core.data.TaskDataModel; >+import org.eclipse.mylyn.tasks.ui.TasksUi; >+import org.eclipse.mylyn.tasks.ui.editors.AbstractAttributeEditor; >+import org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPage; >+import org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPart; >+import org.eclipse.mylyn.tasks.ui.editors.AttributeEditorFactory; >+import org.eclipse.mylyn.tasks.ui.editors.TaskEditor; >+import org.eclipse.mylyn.tasks.ui.editors.TaskEditorInput; >+import org.eclipse.mylyn.tasks.ui.editors.TaskEditorPartDescriptor; >+ >+/** >+ * @author Rob Elves >+ * @since 3.0 >+ */ >+public class BugzillaTaskEditorPage extends AbstractTaskEditorPage { >+ >+ public static final String ID_PART_BUGZILLA_PLANNING = "org.eclipse.mylyn.bugzilla.ui.editors.part.planning"; >+ >+ public BugzillaTaskEditorPage(TaskEditor editor) { >+ super(editor, BugzillaCorePlugin.CONNECTOR_KIND); >+ } >+ >+ @Override >+ protected Set<TaskEditorPartDescriptor> createPartDescriptors() { >+ Set<TaskEditorPartDescriptor> descriptors = super.createPartDescriptors(); >+ >+ // remove unnecessary default editor parts >+ for (TaskEditorPartDescriptor taskEditorPartDescriptor : descriptors) { >+ if (taskEditorPartDescriptor.getId().equals(ID_PART_PEOPLE)) { >+ descriptors.remove(taskEditorPartDescriptor); >+ break; >+ } >+ } >+ >+ for (TaskEditorPartDescriptor taskEditorPartDescriptor : descriptors) { >+ if (taskEditorPartDescriptor.getId().equals(ID_PART_NEW_COMMENT)) { >+ descriptors.remove(taskEditorPartDescriptor); >+ break; >+ } >+ } >+ >+ // Add Bugzilla Planning part >+ try { >+ TaskData data = TasksUi.getTaskDataManager().getTaskData(getTask()); >+ if (data != null) { >+ TaskAttribute attrEstimatedTime = data.getRoot().getMappedAttribute( >+ BugzillaAttribute.ESTIMATED_TIME.getKey()); >+ if (attrEstimatedTime != null) { >+ descriptors.add(new TaskEditorPartDescriptor(ID_PART_BUGZILLA_PLANNING) { >+ @Override >+ public AbstractTaskEditorPart createPart() { >+ return new BugzillaPlanningEditorPart(); >+ } >+ }.setPath(PATH_ATTRIBUTES)); >+ } >+ } >+ } catch (CoreException e) { >+ // ignore >+ } >+ >+ // Add the updated Bugzilla people part >+ descriptors.add(new TaskEditorPartDescriptor(ID_PART_PEOPLE) { >+ @Override >+ public AbstractTaskEditorPart createPart() { >+ return new BugzillaPeoplePart(); >+ } >+ }.setPath(PATH_PEOPLE)); >+ >+ // Add the new comment part with wiki integration >+ descriptors.add(new TaskEditorPartDescriptor(ID_PART_NEW_COMMENT) { >+ @Override >+ public AbstractTaskEditorPart createPart() { >+ return new TaskEditorWikiNewCommentPart(); >+ } >+ }.setPath(PATH_COMMENTS)); >+ >+ return descriptors; >+ } >+ >+ @Override >+ protected AttributeEditorFactory createAttributeEditorFactory() { >+ AttributeEditorFactory factory = new AttributeEditorFactory(getModel(), getTaskRepository()) { >+ @Override >+ public AbstractAttributeEditor createEditor(String type, TaskAttribute taskAttribute) { >+ AbstractAttributeEditor editor; >+ if (IBugzillaConstants.EDITOR_TYPE_KEYWORDS.equals(type)) { >+ editor = new BugzillaKeywordAttributeEditor(getModel(), taskAttribute); >+ } else if (IBugzillaConstants.EDITOR_TYPE_REMOVECC.equals(type)) { >+ editor = new BugzillaCcAttributeEditor(getModel(), taskAttribute); >+ } else { >+ editor = super.createEditor(type, taskAttribute); >+ if (TaskAttribute.TYPE_BOOLEAN.equals(type)) { >+ editor.setDecorationEnabled(false); >+ } >+ } >+ >+ return editor; >+ } >+ }; >+ return factory; >+ } >+ >+ @Override >+ protected TaskDataModel createModel(TaskEditorInput input) throws CoreException { >+ TaskDataModel model = super.createModel(input); >+ if (model.getTaskData().isNew()) { >+ TaskAttribute attrDescription = model.getTaskData().getRoot().getMappedAttribute(TaskAttribute.DESCRIPTION); >+ if (attrDescription != null) { >+ attrDescription.getMetaData().setReadOnly(false); >+ } >+ TaskAttribute attrOwner = model.getTaskData().getRoot().getMappedAttribute(TaskAttribute.USER_ASSIGNED); >+ if (attrOwner != null) { >+ attrOwner.getMetaData().setReadOnly(false); >+ } >+ TaskAttribute attrAddSelfToCc = model.getTaskData().getRoot().getMappedAttribute(TaskAttribute.ADD_SELF_CC); >+ if (attrAddSelfToCc != null) { >+ attrAddSelfToCc.getMetaData().setKind(null); >+ } >+ } >+ return model; >+ } >+} >Index: .refactorings/2008/6/23/refactorings.index >=================================================================== >RCS file: .refactorings/2008/6/23/refactorings.index >diff -N .refactorings/2008/6/23/refactorings.index >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ .refactorings/2008/6/23/refactorings.index 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,3 @@ >+1212827078015 Move compilation unit >+1212828531765 Move compilation units >+1212830996265 Extract method 'checkMarkupLanguage' >Index: src/org/eclipse/mylyn/internal/sandbox/ui/editors/MarkupTaskEditorExtension.java >=================================================================== >RCS file: src/org/eclipse/mylyn/internal/sandbox/ui/editors/MarkupTaskEditorExtension.java >diff -N src/org/eclipse/mylyn/internal/sandbox/ui/editors/MarkupTaskEditorExtension.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylyn/internal/sandbox/ui/editors/MarkupTaskEditorExtension.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,156 @@ >+/******************************************************************************* >+ * 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.source.IVerticalRuler; >+import org.eclipse.jface.text.source.SourceViewer; >+import org.eclipse.jface.viewers.Viewer; >+import org.eclipse.mylyn.tasks.core.TaskRepository; >+import org.eclipse.mylyn.wikitext.core.parser.markup.MarkupLanguage; >+import org.eclipse.mylyn.wikitext.ui.viewer.MarkupViewer; >+import org.eclipse.mylyn.wikitext.ui.viewer.MarkupViewerConfiguration; >+import org.eclipse.swt.SWT; >+import org.eclipse.swt.custom.CTabFolder; >+import org.eclipse.swt.custom.CTabItem; >+import org.eclipse.swt.widgets.Composite; >+import org.eclipse.swt.widgets.Control; >+ >+/** >+ * @author Jingwen Ou >+ */ >+public abstract class MarkupTaskEditorExtension extends AbstractTaskEditorExtension { >+ >+ private boolean enable; >+ >+ public abstract class MultiSourceViewer extends SourceViewer { >+ >+ private CTabFolder folder; >+ >+ public MultiSourceViewer(Composite parent, IVerticalRuler ruler, int styles) { >+ super(parent, ruler, styles); >+ } >+ >+ // FIXME so wired can't access FastMarkupPartitioner >+// private void configurePartitioning(IDocument document) { >+// FastMarkupPartitioner partitioner = new FastMarkupPartitioner(); >+// partitioner.setMarkupLanguage(markupLanguage.clone()); >+// partitioner.connect(document); >+// document.setDocumentPartitioner(partitioner); >+// } >+ >+ //surround the source viewer with CTabFolder if enable is true >+ @Override >+ public void createControl(Composite parent, int styles) { >+ if (!enable) { >+ super.createControl(parent, styles); >+ return; >+ } >+ >+ folder = new CTabFolder(parent, SWT.BOTTOM); >+ { >+ CTabItem viewerItem = new CTabItem(folder, SWT.NONE); >+ viewerItem.setText("Source"); >+ viewerItem.setToolTipText("Edit Source"); >+ >+ super.createControl(folder, styles); >+ >+ viewerItem.setControl(this.getTextWidget()); >+ folder.setSelection(viewerItem); >+ } >+ >+ { >+ CTabItem previewItem = new CTabItem(folder, SWT.NONE); >+ previewItem.setText("Preview"); >+ previewItem.setToolTipText("Preview Source"); >+ >+ SourceViewer previewViewer = createPreviewViewer(folder, styles); >+ >+ previewItem.setControl(previewViewer instanceof Viewer ? ((Viewer) previewViewer).getControl() >+ : previewViewer.getTextWidget()); >+ } >+ } >+ >+ protected abstract SourceViewer createPreviewViewer(Composite parent, int style); >+ >+ public Control getParentControl() { >+ return folder != null ? folder : this.getTextWidget().getParent(); >+ } >+ >+ public boolean isEnable() { >+ return enable; >+ } >+ >+// @Override >+// public void setDocument(IDocument document, IAnnotationModel annotationModel, int modelRangeOffset, >+// int modelRangeLength) { >+// configurePartitioning(document); >+// super.setDocument(document, annotationModel, modelRangeOffset, modelRangeLength); >+// } >+ } >+ >+ private MarkupLanguage markupLanguage;; >+ >+ public MarkupTaskEditorExtension() { >+ initializeMarkupLanguage(); >+ } >+ >+ private void checkMarkupLanguage() { >+ if (markupLanguage == null) { >+ throw new IllegalStateException(); >+ } >+ } >+ >+ protected SourceViewer createMultiSourceViewer(TaskRepository taskRepository, Composite parent, int style) { >+ return createMultiSourceViewer(taskRepository, parent, style, true); >+ } >+ >+ protected SourceViewer createMultiSourceViewer(final TaskRepository taskRepository, Composite parent, int style, >+ boolean enable) { >+ checkMarkupLanguage(); >+ >+ this.enable = enable; >+ >+ // FIXME words don't really wrap, also "enter" does not work >+ SourceViewer multiSourceViewer = new MultiSourceViewer(parent, null, style | SWT.FLAT | SWT.WRAP) { >+ >+ @Override >+ protected SourceViewer createPreviewViewer(Composite parent, int style) { >+ return createReadOnlyViewer(taskRepository, parent, style); >+ } >+ >+ }; >+ >+ multiSourceViewer.getTextWidget().setEditable(true); >+ >+ return multiSourceViewer; >+ >+ } >+ >+ protected SourceViewer createReadOnlyViewer(TaskRepository taskRepository, Composite parent, int style) { >+ checkMarkupLanguage(); >+ MarkupViewer markupViewer = new MarkupViewer(parent, null, style | SWT.FLAT | SWT.WRAP); >+ markupViewer.setMarkupLanguage(markupLanguage.clone()); >+ MarkupViewerConfiguration configuration = new MarkupViewerConfiguration(markupViewer); >+ markupViewer.configure(configuration); >+ >+ markupViewer.getTextWidget().setEditable(false); >+ >+ return markupViewer; >+ } >+ >+ public MarkupLanguage getMarkupLanguage() { >+ return markupLanguage; >+ } >+ >+ public abstract void initializeMarkupLanguage(); >+ >+ public void setMarkupLanguage(MarkupLanguage markupLanguage) { >+ this.markupLanguage = markupLanguage; >+ } >+} >Index: src/org/eclipse/mylyn/internal/sandbox/ui/editors/bugzilla/TaskEditorWikiTextPart.java >=================================================================== >RCS file: src/org/eclipse/mylyn/internal/sandbox/ui/editors/bugzilla/TaskEditorWikiTextPart.java >diff -N src/org/eclipse/mylyn/internal/sandbox/ui/editors/bugzilla/TaskEditorWikiTextPart.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylyn/internal/sandbox/ui/editors/bugzilla/TaskEditorWikiTextPart.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,131 @@ >+/******************************************************************************* >+ * 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.bugzilla; >+ >+import org.eclipse.jface.layout.GridDataFactory; >+import org.eclipse.mylyn.internal.sandbox.ui.editors.MarkupTaskEditorExtension.MultiSourceViewer; >+import org.eclipse.mylyn.internal.tasks.ui.editors.EditorUtil; >+import org.eclipse.mylyn.internal.tasks.ui.editors.RichTextAttributeEditor; >+import org.eclipse.mylyn.internal.tasks.ui.editors.TaskEditorRichTextPart; >+import org.eclipse.swt.SWT; >+import org.eclipse.swt.graphics.Point; >+import org.eclipse.swt.layout.GridData; >+import org.eclipse.swt.layout.GridLayout; >+import org.eclipse.swt.widgets.Composite; >+import org.eclipse.swt.widgets.Control; >+import org.eclipse.ui.forms.widgets.ExpandableComposite; >+import org.eclipse.ui.forms.widgets.FormToolkit; >+import org.eclipse.ui.forms.widgets.Section; >+import org.eclipse.ui.internal.EditorAreaHelper; >+import org.eclipse.ui.internal.WorkbenchPage; >+ >+public class TaskEditorWikiTextPart extends TaskEditorRichTextPart { >+ >+ private WikiTextAttributeEditor editor; >+ >+ private Composite composite; >+ >+ public TaskEditorWikiTextPart() { >+ setSectionStyle(ExpandableComposite.TITLE_BAR | ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED); >+ } >+ >+ @Override >+ public void createControl(Composite parent, FormToolkit toolkit) { >+ if (getAttribute() == null) { >+ return; >+ } >+ >+ editor = new WikiTextAttributeEditor(this.getTaskEditorPage().getModel(), this.getTaskEditorPage() >+ .getTaskRepository(), getAttribute(), SWT.SINGLE); >+ >+ Section section = createSection(parent, toolkit, getSectionStyle()); >+ >+ composite = toolkit.createComposite(section); >+ GridLayout layout = new GridLayout(); >+ layout.numColumns = 1; >+ composite.setLayout(layout); >+ >+ editor.createControl(composite, toolkit); >+ if (editor.isReadOnly()) { >+ GridDataFactory.fillDefaults().hint(EditorUtil.MAXIMUM_WIDTH, SWT.DEFAULT).applyTo(editor.getControl()); >+ } else { >+ final GridData gd = new GridData(); >+ // wrap text at this margin, see comment below >+ int width = getEditorWidth(); >+ // the goal is to make the text viewer as big as the text so it does not require scrolling when first drawn >+ // on screen >+ >+ //resizing CTabFolder if enable >+ Control control = editor.getViewer().getTextWidget(); >+ >+ if (editor.getViewer() instanceof MultiSourceViewer) { >+ control = ((MultiSourceViewer) editor.getViewer()).getParentControl(); >+ } >+ >+ Point size = control.computeSize(width, SWT.DEFAULT, true); >+ gd.widthHint = EditorUtil.MAXIMUM_WIDTH; >+ gd.horizontalAlignment = SWT.FILL; >+ gd.grabExcessHorizontalSpace = true; >+ // limit height to be avoid dynamic resizing of the text widget: >+ // MAXIMUM_HEIGHT < height < MAXIMUM_HEIGHT * 4 >+ //gd.minimumHeight = AbstractAttributeEditor.MAXIMUM_HEIGHT; >+ gd.heightHint = Math.min(Math.max(EditorUtil.MAXIMUM_HEIGHT, size.y), EditorUtil.MAXIMUM_HEIGHT * 4); >+ if (getExpandVertically()) { >+ gd.verticalAlignment = SWT.FILL; >+ gd.grabExcessVerticalSpace = true; >+ } >+ >+ control.setLayoutData(gd); >+ control.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER); >+ } >+ >+ getTaskEditorPage().getAttributeEditorToolkit().adapt(editor); >+ >+ toolkit.paintBordersFor(composite); >+ section.setClient(composite); >+ setSection(toolkit, section); >+ >+ } >+ >+ @Override >+ protected Composite getComposite() { >+ return composite; >+ } >+ >+ private int getEditorWidth() { >+ int widthHint = 0; >+ if (getManagedForm() != null && getManagedForm().getForm() != null) { >+ widthHint = getManagedForm().getForm().getClientArea().width - 90; >+ } >+ if (widthHint <= 0 && getTaskEditorPage().getEditor().getEditorSite() != null >+ && getTaskEditorPage().getEditor().getEditorSite().getPage() != null) { >+ EditorAreaHelper editorManager = ((WorkbenchPage) getTaskEditorPage().getEditor().getEditorSite().getPage()).getEditorPresentation(); >+ if (editorManager != null && editorManager.getLayoutPart() != null) { >+ widthHint = editorManager.getLayoutPart().getControl().getBounds().width - 90; >+ } >+ } >+ if (widthHint <= 0) { >+ widthHint = EditorUtil.MAXIMUM_WIDTH; >+ } >+ return widthHint; >+ } >+ >+ @Override >+ protected RichTextAttributeEditor getEditor() { >+ return editor; >+ } >+ >+ @Override >+ public void setFocus() { >+ if (editor != null) { >+ editor.getControl().setFocus(); >+ } >+ } >+ >+} >Index: src/org/eclipse/mylyn/internal/sandbox/ui/editors/DefalutTaskEditorExtension.java >=================================================================== >RCS file: src/org/eclipse/mylyn/internal/sandbox/ui/editors/DefalutTaskEditorExtension.java >diff -N src/org/eclipse/mylyn/internal/sandbox/ui/editors/DefalutTaskEditorExtension.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylyn/internal/sandbox/ui/editors/DefalutTaskEditorExtension.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,41 @@ >+/******************************************************************************* >+ * 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.source.SourceViewer; >+import org.eclipse.mylyn.tasks.core.TaskRepository; >+import org.eclipse.mylyn.wikitext.textile.core.TextileLanguage; >+import org.eclipse.swt.widgets.Composite; >+ >+/** >+ * @author Jingwen Ou >+ */ >+public class DefalutTaskEditorExtension extends MarkupTaskEditorExtension { >+ >+ @Override >+ public SourceViewer createEditor(TaskRepository taskRepository, Composite parent, int style) { >+ return createMultiSourceViewer(taskRepository, parent, style); >+ } >+ >+ @Override >+ public SourceViewer createViewer(TaskRepository taskRepository, Composite parent, int style) { >+ return createReadOnlyViewer(taskRepository, parent, style); >+ } >+ >+ @Override >+ public String getEditorContextId() { >+ // ignore >+ return null; >+ } >+ >+ @Override >+ public void initializeMarkupLanguage() { >+ setMarkupLanguage(new TextileLanguage()); >+ } >+} >Index: src/org/eclipse/mylyn/internal/sandbox/ui/editors/bugzilla/BugzillaTaskEditorPageFactory.java >=================================================================== >RCS file: src/org/eclipse/mylyn/internal/sandbox/ui/editors/bugzilla/BugzillaTaskEditorPageFactory.java >diff -N src/org/eclipse/mylyn/internal/sandbox/ui/editors/bugzilla/BugzillaTaskEditorPageFactory.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylyn/internal/sandbox/ui/editors/bugzilla/BugzillaTaskEditorPageFactory.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,64 @@ >+/******************************************************************************* >+ * 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.bugzilla; >+ >+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; >+ >+/** >+ * @author Rob Elves >+ */ >+public class BugzillaTaskEditorPageFactory 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 BugzillaTaskEditorPage(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"; >+ } >+ >+} >Index: src/org/eclipse/mylyn/internal/sandbox/ui/editors/TaskEditorExtensionHelper.java >=================================================================== >RCS file: src/org/eclipse/mylyn/internal/sandbox/ui/editors/TaskEditorExtensionHelper.java >diff -N src/org/eclipse/mylyn/internal/sandbox/ui/editors/TaskEditorExtensionHelper.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylyn/internal/sandbox/ui/editors/TaskEditorExtensionHelper.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,73 @@ >+/******************************************************************************* >+ * 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.core.runtime.CoreException; >+import org.eclipse.core.runtime.IConfigurationElement; >+import org.eclipse.core.runtime.IExtension; >+import org.eclipse.core.runtime.IExtensionPoint; >+import org.eclipse.core.runtime.IExtensionRegistry; >+import org.eclipse.core.runtime.IStatus; >+import org.eclipse.core.runtime.Platform; >+import org.eclipse.core.runtime.Status; >+import org.eclipse.mylyn.commons.core.StatusHandler; >+import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin; >+import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiExtensionReader; >+ >+public class TaskEditorExtensionHelper { >+ >+ public static final String EXTENSION_TASK_EDITOR_EXTENSIONS = "org.eclipse.mylyn.sandbox.ui.taskEditorExtensions"; >+ >+ private static final String REPOSITORY_ASSOCIATION = "repositoryAssociation"; >+ >+ private static final String TASK_EDITOR_EXTENSION = "taskEditorExtension"; >+ >+ public static void initEditorExtensions() { >+ IExtensionRegistry registry = Platform.getExtensionRegistry(); >+ >+ IExtensionPoint editorExtensionPoint = registry.getExtensionPoint(EXTENSION_TASK_EDITOR_EXTENSIONS); >+ IExtension[] editorExtensions = editorExtensionPoint.getExtensions(); >+ for (IExtension extension : editorExtensions) { >+ IConfigurationElement[] elements = extension.getConfigurationElements(); >+ for (IConfigurationElement element : elements) { >+ if (element.getName().equals(TASK_EDITOR_EXTENSION)) { >+ readEditorExtension(element); >+ } else if (element.getName().equals(REPOSITORY_ASSOCIATION)) { >+ readEditorExtensionAssociation(element); >+ } >+ } >+ } >+ } >+ >+ private static void readEditorExtensionAssociation(IConfigurationElement element) { >+ try { >+ String repository = element.getAttribute("repository"); >+ String taskEditorExtension = element.getAttribute("taskEditorExtension"); >+ TaskEditorExtensions.addRepositoryAssociation(repository, taskEditorExtension); >+ } catch (Exception e) { >+ StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, "Could not load taskEditorExtension", >+ e)); >+ } >+ } >+ >+ private static void readEditorExtension(IConfigurationElement element) { >+ try { >+ String id = element.getAttribute(TasksUiExtensionReader.ATTR_ID); >+ String name = element.getAttribute(TasksUiExtensionReader.ATTR_NAME); >+ AbstractTaskEditorExtension extension = (AbstractTaskEditorExtension) element.createExecutableExtension("class"); >+ TaskEditorExtensions.addTaskEditorExtension(id, name, extension); >+ } catch (CoreException e) { >+ StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, "Could not load taskEditorExtension", >+ e)); >+ } catch (Exception e) { >+ StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, "Could not load taskEditorExtension", >+ e)); >+ } >+ } >+} >Index: .refactorings/2008/6/23/refactorings.history >=================================================================== >RCS file: .refactorings/2008/6/23/refactorings.history >diff -N .refactorings/2008/6/23/refactorings.history >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ .refactorings/2008/6/23/refactorings.history 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,3 @@ >+<?xml version="1.0" encoding="UTF-8"?> >+<session version="1.0">
<refactoring comment="Move 1 elements(s) to 'org.eclipse.mylyn.tasks.ui/src/org.eclipse.mylyn.internal.tasks.ui.editors'
- Original project: 'org.eclipse.mylyn.sandbox.ui'
- Destination element: 'org.eclipse.mylyn.tasks.ui/src/org.eclipse.mylyn.internal.tasks.ui.editors'
- Original element: 'org.eclipse.mylyn.internal.sandbox.ui.editors.TaskEditorWikiTextPart.java'
- Update references to refactored element" description="Move compilation unit" destination="=org.eclipse.mylyn.tasks.ui/src<org.eclipse.mylyn.internal.tasks.ui.editors" element1="/src<org.eclipse.mylyn.internal.sandbox.ui.editors{TaskEditorWikiTextPart.java" files="0" flags="589830" folders="0" id="org.eclipse.jdt.ui.move" patterns="*" policy="org.eclipse.jdt.ui.moveResources" qualified="false" references="true" stamp="1212827078015" units="1" version="1.0"/>

<refactoring comment="Move 3 elements(s) to 'org.eclipse.mylyn.sandbox.ui/src/org.eclipse.mylyn.internal.sandbox.ui.editors.bugzilla'
- Original project: 'org.eclipse.mylyn.sandbox.ui'
- Destination element: 'org.eclipse.mylyn.sandbox.ui/src/org.eclipse.mylyn.internal.sandbox.ui.editors.bugzilla'
- Original elements:
 org.eclipse.mylyn.internal.sandbox.ui.editors.WikiTextAttributeEditor.java
 org.eclipse.mylyn.internal.sandbox.ui.editors.BugzillaTaskEditorPage.java
 org.eclipse.mylyn.internal.sandbox.ui.editors.TaskEditorWikiTextPart.java
- Update references to refactored element" description="Move compilation units" destination="/src<org.eclipse.mylyn.internal.sandbox.ui.editors.bugzilla" element1="/src<org.eclipse.mylyn.internal.sandbox.ui.editors{WikiTextAttributeEditor.java" element2="/src<org.eclipse.mylyn.internal.sandbox.ui.editors{BugzillaTaskEditorPage.java" element3="/src<org.eclipse.mylyn.internal.sandbox.ui.editors{TaskEditorWikiTextPart.java" files="0" flags="589830" folders="0" id="org.eclipse.jdt.ui.move" patterns="*" policy="org.eclipse.jdt.ui.moveResources" qualified="false" references="true" stamp="1212828531765" units="3" version="1.0"/>
<refactoring comment="Extract method 'private void checkMarkupLanguage()' from 'org.eclipse.mylyn.internal.sandbox.ui.editors.MarkupTaskEditorExtension.createReadOnlyViewer()' to 'org.eclipse.mylyn.internal.sandbox.ui.editors.MarkupTaskEditorExtension'
- Original project: 'org.eclipse.mylyn.sandbox.ui'
- Method name: 'checkMarkupLanguage'
- Destination type: 'org.eclipse.mylyn.internal.sandbox.ui.editors.MarkupTaskEditorExtension'
- Declared visibility: 'private'
- Replace occurrences of statements with method" comments="false" description="Extract method 'checkMarkupLanguage'" destination="0" exceptions="false" flags="786434" id="org.eclipse.jdt.ui.extract.method" input="/src<org.eclipse.mylyn.internal.sandbox.ui.editors{MarkupTaskEditorExtension.java" name="checkMarkupLanguage" replace="true" selection="3921 73" stamp="1212830996265" version="1.0" visibility="2"/> >+</session>
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