use of org.eclipse.swt.graphics.Font in project tdi-studio-se by Talend.
the class LibSelectionComposite method createControl.
/*
* (non-Javadoc)
*
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite)
*/
public void createControl(Composite parent) {
Font font = parent.getFont();
// Composite comp = new Composite(parent, SWT.NONE);
GridLayout topLayout = new GridLayout();
topLayout.numColumns = 2;
this.setLayout(topLayout);
GridData gd;
// Label label = new Label(this, SWT.NONE);
// label.setText("Libraries Selection:");
// gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
// gd.horizontalSpan = 2;
// label.setLayoutData(gd);
libListViewer = new LibListViewer(this);
libListViewer.getControl().setFont(font);
gd = new GridData(GridData.FILL_BOTH);
// gd.horizontalSpan = 7;
gd.heightHint = 100;
gd.widthHint = 240;
libListViewer.getControl().setLayoutData(gd);
LibListProvider provider = new LibListProvider();
libListViewer.setLabelProvider(provider);
libListViewer.setContentProvider(provider);
Composite pathButtonComp = new Composite(this, SWT.NONE);
GridLayout pathButtonLayout = new GridLayout();
pathButtonLayout.marginHeight = 0;
pathButtonLayout.marginWidth = 0;
pathButtonComp.setLayout(pathButtonLayout);
gd = new GridData(GridData.FILL_HORIZONTAL);
// gd.horizontalSpan = 2;
pathButtonComp.setLayoutData(gd);
pathButtonComp.setFont(font);
createPathButtons(pathButtonComp);
}
use of org.eclipse.swt.graphics.Font in project tdi-studio-se by Talend.
the class FontProviderMapper method getFont.
public static Font getFont(FontInfo fontInfo) {
Font fontFromCache = fontsCache.get(fontInfo);
if (fontFromCache != null) {
return fontFromCache;
}
Font font = new Font(Display.getCurrent(), fontInfo.getFontDatas());
fontsCache.put(fontInfo, font);
return font;
}
use of org.eclipse.swt.graphics.Font in project tdi-studio-se by Talend.
the class FontProviderMapper method releaseFonts.
/**
* DOC amaumont Comment method "release".
*/
public static void releaseFonts() {
Collection<Font> fonts = fontsCache.values();
for (Font font : fonts) {
if (!font.isDisposed()) {
font.dispose();
}
}
fontsCache.clear();
}
use of org.eclipse.swt.graphics.Font in project tdi-studio-se by Talend.
the class LoginAgreementPage method createControl.
@Override
public void createControl(Composite parentCtrl) {
Composite container = new Composite(parentCtrl, SWT.NONE);
container.setLayout(new FormLayout());
Label titleLabel = new Label(container, SWT.WRAP);
titleLabel.setFont(LoginDialogV2.fixedFont);
//$NON-NLS-1$
titleLabel.setText(Messages.getString("LoginAgreementPage.title"));
FormData titleLabelFormData = new FormData();
titleLabelFormData.left = new FormAttachment(0, 0);
titleLabelFormData.top = new FormAttachment(0, 0);
titleLabel.setLayoutData(titleLabelFormData);
acceptButton = new Button(container, SWT.CENTER);
acceptButton.setBackground(backgroundColor);
acceptButton.setFont(LoginDialogV2.fixedFont);
//$NON-NLS-1$
acceptButton.setText(Messages.getString("LoginAgreementPage.accept"));
FormData acceptButtonFormLayoutData = new FormData();
acceptButtonFormLayoutData.bottom = new FormAttachment(100, 0);
acceptButtonFormLayoutData.right = new FormAttachment(100, 0);
acceptButtonFormLayoutData.left = new FormAttachment(100, -1 * LoginDialogV2.getNewButtonSize(acceptButton).x);
acceptButton.setLayoutData(acceptButtonFormLayoutData);
boolean haveHtmlDesc = false;
FileInputStream licenseInputStream = null;
String licenseFileBasePath = Platform.getInstallLocation().getURL().getPath();
if (Boolean.parseBoolean(System.getProperty("USE_BROWSER"))) {
//$NON-NLS-1$
File htmlFile = new File(licenseFileBasePath + LICENSE_FILE_PATH_HTML);
if (htmlFile.exists()) {
try {
licenseInputStream = new FileInputStream(htmlFile);
if (licenseInputStream != null) {
haveHtmlDesc = true;
}
} catch (FileNotFoundException e) {
CommonExceptionHandler.process(e);
}
}
}
if (licenseInputStream == null) {
try {
licenseInputStream = new FileInputStream(licenseFileBasePath + LICENSE_FILE_PATH);
} catch (FileNotFoundException e) {
CommonExceptionHandler.process(e);
}
}
FormData clufLayoutData = new FormData();
clufLayoutData.top = new FormAttachment(titleLabel, LoginDialogV2.TAB_VERTICAL_PADDING_LEVEL_1, SWT.BOTTOM);
clufLayoutData.left = new FormAttachment(0, 0);
clufLayoutData.right = new FormAttachment(100, 0);
clufLayoutData.bottom = new FormAttachment(acceptButton, -1 * LoginDialogV2.TAB_VERTICAL_PADDING_LEVEL_1, SWT.TOP);
if (haveHtmlDesc) {
clufBrowser = new Browser(container, SWT.BORDER);
clufBrowser.setText(getLicense(licenseInputStream));
clufBrowser.setLayoutData(clufLayoutData);
} else {
clufText = new Text(container, SWT.MULTI | SWT.WRAP | SWT.V_SCROLL | SWT.H_SCROLL | SWT.LEFT | SWT.BORDER);
clufText.setBackground(new Color(null, 255, 255, 255));
//$NON-NLS-1$
Font font = new Font(DisplayUtils.getDisplay(), "courier", 10, SWT.NONE);
clufText.setFont(font);
clufText.setEditable(false);
clufText.setText(getLicense(licenseInputStream));
clufText.setLayoutData(clufLayoutData);
}
}
use of org.eclipse.swt.graphics.Font in project tdi-studio-se by Talend.
the class ReconcilerViewer method initializeViewer.
protected void initializeViewer(IDocument document) {
fAnnotationPreferences = EditorsPlugin.getDefault().getMarkerAnnotationPreferences();
setDocument(document);
installViewerConfiguration();
setEditable(true);
Font font = JFaceResources.getFontRegistry().get(JFaceResources.TEXT_FONT);
getTextWidget().setFont(font);
Control control = getControl();
GridData data = new GridData(GridData.FILL_BOTH);
control.setLayoutData(data);
prependVerifyKeyListener(new VerifyKeyListener() {
@Override
public void verifyKey(VerifyEvent event) {
handleVerifyKeyPressed(event);
}
});
addDocumentListener(document);
addMenu();
}
Aggregations