1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 22:52:11 +02:00

removed dependency to jface.text.TextViewer

This commit is contained in:
Michael Scharf 2007-02-15 01:40:32 +00:00
parent 061835a458
commit f3e28bd939
2 changed files with 5 additions and 17 deletions

View file

@ -7,8 +7,7 @@ Bundle-Activator: org.eclipse.tm.terminal.internal.control.TerminalPlugin
Bundle-Vendor: %providerName Bundle-Vendor: %providerName
Bundle-Localization: plugin Bundle-Localization: plugin
Require-Bundle: org.eclipse.core.runtime, Require-Bundle: org.eclipse.core.runtime,
org.eclipse.ui, org.eclipse.ui
org.eclipse.jface.text
Eclipse-LazyStart: true Eclipse-LazyStart: true
Bundle-RequiredExecutionEnvironment: J2SE-1.4 Bundle-RequiredExecutionEnvironment: J2SE-1.4
Bundle-ClassPath: . Bundle-ClassPath: .

View file

@ -22,10 +22,6 @@ import java.net.SocketException;
import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.resource.JFaceResources; import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.text.ConfigurableLineTracker;
import org.eclipse.jface.text.Document;
import org.eclipse.jface.text.ITextSelection;
import org.eclipse.jface.text.TextViewer;
import org.eclipse.swt.SWT; import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyledText; import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.custom.VerifyKeyListener; import org.eclipse.swt.custom.VerifyKeyListener;
@ -78,7 +74,6 @@ public class TerminalControl implements ITerminalControlForText, ITerminalContro
private Display fDisplay; private Display fDisplay;
private StyledText fCtlText; private StyledText fCtlText;
private TextViewer fViewer;
private Composite fWndParent; private Composite fWndParent;
private Clipboard fClipboard; private Clipboard fClipboard;
private TerminalModifyListener fModifyListener; private TerminalModifyListener fModifyListener;
@ -180,7 +175,7 @@ public class TerminalControl implements ITerminalControlForText, ITerminalContro
* @return non null selection * @return non null selection
*/ */
public String getSelection() { public String getSelection() {
String txt= ((ITextSelection) fViewer.getSelection()).getText(); String txt= fCtlText.getSelectionText();
if(txt==null) if(txt==null)
txt=""; //$NON-NLS-1$ txt=""; //$NON-NLS-1$
return txt; return txt;
@ -383,12 +378,12 @@ public class TerminalControl implements ITerminalControlForText, ITerminalContro
// switch to another Workbench control). We prevent local keyboard input from // switch to another Workbench control). We prevent local keyboard input from
// modifying the text in method TerminalVerifyKeyListener.verifyKey(). // modifying the text in method TerminalVerifyKeyListener.verifyKey().
fViewer = new TextViewer(fWndParent, SWT.V_SCROLL); // fViewer = new TextViewer(fWndParent, SWT.V_SCROLL);
setCtlText(fViewer.getTextWidget()); setCtlText(new StyledText(fWndParent, SWT.V_SCROLL));
fDisplay = getCtlText().getDisplay(); fDisplay = getCtlText().getDisplay();
fClipboard = new Clipboard(fDisplay); fClipboard = new Clipboard(fDisplay);
fViewer.setDocument(new TerminalDocument()); // fViewer.setDocument(new TerminalDocument());
getCtlText().setFont(JFaceResources.getTextFont()); getCtlText().setFont(JFaceResources.getTextFont());
} }
@ -769,12 +764,6 @@ public class TerminalControl implements ITerminalControlForText, ITerminalContro
} }
protected class TerminalDocument extends Document {
protected TerminalDocument() {
setLineTracker(new ConfigurableLineTracker(LINE_DELIMITERS));
}
}
public void setTerminalTitle(String title) { public void setTerminalTitle(String title) {
fTerminalListener.setTerminalTitle(title); fTerminalListener.setTerminalTitle(title);
} }