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:org.eclipse.mylyn.reviews.r4e.ui.internal.dialogs.ParticipantInputDialog.java
License:Open Source License
/** * method createBasicParameters/* www . j a va2 s . com*/ * * @param aToolkit * @param aComposite */ private void createBasicParameters(FormToolkit aToolkit, Composite aComposite) { //Basic parameters section final Section basicSection = aToolkit.createSection(aComposite, Section.DESCRIPTION | ExpandableComposite.TITLE_BAR | ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED); final GridData basicSectionGridData = new GridData(GridData.FILL, GridData.FILL, true, false); basicSectionGridData.horizontalSpan = 4; basicSection.setLayoutData(basicSectionGridData); basicSection.setText(R4EUIConstants.BASIC_PARAMS_HEADER); basicSection.setDescription(R4EUIConstants.BASIC_PARAMS_HEADER_DETAILS + PARTICIPANT_LABEL); basicSection.addExpansionListener(new ExpansionAdapter() { @Override public void expansionStateChanged(ExpansionEvent e) { getShell().setSize(getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT)); } }); final Composite basicSectionClient = aToolkit.createComposite(basicSection); final GridLayout layout = new GridLayout(4, false); basicSectionClient.setLayout(layout); basicSection.setClient(basicSectionClient); //Participant Id Label label = aToolkit.createLabel(basicSectionClient, R4EUIConstants.ID_LABEL); label.setToolTipText(R4EUIConstants.PARTICIPANT_ID_TOOLTIP); label.setLayoutData(new GridData(GridData.BEGINNING, GridData.BEGINNING, false, false)); aToolkit.setBorderStyle(SWT.NULL); fParticipantIdInputTextField = aToolkit.createText(basicSectionClient, ""); GridData textGridData = new GridData(GridData.FILL, GridData.FILL, true, false); textGridData.horizontalSpan = 3; fParticipantIdInputTextField.setEnabled(false); fParticipantIdInputTextField.setEditable(false); fParticipantIdInputTextField.setToolTipText(R4EUIConstants.PARTICIPANT_ID_TOOLTIP); fParticipantIdInputTextField.setLayoutData(textGridData); //Participant Email label = aToolkit.createLabel(basicSectionClient, R4EUIConstants.EMAIL_LABEL); label.setToolTipText(R4EUIConstants.PARTICIPANT_EMAIL_TOOLTIP); label.setLayoutData(new GridData(GridData.BEGINNING, GridData.BEGINNING, false, false)); aToolkit.setBorderStyle(SWT.BORDER); fParticipantEmailInputTextField = aToolkit.createText(basicSectionClient, "", SWT.SINGLE); textGridData = new GridData(GridData.FILL, GridData.FILL, true, false); textGridData.horizontalSpan = 3; fParticipantEmailInputTextField.setToolTipText(R4EUIConstants.PARTICIPANT_EMAIL_TOOLTIP); fParticipantEmailInputTextField.setLayoutData(textGridData); fParticipantEmailInputTextField.setEnabled(false); fParticipantEmailInputTextField.addListener(SWT.FocusOut, new Listener() { public void handleEvent(Event event) { if (fSelectedParticipantIndex >= 0) { final R4EParticipant participant = fParticipants.get(fSelectedParticipantIndex); participant.setEmail(fParticipantEmailInputTextField.getText().trim()); final TableItem item = fAddedParticipantsTable.getItem(fSelectedParticipantIndex); if (null != participant.getEmail()) { item.setFont(JFaceResources.getFontRegistry().get(JFaceResources.DEFAULT_FONT)); item.setText(1, participant.getEmail()); } else { item.setFont(JFaceResources.getFontRegistry().getItalic(JFaceResources.DEFAULT_FONT)); } } } }); //User details label = aToolkit.createLabel(basicSectionClient, R4EUIConstants.USER_DETAILS_LABEL); label.setToolTipText(R4EUIConstants.PARTICIPANT_DETAILS_TOOLTIP); label.setLayoutData(new GridData(GridData.BEGINNING, GridData.BEGINNING, false, false)); aToolkit.setBorderStyle(SWT.NULL); fParticipantDetailsInputTextField = aToolkit.createText(basicSectionClient, "", SWT.MULTI | SWT.V_SCROLL | SWT.READ_ONLY); textGridData = new GridData(GridData.FILL, GridData.FILL, true, false); textGridData.horizontalSpan = 3; textGridData.heightHint = fParticipantDetailsInputTextField.getLineHeight() << 3; fParticipantDetailsInputTextField.setEnabled(false); fParticipantDetailsInputTextField.setEditable(false); fParticipantDetailsInputTextField.setToolTipText(R4EUIConstants.PARTICIPANT_DETAILS_TOOLTIP); fParticipantDetailsInputTextField.setLayoutData(textGridData); }
From source file:org.eclipse.mylyn.reviews.r4e.ui.internal.dialogs.ParticipantInputDialog.java
License:Open Source License
/** * Method updateComponents./*from w ww .j a va 2s . c om*/ * * @param aParticipant * - R4EParticipant */ private void updateComponents(R4EParticipant aParticipant) { //Add item to the participants table final TableItem item = new TableItem(fAddedParticipantsTable, SWT.NONE); item.setText(0, aParticipant.getId()); if (null != aParticipant.getEmail() && !("".equals(aParticipant.getEmail()))) { item.setFont(JFaceResources.getFontRegistry().get(JFaceResources.DEFAULT_FONT)); item.setText(1, aParticipant.getEmail()); } else { //Mark table item as not complete item.setFont(JFaceResources.getFontRegistry().getItalic(JFaceResources.DEFAULT_FONT)); } fAddedParticipantsTable.showItem(item); if (fParticipants.size() > 0) { fClearParticipantsButton.setEnabled(true); fRemoveUserButton.setEnabled(true); if (fUserToAddCombo instanceof CCombo) { ((CCombo) fUserToAddCombo).setText(""); } else { ((Text) fUserToAddCombo).setText(""); } getButton(IDialogConstants.OK_ID).setEnabled(true); getButton(IDialogConstants.OK_ID).setSelection(false); } else { if (fReviewSource) { getButton(IDialogConstants.OK_ID).setEnabled(false); } } }
From source file:org.eclipse.mylyn.reviews.r4e.ui.internal.navigator.ReviewNavigatorDecorator.java
License:Open Source License
/** * Method decorateFont.//from w ww. j a v a 2 s. c o m * * @param aElement * Object * @return Font * @see org.eclipse.jface.viewers.IFontDecorator#decorateFont(Object) */ public Font decorateFont(Object aElement) { // $codepro.audit.disable if (null != R4EUIModelController.getActiveReview() && R4EUIModelController.getActiveReview().equals(aElement)) { return JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT); } if (isMyReview((IR4EUIModelElement) aElement)) { return JFaceResources.getFontRegistry().getItalic(JFaceResources.DEFAULT_FONT); } return null; }
From source file:org.eclipse.php.internal.debug.ui.views.coverage.CodeCoverageLabelProvider.java
License:Open Source License
public Font getFont(Object element, int columnIndex) { if (columnIndex == 1) { if (element instanceof ISourceModule || element instanceof IFile) { return JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT); }/*w w w . ja v a 2s.co m*/ } return JFaceResources.getFontRegistry().get(JFaceResources.DEFAULT_FONT); }
From source file:org.eclipse.recommenders.internal.apidocs.rcp.ProviderArea.java
License:Open Source License
private void createTitleArea() { title = createComposite(container);//from w w w .j av a 2s .c om final String providerName = provider.getDescription().getName(); final Image providerImage = provider.getDescription().getImage(); final CLabel l = new CLabel(title, SWT.NONE); l.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT)); setInfoForegroundColor(l); setInfoBackgroundColor(l); l.setText(providerName); l.setImage(providerImage); }
From source file:org.eclipse.riena.sample.app.client.mail.View.java
License:Open Source License
@Override public void createPartControl(final Composite parent) { final Composite top = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); layout.marginHeight = 0;//from w w w . j a va 2 s . com layout.marginWidth = 0; top.setLayout(layout); // top banner final 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 final Font boldFont = JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT); Label l = new Label(banner, SWT.WRAP); l.setText("Subject:"); //$NON-NLS-1$ l.setFont(boldFont); l = new Label(banner, SWT.WRAP); l.setText("This is a message about the cool Eclipse RCP!"); //$NON-NLS-1$ l = new Label(banner, SWT.WRAP); l.setText("From:"); //$NON-NLS-1$ l.setFont(boldFont); final Link link = new Link(banner, SWT.NONE); link.setText("<a>nicole@mail.org</a>"); //$NON-NLS-1$ link.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(final SelectionEvent e) { RienaMessageDialog.openInformation(getSite().getShell(), "Not Implemented", //$NON-NLS-1$ "Imagine the address book or a new message being created now."); //$NON-NLS-1$ } }); l = new Label(banner, SWT.WRAP); l.setText("Date:"); //$NON-NLS-1$ l.setFont(boldFont); l = new Label(banner, SWT.WRAP); l.setText("10:34 am"); //$NON-NLS-1$ // message contents final 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" //$NON-NLS-1$ + "- 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:org.eclipse.riena.sample.app.client.rcpmail.MessageView.java
License:Open Source License
@Override public void createPartControl(final Composite parent) { final Composite top = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); layout.marginHeight = 0;/*ww w .j av a 2s .c o m*/ layout.marginWidth = 0; top.setLayout(layout); // top banner final 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 final Font boldFont = JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT); Label l = new Label(banner, SWT.WRAP); l.setText("Subject:"); //$NON-NLS-1$ l.setFont(boldFont); delegate.addUIControl(new Label(banner, SWT.WRAP), "subject"); //$NON-NLS-1$ l = new Label(banner, SWT.WRAP); l.setText("From:"); //$NON-NLS-1$ l.setFont(boldFont); delegate.addUIControl(new Label(banner, SWT.WRAP), "from"); //$NON-NLS-1$ l = new Label(banner, SWT.WRAP); l.setText("Date:"); //$NON-NLS-1$ l.setFont(boldFont); delegate.addUIControl(new Label(banner, SWT.WRAP), "date"); //$NON-NLS-1$ // message contents final Text text = new Text(top, SWT.MULTI | SWT.WRAP); text.setLayoutData(new GridData(GridData.FILL_BOTH)); delegate.addUIControl(text, "message"); //$NON-NLS-1$ delegate.injectAndBind(controller); parent.addDisposeListener(new DisposeListener() { public void widgetDisposed(final DisposeEvent e) { delegate.unbind(controller); } }); }
From source file:org.eclipse.sirius.diagram.ui.tools.internal.views.providers.outline.OutlineLabelProvider.java
License:Open Source License
/** * {@inheritDoc}//w ww . ja va 2s . c om * * @see org.eclipse.jface.viewers.IFontProvider#getFont(java.lang.Object) */ public Font getFont(final Object element) { Font result = JFaceResources.getDefaultFont(); if (element instanceof DDiagramElement) { final DDiagramElement vpe = (DDiagramElement) element; if (!vpe.isVisible() || (vpe instanceof DDiagramElementContainer && new DDiagramElementQuery(vpe).isLabelHidden())) { result = JFaceResources.getFontRegistry().getItalic(JFaceResources.DEFAULT_FONT); } } else if (element instanceof AbstractDDiagramElementLabelItemProvider) { Option<DDiagramElement> optionTarget = ((AbstractDDiagramElementLabelItemProvider) element) .getDiagramElementTarget(); if (optionTarget.some() && new DDiagramElementQuery(optionTarget.get()).isLabelHidden()) { result = JFaceResources.getFontRegistry().getItalic(JFaceResources.DEFAULT_FONT); } } return result; }
From source file:org.eclipse.tcf.internal.debug.ui.model.TCFModelFonts.java
License:Open Source License
public static FontData getNormalFontData(String view_id) { FontData fd = fd_normal.get(view_id); if (fd == null) { if (listener == null) { listener = new IPropertyChangeListener() { public void propertyChange(PropertyChangeEvent event) { Protocol.invokeLater(new Runnable() { public void run() { fd_normal.clear(); fd_italic.clear(); fd_monospaced.clear(); }/*from w w w.j a v a 2s .com*/ }); } }; JFaceResources.getFontRegistry().addListener(listener); } if (IDebugUIConstants.ID_DEBUG_VIEW.equals(view_id)) { fd = JFaceResources.getFontDescriptor(JFaceResources.DEFAULT_FONT).getFontData()[0]; } else if (TCFDetailPane.ID.equals(view_id)) { FontData ff = JFaceResources.getFontDescriptor(JFaceResources.DEFAULT_FONT).getFontData()[0]; FontData fp = JFaceResources.getFontDescriptor(IDebugUIConstants.PREF_DETAIL_PANE_FONT) .getFontData()[0]; fd = new FontData(fp.getName(), ff.getHeight(), SWT.NORMAL); } else { fd = JFaceResources.getFontDescriptor(IDebugUIConstants.PREF_VARIABLE_TEXT_FONT).getFontData()[0]; } fd_normal.put(view_id, fd); } return fd; }
From source file:org.eclipse.tcf.te.ui.notifications.internal.popup.AbstractNotificationPopup.java
License:Open Source License
/** * Override to customize the title bar//from w w w. j a v a 2s .com */ protected void createTitleArea(Composite parent) { ((GridData) parent.getLayoutData()).heightHint = TITLE_HEIGHT; Label titleImageLabel = new Label(parent, SWT.NONE); titleImageLabel.setImage(getPopupShellImage(TITLE_HEIGHT)); Label titleTextLabel = new Label(parent, SWT.NONE); titleTextLabel.setText(getPopupShellTitle()); titleTextLabel.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT)); titleTextLabel.setForeground(getTitleForeground()); titleTextLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true)); titleTextLabel.setCursor(parent.getDisplay().getSystemCursor(SWT.CURSOR_HAND)); final Label button = new Label(parent, SWT.NONE); button.setImage(UIPlugin.getImage(ImageConsts.NOTIFICATION_CLOSE)); button.addMouseTrackListener(new MouseTrackAdapter() { @Override public void mouseEnter(MouseEvent e) { button.setImage(UIPlugin.getImage(ImageConsts.NOTIFICATION_CLOSE_HOVER)); } @Override public void mouseExit(MouseEvent e) { button.setImage(UIPlugin.getImage(ImageConsts.NOTIFICATION_CLOSE)); } }); button.addMouseListener(new MouseAdapter() { @SuppressWarnings("synthetic-access") @Override public void mouseUp(MouseEvent e) { close(); setReturnCode(CANCEL); } }); }