1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42: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-Localization: plugin
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.ui,
org.eclipse.jface.text
org.eclipse.ui
Eclipse-LazyStart: true
Bundle-RequiredExecutionEnvironment: J2SE-1.4
Bundle-ClassPath: .

View file

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