Commit df207191 authored by Miklos Magyari's avatar Miklos Magyari
Browse files

Fixed Ttcn3SourceViewControl disposal


Signed-off-by: Miklos Magyari's avatarMiklos Magyari <miklos.magyari@sigmatechnology.se>
parent c4e50f6d
......@@ -20,8 +20,6 @@ import org.eclipse.swt.custom.StyleRange;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.FocusListener;
import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.events.KeyListener;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.Point;
......@@ -29,6 +27,8 @@ import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.titan.designer.editors.ColorManager;
import org.eclipse.titan.designer.editors.ttcn3editor.CodeScanner;
......@@ -83,15 +83,16 @@ public class Ttcn3SourceViewControl implements IInformationControl, IInformation
gridData = new GridData(GridData.BEGINNING | GridData.FILL_BOTH);
viewer.setLayoutData(gridData);
viewer.setFont(textFont);
viewer.addKeyListener(new KeyListener() {
@Override
public void keyPressed(KeyEvent e) {
if (e.character == 0x1B)
myshell.dispose();
myshell.addListener(SWT.Traverse, new Listener() {
public void handleEvent(Event event) {
switch (event.detail) {
case SWT.TRAVERSE_ESCAPE:
dispose();
event.detail = SWT.TRAVERSE_NONE;
event.doit = false;
break;
}
}
@Override
public void keyReleased(KeyEvent e) {}
});
}
......
......@@ -7,7 +7,6 @@
******************************************************************************/
package org.eclipse.titan.designer.editors.ttcn3editor.actions;
import java.io.File;
import java.io.RandomAccessFile;
import org.eclipse.core.commands.AbstractHandler;
......@@ -19,7 +18,6 @@ import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.preferences.IPreferencesService;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.text.Document;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.TextSelection;
import org.eclipse.jface.viewers.ISelection;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment