diff options
author | Tom Schindl | 2015-05-08 09:54:42 +0000 |
---|---|---|
committer | Tom Schindl | 2015-05-08 09:54:42 +0000 |
commit | 8002e9bd2c902d27103e0638fbb7c718c0e1647c (patch) | |
tree | f3207d58ad6d8af8bef0ebcb5276643eca71593d /experimental | |
parent | f536b2f07ab803e7d3eadc7f4a7dae543ac3b342 (diff) | |
download | org.eclipse.efxclipse-8002e9bd2c902d27103e0638fbb7c718c0e1647c.tar.gz org.eclipse.efxclipse-8002e9bd2c902d27103e0638fbb7c718c0e1647c.tar.xz org.eclipse.efxclipse-8002e9bd2c902d27103e0638fbb7c718c0e1647c.zip |
only viewer is used
Diffstat (limited to 'experimental')
-rw-r--r-- | experimental/compensator/org.eclipse.fx.code.compensator.editor/src/org/eclipse/fx/code/compensator/editor/TextEditor.java | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/experimental/compensator/org.eclipse.fx.code.compensator.editor/src/org/eclipse/fx/code/compensator/editor/TextEditor.java b/experimental/compensator/org.eclipse.fx.code.compensator.editor/src/org/eclipse/fx/code/compensator/editor/TextEditor.java index 932463e58..9374ef2b9 100644 --- a/experimental/compensator/org.eclipse.fx.code.compensator.editor/src/org/eclipse/fx/code/compensator/editor/TextEditor.java +++ b/experimental/compensator/org.eclipse.fx.code.compensator.editor/src/org/eclipse/fx/code/compensator/editor/TextEditor.java @@ -10,9 +10,6 @@ *******************************************************************************/ package org.eclipse.fx.code.compensator.editor; -import javafx.beans.property.Property; -import javafx.scene.layout.BorderPane; - import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; import javax.inject.Inject; @@ -23,7 +20,6 @@ import org.eclipse.e4.ui.di.Focus; import org.eclipse.e4.ui.di.Persist; import org.eclipse.fx.code.compensator.editor.services.DocumentPersitenceService; import org.eclipse.fx.core.di.ContextValue; -import org.eclipse.fx.ui.controls.styledtext.StyledTextArea; import org.eclipse.jface.text.DocumentEvent; import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.IDocumentExtension3; @@ -33,6 +29,9 @@ import org.eclipse.jface.text.source.IAnnotationModel; import org.eclipse.jface.text.source.SourceViewer; import org.eclipse.jface.text.source.SourceViewerConfiguration; +import javafx.beans.property.Property; +import javafx.scene.layout.BorderPane; + public class TextEditor { public static final String DOCUMENT_URL = "documentUrl"; public static final String VCS_URL = "vcsUrl"; @@ -60,15 +59,14 @@ public class TextEditor { @Optional IAnnotationModel annotationModel; - StyledTextArea textArea; - String currentStyle; String currentId; + private SourceViewer viewer; @PostConstruct public void initUI(BorderPane pane, IEventBroker broker) { - SourceViewer viewer = new SourceViewer(); + viewer = new SourceViewer(); if( document instanceof IDocumentExtension3 ) { ((IDocumentExtension3)document).setDocumentPartitioner(configuration.getConfiguredDocumentPartitioning(viewer),partitioner); } else { @@ -108,10 +106,10 @@ public class TextEditor { @Focus void focused() { activeInput.setValue(input); - textArea.requestFocus(); + viewer.getTextWidget().requestFocus(); //TODO We should remember the caret offset - if( textArea.getCaretOffset() == -1 && textArea.getContent().getCharCount() > 0 ) { - textArea.setCaretOffset(0); + if( viewer.getTextWidget().getCaretOffset() == -1 && viewer.getTextWidget().getContent().getCharCount() > 0 ) { + viewer.getTextWidget().setCaretOffset(0); } } |