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 104233 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]
wiki integration step 2 - Textile J part
clipboard.txt (text/plain), 5.38 KB, created by
Jingwen 'Owen' Ou
on 2008-06-09 19:59:46 EDT
(
hide
)
Description:
wiki integration step 2 - Textile J part
Filename:
MIME Type:
Creator:
Jingwen 'Owen' Ou
Created:
2008-06-09 19:59:46 EDT
Size:
5.38 KB
patch
obsolete
>Index: E:/workspace/Mylyn_SoC/org.eclipse.mylyn.wikitext.ui/src/org/eclipse/mylyn/wikitext/ui/viewer/MultiSourceViewer.java >=================================================================== >--- E:/workspace/Mylyn_SoC/org.eclipse.mylyn.wikitext.ui/src/org/eclipse/mylyn/wikitext/ui/viewer/MultiSourceViewer.java (revision 0) >+++ E:/workspace/Mylyn_SoC/org.eclipse.mylyn.wikitext.ui/src/org/eclipse/mylyn/wikitext/ui/viewer/MultiSourceViewer.java (revision 0) >@@ -0,0 +1,141 @@ >+/******************************************************************************* >+ * 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.wikitext.ui.viewer; >+ >+import org.eclipse.jface.text.Document; >+import org.eclipse.jface.text.IDocument; >+import org.eclipse.jface.text.source.IAnnotationModel; >+import org.eclipse.jface.text.source.ISourceViewer; >+import org.eclipse.jface.text.source.IVerticalRuler; >+import org.eclipse.jface.text.source.SourceViewer; >+import org.eclipse.jface.viewers.Viewer; >+import org.eclipse.mylyn.internal.wikitext.ui.editor.MarkupEditor; >+import org.eclipse.mylyn.internal.wikitext.ui.editor.MarkupSourceViewerConfiguration; >+import org.eclipse.mylyn.internal.wikitext.ui.editor.syntax.FastMarkupPartitioner; >+import org.eclipse.mylyn.wikitext.core.parser.markup.MarkupLanguage; >+import org.eclipse.mylyn.wikitext.ui.WikiTextUiPlugin; >+import org.eclipse.swt.SWT; >+import org.eclipse.swt.custom.CTabFolder; >+import org.eclipse.swt.custom.CTabItem; >+import org.eclipse.swt.events.SelectionEvent; >+import org.eclipse.swt.events.SelectionListener; >+import org.eclipse.swt.widgets.Composite; >+import org.eclipse.swt.widgets.Control; >+import org.eclipse.ui.PlatformUI; >+import org.eclipse.ui.swt.IFocusService; >+ >+/** >+ * A multitab source viewer that can edit and preview wikitext markup >+ * (lightweight markup languages) >+ * >+ * @author Jingwen Ou >+ */ >+public abstract class MultiSourceViewer extends SourceViewer { >+ >+ private CTabFolder folder; >+ >+ private MarkupLanguage markupLanguage; >+ >+ public MultiSourceViewer(Composite parent, IVerticalRuler ruler, int styles) { >+ super(parent, ruler, styles); >+ } >+ >+ private void configurePartitioning(IDocument document) { >+ if (document != null) { >+ FastMarkupPartitioner partitioner = new FastMarkupPartitioner(); >+ partitioner.setMarkupLanguage(markupLanguage); >+ partitioner.connect(document); >+ document.setDocumentPartitioner(partitioner); >+ } >+ } >+ >+ @Override >+ public void createControl(Composite parent, int styles) { >+ >+ 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"); >+ >+ super.createControl(folder, styles); >+ >+ viewerItem.setControl(this.getTextWidget()); >+ folder.setSelection(viewerItem); >+ >+ MarkupSourceViewerConfiguration configuration = new MarkupSourceViewerConfiguration( >+ WikiTextUiPlugin.getDefault().getPreferenceStore()); >+ configuration.setMarkupLanguage(markupLanguage); >+ configure(configuration); >+ >+ IFocusService focusService = (IFocusService) PlatformUI >+ .getWorkbench().getService(IFocusService.class); >+ if (focusService != null) { >+ focusService.addFocusTracker(getTextWidget(), >+ MarkupEditor.EDITOR_SOURCE_VIEWER); >+ } >+ >+ getTextWidget().setData(MarkupLanguage.class.getName(), >+ markupLanguage); >+ getTextWidget().setData(ISourceViewer.class.getName(), this); >+ } >+ >+ // wikitext markup viewer >+ { >+ CTabItem previewItem = new CTabItem(folder, SWT.NONE); >+ previewItem.setText("Preview"); >+ previewItem.setToolTipText("Preview Source"); >+ >+ final SourceViewer previewViewer = createPreviewViewer(folder, >+ styles); >+ >+ previewItem >+ .setControl(previewViewer instanceof Viewer ? ((Viewer) previewViewer) >+ .getControl() >+ : previewViewer.getTextWidget()); >+ >+ folder.addSelectionListener(new SelectionListener() { >+ public void widgetDefaultSelected(SelectionEvent selectionevent) { >+ widgetSelected(selectionevent); >+ } >+ >+ public void widgetSelected(SelectionEvent selectionevent) { >+ Document document = new Document(getDocument().get()); >+ previewViewer.setDocument(document); >+ } >+ }); >+ } >+ } >+ >+ protected abstract SourceViewer createPreviewViewer(Composite parent, >+ int style); >+ >+ public Control getParentControl() { >+ return folder != null ? folder : this.getTextWidget().getParent(); >+ } >+ >+ @Override >+ public void setDocument(IDocument document, >+ IAnnotationModel annotationModel, int modelRangeOffset, >+ int modelRangeLength) { >+ configurePartitioning(document); >+ super.setDocument(document, annotationModel, modelRangeOffset, >+ modelRangeLength); >+ } >+ >+ public MarkupLanguage getMarkupLanguage() { >+ return markupLanguage; >+ } >+ >+ public void setMarkupLanguage(MarkupLanguage markupLanguage) { >+ this.markupLanguage = markupLanguage; >+ } >+} >\ No newline at end of file
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