List of usage examples for org.eclipse.jface.resource JFaceResources getHeaderFont
public static Font getHeaderFont()
From source file:org.whole.lang.ui.figures.LabelFactory.java
License:Open Source License
public static EntityLabel createModuleName() { return new EntityLabel() { public Color getLocalForegroundColor() { return FigurePrefs.modulesColor; }//from ww w. j ava 2s.co m public Font getLocalFont() { return JFaceResources.getHeaderFont(); } }; }
From source file:org.wso2.developerstudio.esb.form.editors.article.views.FormView.java
License:Open Source License
/** * This is a callback that will allow us to create the viewer and * initialize it./* w ww .jav a 2 s . c o m*/ */ public void createPartControl(Composite parent) { toolkit = new FormToolkit(parent.getDisplay()); form = toolkit.createScrolledForm(parent); form.setText(Messages.getString("FormView.title")); //$NON-NLS-1$ TableWrapLayout layout = new TableWrapLayout(); //GridLayout layout = new GridLayout(); form.getBody().setLayout(layout); Hyperlink link = toolkit.createHyperlink(form.getBody(), Messages.getString("FormView.link"), //$NON-NLS-1$ SWT.WRAP); link.addHyperlinkListener(new HyperlinkAdapter() { public void linkActivated(HyperlinkEvent e) { System.out.println(Messages.getString("FormView.linkMessage")); //$NON-NLS-1$ } }); link.setText(Messages.getString("FormView.longLink")); //$NON-NLS-1$ layout.numColumns = 2; TableWrapData td = new TableWrapData(); td.colspan = 2; link.setLayoutData(td); //GridData gd = new GridData(); //gd.horizontalSpan = 2; //link.setLayoutData(gd); toolkit.createLabel(form.getBody(), Messages.getString("FormView.textLabel")); //$NON-NLS-1$ Text text = toolkit.createText(form.getBody(), ""); //$NON-NLS-1$ td = new TableWrapData(TableWrapData.FILL_GRAB); text.setLayoutData(td); //text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); Button button = toolkit.createButton(form.getBody(), Messages.getString("FormView.checkbox"), SWT.CHECK); //$NON-NLS-1$ td = new TableWrapData(); td.colspan = 2; button.setLayoutData(td); //gd = new GridData(); //gd.horizontalSpan = 2; //button.setLayoutData(gd); ExpandableComposite ec = toolkit.createExpandableComposite(form.getBody(), ExpandableComposite.TREE_NODE | ExpandableComposite.CLIENT_INDENT); ImageHyperlink eci = toolkit.createImageHyperlink(ec, SWT.NULL); //eci.setImage(FormArticlePlugin.getDefault().getImageRegistry().get(FormArticlePlugin.IMG_SAMPLE)); ec.setTextClient(eci); ec.setText(Messages.getString("FormView.expandable")); //$NON-NLS-1$ String ctext = Messages.getString("FormView.expandableText") + //$NON-NLS-1$ Messages.getString("FormView.expandablText2") + //$NON-NLS-1$ Messages.getString("FormView.expandableText3") + //$NON-NLS-1$ Messages.getString("FormView.expandableText4"); //$NON-NLS-1$ Label client = toolkit.createLabel(ec, ctext, SWT.WRAP); ec.setClient(client); td = new TableWrapData(); td.colspan = 2; ec.setLayoutData(td); ec.addExpansionListener(new ExpansionAdapter() { public void expansionStateChanged(ExpansionEvent e) { form.reflow(true); } }); Section section = toolkit.createSection(form.getBody(), Section.DESCRIPTION | Section.TWISTIE | Section.TITLE_BAR | Section.EXPANDED); td = new TableWrapData(TableWrapData.FILL); td.colspan = 2; section.setLayoutData(td); section.addExpansionListener(new ExpansionAdapter() { public void expansionStateChanged(ExpansionEvent e) { form.reflow(true); } }); section.setText(Messages.getString("FormView.stitle")); //$NON-NLS-1$ section.setDescription(Messages.getString("FormView.sdesc")); //$NON-NLS-1$ Composite sectionClient = toolkit.createComposite(section); sectionClient.setLayout(new GridLayout()); button = toolkit.createButton(sectionClient, Messages.getString("FormView.radio1"), SWT.RADIO); //$NON-NLS-1$ button = toolkit.createButton(sectionClient, Messages.getString("FormView.radio2"), SWT.RADIO); //$NON-NLS-1$ section.setClient(sectionClient); StringBuffer buf = new StringBuffer(); buf.append("<form>"); //$NON-NLS-1$ buf.append("<p>"); //$NON-NLS-1$ buf.append(Messages.getString("FormView.ftext1")); //$NON-NLS-1$ buf.append(Messages.getString("FormView.ftext2")); //$NON-NLS-1$ buf.append("</p>"); //$NON-NLS-1$ buf.append("<p>"); //$NON-NLS-1$ buf.append(Messages.getString("FormView.ftext3")); //$NON-NLS-1$ buf.append("</p>"); //$NON-NLS-1$ buf.append(Messages.getString("FormView.ftext4")); //$NON-NLS-1$ buf.append(Messages.getString("FormView.ftext5")); //$NON-NLS-1$ buf.append("</p>"); //$NON-NLS-1$ buf.append(Messages.getString("FormView.ftext6")); //$NON-NLS-1$ buf.append(Messages.getString("FormView.ftext7")); //$NON-NLS-1$ buf.append(Messages.getString("FormView.ftext8")); //$NON-NLS-1$ buf.append(Messages.getString("FormView.ftext9")); //$NON-NLS-1$ buf.append(Messages.getString("FormView.ftext10")); //$NON-NLS-1$ buf.append(Messages.getString("FormView.ftext11")); //$NON-NLS-1$ buf.append(Messages.getString("FormView.ftext12")); //$NON-NLS-1$ buf.append(Messages.getString("FormView.ftext13")); //$NON-NLS-1$ buf.append("</form>"); //$NON-NLS-1$ FormText rtext = toolkit.createFormText(form.getBody(), true); rtext.setWhitespaceNormalized(true); td = new TableWrapData(TableWrapData.FILL); td.colspan = 2; rtext.setLayoutData(td); // rtext.setImage("image", FormArticlePlugin.getDefault().getImageRegistry().get(FormArticlePlugin.IMG_SAMPLE)); //$NON-NLS-1$ rtext.setColor("header", toolkit.getColors().getColor(FormColors.TITLE)); //$NON-NLS-1$ rtext.setFont("header", JFaceResources.getHeaderFont()); //$NON-NLS-1$ rtext.setFont("code", JFaceResources.getTextFont()); //$NON-NLS-1$ rtext.setText(buf.toString(), true, false); rtext.addHyperlinkListener(new HyperlinkAdapter() { public void linkActivated(HyperlinkEvent e) { System.out.println(Messages.getString("FormView.lmessage") + e.getHref()); //$NON-NLS-1$ } }); /* layout.numColumns = 3; Label label; TableWrapData td; label = toolkit.createLabel(form.getBody(), "Some text to put in the first column", SWT.WRAP); label = toolkit.createLabel(form.getBody() ,"Some text to put in the second column and make it a bit longer so that we can see what happens with column distribution. This text must be the longest so that it can get more space allocated to the columns it belongs to.", SWT.WRAP); td = new TableWrapData(); td.colspan = 2; label.setLayoutData(td); label = toolkit.createLabel(form.getBody(), "This text will span two rows and should not grow the column.", SWT.WRAP); td = new TableWrapData(); td.rowspan = 2; label.setLayoutData(td); label = toolkit.createLabel(form.getBody(), "This text goes into column 2 and consumes only one cell", SWT.WRAP); label.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB)); label = toolkit.createLabel(form.getBody(), "This text goes into column 3 and consumes only one cell too", SWT.WRAP); label.setLayoutData(new TableWrapData(TableWrapData.FILL)); label = toolkit.createLabel(form.getBody(), "This text goes into column 2 and consumes only one cell", SWT.WRAP); label.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB)); label = toolkit.createLabel(form.getBody(), "This text goes into column 3 and consumes only one cell too", SWT.WRAP); label.setLayoutData(new TableWrapData(TableWrapData.FILL)); form.getBody().setBackground(form.getBody().getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND)); */ toolkit.paintBordersFor(form.getBody()); }
From source file:org.xmind.ui.internal.browser.BrowserErrorText.java
License:Open Source License
private void fillContent(Composite parent, Color bg) { GridLayout layout = new GridLayout(); layout.verticalSpacing = 10;/*from w w w. ja va 2 s . com*/ parent.setLayout(layout); title = new Label(parent, SWT.WRAP); title.setText(BrowserMessages.BrowserText_EmbeddedBrowserUnavailableInfo); title.setFont(JFaceResources.getHeaderFont()); title.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); title.setBackground(bg); link = new Link(parent, SWT.WRAP); link.setText(""); //$NON-NLS-1$ link.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); link.setToolTipText("<a href=\"open\">" + BrowserMessages.BrowserText_OpenFileLinkToolTip + "</a>"); //$NON-NLS-1$ //$NON-NLS-2$ link.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { BusyIndicator.showWhile(link.getDisplay(), new Runnable() { public void run() { doOpenExternal(); } }); } }); link.setBackground(bg); sep = new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL); sep.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); exTitle = new Label(parent, SWT.NULL); exTitle.setBackground(bg); exTitle.setFont(JFaceResources.getBannerFont()); exTitle.setText(BrowserMessages.BrowserText_ProblemDetailsTitle); exTitle.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); text = new Label(parent, SWT.WRAP); text.setText(BrowserMessages.BrowserText_ProblemDetails); text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); text.setBackground(bg); button = new Button(parent, SWT.PUSH); updateButtonText(); button.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { toggleException(); } }); exception = new Text(parent, SWT.MULTI); loadExceptionText(); GridData gd = new GridData(GridData.FILL_BOTH); gd.exclude = true; exception.setLayoutData(gd); }
From source file:org.xmind.ui.viewers.CategorizedViewer.java
License:Open Source License
private ScrolledForm createContainer(Composite parent, int style) { if (factory == null) factory = createWidgetFactory(parent.getDisplay()); ScrolledForm form = new ScrolledForm(parent, SWT.V_SCROLL | SWT.LEFT_TO_RIGHT); form.setExpandHorizontal(true);/*from w ww . java 2s. c o m*/ form.setExpandVertical(true); form.setBackground(parent.getBackground()); form.setForeground(parent.getForeground()); form.setFont(JFaceResources.getHeaderFont()); container = form; configureContainer(container); return container; }
From source file:org.xwiki.eclipse.viewers.XWikiPagePreviewViewer.java
License:Open Source License
public XWikiPagePreviewViewer(Composite parent) { composite = new Composite(parent, SWT.NONE); stackLayout = new StackLayout(); composite.setLayout(stackLayout);//from w ww.j a va2 s .c o m browser = new Browser(composite, SWT.NONE); notConnectedComposite = new Composite(composite, SWT.NONE); GridLayoutFactory.fillDefaults().margins(0, 0).applyTo(notConnectedComposite); notConnectedComposite.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WHITE)); Label label = new Label(notConnectedComposite, SWT.NONE); GridDataFactory.fillDefaults().align(SWT.CENTER, SWT.CENTER).grab(true, true).applyTo(label); label.setText("No preview available if not connected."); label.setFont(JFaceResources.getHeaderFont()); label.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WHITE)); label.setForeground(parent.getDisplay().getSystemColor(SWT.COLOR_DARK_GRAY)); noPageSelectedComposite = new Composite(composite, SWT.NONE); noPageSelectedComposite.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WHITE)); GridLayoutFactory.fillDefaults().margins(0, 0).applyTo(noPageSelectedComposite); label = new Label(noPageSelectedComposite, SWT.NONE); GridDataFactory.fillDefaults().align(SWT.CENTER, SWT.CENTER).grab(true, true).applyTo(label); label.setText("No page selected"); label.setFont(JFaceResources.getHeaderFont()); label.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WHITE)); label.setForeground(parent.getDisplay().getSystemColor(SWT.COLOR_DARK_GRAY)); stackLayout.topControl = noPageSelectedComposite; composite.layout(); }
From source file:tubame.knowhow.util.ControlUtil.java
License:Apache License
/** * Create a label (blue, bold, character is large) in the same font as the * title of the form.<br/>//from w w w.ja v a 2 s .c om * * @param parent * Parent composite * @param toolkit * FormToolkit * @param title * Title to be displayed on the label * @return Label that you created */ public static Label createTitleLabel(Composite parent, FormToolkit toolkit, String title) { Label label = toolkit.createLabel(parent, title); label.setForeground(toolkit.getColors().getColor(IFormColors.TITLE)); label.setFont(JFaceResources.getHeaderFont()); return label; }
From source file:v9t9.gui.client.swt.shells.modules.ModuleInfoDialog.java
License:Open Source License
@Override protected Control createDialogArea(Composite parent) { Composite composite = (Composite) super.createDialogArea(parent); ////////////*from w w w. j a v a2 s. co m*/ CLabel title = new CLabel(composite, SWT.NONE); title.setText(module.getName()); title.setFont(JFaceResources.getHeaderFont()); ModuleInfo info = module.getInfo(); String imagePath = info != null ? info.getImagePath() : null; title.setImage(this.moduleSelector.getOrLoadModuleImage(null, module, imagePath)); GridDataFactory.fillDefaults().grab(true, false).applyTo(title); /////////// Label sep; sep = new Label(composite, SWT.HORIZONTAL); GridDataFactory.fillDefaults().grab(true, false).applyTo(sep); if (info != null && !TextUtils.isEmpty(info.getDescription())) { Label descr = new Label(composite, SWT.WRAP); descr.setText(info.getDescription()); GridDataFactory.fillDefaults().grab(true, false).applyTo(descr); sep = new Label(composite, SWT.HORIZONTAL); GridDataFactory.fillDefaults().grab(true, false).applyTo(sep); } /////////// CLabel summary = new CLabel(composite, SWT.WRAP); if (this.moduleSelector.isModuleLoadable(module)) { summary.setText("All module files resolved"); summary.setImage(getShell().getDisplay().getSystemImage(SWT.ICON_INFORMATION)); } else { summary.setText("One or more module files are missing"); summary.setImage(getShell().getDisplay().getSystemImage(SWT.ICON_ERROR)); } GridDataFactory.fillDefaults().grab(true, false).applyTo(summary); /////////// final TreeViewer viewer = new TreeViewer(composite, SWT.BORDER); Tree tree = viewer.getTree(); tree.setHeaderVisible(true); tree.setLinesVisible(true); GridDataFactory.fillDefaults().grab(true, true).applyTo(tree); final TreeColumn nameColumn = new TreeColumn(tree, SWT.RIGHT); final TreeColumn infoColumn = new TreeColumn(tree, SWT.LEFT); ModuleDetailsContentProvider contentProvider = new ModuleDetailsContentProvider( this.moduleSelector.getMachine()); viewer.setContentProvider(contentProvider); viewer.setLabelProvider(new ModuleDetailsTreeLabelProvider()); viewer.setInput(contentProvider.createModuleContent(module)); composite.getDisplay().asyncExec(new Runnable() { public void run() { viewer.expandToLevel(2); nameColumn.pack(); infoColumn.pack(); } }); return composite; }
From source file:v9t9.gui.client.swt.wizards.SetupIntroPage.java
License:Open Source License
private void setupHeaderLabel() { // clear/* ww w. j a v a 2 s .c o m*/ label.replaceTextRange(0, label.getCharCount(), ""); linkMap.clear(); StyledTextHelper styledTextHelper = new StyledTextHelper(label); styledTextHelper.pushStyle( new TextStyle(JFaceResources.getHeaderFont(), getDisplay().getSystemColor(SWT.COLOR_BLUE), null), SWT.BOLD); label.append("Welcome to V9t9!\n\n"); styledTextHelper.popStyle(); label.append("In order to emulate the " + machine.getModel().getName() + ", you need to configure V9t9 so it can " + "find the necessary ROMs for the system and for any modules you want to use.\n\n" + "Add new Search Locations (on the next page), and V9t9 will detect ROMs and modules by content. " + (ADVANCED ? "If you have custom ROMs, though, you can select your own file by clicking the links.\n" : "\n")); }