List of usage examples for org.eclipse.jface.resource JFaceResources getFontRegistry
public static FontRegistry getFontRegistry()
From source file:com.microsoft.tfs.client.common.ui.controls.vc.properties.branches.BranchesPropertiesLabelProvider.java
License:Open Source License
@Override public Font getFont(final Object element) { // Make tree item bold if it is the one that we requested branch // history on. if (((BranchHistoryTreeItem) element).isRequested()) { return JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT); }/*from w ww .j a v a2s .com*/ return null; }
From source file:com.microsoft.tfs.client.common.ui.framework.helper.UIHelpers.java
License:Open Source License
public static Font getTextFont(final Device device) { final FontData[] fontDatas = JFaceResources.getFontRegistry().getFontData(JFaceResources.TEXT_FONT); return new Font(device, fontDatas); }
From source file:com.microsoft.tfs.client.common.ui.teambuild.dialogs.BuildStatusNotificationDialog.java
License:Open Source License
@Override protected void hookAddToDialogArea(final Composite dialogArea) { final GridLayout dialogLayout = new GridLayout(2, false); dialogLayout.marginWidth = getHorizontalMargin(); dialogLayout.marginHeight = getVerticalMargin(); dialogLayout.horizontalSpacing = getHorizontalSpacing() * 2; dialogLayout.verticalSpacing = getVerticalSpacing(); dialogArea.setLayout(dialogLayout);//from w w w.j ava 2s .c o m final Image image = getBuildDetailImage(); if (image != null) { final Label imageLabel = new Label(dialogArea, SWT.NONE); imageLabel.setImage(image); GridDataBuilder.newInstance().vAlignTop().applyTo(imageLabel); } /* Create a composite for the many labels we're displaying. */ final Composite messageComposite = new Composite(dialogArea, SWT.NONE); GridDataBuilder.newInstance().hSpan(image != null ? 1 : 2).hAlignFill().vAlignTop().hFill() .applyTo(messageComposite); final GridLayout messageCompositeLayout = new GridLayout(1, true); messageCompositeLayout.marginWidth = 0; messageCompositeLayout.marginHeight = 0; messageCompositeLayout.horizontalSpacing = getHorizontalSpacing(); messageCompositeLayout.verticalSpacing = getVerticalSpacing(); messageComposite.setLayout(messageCompositeLayout); final Label titleLabel = new Label(messageComposite, SWT.WRAP); titleLabel.setText(getBuildDetailTitle()); titleLabel.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT)); GridDataBuilder.newInstance().hAlignFill().vAlignTop().hFill().wHint(getMinimumMessageAreaWidth()) .applyTo(titleLabel); if (buildDetail != null) { final Composite buildDetailComposite = createBuildDetailMessages(messageComposite); GridDataBuilder.newInstance().hAlignFill().vAlignTop().hFill().applyTo(buildDetailComposite); /* * Provide an informative label about their options for gated * checkins */ final String helpMessage = getBuildHelpMessage(); if (helpMessage != null) { final Label helpLabel = new Label(messageComposite, SWT.WRAP); helpLabel.setText(helpMessage); GridDataBuilder.newInstance().hAlignFill().vAlignTop().hFill().wHint(getMinimumMessageAreaWidth()) .applyTo(helpLabel); } } /* Provide some space between the button area and the message area */ final Label spacerLabel = new Label(dialogArea, SWT.NONE); GridDataBuilder.newInstance().hSpan(2).applyTo(spacerLabel); final Button neverShowButton = new Button(dialogArea, SWT.CHECK | SWT.LEFT); neverShowButton .setText(Messages.getString("BuildStatusNotificationDialog.NeverShowNotificationToggleMessage")); //$NON-NLS-1$ neverShowButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(final SelectionEvent e) { neverShowToggle = neverShowButton.getSelection(); } }); GridDataBuilder.newInstance().hSpan(2).applyTo(neverShowButton); /* * Can only unshelve failed (or partially successful) builds */ final boolean unshelve = (buildDetail != null && buildDetail.isBuildFinished() && (buildDetail.getStatus().contains(BuildStatus.FAILED) || buildDetail.getStatus().contains(BuildStatus.PARTIALLY_SUCCEEDED)) && buildDetail.getReason().contains(BuildReason.CHECK_IN_SHELVESET)); /* * Can only reconcile successfully (or partially successful) builds that * were checked in (ie, have a non-negative changeset id) */ final boolean reconcile = (buildDetail != null && buildDetail.isBuildFinished() && (buildDetail.getStatus().contains(BuildStatus.SUCCEEDED) || buildDetail.getStatus().contains(BuildStatus.PARTIALLY_SUCCEEDED)) && buildDetail.getReason().contains(BuildReason.CHECK_IN_SHELVESET) && InformationNodeConverters.getChangesetID(buildDetail.getInformation()) > 0); /* * If we're not offering reconcile or unshelve, this is simply a build * completion alert. In this case, only offer an okay button. */ if (unshelve || reconcile) { if (reconcile) { /* * Reconcile should be in the OK position (the default button) */ addButtonDescription(RECONCILE_BUTTON_ID, Messages.getString("BuildStatusNotificationDialog.ReconcileButtonLabel"), //$NON-NLS-1$ true); } if (unshelve) { /* * Unshelve should be in the OK position (the default button) * unless there's a reconcile */ addButtonDescription(UNSHELVE_BUTTON_ID, Messages.getString("BuildStatusNotificationDialog.UnshelveButtonLabel"), //$NON-NLS-1$ (!reconcile)); } /* * Note: all non-action buttons (ie, any buttons that are not * unshelve or reconcile) always return cancel id, indicating that * no action was performed and the build should still be considered * "watched". */ addButtonDescription(IGNORE_BUTTON_ID, Messages.getString("BuildStatusNotificationDialog.IgnoreButtonLabel"), //$NON-NLS-1$ false); } else { /* * Note: all non-action buttons (ie, any buttons that are not * unshelve or reconcile) always return cancel id, indicating that * no action was performed and the build should still be considered * "watched". */ addButtonDescription(IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); } }
From source file:com.mindquarry.desktop.client.MindClient.java
License:Open Source License
private void initRegistries() { ImageRegistry reg = JFaceResources.getImageRegistry(); Image img;//from w w w .j a v a2 s . c om if (SVNFileUtil.isOSX) { img = new Image(Display.getCurrent(), MindClient.class.getResourceAsStream("/com/mindquarry/icons/128x128/logo/mindquarry-icon.png")); //$NON-NLS-1$ } else { img = new Image(Display.getCurrent(), MindClient.class.getResourceAsStream("/com/mindquarry/icons/32x32/logo/mindquarry-icon.png")); //$NON-NLS-1$ } reg.put(CLIENT_IMG_KEY, img); img = new Image(Display.getCurrent(), MindClient.class .getResourceAsStream("/org/tango-project/tango-icon-theme/16x16/apps/help-browser.png")); //$NON-NLS-1$ reg.put(Dialog.DLG_IMG_HELP, img); Image trayImg = new Image(Display.getCurrent(), MindClient.class.getResourceAsStream("/com/mindquarry/icons/16x16/logo/mindquarry-icon.png")); //$NON-NLS-1$ reg.put(CLIENT_TRAY_IMG_KEY, trayImg); FontRegistry fReg = JFaceResources.getFontRegistry(); fReg.put(TASK_TITLE_FONT_KEY, getTaskFont()); fReg.put(TASK_DESC_FONT_KEY, getTaskDescriptionFont()); fReg.put(TEAM_NAME_FONT_KEY, getTeamFont()); }
From source file:com.mindquarry.desktop.minutes.editor.MinutesEditor.java
License:Open Source License
/** * Initialzes the image registry for the minutes editor. */// w w w . ja v a 2 s .c o m private void initRegistries() { ImageRegistry reg = JFaceResources.getImageRegistry(); Image img = new Image(Display.getCurrent(), MinutesEditor.class.getResourceAsStream("/com/mindquarry/icons/16x16/logo/mindquarry-icon.png")); //$NON-NLS-1$ reg.put(EDITOR_IMG_KEY, img); img = new Image(Display.getCurrent(), MinutesEditor.class .getResourceAsStream("/org/tango-project/tango-icon-theme/22x22/emotes/face-smile.png")); //$NON-NLS-1$ reg.put(SMILE_IMG_KEY, img); FontRegistry fReg = JFaceResources.getFontRegistry(); fReg.put(CONV_TOPIC_TITLE_FONT_KEY, new FontData[] { new FontData("Arial", //$NON-NLS-1$ 10, SWT.ITALIC) }); fReg.put(CONV_TITLE_FONT_KEY, new FontData[] { new FontData("Arial", //$NON-NLS-1$ 10, SWT.BOLD) }); }
From source file:com.mindquarry.desktop.preferences.dialog.FilteredPreferenceDialog.java
License:Open Source License
/** * Creates the wizard's title area.//from w w w.ja va2 s .c o m * * @param parent the SWT parent for the title area composite. * @return the created title area composite. */ protected Composite createTitleArea(Composite parent) { // Create the title area which will contain // a title, message, and image. int margins = 2; titleArea = new Composite(parent, SWT.NONE); FormLayout layout = new FormLayout(); layout.marginHeight = 0; layout.marginWidth = margins; titleArea.setLayout(layout); GridData layoutData = new GridData(GridData.FILL_HORIZONTAL); layoutData.verticalAlignment = SWT.TOP; titleArea.setLayoutData(layoutData); // Message label messageArea = new DialogMessageArea(); messageArea.createContents(titleArea); titleArea.addControlListener(new ControlAdapter() { @Override public void controlResized(ControlEvent e) { updateMessage(); } }); final IPropertyChangeListener fontListener = new IPropertyChangeListener() { public void propertyChange(PropertyChangeEvent event) { if (JFaceResources.BANNER_FONT.equals(event.getProperty())) { updateMessage(); } if (JFaceResources.DIALOG_FONT.equals(event.getProperty())) { updateMessage(); Font dialogFont = JFaceResources.getDialogFont(); updateTreeFont(dialogFont); Control[] children = ((Composite) buttonBar).getChildren(); for (int i = 0; i < children.length; i++) { children[i].setFont(dialogFont); } } } }; titleArea.addDisposeListener(new DisposeListener() { public void widgetDisposed(DisposeEvent event) { JFaceResources.getFontRegistry().removeListener(fontListener); } }); JFaceResources.getFontRegistry().addListener(fontListener); messageArea.setTitleLayoutData(createMessageAreaData()); messageArea.setMessageLayoutData(createMessageAreaData()); return titleArea; }
From source file:com.netifera.platform.host.terminal.ui.view.TerminalView.java
License:Open Source License
public void dispose() { Logger.log("entered."); //$NON-NLS-1$ Activator.getInstance().getPreferenceStore().removePropertyChangeListener(fPreferenceListener); JFaceResources.getFontRegistry().removeListener(fPropertyChangeHandler); // dispose all connections ITerminalViewConnection[] conn = fMultiConnectionManager.getConnections(); for (int i = 0; i < conn.length; i++) { conn[i].getCtlTerminal().disposeTerminal(); }/*from ww w.j a va 2 s . co m*/ super.dispose(); }
From source file:com.netifera.platform.host.terminal.ui.view.TerminalView.java
License:Open Source License
protected void setupListeners(Composite wndParent) { fPropertyChangeHandler = new TerminalPropertyChangeHandler(); JFaceResources.getFontRegistry().addListener(fPropertyChangeHandler); }
From source file:com.nextep.designer.View.java
License:Open Source License
public void createPartControl(Composite parent) { Composite top = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); layout.marginHeight = 0;//from w w w . ja v a2 s. co m layout.marginWidth = 0; top.setLayout(layout); // top banner Composite banner = new Composite(top, SWT.NONE); banner.setLayoutData( new GridData(GridData.HORIZONTAL_ALIGN_FILL, GridData.VERTICAL_ALIGN_BEGINNING, true, false)); layout = new GridLayout(); layout.marginHeight = 5; layout.marginWidth = 10; layout.numColumns = 2; banner.setLayout(layout); // setup bold font Font boldFont = JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT); Label l = new Label(banner, SWT.WRAP); l.setText("Subject:"); l.setFont(boldFont); l = new Label(banner, SWT.WRAP); l.setText("This is a message about the cool Eclipse RCP!"); l = new Label(banner, SWT.WRAP); l.setText("From:"); l.setFont(boldFont); final Link link = new Link(banner, SWT.NONE); link.setText("<a>nicole@mail.org</a>"); link.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { MessageDialog.openInformation(getSite().getShell(), "Not Implemented", "Imagine the address book or a new message being created now."); } }); l = new Label(banner, SWT.WRAP); l.setText("Date:"); l.setFont(boldFont); l = new Label(banner, SWT.WRAP); l.setText("10:34 am"); // message contents Text text = new Text(top, SWT.MULTI | SWT.WRAP); text.setText( "This RCP Application was generated from the PDE Plug-in Project wizard. This sample shows how to:\n" + "- add a top-level menu and toolbar with actions\n" + "- add keybindings to actions\n" + "- create views that can't be closed and\n" + " multiple instances of the same view\n" + "- perspectives with placeholders for new views\n" + "- use the default about dialog\n" + "- create a product definition\n"); text.setLayoutData(new GridData(GridData.FILL_BOTH)); }
From source file:com.nokia.carbide.cpp.debug.kernelaware.ui.OSViewLabelProvider.java
License:Open Source License
public Font getFont(Object element) { if (beingDebugged(element)) return JFaceResources.getFontRegistry().getBold(viewer.getControl().getFont().toString()); // JFaceResources.DIALOG_FONT return null;/*w w w . j a v a 2 s .c o m*/ }