Skip to content
Snippets Groups Projects

Styling for code peek window

Merged Miklos Magyari requested to merge codepeek into master
2 files
+ 32
11
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -7,6 +7,8 @@
******************************************************************************/
package org.eclipse.titan.designer.editors.controls;
import org.eclipse.jdt.ui.PreferenceConstants;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.text.Document;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IInformationControl;
@@ -18,10 +20,12 @@ 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;
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.Shell;
/**
@@ -42,14 +46,20 @@ public class Ttcn3SourceViewControl implements IInformationControl {
myshell = new Shell(parent, SWT.ON_TOP | SWT.TOOL | SWT.LEFT_TO_RIGHT | SWT.RESIZE);
Composite composite = myshell;
GridLayout layout = new GridLayout(1, false);
layout.marginHeight = 0;
layout.marginWidth = 0;
layout.marginHeight = 10;
layout.marginWidth = 10;
composite.setLayout(layout);
setSize(600, 400);
final Display display = myshell.getDisplay();
//setBackgroundColor(display.getSystemColor(SWT.COLOR_YELLOW));
GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
composite.setLayoutData(gridData);
viewer = new SourceViewer(composite, null, 0);
viewer = new SourceViewer(composite, null, SWT.V_SCROLL | SWT.H_SCROLL);
viewer.setEditable(false);
Font textFont= JFaceResources.getFont(PreferenceConstants.EDITOR_TEXT_FONT);
StyledText styledText = viewer.getTextWidget();
styledText.setFont(textFont);
StyledText st = viewer.getTextWidget();
gridData = new GridData(GridData.BEGINNING | GridData.FILL_BOTH);
st.setLayoutData(gridData);
@@ -96,8 +106,7 @@ public class Ttcn3SourceViewControl implements IInformationControl {
@Override
public void setSize(int width, int height) {
//myshell.setSize(width, height);
myshell.setSize(200, 200);
myshell.setSize(width, height);
}
@Override
@@ -105,6 +114,11 @@ public class Ttcn3SourceViewControl implements IInformationControl {
myshell.setLocation(location);
}
@Override
public void setBackgroundColor(Color background) {
myshell.setBackground(background);
}
@Override
public void dispose() {
// TODO Auto-generated method stub
@@ -129,12 +143,7 @@ public class Ttcn3SourceViewControl implements IInformationControl {
}
@Override
public void setBackgroundColor(Color background) {
// TODO Auto-generated method stub
}
@Override
public boolean isFocusControl() {
// TODO Auto-generated method stub
Loading