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 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 ACS by ACS-Community.
the class AlarmsView method sortCategoryList.
public void sortCategoryList(String name) {
_ffCategoryList.removeAll();
List<Category> catList = _categoryManager.getAllCategories();
List<String> sortedCatList = new ArrayList<String>();
for (Category cat : catList) sortedCatList.add(cat.getPath().toLowerCase());
Collections.sort(sortedCatList);
for (String sc : sortedCatList) {
Category cat = null;
for (Category c : catList) if (c.getPath().toLowerCase().compareTo(sc) == 0)
cat = c;
if (cat == null)
return;
if (cat.getAlarms() == null) {
TableItem t = new TableItem(_ffCategoryList, SWT.None);
t.setText(cat.getPath());
if (cat.getIsDefault()) {
FontData fd = t.getFont().getFontData()[0];
fd.setStyle(SWT.BOLD);
t.setFont(new Font(_shell.getDisplay(), fd));
}
} else {
String[] ffs = cat.getAlarms().getFaultFamily();
TableItem t = new TableItem(_ffCategoryList, SWT.None);
t.setText(cat.getPath());
if (cat.getIsDefault()) {
FontData fd = t.getFont().getFontData()[0];
fd.setStyle(SWT.BOLD);
t.setFont(new Font(_shell.getDisplay(), fd));
}
for (int i = 0; i < ffs.length; i++) {
if (ffs[i].compareTo(name) == 0)
t.setImage(Activator.getDefault().getImageRegistry().get(Activator.IMG_TICKET));
}
}
}
}
use of org.eclipse.swt.graphics.Font in project cubrid-manager by CUBRID.
the class ERDirectEditManager method initCellEditor.
protected void initCellEditor() {
getCellEditor().setValue(label.getText());
getCellEditor().setValidator(validator);
FontData fontData = label.getFont().getFontData()[0];
Dimension fontSize = new Dimension(0, fontData.getHeight());
label.translateToAbsolute(fontSize);
fontData.setHeight(fontSize.height);
Text text = (Text) getCellEditor().getControl();
text.setFont(new Font(null, fontData));
text.setRedraw(true);
text.setVisible(true);
}
Aggregations