List of usage examples for org.eclipse.jface.resource JFaceResources DEFAULT_FONT
String DEFAULT_FONT
To view the source code for org.eclipse.jface.resource JFaceResources DEFAULT_FONT.
Click Source Link
"org.eclipse.jface.defaultfont"
). From source file:com.axmor.eclipse.typescript.editor.preferences.ColorEditor.java
License:Open Source License
protected Point computeImageSize(Control window) { GC gc = new GC(window); Font f = JFaceResources.getFontRegistry().get(JFaceResources.DEFAULT_FONT); gc.setFont(f);//from www .j a v a 2s . c o m int height = gc.getFontMetrics().getHeight(); gc.dispose(); Point p = new Point(height * 3 - 6, height); return p; }
From source file:com.cisco.yangide.editor.editors.text.hover.HoverControlCreator.java
License:Open Source License
@Override public IInformationControl doCreateInformationControl(Shell parent) { if (BrowserInformationControl.isAvailable(parent)) { String font = JFaceResources.DEFAULT_FONT; BrowserInformationControl iControl = new BrowserInformationControl(parent, font, EditorsUI.getTooltipAffordanceString()) { @Override//from w w w . j a v a 2 s. c om public IInformationControlCreator getInformationPresenterControlCreator() { return fInformationPresenterControlCreator; } }; return iControl; } else { return new DefaultInformationControl(parent, EditorsUI.getTooltipAffordanceString()); } }
From source file:com.cisco.yangide.editor.editors.text.hover.PresenterControlCreator.java
License:Open Source License
@Override public IInformationControl doCreateInformationControl(Shell parent) { if (BrowserInformationControl.isAvailable(parent)) { ToolBarManager tbm = new ToolBarManager(SWT.FLAT); String font = JFaceResources.DEFAULT_FONT; return new BrowserInformationControl(parent, font, tbm); } else {//from www. j a va2s . c om return new DefaultInformationControl(parent, true); } }
From source file:com.cloudbees.eclipse.dev.ui.views.build.BuildPart.java
License:Open Source License
/** * Create contents of the editor part./*from w ww . jav a 2 s . com*/ * * @param parent */ @Override public void createPartControl(final Composite parent) { this.form = this.formToolkit.createForm(parent); //form.setDelayedReflow(true); this.formToolkit.decorateFormHeading(this.form/*.getForm()*/); this.formToolkit.paintBordersFor(this.form); this.form.setText("n/a"); this.form.getBody().setLayout(new GridLayout(1, true)); this.compMain = new Composite(this.form.getBody(), SWT.NONE); GridLayout gl_compMain = new GridLayout(1, true); this.compMain.setLayout(gl_compMain); this.compMain.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1)); this.formToolkit.adapt(this.compMain); this.formToolkit.paintBordersFor(this.compMain); Composite compStatusHead = new Composite(this.compMain, SWT.NONE); compStatusHead.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1)); GridLayout rl_compStatusHead = new GridLayout(); rl_compStatusHead.marginHeight = 0; rl_compStatusHead.marginWidth = 0; rl_compStatusHead.numColumns = 2; compStatusHead.setLayout(rl_compStatusHead); this.formToolkit.adapt(compStatusHead); this.formToolkit.paintBordersFor(compStatusHead); this.statusIcon = this.formToolkit.createLabel(compStatusHead, "", SWT.NONE); this.textTopSummary = this.formToolkit.createLabel(compStatusHead, "n/a", SWT.BOLD); this.textTopSummary.setLayoutData(new GridData(SWT.FILL, SWT.BOTTOM, true, false, 1, 1)); this.textTopSummary.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT)); this.textTopSummary.setForeground(this.formToolkit.getColors().getColor(IFormColors.TITLE)); this.openJunitAction = new OpenJunitViewAction(); //createBuildHistorySection(); createSections(); //compMain.layout(true); createActions(); loadInitialData(); }
From source file:com.cloudbees.eclipse.dev.ui.views.forge.ForgeLabelProvider.java
License:Open Source License
@Override public Font getFont(final Object obj) { if (obj instanceof ForgeGroup) { ForgeGroup gr = (ForgeGroup) obj; if (gr.isLoading()) { return JFaceResources.getFontRegistry().getItalic(JFaceResources.DEFAULT_FONT); }/*w ww . j ava2s . co m*/ } if (obj instanceof ForgeInstance) { ForgeInstance inst = (ForgeInstance) obj; if (inst.status.equals(ForgeInstance.STATUS.SYNCED)) { return JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT); } } return null; }
From source file:com.cloudbees.eclipse.dev.ui.views.instances.InstanceLabelProvider.java
License:Open Source License
public Font getFont(final Object obj) { if (obj instanceof InstanceGroup) { InstanceGroup gr = (InstanceGroup) obj; if (gr.isLoading()) { return JFaceResources.getFontRegistry().getItalic(JFaceResources.DEFAULT_FONT); }// w ww . j av a 2 s . co m } if (obj instanceof JenkinsInstanceResponse.View) { View view = (JenkinsInstanceResponse.View) obj; if (view.isPrimary) { return JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT); } } else if (obj instanceof JenkinsInstanceResponse) { if (((JenkinsInstanceResponse) obj).offline) { return JFaceResources.getFontRegistry().getItalic(JFaceResources.DEFAULT_FONT); } } return null; }
From source file:com.cloudbees.eclipse.dtp.internal.treeview.DBLabelProvider.java
License:Open Source License
@Override public Font getFont(final Object obj) { if (obj instanceof DatabaseInfo) { DatabaseInfo appInfo = (DatabaseInfo) obj; String status = appInfo.getStatus(); if (status.equals("active")) { return JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT); } else if (status.equals("stopped")) { return JFaceResources.getFontRegistry().getItalic(JFaceResources.DEFAULT_FONT); }// w w w . ja v a 2s .c o m } return null; }
From source file:com.cloudbees.eclipse.run.ui.views.AppLabelProvider.java
License:Open Source License
@Override public Font getFont(final Object obj) { if (obj instanceof ApplicationInfo) { ApplicationInfo appInfo = (ApplicationInfo) obj; String status = appInfo.getStatus(); if (status.equals("active")) { return JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT); } else if (status.equals("stopped")) { return JFaceResources.getFontRegistry().getItalic(JFaceResources.DEFAULT_FONT); }//from w w w . ja v a2 s .c om } return null; }
From source file:com.google.gapid.widgets.AboutDialog.java
License:Apache License
public static void showAbout(Shell shell, Theme theme) { new TitleAreaDialog(shell) { @Override//from w ww .j av a 2s. c o m public void create() { super.create(); setTitle(Messages.ABOUT_TITLE); } @Override protected void configureShell(Shell newShell) { super.configureShell(newShell); newShell.setText(Messages.ABOUT_WINDOW_TITLE); } @Override protected Control createDialogArea(Composite parent) { Composite area = (Composite) super.createDialogArea(parent); area.setBackground(theme.aboutBackground()); Composite container = createComposite(area, centered(new RowLayout(SWT.VERTICAL))); container.setLayoutData(new GridData(SWT.CENTER, SWT.FILL, true, true)); container.setBackground(theme.aboutBackground()); createLabel(container, "", theme.logoBig()); Label title = createForegroundLabel(container, Messages.WINDOW_TITLE); title.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT)); createForegroundLabel(container, "Version " + Version.GAPIC_VERSION); createForegroundLabel(container, "Server: " + Info.getServerName() + ", Version: " + Info.getServerVersion()); createForegroundLabel(container, Messages.ABOUT_DESCRIPTION); createForegroundLabel(container, Messages.ABOUT_COPY); return area; } @Override protected void createButtonsForButtonBar(Composite parent) { createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); } public Label createForegroundLabel(Composite parent, String text) { Label label = createLabel(parent, text); label.setForeground(theme.aboutForeground()); label.setBackground(theme.aboutBackground()); return label; } }.open(); }
From source file:com.google.gapid.widgets.Widgets.java
License:Apache License
public static Label createBoldLabel(Composite parent, String label) { Label result = createLabel(parent, label); result.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT)); return result; }